123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675 |
- /******/ (function(modules) { // webpackBootstrap
- /******/ // install a JSONP callback for chunk loading
- /******/ var parentJsonpFunction = window["webpackJsonp"];
- /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
- /******/ // add "moreModules" to the modules object,
- /******/ // then flag all "chunkIds" as loaded and fire callback
- /******/ var moduleId, chunkId, i = 0, resolves = [], result;
- /******/ for(;i < chunkIds.length; i++) {
- /******/ chunkId = chunkIds[i];
- /******/ if(installedChunks[chunkId]) {
- /******/ resolves.push(installedChunks[chunkId][0]);
- /******/ }
- /******/ installedChunks[chunkId] = 0;
- /******/ }
- /******/ for(moduleId in moreModules) {
- /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
- /******/ modules[moduleId] = moreModules[moduleId];
- /******/ }
- /******/ }
- /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
- /******/ while(resolves.length) {
- /******/ resolves.shift()();
- /******/ }
- /******/
- /******/ };
- /******/
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // objects to store loaded and loading chunks
- /******/ var installedChunks = {
- /******/ 16: 0
- /******/ };
- /******/
- /******/ // 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;
- /******/ }
- /******/
- /******/ // This file contains only the entry chunk.
- /******/ // The chunk loading function for additional chunks
- /******/ __webpack_require__.e = function requireEnsure(chunkId) {
- /******/ var installedChunkData = installedChunks[chunkId];
- /******/ if(installedChunkData === 0) {
- /******/ return new Promise(function(resolve) { resolve(); });
- /******/ }
- /******/
- /******/ // a Promise means "currently loading".
- /******/ if(installedChunkData) {
- /******/ return installedChunkData[2];
- /******/ }
- /******/
- /******/ // setup Promise in chunk cache
- /******/ var promise = new Promise(function(resolve, reject) {
- /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
- /******/ });
- /******/ installedChunkData[2] = promise;
- /******/
- /******/ // start chunk loading
- /******/ var head = document.getElementsByTagName('head')[0];
- /******/ var script = document.createElement('script');
- /******/ script.type = "text/javascript";
- /******/ script.charset = 'utf-8';
- /******/ script.async = true;
- /******/ script.timeout = 120000;
- /******/
- /******/ if (__webpack_require__.nc) {
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
- /******/ }
- /******/ script.src = __webpack_require__.p + "js/build/" + ({}[chunkId]||chunkId) + ".js?" + "f9cd5b17" + "";
- /******/ var timeout = setTimeout(onScriptComplete, 120000);
- /******/ script.onerror = script.onload = onScriptComplete;
- /******/ function onScriptComplete() {
- /******/ // avoid mem leaks in IE.
- /******/ script.onerror = script.onload = null;
- /******/ clearTimeout(timeout);
- /******/ var chunk = installedChunks[chunkId];
- /******/ if(chunk !== 0) {
- /******/ if(chunk) {
- /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
- /******/ }
- /******/ installedChunks[chunkId] = undefined;
- /******/ }
- /******/ };
- /******/ head.appendChild(script);
- /******/
- /******/ return promise;
- /******/ };
- /******/
- /******/ // 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, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // 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 = "/";
- /******/
- /******/ // on error function for async loading
- /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 65);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports) {
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- // css base code, injected by the css-loader
- module.exports = function(useSourceMap) {
- var list = [];
- // return the list of modules as css string
- list.toString = function toString() {
- return this.map(function (item) {
- var content = cssWithMappingToString(item, useSourceMap);
- if(item[2]) {
- return "@media " + item[2] + "{" + content + "}";
- } else {
- return content;
- }
- }).join("");
- };
- // import a list of modules into the list
- list.i = function(modules, mediaQuery) {
- if(typeof modules === "string")
- modules = [[null, modules, ""]];
- var alreadyImportedModules = {};
- for(var i = 0; i < this.length; i++) {
- var id = this[i][0];
- if(typeof id === "number")
- alreadyImportedModules[id] = true;
- }
- for(i = 0; i < modules.length; i++) {
- var item = modules[i];
- // skip already imported module
- // this implementation is not 100% perfect for weird media query combinations
- // when a module is imported multiple times with different media queries.
- // I hope this will never occur (Hey this way we have smaller bundles)
- if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
- if(mediaQuery && !item[2]) {
- item[2] = mediaQuery;
- } else if(mediaQuery) {
- item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
- }
- list.push(item);
- }
- }
- };
- return list;
- };
- function cssWithMappingToString(item, useSourceMap) {
- var content = item[1] || '';
- var cssMapping = item[3];
- if (!cssMapping) {
- return content;
- }
- if (useSourceMap && typeof btoa === 'function') {
- var sourceMapping = toComment(cssMapping);
- var sourceURLs = cssMapping.sources.map(function (source) {
- return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
- });
- return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
- }
- return [content].join('\n');
- }
- // Adapted from convert-source-map (MIT)
- function toComment(sourceMap) {
- // eslint-disable-next-line no-undef
- var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
- var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
- return '/*# ' + data + ' */';
- }
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- Modified by Evan You @yyx990803
- */
- var hasDocument = typeof document !== 'undefined'
- if (typeof DEBUG !== 'undefined' && DEBUG) {
- if (!hasDocument) {
- throw new Error(
- 'vue-style-loader cannot be used in a non-browser environment. ' +
- "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
- ) }
- }
- var listToStyles = __webpack_require__(72)
- /*
- type StyleObject = {
- id: number;
- parts: Array<StyleObjectPart>
- }
- type StyleObjectPart = {
- css: string;
- media: string;
- sourceMap: ?string
- }
- */
- var stylesInDom = {/*
- [id: number]: {
- id: number,
- refs: number,
- parts: Array<(obj?: StyleObjectPart) => void>
- }
- */}
- var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
- var singletonElement = null
- var singletonCounter = 0
- var isProduction = false
- var noop = function () {}
- var options = null
- var ssrIdKey = 'data-vue-ssr-id'
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
- module.exports = function (parentId, list, _isProduction, _options) {
- isProduction = _isProduction
- options = _options || {}
- var styles = listToStyles(parentId, list)
- addStylesToDom(styles)
- return function update (newList) {
- var mayRemove = []
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i]
- var domStyle = stylesInDom[item.id]
- domStyle.refs--
- mayRemove.push(domStyle)
- }
- if (newList) {
- styles = listToStyles(parentId, newList)
- addStylesToDom(styles)
- } else {
- styles = []
- }
- for (var i = 0; i < mayRemove.length; i++) {
- var domStyle = mayRemove[i]
- if (domStyle.refs === 0) {
- for (var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j]()
- }
- delete stylesInDom[domStyle.id]
- }
- }
- }
- }
- function addStylesToDom (styles /* Array<StyleObject> */) {
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i]
- var domStyle = stylesInDom[item.id]
- if (domStyle) {
- domStyle.refs++
- for (var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j](item.parts[j])
- }
- for (; j < item.parts.length; j++) {
- domStyle.parts.push(addStyle(item.parts[j]))
- }
- if (domStyle.parts.length > item.parts.length) {
- domStyle.parts.length = item.parts.length
- }
- } else {
- var parts = []
- for (var j = 0; j < item.parts.length; j++) {
- parts.push(addStyle(item.parts[j]))
- }
- stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
- }
- }
- }
- function createStyleElement () {
- var styleElement = document.createElement('style')
- styleElement.type = 'text/css'
- head.appendChild(styleElement)
- return styleElement
- }
- function addStyle (obj /* StyleObjectPart */) {
- var update, remove
- var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
- if (styleElement) {
- if (isProduction) {
- // has SSR styles and in production mode.
- // simply do nothing.
- return noop
- } else {
- // has SSR styles but in dev mode.
- // for some reason Chrome can't handle source map in server-rendered
- // style tags - source maps in <style> only works if the style tag is
- // created and inserted dynamically. So we remove the server rendered
- // styles and inject new ones.
- styleElement.parentNode.removeChild(styleElement)
- }
- }
- if (isOldIE) {
- // use singleton mode for IE9.
- var styleIndex = singletonCounter++
- styleElement = singletonElement || (singletonElement = createStyleElement())
- update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
- remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
- } else {
- // use multi-style-tag mode in all other cases
- styleElement = createStyleElement()
- update = applyToTag.bind(null, styleElement)
- remove = function () {
- styleElement.parentNode.removeChild(styleElement)
- }
- }
- update(obj)
- return function updateStyle (newObj /* StyleObjectPart */) {
- if (newObj) {
- if (newObj.css === obj.css &&
- newObj.media === obj.media &&
- newObj.sourceMap === obj.sourceMap) {
- return
- }
- update(obj = newObj)
- } else {
- remove()
- }
- }
- }
- var replaceText = (function () {
- var textStore = []
- return function (index, replacement) {
- textStore[index] = replacement
- return textStore.filter(Boolean).join('\n')
- }
- })()
- function applyToSingletonTag (styleElement, index, remove, obj) {
- var css = remove ? '' : obj.css
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = replaceText(index, css)
- } else {
- var cssNode = document.createTextNode(css)
- var childNodes = styleElement.childNodes
- if (childNodes[index]) styleElement.removeChild(childNodes[index])
- if (childNodes.length) {
- styleElement.insertBefore(cssNode, childNodes[index])
- } else {
- styleElement.appendChild(cssNode)
- }
- }
- }
- function applyToTag (styleElement, obj) {
- var css = obj.css
- var media = obj.media
- var sourceMap = obj.sourceMap
- if (media) {
- styleElement.setAttribute('media', media)
- }
- if (options.ssrId) {
- styleElement.setAttribute(ssrIdKey, obj.id)
- }
- if (sourceMap) {
- // https://developer.chrome.com/devtools/docs/javascript-debugging
- // this makes source maps inside style tags work properly in Chrome
- css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
- // http://stackoverflow.com/a/26603875
- css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
- }
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = css
- } else {
- while (styleElement.firstChild) {
- styleElement.removeChild(styleElement.firstChild)
- }
- styleElement.appendChild(document.createTextNode(css))
- }
- }
- /***/ }),
- /* 2 */
- /***/ (function(module, exports) {
- /* globals __VUE_SSR_CONTEXT__ */
- // IMPORTANT: Do NOT use ES2015 features in this file.
- // This module is a runtime utility for cleaner component module output and will
- // be included in the final webpack user bundle.
- module.exports = function normalizeComponent (
- rawScriptExports,
- compiledTemplate,
- functionalTemplate,
- injectStyles,
- scopeId,
- moduleIdentifier /* server only */
- ) {
- var esModule
- var scriptExports = rawScriptExports = rawScriptExports || {}
- // ES6 modules interop
- var type = typeof rawScriptExports.default
- if (type === 'object' || type === 'function') {
- esModule = rawScriptExports
- scriptExports = rawScriptExports.default
- }
- // Vue.extend constructor export interop
- var options = typeof scriptExports === 'function'
- ? scriptExports.options
- : scriptExports
- // render functions
- if (compiledTemplate) {
- options.render = compiledTemplate.render
- options.staticRenderFns = compiledTemplate.staticRenderFns
- options._compiled = true
- }
- // functional template
- if (functionalTemplate) {
- options.functional = true
- }
- // scopedId
- if (scopeId) {
- options._scopeId = scopeId
- }
- var hook
- if (moduleIdentifier) { // server build
- hook = function (context) {
- // 2.3 injection
- context =
- context || // cached call
- (this.$vnode && this.$vnode.ssrContext) || // stateful
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
- // 2.2 with runInNewContext: true
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
- context = __VUE_SSR_CONTEXT__
- }
- // inject component styles
- if (injectStyles) {
- injectStyles.call(this, context)
- }
- // register component module identifier for async chunk inferrence
- if (context && context._registeredComponents) {
- context._registeredComponents.add(moduleIdentifier)
- }
- }
- // used by ssr in case component is cached and beforeCreate
- // never gets called
- options._ssrRegister = hook
- } else if (injectStyles) {
- hook = injectStyles
- }
- if (hook) {
- var functional = options.functional
- var existing = functional
- ? options.render
- : options.beforeCreate
- if (!functional) {
- // inject component registration as beforeCreate hook
- options.beforeCreate = existing
- ? [].concat(existing, hook)
- : [hook]
- } else {
- // for template-only hot-reload because in that case the render fn doesn't
- // go through the normalizer
- options._injectStyles = hook
- // register for functioal component in vue file
- options.render = function renderWithStyleInjection (h, context) {
- hook.call(context)
- return existing(h, context)
- }
- }
- }
- return {
- esModule: esModule,
- exports: scriptExports,
- options: options
- }
- }
- /***/ }),
- /* 3 */
- /***/ (function(module, exports, __webpack_require__) {
- var freeGlobal = __webpack_require__(37);
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
- module.exports = root;
- /***/ }),
- /* 4 */
- /***/ (function(module, exports, __webpack_require__) {
- if (false) {
- module.exports = require('./vue.common.prod.js')
- } else {
- module.exports = __webpack_require__(67)
- }
- /***/ }),
- /* 5 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseIsNative = __webpack_require__(153),
- getValue = __webpack_require__(156);
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
- module.exports = getNative;
- /***/ }),
- /* 6 */
- /***/ (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 || Function("return this")() || (1,eval)("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;
- /***/ }),
- /* 7 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(95)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(97)
- /* template */
- var __vue_template__ = __webpack_require__(98)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-329e9aed"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/DrawerTabsContainer.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-329e9aed", Component.options)
- } else {
- hotAPI.reload("data-v-329e9aed", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 8 */
- /***/ (function(module, exports) {
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
- module.exports = isObjectLike;
- /***/ }),
- /* 9 */
- /***/ (function(module, exports) {
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
- module.exports = isObject;
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
- var Symbol = __webpack_require__(18),
- getRawTag = __webpack_require__(148),
- objectToString = __webpack_require__(149);
- /** `Object#toString` result references. */
- var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
- /** Built-in value references. */
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
- }
- module.exports = baseGetTag;
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5);
- /* Built-in method references that are verified to be native. */
- var nativeCreate = getNative(Object, 'create');
- module.exports = nativeCreate;
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
- var listCacheClear = __webpack_require__(161),
- listCacheDelete = __webpack_require__(162),
- listCacheGet = __webpack_require__(163),
- listCacheHas = __webpack_require__(164),
- listCacheSet = __webpack_require__(165);
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `ListCache`.
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype['delete'] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- module.exports = ListCache;
- /***/ }),
- /* 13 */
- /***/ (function(module, exports, __webpack_require__) {
- var eq = __webpack_require__(33);
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- module.exports = assocIndexOf;
- /***/ }),
- /* 14 */
- /***/ (function(module, exports, __webpack_require__) {
- var isKeyable = __webpack_require__(167);
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
- module.exports = getMapData;
- /***/ }),
- /* 15 */
- /***/ (function(module, exports, __webpack_require__) {
- var assignValue = __webpack_require__(45),
- baseAssignValue = __webpack_require__(46);
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index = -1,
- length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
- module.exports = copyObject;
- /***/ }),
- /* 16 */
- /***/ (function(module, exports) {
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
- module.exports = isArray;
- /***/ }),
- /* 17 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(87)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(89)
- /* template */
- var __vue_template__ = __webpack_require__(90)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/ImgUpload.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-55c90fc2", Component.options)
- } else {
- hotAPI.reload("data-v-55c90fc2", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 18 */
- /***/ (function(module, exports, __webpack_require__) {
- var root = __webpack_require__(3);
- /** Built-in value references. */
- var Symbol = root.Symbol;
- module.exports = Symbol;
- /***/ }),
- /* 19 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayLikeKeys = __webpack_require__(43),
- baseKeys = __webpack_require__(181),
- isArrayLike = __webpack_require__(32);
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- module.exports = keys;
- /***/ }),
- /* 20 */
- /***/ (function(module, exports) {
- /**
- * The base implementation of `_.unary` without support for storing metadata.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- */
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- module.exports = baseUnary;
- /***/ }),
- /* 21 */
- /***/ (function(module, exports, __webpack_require__) {
- var DataView = __webpack_require__(183),
- Map = __webpack_require__(23),
- Promise = __webpack_require__(184),
- Set = __webpack_require__(185),
- WeakMap = __webpack_require__(186),
- baseGetTag = __webpack_require__(10),
- toSource = __webpack_require__(39);
- /** `Object#toString` result references. */
- var mapTag = '[object Map]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- setTag = '[object Set]',
- weakMapTag = '[object WeakMap]';
- var dataViewTag = '[object DataView]';
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = baseGetTag;
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
- (Map && getTag(new Map) != mapTag) ||
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
- (Set && getTag(new Set) != setTag) ||
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function(value) {
- var result = baseGetTag(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : '';
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
- }
- module.exports = getTag;
- /***/ }),
- /* 22 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["e"] = oneOf;
- /* unused harmony export camelcaseToHyphen */
- /* harmony export (immutable) */ __webpack_exports__["d"] = getScrollBarSize;
- /* unused harmony export getStyle */
- /* unused harmony export firstUpperCase */
- /* unused harmony export warnProp */
- /* unused harmony export deepCopy */
- /* unused harmony export scrollTop */
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return findComponentUpward; });
- /* unused harmony export findComponentDownward */
- /* unused harmony export findComponentsDownward */
- /* harmony export (immutable) */ __webpack_exports__["c"] = findComponentsUpward;
- /* harmony export (immutable) */ __webpack_exports__["a"] = findBrothersComponents;
- /* unused harmony export hasClass */
- /* unused harmony export addClass */
- /* unused harmony export removeClass */
- /* unused harmony export setMatchMedia */
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- const isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
- // 判断参数是否是其中之一
- function oneOf (value, validList) {
- for (let i = 0; i < validList.length; i++) {
- if (value === validList[i]) {
- return true;
- }
- }
- return false;
- }
- function camelcaseToHyphen (str) {
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
- }
- // For Modal scrollBar hidden
- let cached;
- function getScrollBarSize (fresh) {
- if (isServer) return 0;
- if (fresh || cached === undefined) {
- const inner = document.createElement('div');
- inner.style.width = '100%';
- inner.style.height = '200px';
- const outer = document.createElement('div');
- const outerStyle = outer.style;
- outerStyle.position = 'absolute';
- outerStyle.top = 0;
- outerStyle.left = 0;
- outerStyle.pointerEvents = 'none';
- outerStyle.visibility = 'hidden';
- outerStyle.width = '200px';
- outerStyle.height = '150px';
- outerStyle.overflow = 'hidden';
- outer.appendChild(inner);
- document.body.appendChild(outer);
- const widthContained = inner.offsetWidth;
- outer.style.overflow = 'scroll';
- let widthScroll = inner.offsetWidth;
- if (widthContained === widthScroll) {
- widthScroll = outer.clientWidth;
- }
- document.body.removeChild(outer);
- cached = widthContained - widthScroll;
- }
- return cached;
- }
- // watch DOM change
- const MutationObserver = isServer ? false : window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
- /* unused harmony export MutationObserver */
- const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
- const MOZ_HACK_REGEXP = /^moz([A-Z])/;
- function camelCase(name) {
- return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
- return offset ? letter.toUpperCase() : letter;
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
- }
- // getStyle
- function getStyle (element, styleName) {
- if (!element || !styleName) return null;
- styleName = camelCase(styleName);
- if (styleName === 'float') {
- styleName = 'cssFloat';
- }
- try {
- const computed = document.defaultView.getComputedStyle(element, '');
- return element.style[styleName] || computed ? computed[styleName] : null;
- } catch(e) {
- return element.style[styleName];
- }
- }
- // firstUpperCase
- function firstUpperCase(str) {
- return str.toString()[0].toUpperCase() + str.toString().slice(1);
- }
- // Warn
- function warnProp(component, prop, correctType, wrongType) {
- correctType = firstUpperCase(correctType);
- wrongType = firstUpperCase(wrongType);
- console.error(`[iView warn]: Invalid prop: type check failed for prop ${prop}. Expected ${correctType}, got ${wrongType}. (found in component: ${component})`); // eslint-disable-line
- }
- function typeOf(obj) {
- const toString = Object.prototype.toString;
- const map = {
- '[object Boolean]' : 'boolean',
- '[object Number]' : 'number',
- '[object String]' : 'string',
- '[object Function]' : 'function',
- '[object Array]' : 'array',
- '[object Date]' : 'date',
- '[object RegExp]' : 'regExp',
- '[object Undefined]': 'undefined',
- '[object Null]' : 'null',
- '[object Object]' : 'object'
- };
- return map[toString.call(obj)];
- }
- // deepCopy
- function deepCopy(data) {
- const t = typeOf(data);
- let o;
- if (t === 'array') {
- o = [];
- } else if ( t === 'object') {
- o = {};
- } else {
- return data;
- }
- if (t === 'array') {
- for (let i = 0; i < data.length; i++) {
- o.push(deepCopy(data[i]));
- }
- } else if ( t === 'object') {
- for (let i in data) {
- o[i] = deepCopy(data[i]);
- }
- }
- return o;
- }
- // scrollTop animation
- function scrollTop(el, from = 0, to, duration = 500, endCallback) {
- if (!window.requestAnimationFrame) {
- window.requestAnimationFrame = (
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function (callback) {
- return window.setTimeout(callback, 1000/60);
- }
- );
- }
- const difference = Math.abs(from - to);
- const step = Math.ceil(difference / duration * 50);
- function scroll(start, end, step) {
- if (start === end) {
- endCallback && endCallback();
- return;
- }
- let d = (start + step > end) ? end : start + step;
- if (start > end) {
- d = (start - step < end) ? end : start - step;
- }
- if (el === window) {
- window.scrollTo(d, d);
- } else {
- el.scrollTop = d;
- }
- window.requestAnimationFrame(() => scroll(d, end, step));
- }
- scroll(from, to, step);
- }
- // Find components upward
- function findComponentUpward (context, componentName, componentNames) {
- if (typeof componentName === 'string') {
- componentNames = [componentName];
- } else {
- componentNames = componentName;
- }
- let parent = context.$parent;
- let name = parent.$options.name;
- while (parent && (!name || componentNames.indexOf(name) < 0)) {
- parent = parent.$parent;
- if (parent) name = parent.$options.name;
- }
- return parent;
- }
- // Find component downward
- function findComponentDownward (context, componentName) {
- const $children = context.$children;
- let children = null;
- if ($children.length) {
- for (const child of $children) {
- const name = child.$options.name;
- if (name === componentName) {
- children = child;
- break;
- } else {
- children = findComponentDownward(child, componentName);
- if (children) break;
- }
- }
- }
- return children;
- }
- // Find components downward
- function findComponentsDownward (context, componentName) {
- return context.$children.reduce((components, child) => {
- if (child.$options.name === componentName) components.push(child);
- const foundChilds = findComponentsDownward(child, componentName);
- return components.concat(foundChilds);
- }, []);
- }
- // Find components upward
- function findComponentsUpward (context, componentName) {
- let parents = [];
- const parent = context.$parent;
- if (parent) {
- if (parent.$options.name === componentName) parents.push(parent);
- return parents.concat(findComponentsUpward(parent, componentName));
- } else {
- return [];
- }
- }
- // Find brothers components
- function findBrothersComponents (context, componentName, exceptMe = true) {
- let res = context.$parent.$children.filter(item => {
- return item.$options.name === componentName;
- });
- let index = res.findIndex(item => item._uid === context._uid);
- if (exceptMe) res.splice(index, 1);
- return res;
- }
- /* istanbul ignore next */
- const trim = function(string) {
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
- };
- /* istanbul ignore next */
- function hasClass(el, cls) {
- if (!el || !cls) return false;
- if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
- if (el.classList) {
- return el.classList.contains(cls);
- } else {
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
- }
- }
- /* istanbul ignore next */
- function addClass(el, cls) {
- if (!el) return;
- let curClass = el.className;
- const classes = (cls || '').split(' ');
- for (let i = 0, j = classes.length; i < j; i++) {
- const clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.add(clsName);
- } else {
- if (!hasClass(el, clsName)) {
- curClass += ' ' + clsName;
- }
- }
- }
- if (!el.classList) {
- el.className = curClass;
- }
- }
- /* istanbul ignore next */
- function removeClass(el, cls) {
- if (!el || !cls) return;
- const classes = cls.split(' ');
- let curClass = ' ' + el.className + ' ';
- for (let i = 0, j = classes.length; i < j; i++) {
- const clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.remove(clsName);
- } else {
- if (hasClass(el, clsName)) {
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
- }
- }
- }
- if (!el.classList) {
- el.className = trim(curClass);
- }
- }
- const dimensionMap = {
- xs: '480px',
- sm: '576px',
- md: '768px',
- lg: '992px',
- xl: '1200px',
- xxl: '1600px',
- };
- /* unused harmony export dimensionMap */
- function setMatchMedia () {
- if (typeof window !== 'undefined') {
- const matchMediaPolyfill = mediaQuery => {
- return {
- media: mediaQuery,
- matches: false,
- on() {},
- off() {},
- };
- };
- window.matchMedia = window.matchMedia || matchMediaPolyfill;
- }
- }
- const sharpMatcherRegx = /#([^#]+)$/;
- /* unused harmony export sharpMatcherRegx */
- /***/ }),
- /* 23 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5),
- root = __webpack_require__(3);
- /* Built-in method references that are verified to be native. */
- var Map = getNative(root, 'Map');
- module.exports = Map;
- /***/ }),
- /* 24 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayFilter = __webpack_require__(176),
- stubArray = __webpack_require__(42);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Built-in value references. */
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- /**
- * Creates an array of the own enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- module.exports = getSymbols;
- /***/ }),
- /* 25 */
- /***/ (function(module, exports) {
- module.exports = function(module) {
- if(!module.webpackPolyfill) {
- module.deprecate = function() {};
- module.paths = [];
- // module.parent = undefined by default
- if(!module.children) module.children = [];
- Object.defineProperty(module, "loaded", {
- enumerable: true,
- get: function() {
- return module.l;
- }
- });
- Object.defineProperty(module, "id", {
- enumerable: true,
- get: function() {
- return module.i;
- }
- });
- module.webpackPolyfill = 1;
- }
- return module;
- };
- /***/ }),
- /* 26 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(37);
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Detect free variable `process` from Node.js. */
- var freeProcess = moduleExports && freeGlobal.process;
- /** Used to access faster Node.js helpers. */
- var nodeUtil = (function() {
- try {
- // Use `util.types` for Node.js 10+.
- var types = freeModule && freeModule.require && freeModule.require('util').types;
- if (types) {
- return types;
- }
- // Legacy `process.binding('util')` for Node.js < 10.
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }());
- module.exports = nodeUtil;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
- /***/ }),
- /* 27 */
- /***/ (function(module, exports) {
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
- return value === proto;
- }
- module.exports = isPrototype;
- /***/ }),
- /* 28 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayLikeKeys = __webpack_require__(43),
- baseKeysIn = __webpack_require__(249),
- isArrayLike = __webpack_require__(32);
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
- module.exports = keysIn;
- /***/ }),
- /* 29 */
- /***/ (function(module, exports, __webpack_require__) {
- var Uint8Array = __webpack_require__(59);
- /**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
- }
- module.exports = cloneArrayBuffer;
- /***/ }),
- /* 30 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony default export */ __webpack_exports__["a"] = ({
- methods: {
- taskComplete: function taskComplete(taskDetail) {
- var _this = this;
- var complete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- if (taskDetail['loadIng'] === true) {
- return;
- }
- this.$set(taskDetail, 'loadIng', true);
- this.$set(taskDetail, 'complete', !!complete);
- $A.apiAjax({
- url: 'project/task/edit',
- method: 'post',
- data: {
- act: complete ? 'complete' : 'unfinished',
- taskid: taskDetail.id
- },
- complete: function complete() {
- _this.$set(taskDetail, 'loadIng', false);
- },
- error: function error() {
- _this.$set(taskDetail, 'complete', !complete);
- alert(_this.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this.$Message.success(res.msg);
- $A.triggerTaskInfoListener(complete ? 'complete' : 'unfinished', res.data);
- $A.triggerTaskInfoChange(taskDetail.id);
- } else {
- _this.$set(taskDetail, 'complete', !complete);
- _this.$Modal.error({ title: _this.$L('温馨提示'), content: res.msg });
- }
- }
- });
- },
- renderTaskTitle: function renderTaskTitle(h, params) {
- var _this2 = this;
- return h('div', [h('Icon', {
- props: { type: params.row.complete ? 'md-checkbox-outline' : 'md-square-outline' },
- style: { marginRight: '4px', cursor: 'pointer', fontSize: '15px' },
- on: {
- click: function click() {
- _this2.taskComplete(params.row, !params.row.complete);
- }
- }
- }), h('span', {
- style: { cursor: 'pointer', textDecoration: params.row.complete ? 'line-through' : '' },
- on: {
- click: function click() {
- _this2.taskDetail(params.row);
- }
- }
- }, params.row.title)]);
- }
- }
- });
- /***/ }),
- /* 31 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
- (typeof self !== "undefined" && self) ||
- window;
- var apply = Function.prototype.apply;
- // DOM APIs, for completeness
- exports.setTimeout = function() {
- return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
- };
- exports.setInterval = function() {
- return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
- };
- exports.clearTimeout =
- exports.clearInterval = function(timeout) {
- if (timeout) {
- timeout.close();
- }
- };
- function Timeout(id, clearFn) {
- this._id = id;
- this._clearFn = clearFn;
- }
- Timeout.prototype.unref = Timeout.prototype.ref = function() {};
- Timeout.prototype.close = function() {
- this._clearFn.call(scope, this._id);
- };
- // Does not start the time, just sets up the members needed.
- exports.enroll = function(item, msecs) {
- clearTimeout(item._idleTimeoutId);
- item._idleTimeout = msecs;
- };
- exports.unenroll = function(item) {
- clearTimeout(item._idleTimeoutId);
- item._idleTimeout = -1;
- };
- exports._unrefActive = exports.active = function(item) {
- clearTimeout(item._idleTimeoutId);
- var msecs = item._idleTimeout;
- if (msecs >= 0) {
- item._idleTimeoutId = setTimeout(function onTimeout() {
- if (item._onTimeout)
- item._onTimeout();
- }, msecs);
- }
- };
- // setimmediate attaches itself to the global object
- __webpack_require__(68);
- // On some exotic environments, it's not clear which object `setimmediate` was
- // able to install onto. Search each possibility in the same order as the
- // `setimmediate` library.
- exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
- (typeof global !== "undefined" && global.setImmediate) ||
- (this && this.setImmediate);
- exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
- (typeof global !== "undefined" && global.clearImmediate) ||
- (this && this.clearImmediate);
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
- /***/ }),
- /* 32 */
- /***/ (function(module, exports, __webpack_require__) {
- var isFunction = __webpack_require__(38),
- isLength = __webpack_require__(35);
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- module.exports = isArrayLike;
- /***/ }),
- /* 33 */
- /***/ (function(module, exports) {
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
- module.exports = eq;
- /***/ }),
- /* 34 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3),
- stubFalse = __webpack_require__(179);
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Built-in value references. */
- var Buffer = moduleExports ? root.Buffer : undefined;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
- /**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
- var isBuffer = nativeIsBuffer || stubFalse;
- module.exports = isBuffer;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
- /***/ }),
- /* 35 */
- /***/ (function(module, exports) {
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- module.exports = isLength;
- /***/ }),
- /* 36 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- function broadcast(componentName, eventName, params) {
- this.$children.forEach(child => {
- const name = child.$options.name;
- if (name === componentName) {
- child.$emit.apply(child, [eventName].concat(params));
- } else {
- // todo 如果 params 是空数组,接收到的会是 undefined
- broadcast.apply(child, [componentName, eventName].concat([params]));
- }
- });
- }
- /* harmony default export */ __webpack_exports__["a"] = ({
- methods: {
- dispatch(componentName, eventName, params) {
- let parent = this.$parent || this.$root;
- let name = parent.$options.name;
- while (parent && (!name || name !== componentName)) {
- parent = parent.$parent;
- if (parent) {
- name = parent.$options.name;
- }
- }
- if (parent) {
- parent.$emit.apply(parent, [eventName].concat(params));
- }
- },
- broadcast(componentName, eventName, params) {
- broadcast.call(this, componentName, eventName, params);
- }
- }
- });
- /***/ }),
- /* 37 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
- module.exports = freeGlobal;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
- /***/ }),
- /* 38 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseGetTag = __webpack_require__(10),
- isObject = __webpack_require__(9);
- /** `Object#toString` result references. */
- var asyncTag = '[object AsyncFunction]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- proxyTag = '[object Proxy]';
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- module.exports = isFunction;
- /***/ }),
- /* 39 */
- /***/ (function(module, exports) {
- /** Used for built-in method references. */
- var funcProto = Function.prototype;
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to convert.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
- module.exports = toSource;
- /***/ }),
- /* 40 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayPush = __webpack_require__(41),
- isArray = __webpack_require__(16);
- /**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
- module.exports = baseGetAllKeys;
- /***/ }),
- /* 41 */
- /***/ (function(module, exports) {
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- module.exports = arrayPush;
- /***/ }),
- /* 42 */
- /***/ (function(module, exports) {
- /**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
- function stubArray() {
- return [];
- }
- module.exports = stubArray;
- /***/ }),
- /* 43 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseTimes = __webpack_require__(177),
- isArguments = __webpack_require__(61),
- isArray = __webpack_require__(16),
- isBuffer = __webpack_require__(34),
- isIndex = __webpack_require__(62),
- isTypedArray = __webpack_require__(63);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value),
- isArg = !isArr && isArguments(value),
- isBuff = !isArr && !isArg && isBuffer(value),
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? baseTimes(value.length, String) : [],
- length = result.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (
- // Safari 9 has enumerable `arguments.length` in strict mode.
- key == 'length' ||
- // Node.js 0.10 has enumerable non-index properties on buffers.
- (isBuff && (key == 'offset' || key == 'parent')) ||
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
- // Skip index properties.
- isIndex(key, length)
- ))) {
- result.push(key);
- }
- }
- return result;
- }
- module.exports = arrayLikeKeys;
- /***/ }),
- /* 44 */
- /***/ (function(module, exports) {
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- module.exports = overArg;
- /***/ }),
- /* 45 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseAssignValue = __webpack_require__(46),
- eq = __webpack_require__(33);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
- module.exports = assignValue;
- /***/ }),
- /* 46 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineProperty = __webpack_require__(246);
- /**
- * The base implementation of `assignValue` and `assignMergeValue` without
- * value checks.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && defineProperty) {
- defineProperty(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
- module.exports = baseAssignValue;
- /***/ }),
- /* 47 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayPush = __webpack_require__(41),
- getPrototype = __webpack_require__(48),
- getSymbols = __webpack_require__(24),
- stubArray = __webpack_require__(42);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- /**
- * Creates an array of the own and inherited enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result = [];
- while (object) {
- arrayPush(result, getSymbols(object));
- object = getPrototype(object);
- }
- return result;
- };
- module.exports = getSymbolsIn;
- /***/ }),
- /* 48 */
- /***/ (function(module, exports, __webpack_require__) {
- var overArg = __webpack_require__(44);
- /** Built-in value references. */
- var getPrototype = overArg(Object.getPrototypeOf, Object);
- module.exports = getPrototype;
- /***/ }),
- /* 49 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(125)
- /* template */
- var __vue_template__ = __webpack_require__(133)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/iview/WDrawer.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-37c31742", Component.options)
- } else {
- hotAPI.reload("data-v-37c31742", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 50 */
- /***/ (function(module, exports, __webpack_require__) {
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- var stylesInDom = {};
- var memoize = function (fn) {
- var memo;
- return function () {
- if (typeof memo === "undefined") memo = fn.apply(this, arguments);
- return memo;
- };
- };
- var isOldIE = memoize(function () {
- // Test for IE <= 9 as proposed by Browserhacks
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
- // Tests for existence of standard globals is to allow style-loader
- // to operate correctly into non-standard environments
- // @see https://github.com/webpack-contrib/style-loader/issues/177
- return window && document && document.all && !window.atob;
- });
- var getElement = (function (fn) {
- var memo = {};
- return function(selector) {
- if (typeof memo[selector] === "undefined") {
- memo[selector] = fn.call(this, selector);
- }
- return memo[selector]
- };
- })(function (target) {
- return document.querySelector(target)
- });
- var singleton = null;
- var singletonCounter = 0;
- var stylesInsertedAtTop = [];
- var fixUrls = __webpack_require__(187);
- module.exports = function(list, options) {
- if (typeof DEBUG !== "undefined" && DEBUG) {
- if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
- }
- options = options || {};
- options.attrs = typeof options.attrs === "object" ? options.attrs : {};
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- if (!options.singleton) options.singleton = isOldIE();
- // By default, add <style> tags to the <head> element
- if (!options.insertInto) options.insertInto = "head";
- // By default, add <style> tags to the bottom of the target
- if (!options.insertAt) options.insertAt = "bottom";
- var styles = listToStyles(list, options);
- addStylesToDom(styles, options);
- return function update (newList) {
- var mayRemove = [];
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
- domStyle.refs--;
- mayRemove.push(domStyle);
- }
- if(newList) {
- var newStyles = listToStyles(newList, options);
- addStylesToDom(newStyles, options);
- }
- for (var i = 0; i < mayRemove.length; i++) {
- var domStyle = mayRemove[i];
- if(domStyle.refs === 0) {
- for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
- delete stylesInDom[domStyle.id];
- }
- }
- };
- };
- function addStylesToDom (styles, options) {
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
- if(domStyle) {
- domStyle.refs++;
- for(var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j](item.parts[j]);
- }
- for(; j < item.parts.length; j++) {
- domStyle.parts.push(addStyle(item.parts[j], options));
- }
- } else {
- var parts = [];
- for(var j = 0; j < item.parts.length; j++) {
- parts.push(addStyle(item.parts[j], options));
- }
- stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
- }
- }
- }
- function listToStyles (list, options) {
- var styles = [];
- var newStyles = {};
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = options.base ? item[0] + options.base : item[0];
- var css = item[1];
- var media = item[2];
- var sourceMap = item[3];
- var part = {css: css, media: media, sourceMap: sourceMap};
- if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
- else newStyles[id].parts.push(part);
- }
- return styles;
- }
- function insertStyleElement (options, style) {
- var target = getElement(options.insertInto)
- if (!target) {
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
- }
- var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
- if (options.insertAt === "top") {
- if (!lastStyleElementInsertedAtTop) {
- target.insertBefore(style, target.firstChild);
- } else if (lastStyleElementInsertedAtTop.nextSibling) {
- target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
- } else {
- target.appendChild(style);
- }
- stylesInsertedAtTop.push(style);
- } else if (options.insertAt === "bottom") {
- target.appendChild(style);
- } else {
- throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
- }
- }
- function removeStyleElement (style) {
- if (style.parentNode === null) return false;
- style.parentNode.removeChild(style);
- var idx = stylesInsertedAtTop.indexOf(style);
- if(idx >= 0) {
- stylesInsertedAtTop.splice(idx, 1);
- }
- }
- function createStyleElement (options) {
- var style = document.createElement("style");
- options.attrs.type = "text/css";
- addAttrs(style, options.attrs);
- insertStyleElement(options, style);
- return style;
- }
- function createLinkElement (options) {
- var link = document.createElement("link");
- options.attrs.type = "text/css";
- options.attrs.rel = "stylesheet";
- addAttrs(link, options.attrs);
- insertStyleElement(options, link);
- return link;
- }
- function addAttrs (el, attrs) {
- Object.keys(attrs).forEach(function (key) {
- el.setAttribute(key, attrs[key]);
- });
- }
- function addStyle (obj, options) {
- var style, update, remove, result;
- // If a transform function was defined, run it on the css
- if (options.transform && obj.css) {
- result = options.transform(obj.css);
- if (result) {
- // If transform returns a value, use that instead of the original css.
- // This allows running runtime transformations on the css.
- obj.css = result;
- } else {
- // If the transform function returns a falsy value, don't add this css.
- // This allows conditional loading of css
- return function() {
- // noop
- };
- }
- }
- if (options.singleton) {
- var styleIndex = singletonCounter++;
- style = singleton || (singleton = createStyleElement(options));
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
- } else if (
- obj.sourceMap &&
- typeof URL === "function" &&
- typeof URL.createObjectURL === "function" &&
- typeof URL.revokeObjectURL === "function" &&
- typeof Blob === "function" &&
- typeof btoa === "function"
- ) {
- style = createLinkElement(options);
- update = updateLink.bind(null, style, options);
- remove = function () {
- removeStyleElement(style);
- if(style.href) URL.revokeObjectURL(style.href);
- };
- } else {
- style = createStyleElement(options);
- update = applyToTag.bind(null, style);
- remove = function () {
- removeStyleElement(style);
- };
- }
- update(obj);
- return function updateStyle (newObj) {
- if (newObj) {
- if (
- newObj.css === obj.css &&
- newObj.media === obj.media &&
- newObj.sourceMap === obj.sourceMap
- ) {
- return;
- }
- update(obj = newObj);
- } else {
- remove();
- }
- };
- }
- var replaceText = (function () {
- var textStore = [];
- return function (index, replacement) {
- textStore[index] = replacement;
- return textStore.filter(Boolean).join('\n');
- };
- })();
- function applyToSingletonTag (style, index, remove, obj) {
- var css = remove ? "" : obj.css;
- if (style.styleSheet) {
- style.styleSheet.cssText = replaceText(index, css);
- } else {
- var cssNode = document.createTextNode(css);
- var childNodes = style.childNodes;
- if (childNodes[index]) style.removeChild(childNodes[index]);
- if (childNodes.length) {
- style.insertBefore(cssNode, childNodes[index]);
- } else {
- style.appendChild(cssNode);
- }
- }
- }
- function applyToTag (style, obj) {
- var css = obj.css;
- var media = obj.media;
- if(media) {
- style.setAttribute("media", media)
- }
- if(style.styleSheet) {
- style.styleSheet.cssText = css;
- } else {
- while(style.firstChild) {
- style.removeChild(style.firstChild);
- }
- style.appendChild(document.createTextNode(css));
- }
- }
- function updateLink (link, options, obj) {
- var css = obj.css;
- var sourceMap = obj.sourceMap;
- /*
- If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
- and there is no publicPath defined then lets turn convertToAbsoluteUrls
- on by default. Otherwise default to the convertToAbsoluteUrls option
- directly
- */
- var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
- if (options.convertToAbsoluteUrls || autoFixUrls) {
- css = fixUrls(css);
- }
- if (sourceMap) {
- // http://stackoverflow.com/a/26603875
- css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
- }
- var blob = new Blob([css], { type: "text/css" });
- var oldSrc = link.href;
- link.href = URL.createObjectURL(blob);
- if(oldSrc) URL.revokeObjectURL(oldSrc);
- }
- /***/ }),
- /* 51 */
- /***/ (function(module, exports, __webpack_require__) {
- (function webpackUniversalModuleDefinition(root, factory) {
- if(true)
- module.exports = factory(__webpack_require__(137));
- else if(typeof define === 'function' && define.amd)
- define(["sortablejs"], factory);
- else if(typeof exports === 'object')
- exports["vuedraggable"] = factory(require("sortablejs"));
- else
- root["vuedraggable"] = factory(root["Sortable"]);
- })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE_a352__) {
- 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");
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "01f9":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var LIBRARY = __webpack_require__("2d00");
- var $export = __webpack_require__("5ca1");
- var redefine = __webpack_require__("2aba");
- var hide = __webpack_require__("32e9");
- var Iterators = __webpack_require__("84f2");
- var $iterCreate = __webpack_require__("41a0");
- var setToStringTag = __webpack_require__("7f20");
- var getPrototypeOf = __webpack_require__("38fd");
- var ITERATOR = __webpack_require__("2b4c")('iterator');
- var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
- var FF_ITERATOR = '@@iterator';
- var KEYS = 'keys';
- var VALUES = 'values';
- var returnThis = function () { return this; };
- module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- $iterCreate(Constructor, NAME, next);
- var getMethod = function (kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS: return function keys() { return new Constructor(this, kind); };
- case VALUES: return function values() { return new Constructor(this, kind); };
- } return function entries() { return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
- // Fix native
- if ($anyNative) {
- IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
- // Set @@toStringTag to native iterators
- setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() { return $native.call(this); };
- }
- // Define iterator
- if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
- hide(proto, ITERATOR, $default);
- }
- // Plug for library
- Iterators[NAME] = $default;
- Iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) redefine(proto, key, methods[key]);
- } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
- /***/ }),
- /***/ "02f4":
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__("4588");
- var defined = __webpack_require__("be13");
- // true -> String#at
- // false -> String#codePointAt
- module.exports = function (TO_STRING) {
- return function (that, pos) {
- var s = String(defined(that));
- var i = toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
- /***/ }),
- /***/ "0390":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var at = __webpack_require__("02f4")(true);
- // `AdvanceStringIndex` abstract operation
- // https://tc39.github.io/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? at(S, index).length : 1);
- };
- /***/ }),
- /***/ "0bfb":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.2.5.3 get RegExp.prototype.flags
- var anObject = __webpack_require__("cb7c");
- 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.unicode) result += 'u';
- if (that.sticky) result += 'y';
- return result;
- };
- /***/ }),
- /***/ "0d58":
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
- var $keys = __webpack_require__("ce10");
- var enumBugKeys = __webpack_require__("e11e");
- module.exports = Object.keys || function keys(O) {
- return $keys(O, enumBugKeys);
- };
- /***/ }),
- /***/ "1495":
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__("86cc");
- var anObject = __webpack_require__("cb7c");
- var getKeys = __webpack_require__("0d58");
- module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = getKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) dP.f(O, P = keys[i++], Properties[P]);
- return O;
- };
- /***/ }),
- /***/ "214f":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- __webpack_require__("b0c5");
- var redefine = __webpack_require__("2aba");
- var hide = __webpack_require__("32e9");
- var fails = __webpack_require__("79e5");
- var defined = __webpack_require__("be13");
- var wks = __webpack_require__("2b4c");
- var regexpExec = __webpack_require__("520a");
- var SPECIES = wks('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';
- });
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- 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) {
- var SYMBOL = wks(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/;
- re.exec = function () { execCalled = true; return null; };
- if (KEY === 'split') {
- // 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[SYMBOL]('');
- return !execCalled;
- }) : undefined;
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
- (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var fns = exec(
- defined,
- SYMBOL,
- ''[KEY],
- function maybeCallNative(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 };
- }
- );
- var strfn = fns[0];
- var rxfn = fns[1];
- redefine(String.prototype, KEY, strfn);
- hide(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 rxfn.call(string, this, arg); }
- // 21.2.5.6 RegExp.prototype[@@match](string)
- // 21.2.5.9 RegExp.prototype[@@search](string)
- : function (string) { return rxfn.call(string, this); }
- );
- }
- };
- /***/ }),
- /***/ "230e":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("d3f4");
- var document = __webpack_require__("7726").document;
- // typeof document.createElement is 'object' in old IE
- var is = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return is ? document.createElement(it) : {};
- };
- /***/ }),
- /***/ "23c6":
- /***/ (function(module, exports, __webpack_require__) {
- // getting tag from 19.1.3.6 Object.prototype.toString()
- var cof = __webpack_require__("2d95");
- var TAG = __webpack_require__("2b4c")('toStringTag');
- // ES3 wrong here
- var ARG = cof(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (e) { /* empty */ }
- };
- module.exports = function (it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
- // builtinTag case
- : ARG ? cof(O)
- // ES3 arguments fallback
- : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
- /***/ }),
- /***/ "2621":
- /***/ (function(module, exports) {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /***/ "2aba":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("7726");
- var hide = __webpack_require__("32e9");
- var has = __webpack_require__("69a8");
- var SRC = __webpack_require__("ca5a")('src');
- var $toString = __webpack_require__("fa5b");
- var TO_STRING = 'toString';
- var TPL = ('' + $toString).split(TO_STRING);
- __webpack_require__("8378").inspectSource = function (it) {
- return $toString.call(it);
- };
- (module.exports = function (O, key, val, safe) {
- var isFunction = typeof val == 'function';
- if (isFunction) has(val, 'name') || hide(val, 'name', key);
- if (O[key] === val) return;
- if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
- if (O === global) {
- O[key] = val;
- } else if (!safe) {
- delete O[key];
- hide(O, key, val);
- } else if (O[key]) {
- O[key] = val;
- } else {
- hide(O, key, val);
- }
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
- })(Function.prototype, TO_STRING, function toString() {
- return typeof this == 'function' && this[SRC] || $toString.call(this);
- });
- /***/ }),
- /***/ "2aeb":
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- var anObject = __webpack_require__("cb7c");
- var dPs = __webpack_require__("1495");
- var enumBugKeys = __webpack_require__("e11e");
- var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
- var Empty = function () { /* empty */ };
- var PROTOTYPE = 'prototype';
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var createDict = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = __webpack_require__("230e")('iframe');
- var i = enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- __webpack_require__("fab2").appendChild(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
- return createDict();
- };
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE] = anObject(O);
- result = new Empty();
- Empty[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = createDict();
- return Properties === undefined ? result : dPs(result, Properties);
- };
- /***/ }),
- /***/ "2b4c":
- /***/ (function(module, exports, __webpack_require__) {
- var store = __webpack_require__("5537")('wks');
- var uid = __webpack_require__("ca5a");
- var Symbol = __webpack_require__("7726").Symbol;
- var USE_SYMBOL = typeof Symbol == 'function';
- var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
- };
- $exports.store = store;
- /***/ }),
- /***/ "2d00":
- /***/ (function(module, exports) {
- module.exports = false;
- /***/ }),
- /***/ "2d95":
- /***/ (function(module, exports) {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /***/ "2fdb":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.1.3.7 String.prototype.includes(searchString, position = 0)
- var $export = __webpack_require__("5ca1");
- var context = __webpack_require__("d2c8");
- var INCLUDES = 'includes';
- $export($export.P + $export.F * __webpack_require__("5147")(INCLUDES), 'String', {
- includes: function includes(searchString /* , position = 0 */) {
- return !!~context(this, searchString, INCLUDES)
- .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /***/ "32e9":
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__("86cc");
- var createDesc = __webpack_require__("4630");
- module.exports = __webpack_require__("9e1e") ? function (object, key, value) {
- return dP.f(object, key, createDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /***/ "38fd":
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
- var has = __webpack_require__("69a8");
- var toObject = __webpack_require__("4bf8");
- var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
- var ObjectProto = Object.prototype;
- module.exports = 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 ? ObjectProto : null;
- };
- /***/ }),
- /***/ "41a0":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var create = __webpack_require__("2aeb");
- var descriptor = __webpack_require__("4630");
- var setToStringTag = __webpack_require__("7f20");
- var IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- __webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")('iterator'), function () { return this; });
- module.exports = function (Constructor, NAME, next) {
- Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
- setToStringTag(Constructor, NAME + ' Iterator');
- };
- /***/ }),
- /***/ "456d":
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.14 Object.keys(O)
- var toObject = __webpack_require__("4bf8");
- var $keys = __webpack_require__("0d58");
- __webpack_require__("5eda")('keys', function () {
- return function keys(it) {
- return $keys(toObject(it));
- };
- });
- /***/ }),
- /***/ "4588":
- /***/ (function(module, exports) {
- // 7.1.4 ToInteger
- var ceil = Math.ceil;
- var floor = Math.floor;
- module.exports = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
- /***/ }),
- /***/ "4630":
- /***/ (function(module, exports) {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /***/ "4bf8":
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.13 ToObject(argument)
- var defined = __webpack_require__("be13");
- module.exports = function (it) {
- return Object(defined(it));
- };
- /***/ }),
- /***/ "5147":
- /***/ (function(module, exports, __webpack_require__) {
- var MATCH = __webpack_require__("2b4c")('match');
- module.exports = function (KEY) {
- var re = /./;
- try {
- '/./'[KEY](re);
- } catch (e) {
- try {
- re[MATCH] = false;
- return !'/./'[KEY](re);
- } catch (f) { /* empty */ }
- } return true;
- };
- /***/ }),
- /***/ "520a":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var regexpFlags = __webpack_require__("0bfb");
- 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 LAST_INDEX = 'lastIndex';
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/,
- re2 = /b*/g;
- nativeExec.call(re1, 'a');
- nativeExec.call(re2, 'a');
- return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
- })();
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
- if (PATCH) {
- patchedExec = function exec(str) {
- var re = this;
- var lastIndex, reCopy, match, i;
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
- match = nativeExec.call(re, str);
- if (UPDATES_LAST_INDEX_WRONG && match) {
- re[LAST_INDEX] = 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 /(.?)?/
- // eslint-disable-next-line no-loop-func
- 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;
- /***/ }),
- /***/ "52a7":
- /***/ (function(module, exports) {
- exports.f = {}.propertyIsEnumerable;
- /***/ }),
- /***/ "5537":
- /***/ (function(module, exports, __webpack_require__) {
- var core = __webpack_require__("8378");
- var global = __webpack_require__("7726");
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || (global[SHARED] = {});
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: core.version,
- mode: __webpack_require__("2d00") ? 'pure' : 'global',
- copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /***/ "5ca1":
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__("7726");
- var core = __webpack_require__("8378");
- var hide = __webpack_require__("32e9");
- var redefine = __webpack_require__("2aba");
- var ctx = __webpack_require__("9b43");
- var PROTOTYPE = 'prototype';
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
- var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
- var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
- var key, own, out, exp;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- // export native or passed
- out = (own ? target : source)[key];
- // bind timers to global for call from export context
- exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // extend global
- if (target) redefine(target, key, out, type & $export.U);
- // export
- if (exports[key] != out) hide(exports, key, exp);
- if (IS_PROTO && expProto[key] != out) expProto[key] = out;
- }
- };
- global.core = core;
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
- /***/ }),
- /***/ "5eda":
- /***/ (function(module, exports, __webpack_require__) {
- // most Object methods by ES6 should accept primitives
- var $export = __webpack_require__("5ca1");
- var core = __webpack_require__("8378");
- var fails = __webpack_require__("79e5");
- module.exports = function (KEY, exec) {
- var fn = (core.Object || {})[KEY] || Object[KEY];
- var exp = {};
- exp[KEY] = exec(fn);
- $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
- };
- /***/ }),
- /***/ "5f1b":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var classof = __webpack_require__("23c6");
- var builtinExec = RegExp.prototype.exec;
- // `RegExpExec` abstract operation
- // https://tc39.github.io/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (typeof exec === 'function') {
- var result = exec.call(R, S);
- if (typeof result !== 'object') {
- throw new TypeError('RegExp exec method returned something other than an Object or null');
- }
- return result;
- }
- if (classof(R) !== 'RegExp') {
- throw new TypeError('RegExp#exec called on incompatible receiver');
- }
- return builtinExec.call(R, S);
- };
- /***/ }),
- /***/ "613b":
- /***/ (function(module, exports, __webpack_require__) {
- var shared = __webpack_require__("5537")('keys');
- var uid = __webpack_require__("ca5a");
- module.exports = function (key) {
- return shared[key] || (shared[key] = uid(key));
- };
- /***/ }),
- /***/ "626a":
- /***/ (function(module, exports, __webpack_require__) {
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- var cof = __webpack_require__("2d95");
- // eslint-disable-next-line no-prototype-builtins
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return cof(it) == 'String' ? it.split('') : Object(it);
- };
- /***/ }),
- /***/ "6762":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/Array.prototype.includes
- var $export = __webpack_require__("5ca1");
- var $includes = __webpack_require__("c366")(true);
- $export($export.P, 'Array', {
- includes: function includes(el /* , fromIndex = 0 */) {
- return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- __webpack_require__("9c6c")('includes');
- /***/ }),
- /***/ "6821":
- /***/ (function(module, exports, __webpack_require__) {
- // to indexed object, toObject with fallback for non-array-like ES3 strings
- var IObject = __webpack_require__("626a");
- var defined = __webpack_require__("be13");
- module.exports = function (it) {
- return IObject(defined(it));
- };
- /***/ }),
- /***/ "69a8":
- /***/ (function(module, exports) {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /***/ "6a99":
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__("d3f4");
- // 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 (it, S) {
- if (!isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /***/ "7333":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 19.1.2.1 Object.assign(target, source, ...)
- var getKeys = __webpack_require__("0d58");
- var gOPS = __webpack_require__("2621");
- var pIE = __webpack_require__("52a7");
- var toObject = __webpack_require__("4bf8");
- var IObject = __webpack_require__("626a");
- var $assign = Object.assign;
- // should work with symbols and should have deterministic property order (V8 bug)
- module.exports = !$assign || __webpack_require__("79e5")(function () {
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) { B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = gOPS.f;
- var isEnum = pIE.f;
- while (aLen > index) {
- var S = IObject(arguments[index++]);
- var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
- } return T;
- } : $assign;
- /***/ }),
- /***/ "7726":
- /***/ (function(module, exports) {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
- /***/ }),
- /***/ "77f1":
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__("4588");
- var max = Math.max;
- var min = Math.min;
- module.exports = function (index, length) {
- index = toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
- /***/ }),
- /***/ "79e5":
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
- /***/ }),
- /***/ "7f20":
- /***/ (function(module, exports, __webpack_require__) {
- var def = __webpack_require__("86cc").f;
- var has = __webpack_require__("69a8");
- var TAG = __webpack_require__("2b4c")('toStringTag');
- module.exports = function (it, tag, stat) {
- if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
- };
- /***/ }),
- /***/ "8378":
- /***/ (function(module, exports) {
- var core = module.exports = { version: '2.6.5' };
- if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
- /***/ }),
- /***/ "84f2":
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /***/ "86cc":
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__("cb7c");
- var IE8_DOM_DEFINE = __webpack_require__("c69a");
- var toPrimitive = __webpack_require__("6a99");
- var dP = Object.defineProperty;
- exports.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /***/ "9b43":
- /***/ (function(module, exports, __webpack_require__) {
- // optional / simple context binding
- var aFunction = __webpack_require__("d8e8");
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- 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);
- };
- };
- /***/ }),
- /***/ "9c6c":
- /***/ (function(module, exports, __webpack_require__) {
- // 22.1.3.31 Array.prototype[@@unscopables]
- var UNSCOPABLES = __webpack_require__("2b4c")('unscopables');
- var ArrayProto = Array.prototype;
- if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
- module.exports = function (key) {
- ArrayProto[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ "9def":
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.15 ToLength
- var toInteger = __webpack_require__("4588");
- var min = Math.min;
- module.exports = function (it) {
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
- /***/ }),
- /***/ "9e1e":
- /***/ (function(module, exports, __webpack_require__) {
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__("79e5")(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ "a352":
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_a352__;
- /***/ }),
- /***/ "a481":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var anObject = __webpack_require__("cb7c");
- var toObject = __webpack_require__("4bf8");
- var toLength = __webpack_require__("9def");
- var toInteger = __webpack_require__("4588");
- var advanceStringIndex = __webpack_require__("0390");
- var regExpExec = __webpack_require__("5f1b");
- var max = Math.max;
- var min = Math.min;
- var floor = Math.floor;
- var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
- var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // @@replace logic
- __webpack_require__("214f")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
- return [
- // `String.prototype.replace` method
- // https://tc39.github.io/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = defined(this);
- var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
- return fn !== undefined
- ? fn.call(searchValue, O, replaceValue)
- : $replace.call(String(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
- function (regexp, replaceValue) {
- var res = maybeCallNative($replace, regexp, this, replaceValue);
- if (res.done) return res.value;
- var rx = anObject(regexp);
- var S = String(this);
- var functionalReplace = typeof replaceValue === 'function';
- if (!functionalReplace) replaceValue = String(replaceValue);
- var global = rx.global;
- if (global) {
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- while (true) {
- var result = regExpExec(rx, S);
- if (result === null) break;
- results.push(result);
- if (!global) break;
- var matchStr = String(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = String(result[0]);
- var position = max(min(toInteger(result.index), S.length), 0);
- var captures = [];
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = [matched].concat(captures, position, S);
- if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
- var replacement = String(replaceValue.apply(undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + S.slice(nextSourcePosition);
- }
- ];
- // https://tc39.github.io/ecma262/#sec-getsubstitution
- function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
- var tailPos = position + matched.length;
- var m = captures.length;
- var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
- if (namedCaptures !== undefined) {
- namedCaptures = toObject(namedCaptures);
- symbols = SUBSTITUTION_SYMBOLS;
- }
- return $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;
- });
- }
- });
- /***/ }),
- /***/ "aae3":
- /***/ (function(module, exports, __webpack_require__) {
- // 7.2.8 IsRegExp(argument)
- var isObject = __webpack_require__("d3f4");
- var cof = __webpack_require__("2d95");
- var MATCH = __webpack_require__("2b4c")('match');
- module.exports = function (it) {
- var isRegExp;
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
- };
- /***/ }),
- /***/ "ac6a":
- /***/ (function(module, exports, __webpack_require__) {
- var $iterators = __webpack_require__("cadf");
- var getKeys = __webpack_require__("0d58");
- var redefine = __webpack_require__("2aba");
- var global = __webpack_require__("7726");
- var hide = __webpack_require__("32e9");
- var Iterators = __webpack_require__("84f2");
- var wks = __webpack_require__("2b4c");
- var ITERATOR = wks('iterator');
- var TO_STRING_TAG = wks('toStringTag');
- var ArrayValues = Iterators.Array;
- var DOMIterables = {
- CSSRuleList: true, // TODO: Not spec compliant, should be false.
- CSSStyleDeclaration: false,
- CSSValueList: false,
- ClientRectList: false,
- DOMRectList: false,
- DOMStringList: false,
- DOMTokenList: true,
- DataTransferItemList: false,
- FileList: false,
- HTMLAllCollection: false,
- HTMLCollection: false,
- HTMLFormElement: false,
- HTMLSelectElement: false,
- MediaList: true, // TODO: Not spec compliant, should be false.
- MimeTypeArray: false,
- NamedNodeMap: false,
- NodeList: true,
- PaintRequestList: false,
- Plugin: false,
- PluginArray: false,
- SVGLengthList: false,
- SVGNumberList: false,
- SVGPathSegList: false,
- SVGPointList: false,
- SVGStringList: false,
- SVGTransformList: false,
- SourceBufferList: false,
- StyleSheetList: true, // TODO: Not spec compliant, should be false.
- TextTrackCueList: false,
- TextTrackList: false,
- TouchList: false
- };
- for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
- var NAME = collections[i];
- var explicit = DOMIterables[NAME];
- var Collection = global[NAME];
- var proto = Collection && Collection.prototype;
- var key;
- if (proto) {
- if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
- if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
- Iterators[NAME] = ArrayValues;
- if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
- }
- }
- /***/ }),
- /***/ "b0c5":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var regexpExec = __webpack_require__("520a");
- __webpack_require__("5ca1")({
- target: 'RegExp',
- proto: true,
- forced: regexpExec !== /./.exec
- }, {
- exec: regexpExec
- });
- /***/ }),
- /***/ "be13":
- /***/ (function(module, exports) {
- // 7.2.1 RequireObjectCoercible(argument)
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /***/ "c366":
- /***/ (function(module, exports, __webpack_require__) {
- // false -> Array#indexOf
- // true -> Array#includes
- var toIObject = __webpack_require__("6821");
- var toLength = __webpack_require__("9def");
- var toAbsoluteIndex = __webpack_require__("77f1");
- module.exports = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- /***/ }),
- /***/ "c649":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return insertNodeAt; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return console; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeNode; });
- /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a481");
- /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__);
- function getConsole() {
- if (typeof window !== "undefined") {
- return window.console;
- }
- return global.console;
- }
- var console = getConsole();
- function cached(fn) {
- var cache = Object.create(null);
- return function cachedFn(str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- }
- var regex = /-(\w)/g;
- var camelize = cached(function (str) {
- return str.replace(regex, function (_, c) {
- return c ? c.toUpperCase() : "";
- });
- });
- function removeNode(node) {
- if (node.parentElement !== null) {
- node.parentElement.removeChild(node);
- }
- }
- function insertNodeAt(fatherNode, node, position) {
- var refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling;
- fatherNode.insertBefore(node, refNode);
- }
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
- /***/ }),
- /***/ "c69a":
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () {
- return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /***/ "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;
- /***/ }),
- /***/ "ca5a":
- /***/ (function(module, exports) {
- var id = 0;
- var px = Math.random();
- module.exports = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
- /***/ }),
- /***/ "cadf":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var addToUnscopables = __webpack_require__("9c6c");
- var step = __webpack_require__("d53b");
- var Iterators = __webpack_require__("84f2");
- var toIObject = __webpack_require__("6821");
- // 22.1.3.4 Array.prototype.entries()
- // 22.1.3.13 Array.prototype.keys()
- // 22.1.3.29 Array.prototype.values()
- // 22.1.3.30 Array.prototype[@@iterator]()
- module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) {
- this._t = toIObject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return step(1);
- }
- if (kind == 'keys') return step(0, index);
- if (kind == 'values') return step(0, O[index]);
- return step(0, [index, O[index]]);
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
- Iterators.Arguments = Iterators.Array;
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /***/ "cb7c":
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__("d3f4");
- module.exports = function (it) {
- if (!isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
- /***/ }),
- /***/ "ce10":
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__("69a8");
- var toIObject = __webpack_require__("6821");
- var arrayIndexOf = __webpack_require__("c366")(false);
- var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
- module.exports = function (object, names) {
- var O = toIObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /***/ "d2c8":
- /***/ (function(module, exports, __webpack_require__) {
- // helper for String#{startsWith, endsWith, includes}
- var isRegExp = __webpack_require__("aae3");
- var defined = __webpack_require__("be13");
- module.exports = function (that, searchString, NAME) {
- if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
- return String(defined(that));
- };
- /***/ }),
- /***/ "d3f4":
- /***/ (function(module, exports) {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /***/ "d53b":
- /***/ (function(module, exports) {
- module.exports = function (done, value) {
- return { value: value, done: !!done };
- };
- /***/ }),
- /***/ "d8e8":
- /***/ (function(module, exports) {
- module.exports = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
- /***/ }),
- /***/ "e11e":
- /***/ (function(module, exports) {
- // IE 8- don't enum bug keys
- module.exports = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
- /***/ }),
- /***/ "f559":
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
- var $export = __webpack_require__("5ca1");
- var toLength = __webpack_require__("9def");
- var context = __webpack_require__("d2c8");
- var STARTS_WITH = 'startsWith';
- var $startsWith = ''[STARTS_WITH];
- $export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'String', {
- startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = context(this, searchString, STARTS_WITH);
- var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
- var search = String(searchString);
- return $startsWith
- ? $startsWith.call(that, search, index)
- : that.slice(index, index + search.length) === search;
- }
- });
- /***/ }),
- /***/ "f6fd":
- /***/ (function(module, exports) {
- // document.currentScript polyfill by Adam Miller
- // MIT license
- (function(document){
- var currentScript = "currentScript",
- scripts = document.getElementsByTagName('script'); // Live NodeList collection
- // If browser needs currentScript polyfill, add get currentScript() to the document object
- if (!(currentScript in document)) {
- Object.defineProperty(document, currentScript, {
- get: function(){
- // IE 6-10 supports script readyState
- // IE 10+ support stack trace
- try { throw new Error(); }
- catch (err) {
- // Find the second match for the "at" string to get file src url from stack.
- // Specifically works with the format of stack traces in IE.
- var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
- // For all scripts on the page, if src matches or if ready state is interactive, return the script tag
- for(i in scripts){
- if(scripts[i].src == res || scripts[i].readyState == "interactive"){
- return scripts[i];
- }
- }
- // If no match, return null
- return null;
- }
- }
- });
- }
- })(document);
- /***/ }),
- /***/ "f751":
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.3.1 Object.assign(target, source)
- var $export = __webpack_require__("5ca1");
- $export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
- /***/ }),
- /***/ "fa5b":
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
- /***/ }),
- /***/ "fab2":
- /***/ (function(module, exports, __webpack_require__) {
- var document = __webpack_require__("7726").document;
- module.exports = document && document.documentElement;
- /***/ }),
- /***/ "fb15":
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // 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') {
- if (true) {
- __webpack_require__("f6fd")
- }
- var setPublicPath_i
- if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
- __webpack_require__.p = setPublicPath_i[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/es6.object.assign.js
- var es6_object_assign = __webpack_require__("f751");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
- var es6_string_starts_with = __webpack_require__("f559");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
- var web_dom_iterable = __webpack_require__("ac6a");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
- var es6_array_iterator = __webpack_require__("cadf");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
- var es6_object_keys = __webpack_require__("456d");
- // 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/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/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/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();
- }
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
- var es7_array_includes = __webpack_require__("6762");
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
- var es6_string_includes = __webpack_require__("2fdb");
- // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
- }
- // 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);
- }
- // 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: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
- var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
- var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
- // EXTERNAL MODULE: ./src/util/helper.js
- var helper = __webpack_require__("c649");
- // CONCATENATED MODULE: ./src/vuedraggable.js
- function buildAttribute(object, propName, value) {
- if (value === undefined) {
- return object;
- }
- object = object || {};
- object[propName] = value;
- return object;
- }
- function computeVmIndex(vnodes, element) {
- return vnodes.map(function (elt) {
- return elt.elm;
- }).indexOf(element);
- }
- function _computeIndexes(slots, children, isTransition, footerOffset) {
- if (!slots) {
- return [];
- }
- var elmFromNodes = slots.map(function (elt) {
- return elt.elm;
- });
- var footerIndex = children.length - footerOffset;
- var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
- return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
- });
- return isTransition ? rawIndexes.filter(function (ind) {
- return ind !== -1;
- }) : rawIndexes;
- }
- function emit(evtName, evtData) {
- var _this = this;
- this.$nextTick(function () {
- return _this.$emit(evtName.toLowerCase(), evtData);
- });
- }
- function delegateAndEmit(evtName) {
- var _this2 = this;
- return function (evtData) {
- if (_this2.realList !== null) {
- _this2["onDrag" + evtName](evtData);
- }
- emit.call(_this2, evtName, evtData);
- };
- }
- function isTransitionName(name) {
- return ["transition-group", "TransitionGroup"].includes(name);
- }
- function vuedraggable_isTransition(slots) {
- if (!slots || slots.length !== 1) {
- return false;
- }
- var _slots = _slicedToArray(slots, 1),
- componentOptions = _slots[0].componentOptions;
- if (!componentOptions) {
- return false;
- }
- return isTransitionName(componentOptions.tag);
- }
- function getSlot(slot, scopedSlot, key) {
- return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
- }
- function computeChildrenAndOffsets(children, slot, scopedSlot) {
- var headerOffset = 0;
- var footerOffset = 0;
- var header = getSlot(slot, scopedSlot, "header");
- if (header) {
- headerOffset = header.length;
- children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
- }
- var footer = getSlot(slot, scopedSlot, "footer");
- if (footer) {
- footerOffset = footer.length;
- children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
- }
- return {
- children: children,
- headerOffset: headerOffset,
- footerOffset: footerOffset
- };
- }
- function getComponentAttributes($attrs, componentData) {
- var attributes = null;
- var update = function update(name, value) {
- attributes = buildAttribute(attributes, name, value);
- };
- var attrs = Object.keys($attrs).filter(function (key) {
- return key === "id" || key.startsWith("data-");
- }).reduce(function (res, key) {
- res[key] = $attrs[key];
- return res;
- }, {});
- update("attrs", attrs);
- if (!componentData) {
- return attributes;
- }
- var on = componentData.on,
- props = componentData.props,
- componentDataAttrs = componentData.attrs;
- update("on", on);
- update("props", props);
- Object.assign(attributes.attrs, componentDataAttrs);
- return attributes;
- }
- var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
- var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
- var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
- return "on" + evt;
- });
- var draggingElement = null;
- var props = {
- options: Object,
- list: {
- type: Array,
- required: false,
- default: null
- },
- value: {
- type: Array,
- required: false,
- default: null
- },
- noTransitionOnDrag: {
- type: Boolean,
- default: false
- },
- clone: {
- type: Function,
- default: function _default(original) {
- return original;
- }
- },
- element: {
- type: String,
- default: "div"
- },
- tag: {
- type: String,
- default: null
- },
- move: {
- type: Function,
- default: null
- },
- componentData: {
- type: Object,
- required: false,
- default: null
- }
- };
- var draggableComponent = {
- name: "draggable",
- inheritAttrs: false,
- props: props,
- data: function data() {
- return {
- transitionMode: false,
- noneFunctionalComponentMode: false
- };
- },
- render: function render(h) {
- var slots = this.$slots.default;
- this.transitionMode = vuedraggable_isTransition(slots);
- var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
- children = _computeChildrenAndOf.children,
- headerOffset = _computeChildrenAndOf.headerOffset,
- footerOffset = _computeChildrenAndOf.footerOffset;
- this.headerOffset = headerOffset;
- this.footerOffset = footerOffset;
- var attributes = getComponentAttributes(this.$attrs, this.componentData);
- return h(this.getTag(), attributes, children);
- },
- created: function created() {
- if (this.list !== null && this.value !== null) {
- helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
- }
- if (this.element !== "div") {
- helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
- }
- if (this.options !== undefined) {
- helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
- }
- },
- mounted: function mounted() {
- var _this3 = this;
- this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
- if (this.noneFunctionalComponentMode && this.transitionMode) {
- throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
- }
- var optionsAdded = {};
- eventsListened.forEach(function (elt) {
- optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
- });
- eventsToEmit.forEach(function (elt) {
- optionsAdded["on" + elt] = emit.bind(_this3, elt);
- });
- var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
- res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
- return res;
- }, {});
- var options = Object.assign({}, this.options, attributes, optionsAdded, {
- onMove: function onMove(evt, originalEvent) {
- return _this3.onDragMove(evt, originalEvent);
- }
- });
- !("draggable" in options) && (options.draggable = ">*");
- this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
- this.computeIndexes();
- },
- beforeDestroy: function beforeDestroy() {
- if (this._sortable !== undefined) this._sortable.destroy();
- },
- computed: {
- rootContainer: function rootContainer() {
- return this.transitionMode ? this.$el.children[0] : this.$el;
- },
- realList: function realList() {
- return this.list ? this.list : this.value;
- }
- },
- watch: {
- options: {
- handler: function handler(newOptionValue) {
- this.updateOptions(newOptionValue);
- },
- deep: true
- },
- $attrs: {
- handler: function handler(newOptionValue) {
- this.updateOptions(newOptionValue);
- },
- deep: true
- },
- realList: function realList() {
- this.computeIndexes();
- }
- },
- methods: {
- getIsFunctional: function getIsFunctional() {
- var fnOptions = this._vnode.fnOptions;
- return fnOptions && fnOptions.functional;
- },
- getTag: function getTag() {
- return this.tag || this.element;
- },
- updateOptions: function updateOptions(newOptionValue) {
- for (var property in newOptionValue) {
- var value = Object(helper["a" /* camelize */])(property);
- if (readonlyProperties.indexOf(value) === -1) {
- this._sortable.option(value, newOptionValue[property]);
- }
- }
- },
- getChildrenNodes: function getChildrenNodes() {
- if (this.noneFunctionalComponentMode) {
- return this.$children[0].$slots.default;
- }
- var rawNodes = this.$slots.default;
- return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
- },
- computeIndexes: function computeIndexes() {
- var _this4 = this;
- this.$nextTick(function () {
- _this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
- });
- },
- getUnderlyingVm: function getUnderlyingVm(htmlElt) {
- var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
- if (index === -1) {
- //Edge case during move callback: related element might be
- //an element different from collection
- return null;
- }
- var element = this.realList[index];
- return {
- index: index,
- element: element
- };
- },
- getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
- var vue = _ref.__vue__;
- if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
- if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
- return vue;
- }
- return vue.$parent;
- },
- emitChanges: function emitChanges(evt) {
- var _this5 = this;
- this.$nextTick(function () {
- _this5.$emit("change", evt);
- });
- },
- alterList: function alterList(onList) {
- if (this.list) {
- onList(this.list);
- return;
- }
- var newList = _toConsumableArray(this.value);
- onList(newList);
- this.$emit("input", newList);
- },
- spliceList: function spliceList() {
- var _arguments = arguments;
- var spliceList = function spliceList(list) {
- return list.splice.apply(list, _toConsumableArray(_arguments));
- };
- this.alterList(spliceList);
- },
- updatePosition: function updatePosition(oldIndex, newIndex) {
- var updatePosition = function updatePosition(list) {
- return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
- };
- this.alterList(updatePosition);
- },
- getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
- var to = _ref2.to,
- related = _ref2.related;
- var component = this.getUnderlyingPotencialDraggableComponent(to);
- if (!component) {
- return {
- component: component
- };
- }
- var list = component.realList;
- var context = {
- list: list,
- component: component
- };
- if (to !== related && list && component.getUnderlyingVm) {
- var destination = component.getUnderlyingVm(related);
- if (destination) {
- return Object.assign(destination, context);
- }
- }
- return context;
- },
- getVmIndex: function getVmIndex(domIndex) {
- var indexes = this.visibleIndexes;
- var numberIndexes = indexes.length;
- return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
- },
- getComponent: function getComponent() {
- return this.$slots.default[0].componentInstance;
- },
- resetTransitionData: function resetTransitionData(index) {
- if (!this.noTransitionOnDrag || !this.transitionMode) {
- return;
- }
- var nodes = this.getChildrenNodes();
- nodes[index].data = null;
- var transitionContainer = this.getComponent();
- transitionContainer.children = [];
- transitionContainer.kept = undefined;
- },
- onDragStart: function onDragStart(evt) {
- this.context = this.getUnderlyingVm(evt.item);
- evt.item._underlying_vm_ = this.clone(this.context.element);
- draggingElement = evt.item;
- },
- onDragAdd: function onDragAdd(evt) {
- var element = evt.item._underlying_vm_;
- if (element === undefined) {
- return;
- }
- Object(helper["d" /* removeNode */])(evt.item);
- var newIndex = this.getVmIndex(evt.newIndex);
- this.spliceList(newIndex, 0, element);
- this.computeIndexes();
- var added = {
- element: element,
- newIndex: newIndex
- };
- this.emitChanges({
- added: added
- });
- },
- onDragRemove: function onDragRemove(evt) {
- Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
- if (evt.pullMode === "clone") {
- Object(helper["d" /* removeNode */])(evt.clone);
- return;
- }
- var oldIndex = this.context.index;
- this.spliceList(oldIndex, 1);
- var removed = {
- element: this.context.element,
- oldIndex: oldIndex
- };
- this.resetTransitionData(oldIndex);
- this.emitChanges({
- removed: removed
- });
- },
- onDragUpdate: function onDragUpdate(evt) {
- Object(helper["d" /* removeNode */])(evt.item);
- Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
- var oldIndex = this.context.index;
- var newIndex = this.getVmIndex(evt.newIndex);
- this.updatePosition(oldIndex, newIndex);
- var moved = {
- element: this.context.element,
- oldIndex: oldIndex,
- newIndex: newIndex
- };
- this.emitChanges({
- moved: moved
- });
- },
- updateProperty: function updateProperty(evt, propertyName) {
- evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
- },
- computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
- if (!relatedContext.element) {
- return 0;
- }
- var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
- return el.style["display"] !== "none";
- });
- var currentDOMIndex = domChildren.indexOf(evt.related);
- var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
- var draggedInList = domChildren.indexOf(draggingElement) !== -1;
- return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
- },
- onDragMove: function onDragMove(evt, originalEvent) {
- var onMove = this.move;
- if (!onMove || !this.realList) {
- return true;
- }
- var relatedContext = this.getRelatedContextFromMoveEvent(evt);
- var draggedContext = this.context;
- var futureIndex = this.computeFutureIndex(relatedContext, evt);
- Object.assign(draggedContext, {
- futureIndex: futureIndex
- });
- var sendEvt = Object.assign({}, evt, {
- relatedContext: relatedContext,
- draggedContext: draggedContext
- });
- return onMove(sendEvt, originalEvent);
- },
- onDragEnd: function onDragEnd() {
- this.computeIndexes();
- draggingElement = null;
- }
- }
- };
- if (typeof window !== "undefined" && "Vue" in window) {
- window.Vue.component("draggable", draggableComponent);
- }
- /* harmony default export */ var vuedraggable = (draggableComponent);
- // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
- /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (vuedraggable);
- /***/ })
- /******/ })["default"];
- });
- //# sourceMappingURL=vuedraggable.umd.js.map
- /***/ }),
- /* 52 */
- /***/ (function(module, exports) {
- // shim for using process in browser
- var process = module.exports = {};
- // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
- var cachedSetTimeout;
- var cachedClearTimeout;
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- } ())
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
- function noop() {}
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function (name) { return [] }
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
- /***/ }),
- /* 53 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/**
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
- * Licensed under the LGPL or a commercial license.
- * For LGPL see License.txt in the project root for license information.
- * For commercial licenses see https://www.tiny.cloud/
- *
- * Version: 5.10.3 (2022-02-09)
- */
- (function () {
- 'use strict';
- var typeOf$1 = function (x) {
- if (x === null) {
- return 'null';
- }
- if (x === undefined) {
- return 'undefined';
- }
- var t = typeof x;
- if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
- return 'array';
- }
- if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
- return 'string';
- }
- return t;
- };
- var isEquatableType = function (x) {
- return [
- 'undefined',
- 'boolean',
- 'number',
- 'string',
- 'function',
- 'xml',
- 'null'
- ].indexOf(x) !== -1;
- };
- var sort$1 = function (xs, compareFn) {
- var clone = Array.prototype.slice.call(xs);
- return clone.sort(compareFn);
- };
- var contramap = function (eqa, f) {
- return eq$2(function (x, y) {
- return eqa.eq(f(x), f(y));
- });
- };
- var eq$2 = function (f) {
- return { eq: f };
- };
- var tripleEq = eq$2(function (x, y) {
- return x === y;
- });
- var eqString = tripleEq;
- var eqArray = function (eqa) {
- return eq$2(function (x, y) {
- if (x.length !== y.length) {
- return false;
- }
- var len = x.length;
- for (var i = 0; i < len; i++) {
- if (!eqa.eq(x[i], y[i])) {
- return false;
- }
- }
- return true;
- });
- };
- var eqSortedArray = function (eqa, compareFn) {
- return contramap(eqArray(eqa), function (xs) {
- return sort$1(xs, compareFn);
- });
- };
- var eqRecord = function (eqa) {
- return eq$2(function (x, y) {
- var kx = Object.keys(x);
- var ky = Object.keys(y);
- if (!eqSortedArray(eqString).eq(kx, ky)) {
- return false;
- }
- var len = kx.length;
- for (var i = 0; i < len; i++) {
- var q = kx[i];
- if (!eqa.eq(x[q], y[q])) {
- return false;
- }
- }
- return true;
- });
- };
- var eqAny = eq$2(function (x, y) {
- if (x === y) {
- return true;
- }
- var tx = typeOf$1(x);
- var ty = typeOf$1(y);
- if (tx !== ty) {
- return false;
- }
- if (isEquatableType(tx)) {
- return x === y;
- } else if (tx === 'array') {
- return eqArray(eqAny).eq(x, y);
- } else if (tx === 'object') {
- return eqRecord(eqAny).eq(x, y);
- }
- return false;
- });
- var typeOf = function (x) {
- var t = typeof x;
- if (x === null) {
- return 'null';
- } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
- return 'array';
- } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
- return 'string';
- } else {
- return t;
- }
- };
- var isType$1 = function (type) {
- return function (value) {
- return typeOf(value) === type;
- };
- };
- var isSimpleType = function (type) {
- return function (value) {
- return typeof value === type;
- };
- };
- var eq$1 = function (t) {
- return function (a) {
- return t === a;
- };
- };
- var isString$1 = isType$1('string');
- var isObject = isType$1('object');
- var isArray$1 = isType$1('array');
- var isNull = eq$1(null);
- var isBoolean = isSimpleType('boolean');
- var isUndefined = eq$1(undefined);
- var isNullable = function (a) {
- return a === null || a === undefined;
- };
- var isNonNullable = function (a) {
- return !isNullable(a);
- };
- var isFunction = isSimpleType('function');
- var isNumber = isSimpleType('number');
- var noop = function () {
- };
- var compose = function (fa, fb) {
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return fa(fb.apply(null, args));
- };
- };
- var compose1 = function (fbc, fab) {
- return function (a) {
- return fbc(fab(a));
- };
- };
- var constant = function (value) {
- return function () {
- return value;
- };
- };
- var identity = function (x) {
- return x;
- };
- var tripleEquals = function (a, b) {
- return a === b;
- };
- function curry(fn) {
- var initialArgs = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- initialArgs[_i - 1] = arguments[_i];
- }
- return function () {
- var restArgs = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- restArgs[_i] = arguments[_i];
- }
- var all = initialArgs.concat(restArgs);
- return fn.apply(null, all);
- };
- }
- var not = function (f) {
- return function (t) {
- return !f(t);
- };
- };
- var die = function (msg) {
- return function () {
- throw new Error(msg);
- };
- };
- var apply = function (f) {
- return f();
- };
- var call = function (f) {
- f();
- };
- var never = constant(false);
- var always = constant(true);
- var none = function () {
- return NONE;
- };
- var NONE = function () {
- var call = function (thunk) {
- return thunk();
- };
- var id = identity;
- var me = {
- fold: function (n, _s) {
- return n();
- },
- isSome: never,
- isNone: always,
- getOr: id,
- getOrThunk: call,
- getOrDie: function (msg) {
- throw new Error(msg || 'error: getOrDie called on none.');
- },
- getOrNull: constant(null),
- getOrUndefined: constant(undefined),
- or: id,
- orThunk: call,
- map: none,
- each: noop,
- bind: none,
- exists: never,
- forall: always,
- filter: function () {
- return none();
- },
- toArray: function () {
- return [];
- },
- toString: constant('none()')
- };
- return me;
- }();
- var some = function (a) {
- var constant_a = constant(a);
- var self = function () {
- return me;
- };
- var bind = function (f) {
- return f(a);
- };
- var me = {
- fold: function (n, s) {
- return s(a);
- },
- isSome: always,
- isNone: never,
- getOr: constant_a,
- getOrThunk: constant_a,
- getOrDie: constant_a,
- getOrNull: constant_a,
- getOrUndefined: constant_a,
- or: self,
- orThunk: self,
- map: function (f) {
- return some(f(a));
- },
- each: function (f) {
- f(a);
- },
- bind: bind,
- exists: bind,
- forall: bind,
- filter: function (f) {
- return f(a) ? me : NONE;
- },
- toArray: function () {
- return [a];
- },
- toString: function () {
- return 'some(' + a + ')';
- }
- };
- return me;
- };
- var from$1 = function (value) {
- return value === null || value === undefined ? NONE : some(value);
- };
- var Optional = {
- some: some,
- none: none,
- from: from$1
- };
- var nativeSlice = Array.prototype.slice;
- var nativeIndexOf = Array.prototype.indexOf;
- var nativePush = Array.prototype.push;
- var rawIndexOf = function (ts, t) {
- return nativeIndexOf.call(ts, t);
- };
- var indexOf$2 = function (xs, x) {
- var r = rawIndexOf(xs, x);
- return r === -1 ? Optional.none() : Optional.some(r);
- };
- var contains$3 = function (xs, x) {
- return rawIndexOf(xs, x) > -1;
- };
- var exists = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i)) {
- return true;
- }
- }
- return false;
- };
- var map$3 = function (xs, f) {
- var len = xs.length;
- var r = new Array(len);
- for (var i = 0; i < len; i++) {
- var x = xs[i];
- r[i] = f(x, i);
- }
- return r;
- };
- var each$k = function (xs, f) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- f(x, i);
- }
- };
- var eachr = function (xs, f) {
- for (var i = xs.length - 1; i >= 0; i--) {
- var x = xs[i];
- f(x, i);
- }
- };
- var partition = function (xs, pred) {
- var pass = [];
- var fail = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- var arr = pred(x, i) ? pass : fail;
- arr.push(x);
- }
- return {
- pass: pass,
- fail: fail
- };
- };
- var filter$4 = function (xs, pred) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i)) {
- r.push(x);
- }
- }
- return r;
- };
- var foldr = function (xs, f, acc) {
- eachr(xs, function (x, i) {
- acc = f(acc, x, i);
- });
- return acc;
- };
- var foldl = function (xs, f, acc) {
- each$k(xs, function (x, i) {
- acc = f(acc, x, i);
- });
- return acc;
- };
- var findUntil$1 = function (xs, pred, until) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i)) {
- return Optional.some(x);
- } else if (until(x, i)) {
- break;
- }
- }
- return Optional.none();
- };
- var find$3 = function (xs, pred) {
- return findUntil$1(xs, pred, never);
- };
- var findIndex$2 = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i)) {
- return Optional.some(i);
- }
- }
- return Optional.none();
- };
- var flatten = function (xs) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (!isArray$1(xs[i])) {
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
- }
- nativePush.apply(r, xs[i]);
- }
- return r;
- };
- var bind = function (xs, f) {
- return flatten(map$3(xs, f));
- };
- var forall = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; ++i) {
- var x = xs[i];
- if (pred(x, i) !== true) {
- return false;
- }
- }
- return true;
- };
- var reverse = function (xs) {
- var r = nativeSlice.call(xs, 0);
- r.reverse();
- return r;
- };
- var difference = function (a1, a2) {
- return filter$4(a1, function (x) {
- return !contains$3(a2, x);
- });
- };
- var mapToObject = function (xs, f) {
- var r = {};
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- r[String(x)] = f(x, i);
- }
- return r;
- };
- var sort = function (xs, comparator) {
- var copy = nativeSlice.call(xs, 0);
- copy.sort(comparator);
- return copy;
- };
- var get$a = function (xs, i) {
- return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
- };
- var head = function (xs) {
- return get$a(xs, 0);
- };
- var last$2 = function (xs) {
- return get$a(xs, xs.length - 1);
- };
- var from = isFunction(Array.from) ? Array.from : function (x) {
- return nativeSlice.call(x);
- };
- var findMap = function (arr, f) {
- for (var i = 0; i < arr.length; i++) {
- var r = f(arr[i], i);
- if (r.isSome()) {
- return r;
- }
- }
- return Optional.none();
- };
- var keys = Object.keys;
- var hasOwnProperty$1 = Object.hasOwnProperty;
- var each$j = function (obj, f) {
- var props = keys(obj);
- for (var k = 0, len = props.length; k < len; k++) {
- var i = props[k];
- var x = obj[i];
- f(x, i);
- }
- };
- var map$2 = function (obj, f) {
- return tupleMap(obj, function (x, i) {
- return {
- k: i,
- v: f(x, i)
- };
- });
- };
- var tupleMap = function (obj, f) {
- var r = {};
- each$j(obj, function (x, i) {
- var tuple = f(x, i);
- r[tuple.k] = tuple.v;
- });
- return r;
- };
- var objAcc = function (r) {
- return function (x, i) {
- r[i] = x;
- };
- };
- var internalFilter = function (obj, pred, onTrue, onFalse) {
- var r = {};
- each$j(obj, function (x, i) {
- (pred(x, i) ? onTrue : onFalse)(x, i);
- });
- return r;
- };
- var bifilter = function (obj, pred) {
- var t = {};
- var f = {};
- internalFilter(obj, pred, objAcc(t), objAcc(f));
- return {
- t: t,
- f: f
- };
- };
- var filter$3 = function (obj, pred) {
- var t = {};
- internalFilter(obj, pred, objAcc(t), noop);
- return t;
- };
- var mapToArray = function (obj, f) {
- var r = [];
- each$j(obj, function (value, name) {
- r.push(f(value, name));
- });
- return r;
- };
- var values = function (obj) {
- return mapToArray(obj, identity);
- };
- var get$9 = function (obj, key) {
- return has$2(obj, key) ? Optional.from(obj[key]) : Optional.none();
- };
- var has$2 = function (obj, key) {
- return hasOwnProperty$1.call(obj, key);
- };
- var hasNonNullableKey = function (obj, key) {
- return has$2(obj, key) && obj[key] !== undefined && obj[key] !== null;
- };
- var equal$1 = function (a1, a2, eq) {
- if (eq === void 0) {
- eq = eqAny;
- }
- return eqRecord(eq).eq(a1, a2);
- };
- var isArray = Array.isArray;
- var toArray$1 = function (obj) {
- if (!isArray(obj)) {
- var array = [];
- for (var i = 0, l = obj.length; i < l; i++) {
- array[i] = obj[i];
- }
- return array;
- } else {
- return obj;
- }
- };
- var each$i = function (o, cb, s) {
- var n, l;
- if (!o) {
- return false;
- }
- s = s || o;
- if (o.length !== undefined) {
- for (n = 0, l = o.length; n < l; n++) {
- if (cb.call(s, o[n], n, o) === false) {
- return false;
- }
- }
- } else {
- for (n in o) {
- if (has$2(o, n)) {
- if (cb.call(s, o[n], n, o) === false) {
- return false;
- }
- }
- }
- }
- return true;
- };
- var map$1 = function (array, callback) {
- var out = [];
- each$i(array, function (item, index) {
- out.push(callback(item, index, array));
- });
- return out;
- };
- var filter$2 = function (a, f) {
- var o = [];
- each$i(a, function (v, index) {
- if (!f || f(v, index, a)) {
- o.push(v);
- }
- });
- return o;
- };
- var indexOf$1 = function (a, v) {
- if (a) {
- for (var i = 0, l = a.length; i < l; i++) {
- if (a[i] === v) {
- return i;
- }
- }
- }
- return -1;
- };
- var reduce = function (collection, iteratee, accumulator, thisArg) {
- var acc = isUndefined(accumulator) ? collection[0] : accumulator;
- for (var i = 0; i < collection.length; i++) {
- acc = iteratee.call(thisArg, acc, collection[i], i);
- }
- return acc;
- };
- var findIndex$1 = function (array, predicate, thisArg) {
- var i, l;
- for (i = 0, l = array.length; i < l; i++) {
- if (predicate.call(thisArg, array[i], i, array)) {
- return i;
- }
- }
- return -1;
- };
- var last$1 = function (collection) {
- return collection[collection.length - 1];
- };
- var __assign = function () {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s)
- if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- function __rest(s, e) {
- var t = {};
- for (var p in s)
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === 'function')
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
- }
- function __spreadArray(to, from, pack) {
- if (pack || arguments.length === 2)
- for (var i = 0, l = from.length, ar; i < l; i++) {
- if (ar || !(i in from)) {
- if (!ar)
- ar = Array.prototype.slice.call(from, 0, i);
- ar[i] = from[i];
- }
- }
- return to.concat(ar || Array.prototype.slice.call(from));
- }
- var cached = function (f) {
- var called = false;
- var r;
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (!called) {
- called = true;
- r = f.apply(null, args);
- }
- return r;
- };
- };
- var DeviceType = function (os, browser, userAgent, mediaMatch) {
- var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
- var isiPhone = os.isiOS() && !isiPad;
- var isMobile = os.isiOS() || os.isAndroid();
- var isTouch = isMobile || mediaMatch('(pointer:coarse)');
- var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');
- var isPhone = isiPhone || isMobile && !isTablet;
- var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
- var isDesktop = !isPhone && !isTablet && !iOSwebview;
- return {
- isiPad: constant(isiPad),
- isiPhone: constant(isiPhone),
- isTablet: constant(isTablet),
- isPhone: constant(isPhone),
- isTouch: constant(isTouch),
- isAndroid: os.isAndroid,
- isiOS: os.isiOS,
- isWebView: constant(iOSwebview),
- isDesktop: constant(isDesktop)
- };
- };
- var firstMatch = function (regexes, s) {
- for (var i = 0; i < regexes.length; i++) {
- var x = regexes[i];
- if (x.test(s)) {
- return x;
- }
- }
- return undefined;
- };
- var find$2 = function (regexes, agent) {
- var r = firstMatch(regexes, agent);
- if (!r) {
- return {
- major: 0,
- minor: 0
- };
- }
- var group = function (i) {
- return Number(agent.replace(r, '$' + i));
- };
- return nu$4(group(1), group(2));
- };
- var detect$3 = function (versionRegexes, agent) {
- var cleanedAgent = String(agent).toLowerCase();
- if (versionRegexes.length === 0) {
- return unknown$2();
- }
- return find$2(versionRegexes, cleanedAgent);
- };
- var unknown$2 = function () {
- return nu$4(0, 0);
- };
- var nu$4 = function (major, minor) {
- return {
- major: major,
- minor: minor
- };
- };
- var Version = {
- nu: nu$4,
- detect: detect$3,
- unknown: unknown$2
- };
- var detectBrowser$1 = function (browsers, userAgentData) {
- return findMap(userAgentData.brands, function (uaBrand) {
- var lcBrand = uaBrand.brand.toLowerCase();
- return find$3(browsers, function (browser) {
- var _a;
- return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase());
- }).map(function (info) {
- return {
- current: info.name,
- version: Version.nu(parseInt(uaBrand.version, 10), 0)
- };
- });
- });
- };
- var detect$2 = function (candidates, userAgent) {
- var agent = String(userAgent).toLowerCase();
- return find$3(candidates, function (candidate) {
- return candidate.search(agent);
- });
- };
- var detectBrowser = function (browsers, userAgent) {
- return detect$2(browsers, userAgent).map(function (browser) {
- var version = Version.detect(browser.versionRegexes, userAgent);
- return {
- current: browser.name,
- version: version
- };
- });
- };
- var detectOs = function (oses, userAgent) {
- return detect$2(oses, userAgent).map(function (os) {
- var version = Version.detect(os.versionRegexes, userAgent);
- return {
- current: os.name,
- version: version
- };
- });
- };
- var removeFromStart = function (str, numChars) {
- return str.substring(numChars);
- };
- var checkRange = function (str, substr, start) {
- return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
- };
- var removeLeading = function (str, prefix) {
- return startsWith(str, prefix) ? removeFromStart(str, prefix.length) : str;
- };
- var contains$2 = function (str, substr) {
- return str.indexOf(substr) !== -1;
- };
- var startsWith = function (str, prefix) {
- return checkRange(str, prefix, 0);
- };
- var blank = function (r) {
- return function (s) {
- return s.replace(r, '');
- };
- };
- var trim$4 = blank(/^\s+|\s+$/g);
- var lTrim = blank(/^\s+/g);
- var rTrim = blank(/\s+$/g);
- var isNotEmpty = function (s) {
- return s.length > 0;
- };
- var isEmpty$3 = function (s) {
- return !isNotEmpty(s);
- };
- var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
- var checkContains = function (target) {
- return function (uastring) {
- return contains$2(uastring, target);
- };
- };
- var browsers = [
- {
- name: 'Edge',
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
- search: function (uastring) {
- return contains$2(uastring, 'edge/') && contains$2(uastring, 'chrome') && contains$2(uastring, 'safari') && contains$2(uastring, 'applewebkit');
- }
- },
- {
- name: 'Chrome',
- brand: 'Chromium',
- versionRegexes: [
- /.*?chrome\/([0-9]+)\.([0-9]+).*/,
- normalVersionRegex
- ],
- search: function (uastring) {
- return contains$2(uastring, 'chrome') && !contains$2(uastring, 'chromeframe');
- }
- },
- {
- name: 'IE',
- versionRegexes: [
- /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
- /.*?rv:([0-9]+)\.([0-9]+).*/
- ],
- search: function (uastring) {
- return contains$2(uastring, 'msie') || contains$2(uastring, 'trident');
- }
- },
- {
- name: 'Opera',
- versionRegexes: [
- normalVersionRegex,
- /.*?opera\/([0-9]+)\.([0-9]+).*/
- ],
- search: checkContains('opera')
- },
- {
- name: 'Firefox',
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
- search: checkContains('firefox')
- },
- {
- name: 'Safari',
- versionRegexes: [
- normalVersionRegex,
- /.*?cpu os ([0-9]+)_([0-9]+).*/
- ],
- search: function (uastring) {
- return (contains$2(uastring, 'safari') || contains$2(uastring, 'mobile/')) && contains$2(uastring, 'applewebkit');
- }
- }
- ];
- var oses = [
- {
- name: 'Windows',
- search: checkContains('win'),
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'iOS',
- search: function (uastring) {
- return contains$2(uastring, 'iphone') || contains$2(uastring, 'ipad');
- },
- versionRegexes: [
- /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
- /.*cpu os ([0-9]+)_([0-9]+).*/,
- /.*cpu iphone os ([0-9]+)_([0-9]+).*/
- ]
- },
- {
- name: 'Android',
- search: checkContains('android'),
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'OSX',
- search: checkContains('mac os x'),
- versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]
- },
- {
- name: 'Linux',
- search: checkContains('linux'),
- versionRegexes: []
- },
- {
- name: 'Solaris',
- search: checkContains('sunos'),
- versionRegexes: []
- },
- {
- name: 'FreeBSD',
- search: checkContains('freebsd'),
- versionRegexes: []
- },
- {
- name: 'ChromeOS',
- search: checkContains('cros'),
- versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/]
- }
- ];
- var PlatformInfo = {
- browsers: constant(browsers),
- oses: constant(oses)
- };
- var edge = 'Edge';
- var chrome = 'Chrome';
- var ie$1 = 'IE';
- var opera = 'Opera';
- var firefox = 'Firefox';
- var safari = 'Safari';
- var unknown$1 = function () {
- return nu$3({
- current: undefined,
- version: Version.unknown()
- });
- };
- var nu$3 = function (info) {
- var current = info.current;
- var version = info.version;
- var isBrowser = function (name) {
- return function () {
- return current === name;
- };
- };
- return {
- current: current,
- version: version,
- isEdge: isBrowser(edge),
- isChrome: isBrowser(chrome),
- isIE: isBrowser(ie$1),
- isOpera: isBrowser(opera),
- isFirefox: isBrowser(firefox),
- isSafari: isBrowser(safari)
- };
- };
- var Browser = {
- unknown: unknown$1,
- nu: nu$3,
- edge: constant(edge),
- chrome: constant(chrome),
- ie: constant(ie$1),
- opera: constant(opera),
- firefox: constant(firefox),
- safari: constant(safari)
- };
- var windows = 'Windows';
- var ios = 'iOS';
- var android = 'Android';
- var linux = 'Linux';
- var osx = 'OSX';
- var solaris = 'Solaris';
- var freebsd = 'FreeBSD';
- var chromeos = 'ChromeOS';
- var unknown = function () {
- return nu$2({
- current: undefined,
- version: Version.unknown()
- });
- };
- var nu$2 = function (info) {
- var current = info.current;
- var version = info.version;
- var isOS = function (name) {
- return function () {
- return current === name;
- };
- };
- return {
- current: current,
- version: version,
- isWindows: isOS(windows),
- isiOS: isOS(ios),
- isAndroid: isOS(android),
- isOSX: isOS(osx),
- isLinux: isOS(linux),
- isSolaris: isOS(solaris),
- isFreeBSD: isOS(freebsd),
- isChromeOS: isOS(chromeos)
- };
- };
- var OperatingSystem = {
- unknown: unknown,
- nu: nu$2,
- windows: constant(windows),
- ios: constant(ios),
- android: constant(android),
- linux: constant(linux),
- osx: constant(osx),
- solaris: constant(solaris),
- freebsd: constant(freebsd),
- chromeos: constant(chromeos)
- };
- var detect$1 = function (userAgent, userAgentDataOpt, mediaMatch) {
- var browsers = PlatformInfo.browsers();
- var oses = PlatformInfo.oses();
- var browser = userAgentDataOpt.bind(function (userAgentData) {
- return detectBrowser$1(browsers, userAgentData);
- }).orThunk(function () {
- return detectBrowser(browsers, userAgent);
- }).fold(Browser.unknown, Browser.nu);
- var os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
- var deviceType = DeviceType(os, browser, userAgent, mediaMatch);
- return {
- browser: browser,
- os: os,
- deviceType: deviceType
- };
- };
- var PlatformDetection = { detect: detect$1 };
- var mediaMatch = function (query) {
- return window.matchMedia(query).matches;
- };
- var platform$2 = cached(function () {
- return PlatformDetection.detect(navigator.userAgent, Optional.from(navigator.userAgentData), mediaMatch);
- });
- var detect = function () {
- return platform$2();
- };
- var userAgent = navigator.userAgent;
- var platform$1 = detect();
- var browser$4 = platform$1.browser;
- var os = platform$1.os;
- var deviceType = platform$1.deviceType;
- var webkit = /WebKit/.test(userAgent) && !browser$4.isEdge();
- var fileApi = 'FormData' in window && 'FileReader' in window && 'URL' in window && !!URL.createObjectURL;
- var windowsPhone = userAgent.indexOf('Windows Phone') !== -1;
- var Env = {
- opera: browser$4.isOpera(),
- webkit: webkit,
- ie: browser$4.isIE() || browser$4.isEdge() ? browser$4.version.major : false,
- gecko: browser$4.isFirefox(),
- mac: os.isOSX() || os.isiOS(),
- iOS: deviceType.isiPad() || deviceType.isiPhone(),
- android: os.isAndroid(),
- contentEditable: true,
- transparentSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
- caretAfter: true,
- range: window.getSelection && 'Range' in window,
- documentMode: browser$4.isIE() ? document.documentMode || 7 : 10,
- fileApi: fileApi,
- ceFalse: true,
- cacheSuffix: null,
- container: null,
- experimentalShadowDom: false,
- canHaveCSP: !browser$4.isIE(),
- desktop: deviceType.isDesktop(),
- windowsPhone: windowsPhone,
- browser: {
- current: browser$4.current,
- version: browser$4.version,
- isChrome: browser$4.isChrome,
- isEdge: browser$4.isEdge,
- isFirefox: browser$4.isFirefox,
- isIE: browser$4.isIE,
- isOpera: browser$4.isOpera,
- isSafari: browser$4.isSafari
- },
- os: {
- current: os.current,
- version: os.version,
- isAndroid: os.isAndroid,
- isChromeOS: os.isChromeOS,
- isFreeBSD: os.isFreeBSD,
- isiOS: os.isiOS,
- isLinux: os.isLinux,
- isOSX: os.isOSX,
- isSolaris: os.isSolaris,
- isWindows: os.isWindows
- },
- deviceType: {
- isDesktop: deviceType.isDesktop,
- isiPad: deviceType.isiPad,
- isiPhone: deviceType.isiPhone,
- isPhone: deviceType.isPhone,
- isTablet: deviceType.isTablet,
- isTouch: deviceType.isTouch,
- isWebView: deviceType.isWebView
- }
- };
- var whiteSpaceRegExp$2 = /^\s*|\s*$/g;
- var trim$3 = function (str) {
- return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$2, '');
- };
- var is$3 = function (obj, type) {
- if (!type) {
- return obj !== undefined;
- }
- if (type === 'array' && isArray(obj)) {
- return true;
- }
- return typeof obj === type;
- };
- var makeMap$4 = function (items, delim, map) {
- var i;
- items = items || [];
- delim = delim || ',';
- if (typeof items === 'string') {
- items = items.split(delim);
- }
- map = map || {};
- i = items.length;
- while (i--) {
- map[items[i]] = {};
- }
- return map;
- };
- var hasOwnProperty = has$2;
- var create$9 = function (s, p, root) {
- var self = this;
- var sp, scn, c, de = 0;
- s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
- var cn = s[3].match(/(^|\.)(\w+)$/i)[2];
- var ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
- if (ns[cn]) {
- return;
- }
- if (s[2] === 'static') {
- ns[cn] = p;
- if (this.onCreate) {
- this.onCreate(s[2], s[3], ns[cn]);
- }
- return;
- }
- if (!p[cn]) {
- p[cn] = function () {
- };
- de = 1;
- }
- ns[cn] = p[cn];
- self.extend(ns[cn].prototype, p);
- if (s[5]) {
- sp = self.resolve(s[5]).prototype;
- scn = s[5].match(/\.(\w+)$/i)[1];
- c = ns[cn];
- if (de) {
- ns[cn] = function () {
- return sp[scn].apply(this, arguments);
- };
- } else {
- ns[cn] = function () {
- this.parent = sp[scn];
- return c.apply(this, arguments);
- };
- }
- ns[cn].prototype[cn] = ns[cn];
- self.each(sp, function (f, n) {
- ns[cn].prototype[n] = sp[n];
- });
- self.each(p, function (f, n) {
- if (sp[n]) {
- ns[cn].prototype[n] = function () {
- this.parent = sp[n];
- return f.apply(this, arguments);
- };
- } else {
- if (n !== cn) {
- ns[cn].prototype[n] = f;
- }
- }
- });
- }
- self.each(p.static, function (f, n) {
- ns[cn][n] = f;
- });
- };
- var extend$6 = function (obj) {
- var exts = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- exts[_i - 1] = arguments[_i];
- }
- for (var i = 0; i < exts.length; i++) {
- var ext = exts[i];
- for (var name_1 in ext) {
- if (has$2(ext, name_1)) {
- var value = ext[name_1];
- if (value !== undefined) {
- obj[name_1] = value;
- }
- }
- }
- }
- return obj;
- };
- var walk$3 = function (o, f, n, s) {
- s = s || this;
- if (o) {
- if (n) {
- o = o[n];
- }
- each$i(o, function (o, i) {
- if (f.call(s, o, i, n) === false) {
- return false;
- }
- walk$3(o, f, n, s);
- });
- }
- };
- var createNS = function (n, o) {
- var i, v;
- o = o || window;
- n = n.split('.');
- for (i = 0; i < n.length; i++) {
- v = n[i];
- if (!o[v]) {
- o[v] = {};
- }
- o = o[v];
- }
- return o;
- };
- var resolve$3 = function (n, o) {
- var i, l;
- o = o || window;
- n = n.split('.');
- for (i = 0, l = n.length; i < l; i++) {
- o = o[n[i]];
- if (!o) {
- break;
- }
- }
- return o;
- };
- var explode$4 = function (s, d) {
- if (!s || is$3(s, 'array')) {
- return s;
- }
- return map$1(s.split(d || ','), trim$3);
- };
- var _addCacheSuffix = function (url) {
- var cacheSuffix = Env.cacheSuffix;
- if (cacheSuffix) {
- url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
- }
- return url;
- };
- var Tools = {
- trim: trim$3,
- isArray: isArray,
- is: is$3,
- toArray: toArray$1,
- makeMap: makeMap$4,
- each: each$i,
- map: map$1,
- grep: filter$2,
- inArray: indexOf$1,
- hasOwn: hasOwnProperty,
- extend: extend$6,
- create: create$9,
- walk: walk$3,
- createNS: createNS,
- resolve: resolve$3,
- explode: explode$4,
- _addCacheSuffix: _addCacheSuffix
- };
- var fromHtml$1 = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
- console.error('HTML does not have a single root node', html);
- throw new Error('HTML must have a single root node');
- }
- return fromDom$2(div.childNodes[0]);
- };
- var fromTag = function (tag, scope) {
- var doc = scope || document;
- var node = doc.createElement(tag);
- return fromDom$2(node);
- };
- var fromText = function (text, scope) {
- var doc = scope || document;
- var node = doc.createTextNode(text);
- return fromDom$2(node);
- };
- var fromDom$2 = function (node) {
- if (node === null || node === undefined) {
- throw new Error('Node cannot be null or undefined');
- }
- return { dom: node };
- };
- var fromPoint$1 = function (docElm, x, y) {
- return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom$2);
- };
- var SugarElement = {
- fromHtml: fromHtml$1,
- fromTag: fromTag,
- fromText: fromText,
- fromDom: fromDom$2,
- fromPoint: fromPoint$1
- };
- var toArray = function (target, f) {
- var r = [];
- var recurse = function (e) {
- r.push(e);
- return f(e);
- };
- var cur = f(target);
- do {
- cur = cur.bind(recurse);
- } while (cur.isSome());
- return r;
- };
- var compareDocumentPosition = function (a, b, match) {
- return (a.compareDocumentPosition(b) & match) !== 0;
- };
- var documentPositionContainedBy = function (a, b) {
- return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY);
- };
- var COMMENT = 8;
- var DOCUMENT = 9;
- var DOCUMENT_FRAGMENT = 11;
- var ELEMENT = 1;
- var TEXT = 3;
- var is$2 = function (element, selector) {
- var dom = element.dom;
- if (dom.nodeType !== ELEMENT) {
- return false;
- } else {
- var elem = dom;
- if (elem.matches !== undefined) {
- return elem.matches(selector);
- } else if (elem.msMatchesSelector !== undefined) {
- return elem.msMatchesSelector(selector);
- } else if (elem.webkitMatchesSelector !== undefined) {
- return elem.webkitMatchesSelector(selector);
- } else if (elem.mozMatchesSelector !== undefined) {
- return elem.mozMatchesSelector(selector);
- } else {
- throw new Error('Browser lacks native selectors');
- }
- }
- };
- var bypassSelector = function (dom) {
- return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
- };
- var all = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom;
- return bypassSelector(base) ? [] : map$3(base.querySelectorAll(selector), SugarElement.fromDom);
- };
- var one = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom;
- return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom);
- };
- var eq = function (e1, e2) {
- return e1.dom === e2.dom;
- };
- var regularContains = function (e1, e2) {
- var d1 = e1.dom;
- var d2 = e2.dom;
- return d1 === d2 ? false : d1.contains(d2);
- };
- var ieContains = function (e1, e2) {
- return documentPositionContainedBy(e1.dom, e2.dom);
- };
- var contains$1 = function (e1, e2) {
- return detect().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2);
- };
- typeof window !== 'undefined' ? window : Function('return this;')();
- var name = function (element) {
- var r = element.dom.nodeName;
- return r.toLowerCase();
- };
- var type = function (element) {
- return element.dom.nodeType;
- };
- var isType = function (t) {
- return function (element) {
- return type(element) === t;
- };
- };
- var isComment$1 = function (element) {
- return type(element) === COMMENT || name(element) === '#comment';
- };
- var isElement$6 = isType(ELEMENT);
- var isText$8 = isType(TEXT);
- var isDocument$2 = isType(DOCUMENT);
- var isDocumentFragment$1 = isType(DOCUMENT_FRAGMENT);
- var isTag = function (tag) {
- return function (e) {
- return isElement$6(e) && name(e) === tag;
- };
- };
- var owner$1 = function (element) {
- return SugarElement.fromDom(element.dom.ownerDocument);
- };
- var documentOrOwner = function (dos) {
- return isDocument$2(dos) ? dos : owner$1(dos);
- };
- var documentElement = function (element) {
- return SugarElement.fromDom(documentOrOwner(element).dom.documentElement);
- };
- var defaultView = function (element) {
- return SugarElement.fromDom(documentOrOwner(element).dom.defaultView);
- };
- var parent = function (element) {
- return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
- };
- var parents$1 = function (element, isRoot) {
- var stop = isFunction(isRoot) ? isRoot : never;
- var dom = element.dom;
- var ret = [];
- while (dom.parentNode !== null && dom.parentNode !== undefined) {
- var rawParent = dom.parentNode;
- var p = SugarElement.fromDom(rawParent);
- ret.push(p);
- if (stop(p) === true) {
- break;
- } else {
- dom = rawParent;
- }
- }
- return ret;
- };
- var siblings = function (element) {
- var filterSelf = function (elements) {
- return filter$4(elements, function (x) {
- return !eq(element, x);
- });
- };
- return parent(element).map(children).map(filterSelf).getOr([]);
- };
- var prevSibling = function (element) {
- return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom);
- };
- var nextSibling = function (element) {
- return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom);
- };
- var prevSiblings = function (element) {
- return reverse(toArray(element, prevSibling));
- };
- var nextSiblings = function (element) {
- return toArray(element, nextSibling);
- };
- var children = function (element) {
- return map$3(element.dom.childNodes, SugarElement.fromDom);
- };
- var child$1 = function (element, index) {
- var cs = element.dom.childNodes;
- return Optional.from(cs[index]).map(SugarElement.fromDom);
- };
- var firstChild = function (element) {
- return child$1(element, 0);
- };
- var lastChild = function (element) {
- return child$1(element, element.dom.childNodes.length - 1);
- };
- var childNodesCount = function (element) {
- return element.dom.childNodes.length;
- };
- var getHead = function (doc) {
- var b = doc.dom.head;
- if (b === null || b === undefined) {
- throw new Error('Head is not available yet');
- }
- return SugarElement.fromDom(b);
- };
- var isShadowRoot = function (dos) {
- return isDocumentFragment$1(dos) && isNonNullable(dos.dom.host);
- };
- var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
- var isSupported$1 = constant(supported);
- var getRootNode = supported ? function (e) {
- return SugarElement.fromDom(e.dom.getRootNode());
- } : documentOrOwner;
- var getStyleContainer = function (dos) {
- return isShadowRoot(dos) ? dos : getHead(documentOrOwner(dos));
- };
- var getShadowRoot = function (e) {
- var r = getRootNode(e);
- return isShadowRoot(r) ? Optional.some(r) : Optional.none();
- };
- var getShadowHost = function (e) {
- return SugarElement.fromDom(e.dom.host);
- };
- var getOriginalEventTarget = function (event) {
- if (isSupported$1() && isNonNullable(event.target)) {
- var el = SugarElement.fromDom(event.target);
- if (isElement$6(el) && isOpenShadowHost(el)) {
- if (event.composed && event.composedPath) {
- var composedPath = event.composedPath();
- if (composedPath) {
- return head(composedPath);
- }
- }
- }
- }
- return Optional.from(event.target);
- };
- var isOpenShadowHost = function (element) {
- return isNonNullable(element.dom.shadowRoot);
- };
- var before$4 = function (marker, element) {
- var parent$1 = parent(marker);
- parent$1.each(function (v) {
- v.dom.insertBefore(element.dom, marker.dom);
- });
- };
- var after$3 = function (marker, element) {
- var sibling = nextSibling(marker);
- sibling.fold(function () {
- var parent$1 = parent(marker);
- parent$1.each(function (v) {
- append$1(v, element);
- });
- }, function (v) {
- before$4(v, element);
- });
- };
- var prepend = function (parent, element) {
- var firstChild$1 = firstChild(parent);
- firstChild$1.fold(function () {
- append$1(parent, element);
- }, function (v) {
- parent.dom.insertBefore(element.dom, v.dom);
- });
- };
- var append$1 = function (parent, element) {
- parent.dom.appendChild(element.dom);
- };
- var wrap$3 = function (element, wrapper) {
- before$4(element, wrapper);
- append$1(wrapper, element);
- };
- var before$3 = function (marker, elements) {
- each$k(elements, function (x) {
- before$4(marker, x);
- });
- };
- var append = function (parent, elements) {
- each$k(elements, function (x) {
- append$1(parent, x);
- });
- };
- var empty = function (element) {
- element.dom.textContent = '';
- each$k(children(element), function (rogue) {
- remove$7(rogue);
- });
- };
- var remove$7 = function (element) {
- var dom = element.dom;
- if (dom.parentNode !== null) {
- dom.parentNode.removeChild(dom);
- }
- };
- var unwrap = function (wrapper) {
- var children$1 = children(wrapper);
- if (children$1.length > 0) {
- before$3(wrapper, children$1);
- }
- remove$7(wrapper);
- };
- var inBody = function (element) {
- var dom = isText$8(element) ? element.dom.parentNode : element.dom;
- if (dom === undefined || dom === null || dom.ownerDocument === null) {
- return false;
- }
- var doc = dom.ownerDocument;
- return getShadowRoot(SugarElement.fromDom(dom)).fold(function () {
- return doc.body.contains(dom);
- }, compose1(inBody, getShadowHost));
- };
- var r = function (left, top) {
- var translate = function (x, y) {
- return r(left + x, top + y);
- };
- return {
- left: left,
- top: top,
- translate: translate
- };
- };
- var SugarPosition = r;
- var boxPosition = function (dom) {
- var box = dom.getBoundingClientRect();
- return SugarPosition(box.left, box.top);
- };
- var firstDefinedOrZero = function (a, b) {
- if (a !== undefined) {
- return a;
- } else {
- return b !== undefined ? b : 0;
- }
- };
- var absolute = function (element) {
- var doc = element.dom.ownerDocument;
- var body = doc.body;
- var win = doc.defaultView;
- var html = doc.documentElement;
- if (body === element.dom) {
- return SugarPosition(body.offsetLeft, body.offsetTop);
- }
- var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop);
- var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft);
- var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop);
- var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft);
- return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop);
- };
- var viewport = function (element) {
- var dom = element.dom;
- var doc = dom.ownerDocument;
- var body = doc.body;
- if (body === dom) {
- return SugarPosition(body.offsetLeft, body.offsetTop);
- }
- if (!inBody(element)) {
- return SugarPosition(0, 0);
- }
- return boxPosition(dom);
- };
- var get$8 = function (_DOC) {
- var doc = _DOC !== undefined ? _DOC.dom : document;
- var x = doc.body.scrollLeft || doc.documentElement.scrollLeft;
- var y = doc.body.scrollTop || doc.documentElement.scrollTop;
- return SugarPosition(x, y);
- };
- var to = function (x, y, _DOC) {
- var doc = _DOC !== undefined ? _DOC.dom : document;
- var win = doc.defaultView;
- if (win) {
- win.scrollTo(x, y);
- }
- };
- var intoView = function (element, alignToTop) {
- var isSafari = detect().browser.isSafari();
- if (isSafari && isFunction(element.dom.scrollIntoViewIfNeeded)) {
- element.dom.scrollIntoViewIfNeeded(false);
- } else {
- element.dom.scrollIntoView(alignToTop);
- }
- };
- var get$7 = function (_win) {
- var win = _win === undefined ? window : _win;
- if (detect().browser.isFirefox()) {
- return Optional.none();
- } else {
- return Optional.from(win['visualViewport']);
- }
- };
- var bounds = function (x, y, width, height) {
- return {
- x: x,
- y: y,
- width: width,
- height: height,
- right: x + width,
- bottom: y + height
- };
- };
- var getBounds = function (_win) {
- var win = _win === undefined ? window : _win;
- var doc = win.document;
- var scroll = get$8(SugarElement.fromDom(doc));
- return get$7(win).fold(function () {
- var html = win.document.documentElement;
- var width = html.clientWidth;
- var height = html.clientHeight;
- return bounds(scroll.left, scroll.top, width, height);
- }, function (visualViewport) {
- return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height);
- });
- };
- var isNodeType = function (type) {
- return function (node) {
- return !!node && node.nodeType === type;
- };
- };
- var isRestrictedNode = function (node) {
- return !!node && !Object.getPrototypeOf(node);
- };
- var isElement$5 = isNodeType(1);
- var matchNodeNames = function (names) {
- var lowercasedNames = names.map(function (s) {
- return s.toLowerCase();
- });
- return function (node) {
- if (node && node.nodeName) {
- var nodeName = node.nodeName.toLowerCase();
- return contains$3(lowercasedNames, nodeName);
- }
- return false;
- };
- };
- var matchStyleValues = function (name, values) {
- var items = values.toLowerCase().split(' ');
- return function (node) {
- if (isElement$5(node)) {
- for (var i = 0; i < items.length; i++) {
- var computed = node.ownerDocument.defaultView.getComputedStyle(node, null);
- var cssValue = computed ? computed.getPropertyValue(name) : null;
- if (cssValue === items[i]) {
- return true;
- }
- }
- }
- return false;
- };
- };
- var hasAttribute = function (attrName) {
- return function (node) {
- return isElement$5(node) && node.hasAttribute(attrName);
- };
- };
- var hasAttributeValue = function (attrName, attrValue) {
- return function (node) {
- return isElement$5(node) && node.getAttribute(attrName) === attrValue;
- };
- };
- var isBogus$2 = function (node) {
- return isElement$5(node) && node.hasAttribute('data-mce-bogus');
- };
- var isBogusAll$1 = function (node) {
- return isElement$5(node) && node.getAttribute('data-mce-bogus') === 'all';
- };
- var isTable$3 = function (node) {
- return isElement$5(node) && node.tagName === 'TABLE';
- };
- var hasContentEditableState = function (value) {
- return function (node) {
- if (isElement$5(node)) {
- if (node.contentEditable === value) {
- return true;
- }
- if (node.getAttribute('data-mce-contenteditable') === value) {
- return true;
- }
- }
- return false;
- };
- };
- var isTextareaOrInput = matchNodeNames([
- 'textarea',
- 'input'
- ]);
- var isText$7 = isNodeType(3);
- var isComment = isNodeType(8);
- var isDocument$1 = isNodeType(9);
- var isDocumentFragment = isNodeType(11);
- var isBr$5 = matchNodeNames(['br']);
- var isImg = matchNodeNames(['img']);
- var isContentEditableTrue$4 = hasContentEditableState('true');
- var isContentEditableFalse$b = hasContentEditableState('false');
- var isTableCell$5 = matchNodeNames([
- 'td',
- 'th'
- ]);
- var isMedia$2 = matchNodeNames([
- 'video',
- 'audio',
- 'object',
- 'embed'
- ]);
- var is$1 = function (lhs, rhs, comparator) {
- if (comparator === void 0) {
- comparator = tripleEquals;
- }
- return lhs.exists(function (left) {
- return comparator(left, rhs);
- });
- };
- var cat = function (arr) {
- var r = [];
- var push = function (x) {
- r.push(x);
- };
- for (var i = 0; i < arr.length; i++) {
- arr[i].each(push);
- }
- return r;
- };
- var lift2 = function (oa, ob, f) {
- return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none();
- };
- var lift3 = function (oa, ob, oc, f) {
- return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none();
- };
- var someIf = function (b, a) {
- return b ? Optional.some(a) : Optional.none();
- };
- var isSupported = function (dom) {
- return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
- };
- var rawSet = function (dom, key, value) {
- if (isString$1(value) || isBoolean(value) || isNumber(value)) {
- dom.setAttribute(key, value + '');
- } else {
- console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
- throw new Error('Attribute value was not simple');
- }
- };
- var set$1 = function (element, key, value) {
- rawSet(element.dom, key, value);
- };
- var setAll$1 = function (element, attrs) {
- var dom = element.dom;
- each$j(attrs, function (v, k) {
- rawSet(dom, k, v);
- });
- };
- var get$6 = function (element, key) {
- var v = element.dom.getAttribute(key);
- return v === null ? undefined : v;
- };
- var getOpt = function (element, key) {
- return Optional.from(get$6(element, key));
- };
- var has$1 = function (element, key) {
- var dom = element.dom;
- return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
- };
- var remove$6 = function (element, key) {
- element.dom.removeAttribute(key);
- };
- var clone$3 = function (element) {
- return foldl(element.dom.attributes, function (acc, attr) {
- acc[attr.name] = attr.value;
- return acc;
- }, {});
- };
- var internalSet = function (dom, property, value) {
- if (!isString$1(value)) {
- console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
- throw new Error('CSS value must be a string: ' + value);
- }
- if (isSupported(dom)) {
- dom.style.setProperty(property, value);
- }
- };
- var setAll = function (element, css) {
- var dom = element.dom;
- each$j(css, function (v, k) {
- internalSet(dom, k, v);
- });
- };
- var get$5 = function (element, property) {
- var dom = element.dom;
- var styles = window.getComputedStyle(dom);
- var r = styles.getPropertyValue(property);
- return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
- };
- var getUnsafeProperty = function (dom, property) {
- return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
- };
- var getRaw = function (element, property) {
- var dom = element.dom;
- var raw = getUnsafeProperty(dom, property);
- return Optional.from(raw).filter(function (r) {
- return r.length > 0;
- });
- };
- var getAllRaw = function (element) {
- var css = {};
- var dom = element.dom;
- if (isSupported(dom)) {
- for (var i = 0; i < dom.style.length; i++) {
- var ruleName = dom.style.item(i);
- css[ruleName] = dom.style[ruleName];
- }
- }
- return css;
- };
- var reflow = function (e) {
- return e.dom.offsetWidth;
- };
- var browser$3 = detect().browser;
- var firstElement = function (nodes) {
- return find$3(nodes, isElement$6);
- };
- var getTableCaptionDeltaY = function (elm) {
- if (browser$3.isFirefox() && name(elm) === 'table') {
- return firstElement(children(elm)).filter(function (elm) {
- return name(elm) === 'caption';
- }).bind(function (caption) {
- return firstElement(nextSiblings(caption)).map(function (body) {
- var bodyTop = body.dom.offsetTop;
- var captionTop = caption.dom.offsetTop;
- var captionHeight = caption.dom.offsetHeight;
- return bodyTop <= captionTop ? -captionHeight : 0;
- });
- }).getOr(0);
- } else {
- return 0;
- }
- };
- var hasChild = function (elm, child) {
- return elm.children && contains$3(elm.children, child);
- };
- var getPos = function (body, elm, rootElm) {
- var x = 0, y = 0;
- var doc = body.ownerDocument;
- rootElm = rootElm ? rootElm : body;
- if (elm) {
- if (rootElm === body && elm.getBoundingClientRect && get$5(SugarElement.fromDom(body), 'position') === 'static') {
- var pos = elm.getBoundingClientRect();
- x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft;
- y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop;
- return {
- x: x,
- y: y
- };
- }
- var offsetParent = elm;
- while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) {
- var castOffsetParent = offsetParent;
- x += castOffsetParent.offsetLeft || 0;
- y += castOffsetParent.offsetTop || 0;
- offsetParent = castOffsetParent.offsetParent;
- }
- offsetParent = elm.parentNode;
- while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) {
- x -= offsetParent.scrollLeft || 0;
- y -= offsetParent.scrollTop || 0;
- offsetParent = offsetParent.parentNode;
- }
- y += getTableCaptionDeltaY(SugarElement.fromDom(elm));
- }
- return {
- x: x,
- y: y
- };
- };
- var exports$1 = {}, module$1 = { exports: exports$1 };
- (function (define, exports, module, require) {
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EphoxContactWrapper = factory());
- }(this, function () {
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- var promise = { exports: {} };
- (function (module) {
- (function (root) {
- var setTimeoutFunc = setTimeout;
- function noop() {
- }
- function bind(fn, thisArg) {
- return function () {
- fn.apply(thisArg, arguments);
- };
- }
- function Promise(fn) {
- if (typeof this !== 'object')
- throw new TypeError('Promises must be constructed via new');
- if (typeof fn !== 'function')
- throw new TypeError('not a function');
- this._state = 0;
- this._handled = false;
- this._value = undefined;
- this._deferreds = [];
- doResolve(fn, this);
- }
- function handle(self, deferred) {
- while (self._state === 3) {
- self = self._value;
- }
- if (self._state === 0) {
- self._deferreds.push(deferred);
- return;
- }
- self._handled = true;
- Promise._immediateFn(function () {
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
- if (cb === null) {
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
- return;
- }
- var ret;
- try {
- ret = cb(self._value);
- } catch (e) {
- reject(deferred.promise, e);
- return;
- }
- resolve(deferred.promise, ret);
- });
- }
- function resolve(self, newValue) {
- try {
- if (newValue === self)
- throw new TypeError('A promise cannot be resolved with itself.');
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
- var then = newValue.then;
- if (newValue instanceof Promise) {
- self._state = 3;
- self._value = newValue;
- finale(self);
- return;
- } else if (typeof then === 'function') {
- doResolve(bind(then, newValue), self);
- return;
- }
- }
- self._state = 1;
- self._value = newValue;
- finale(self);
- } catch (e) {
- reject(self, e);
- }
- }
- function reject(self, newValue) {
- self._state = 2;
- self._value = newValue;
- finale(self);
- }
- function finale(self) {
- if (self._state === 2 && self._deferreds.length === 0) {
- Promise._immediateFn(function () {
- if (!self._handled) {
- Promise._unhandledRejectionFn(self._value);
- }
- });
- }
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
- handle(self, self._deferreds[i]);
- }
- self._deferreds = null;
- }
- function Handler(onFulfilled, onRejected, promise) {
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
- this.promise = promise;
- }
- function doResolve(fn, self) {
- var done = false;
- try {
- fn(function (value) {
- if (done)
- return;
- done = true;
- resolve(self, value);
- }, function (reason) {
- if (done)
- return;
- done = true;
- reject(self, reason);
- });
- } catch (ex) {
- if (done)
- return;
- done = true;
- reject(self, ex);
- }
- }
- Promise.prototype['catch'] = function (onRejected) {
- return this.then(null, onRejected);
- };
- Promise.prototype.then = function (onFulfilled, onRejected) {
- var prom = new this.constructor(noop);
- handle(this, new Handler(onFulfilled, onRejected, prom));
- return prom;
- };
- Promise.all = function (arr) {
- var args = Array.prototype.slice.call(arr);
- return new Promise(function (resolve, reject) {
- if (args.length === 0)
- return resolve([]);
- var remaining = args.length;
- function res(i, val) {
- try {
- if (val && (typeof val === 'object' || typeof val === 'function')) {
- var then = val.then;
- if (typeof then === 'function') {
- then.call(val, function (val) {
- res(i, val);
- }, reject);
- return;
- }
- }
- args[i] = val;
- if (--remaining === 0) {
- resolve(args);
- }
- } catch (ex) {
- reject(ex);
- }
- }
- for (var i = 0; i < args.length; i++) {
- res(i, args[i]);
- }
- });
- };
- Promise.resolve = function (value) {
- if (value && typeof value === 'object' && value.constructor === Promise) {
- return value;
- }
- return new Promise(function (resolve) {
- resolve(value);
- });
- };
- Promise.reject = function (value) {
- return new Promise(function (resolve, reject) {
- reject(value);
- });
- };
- Promise.race = function (values) {
- return new Promise(function (resolve, reject) {
- for (var i = 0, len = values.length; i < len; i++) {
- values[i].then(resolve, reject);
- }
- });
- };
- Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
- setImmediate(fn);
- } : function (fn) {
- setTimeoutFunc(fn, 0);
- };
- Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
- if (typeof console !== 'undefined' && console) {
- console.warn('Possible Unhandled Promise Rejection:', err);
- }
- };
- Promise._setImmediateFn = function _setImmediateFn(fn) {
- Promise._immediateFn = fn;
- };
- Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
- Promise._unhandledRejectionFn = fn;
- };
- if (module.exports) {
- module.exports = Promise;
- } else if (!root.Promise) {
- root.Promise = Promise;
- }
- }(commonjsGlobal));
- }(promise));
- var promisePolyfill = promise.exports;
- var Global = function () {
- if (typeof window !== 'undefined') {
- return window;
- } else {
- return Function('return this;')();
- }
- }();
- var promisePolyfill_1 = { boltExport: Global.Promise || promisePolyfill };
- return promisePolyfill_1;
- }));
- }(undefined, exports$1, module$1));
- var Promise$1 = module$1.exports.boltExport;
- var nu$1 = function (baseFn) {
- var data = Optional.none();
- var callbacks = [];
- var map = function (f) {
- return nu$1(function (nCallback) {
- get(function (data) {
- nCallback(f(data));
- });
- });
- };
- var get = function (nCallback) {
- if (isReady()) {
- call(nCallback);
- } else {
- callbacks.push(nCallback);
- }
- };
- var set = function (x) {
- if (!isReady()) {
- data = Optional.some(x);
- run(callbacks);
- callbacks = [];
- }
- };
- var isReady = function () {
- return data.isSome();
- };
- var run = function (cbs) {
- each$k(cbs, call);
- };
- var call = function (cb) {
- data.each(function (x) {
- setTimeout(function () {
- cb(x);
- }, 0);
- });
- };
- baseFn(set);
- return {
- get: get,
- map: map,
- isReady: isReady
- };
- };
- var pure$1 = function (a) {
- return nu$1(function (callback) {
- callback(a);
- });
- };
- var LazyValue = {
- nu: nu$1,
- pure: pure$1
- };
- var errorReporter = function (err) {
- setTimeout(function () {
- throw err;
- }, 0);
- };
- var make = function (run) {
- var get = function (callback) {
- run().then(callback, errorReporter);
- };
- var map = function (fab) {
- return make(function () {
- return run().then(fab);
- });
- };
- var bind = function (aFutureB) {
- return make(function () {
- return run().then(function (v) {
- return aFutureB(v).toPromise();
- });
- });
- };
- var anonBind = function (futureB) {
- return make(function () {
- return run().then(function () {
- return futureB.toPromise();
- });
- });
- };
- var toLazy = function () {
- return LazyValue.nu(get);
- };
- var toCached = function () {
- var cache = null;
- return make(function () {
- if (cache === null) {
- cache = run();
- }
- return cache;
- });
- };
- var toPromise = run;
- return {
- map: map,
- bind: bind,
- anonBind: anonBind,
- toLazy: toLazy,
- toCached: toCached,
- toPromise: toPromise,
- get: get
- };
- };
- var nu = function (baseFn) {
- return make(function () {
- return new Promise$1(baseFn);
- });
- };
- var pure = function (a) {
- return make(function () {
- return Promise$1.resolve(a);
- });
- };
- var Future = {
- nu: nu,
- pure: pure
- };
- var par$1 = function (asyncValues, nu) {
- return nu(function (callback) {
- var r = [];
- var count = 0;
- var cb = function (i) {
- return function (value) {
- r[i] = value;
- count++;
- if (count >= asyncValues.length) {
- callback(r);
- }
- };
- };
- if (asyncValues.length === 0) {
- callback([]);
- } else {
- each$k(asyncValues, function (asyncValue, i) {
- asyncValue.get(cb(i));
- });
- }
- });
- };
- var par = function (futures) {
- return par$1(futures, Future.nu);
- };
- var value$1 = function (o) {
- var or = function (_opt) {
- return value$1(o);
- };
- var orThunk = function (_f) {
- return value$1(o);
- };
- var map = function (f) {
- return value$1(f(o));
- };
- var mapError = function (_f) {
- return value$1(o);
- };
- var each = function (f) {
- f(o);
- };
- var bind = function (f) {
- return f(o);
- };
- var fold = function (_, onValue) {
- return onValue(o);
- };
- var exists = function (f) {
- return f(o);
- };
- var forall = function (f) {
- return f(o);
- };
- var toOptional = function () {
- return Optional.some(o);
- };
- return {
- isValue: always,
- isError: never,
- getOr: constant(o),
- getOrThunk: constant(o),
- getOrDie: constant(o),
- or: or,
- orThunk: orThunk,
- fold: fold,
- map: map,
- mapError: mapError,
- each: each,
- bind: bind,
- exists: exists,
- forall: forall,
- toOptional: toOptional
- };
- };
- var error = function (message) {
- var getOrThunk = function (f) {
- return f();
- };
- var getOrDie = function () {
- return die(String(message))();
- };
- var or = identity;
- var orThunk = function (f) {
- return f();
- };
- var map = function (_f) {
- return error(message);
- };
- var mapError = function (f) {
- return error(f(message));
- };
- var bind = function (_f) {
- return error(message);
- };
- var fold = function (onError, _) {
- return onError(message);
- };
- return {
- isValue: never,
- isError: always,
- getOr: identity,
- getOrThunk: getOrThunk,
- getOrDie: getOrDie,
- or: or,
- orThunk: orThunk,
- fold: fold,
- map: map,
- mapError: mapError,
- each: noop,
- bind: bind,
- exists: never,
- forall: always,
- toOptional: Optional.none
- };
- };
- var fromOption = function (opt, err) {
- return opt.fold(function () {
- return error(err);
- }, value$1);
- };
- var Result = {
- value: value$1,
- error: error,
- fromOption: fromOption
- };
- var generate$1 = function (cases) {
- if (!isArray$1(cases)) {
- throw new Error('cases must be an array');
- }
- if (cases.length === 0) {
- throw new Error('there must be at least one case');
- }
- var constructors = [];
- var adt = {};
- each$k(cases, function (acase, count) {
- var keys$1 = keys(acase);
- if (keys$1.length !== 1) {
- throw new Error('one and only one name per case');
- }
- var key = keys$1[0];
- var value = acase[key];
- if (adt[key] !== undefined) {
- throw new Error('duplicate key detected:' + key);
- } else if (key === 'cata') {
- throw new Error('cannot have a case named cata (sorry)');
- } else if (!isArray$1(value)) {
- throw new Error('case arguments must be an array');
- }
- constructors.push(key);
- adt[key] = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var argLength = args.length;
- if (argLength !== value.length) {
- throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
- }
- var match = function (branches) {
- var branchKeys = keys(branches);
- if (constructors.length !== branchKeys.length) {
- throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(','));
- }
- var allReqd = forall(constructors, function (reqKey) {
- return contains$3(branchKeys, reqKey);
- });
- if (!allReqd) {
- throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
- }
- return branches[key].apply(null, args);
- };
- return {
- fold: function () {
- var foldArgs = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- foldArgs[_i] = arguments[_i];
- }
- if (foldArgs.length !== cases.length) {
- throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + foldArgs.length);
- }
- var target = foldArgs[count];
- return target.apply(null, args);
- },
- match: match,
- log: function (label) {
- console.log(label, {
- constructors: constructors,
- constructor: key,
- params: args
- });
- }
- };
- };
- });
- return adt;
- };
- var Adt = { generate: generate$1 };
- Adt.generate([
- {
- bothErrors: [
- 'error1',
- 'error2'
- ]
- },
- {
- firstError: [
- 'error1',
- 'value2'
- ]
- },
- {
- secondError: [
- 'value1',
- 'error2'
- ]
- },
- {
- bothValues: [
- 'value1',
- 'value2'
- ]
- }
- ]);
- var unite = function (result) {
- return result.fold(identity, identity);
- };
- function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
- if (is(scope, a)) {
- return Optional.some(scope);
- } else if (isFunction(isRoot) && isRoot(scope)) {
- return Optional.none();
- } else {
- return ancestor(scope, a, isRoot);
- }
- }
- var ancestor$3 = function (scope, predicate, isRoot) {
- var element = scope.dom;
- var stop = isFunction(isRoot) ? isRoot : never;
- while (element.parentNode) {
- element = element.parentNode;
- var el = SugarElement.fromDom(element);
- if (predicate(el)) {
- return Optional.some(el);
- } else if (stop(el)) {
- break;
- }
- }
- return Optional.none();
- };
- var closest$3 = function (scope, predicate, isRoot) {
- var is = function (s, test) {
- return test(s);
- };
- return ClosestOrAncestor(is, ancestor$3, scope, predicate, isRoot);
- };
- var sibling$2 = function (scope, predicate) {
- var element = scope.dom;
- if (!element.parentNode) {
- return Optional.none();
- }
- return child(SugarElement.fromDom(element.parentNode), function (x) {
- return !eq(scope, x) && predicate(x);
- });
- };
- var child = function (scope, predicate) {
- var pred = function (node) {
- return predicate(SugarElement.fromDom(node));
- };
- var result = find$3(scope.dom.childNodes, pred);
- return result.map(SugarElement.fromDom);
- };
- var ancestor$2 = function (scope, selector, isRoot) {
- return ancestor$3(scope, function (e) {
- return is$2(e, selector);
- }, isRoot);
- };
- var descendant = function (scope, selector) {
- return one(selector, scope);
- };
- var closest$2 = function (scope, selector, isRoot) {
- var is = function (element, selector) {
- return is$2(element, selector);
- };
- return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot);
- };
- var promiseObj = window.Promise ? window.Promise : Promise$1;
- var requestAnimationFramePromise;
- var requestAnimationFrame = function (callback, element) {
- var requestAnimationFrameFunc = window.requestAnimationFrame;
- var vendors = [
- 'ms',
- 'moz',
- 'webkit'
- ];
- var featurefill = function (cb) {
- window.setTimeout(cb, 0);
- };
- for (var i = 0; i < vendors.length && !requestAnimationFrameFunc; i++) {
- requestAnimationFrameFunc = window[vendors[i] + 'RequestAnimationFrame'];
- }
- if (!requestAnimationFrameFunc) {
- requestAnimationFrameFunc = featurefill;
- }
- requestAnimationFrameFunc(callback, element);
- };
- var wrappedSetTimeout = function (callback, time) {
- if (typeof time !== 'number') {
- time = 0;
- }
- return setTimeout(callback, time);
- };
- var wrappedSetInterval = function (callback, time) {
- if (typeof time !== 'number') {
- time = 1;
- }
- return setInterval(callback, time);
- };
- var wrappedClearTimeout = function (id) {
- return clearTimeout(id);
- };
- var wrappedClearInterval = function (id) {
- return clearInterval(id);
- };
- var debounce = function (callback, time) {
- var timer;
- var func = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- clearTimeout(timer);
- timer = wrappedSetTimeout(function () {
- callback.apply(this, args);
- }, time);
- };
- func.stop = function () {
- clearTimeout(timer);
- };
- return func;
- };
- var Delay = {
- requestAnimationFrame: function (callback, element) {
- if (requestAnimationFramePromise) {
- requestAnimationFramePromise.then(callback);
- return;
- }
- requestAnimationFramePromise = new promiseObj(function (resolve) {
- if (!element) {
- element = document.body;
- }
- requestAnimationFrame(resolve, element);
- }).then(callback);
- },
- setTimeout: wrappedSetTimeout,
- setInterval: wrappedSetInterval,
- setEditorTimeout: function (editor, callback, time) {
- return wrappedSetTimeout(function () {
- if (!editor.removed) {
- callback();
- }
- }, time);
- },
- setEditorInterval: function (editor, callback, time) {
- var timer = wrappedSetInterval(function () {
- if (!editor.removed) {
- callback();
- } else {
- clearInterval(timer);
- }
- }, time);
- return timer;
- },
- debounce: debounce,
- throttle: debounce,
- clearInterval: wrappedClearInterval,
- clearTimeout: wrappedClearTimeout
- };
- var StyleSheetLoader = function (documentOrShadowRoot, settings) {
- if (settings === void 0) {
- settings = {};
- }
- var idCount = 0;
- var loadedStates = {};
- var edos = SugarElement.fromDom(documentOrShadowRoot);
- var doc = documentOrOwner(edos);
- var maxLoadTime = settings.maxLoadTime || 5000;
- var _setReferrerPolicy = function (referrerPolicy) {
- settings.referrerPolicy = referrerPolicy;
- };
- var addStyle = function (element) {
- append$1(getStyleContainer(edos), element);
- };
- var removeStyle = function (id) {
- var styleContainer = getStyleContainer(edos);
- descendant(styleContainer, '#' + id).each(remove$7);
- };
- var getOrCreateState = function (url) {
- return get$9(loadedStates, url).getOrThunk(function () {
- return {
- id: 'mce-u' + idCount++,
- passed: [],
- failed: [],
- count: 0
- };
- });
- };
- var load = function (url, success, failure) {
- var link;
- var urlWithSuffix = Tools._addCacheSuffix(url);
- var state = getOrCreateState(urlWithSuffix);
- loadedStates[urlWithSuffix] = state;
- state.count++;
- var resolve = function (callbacks, status) {
- var i = callbacks.length;
- while (i--) {
- callbacks[i]();
- }
- state.status = status;
- state.passed = [];
- state.failed = [];
- if (link) {
- link.onload = null;
- link.onerror = null;
- link = null;
- }
- };
- var passed = function () {
- return resolve(state.passed, 2);
- };
- var failed = function () {
- return resolve(state.failed, 3);
- };
- var wait = function (testCallback, waitCallback) {
- if (!testCallback()) {
- if (Date.now() - startTime < maxLoadTime) {
- Delay.setTimeout(waitCallback);
- } else {
- failed();
- }
- }
- };
- var waitForWebKitLinkLoaded = function () {
- wait(function () {
- var styleSheets = documentOrShadowRoot.styleSheets;
- var i = styleSheets.length;
- while (i--) {
- var styleSheet = styleSheets[i];
- var owner = styleSheet.ownerNode;
- if (owner && owner.id === link.id) {
- passed();
- return true;
- }
- }
- return false;
- }, waitForWebKitLinkLoaded);
- };
- if (success) {
- state.passed.push(success);
- }
- if (failure) {
- state.failed.push(failure);
- }
- if (state.status === 1) {
- return;
- }
- if (state.status === 2) {
- passed();
- return;
- }
- if (state.status === 3) {
- failed();
- return;
- }
- state.status = 1;
- var linkElem = SugarElement.fromTag('link', doc.dom);
- setAll$1(linkElem, {
- rel: 'stylesheet',
- type: 'text/css',
- id: state.id
- });
- var startTime = Date.now();
- if (settings.contentCssCors) {
- set$1(linkElem, 'crossOrigin', 'anonymous');
- }
- if (settings.referrerPolicy) {
- set$1(linkElem, 'referrerpolicy', settings.referrerPolicy);
- }
- link = linkElem.dom;
- link.onload = waitForWebKitLinkLoaded;
- link.onerror = failed;
- addStyle(linkElem);
- set$1(linkElem, 'href', urlWithSuffix);
- };
- var loadF = function (url) {
- return Future.nu(function (resolve) {
- load(url, compose(resolve, constant(Result.value(url))), compose(resolve, constant(Result.error(url))));
- });
- };
- var loadAll = function (urls, success, failure) {
- par(map$3(urls, loadF)).get(function (result) {
- var parts = partition(result, function (r) {
- return r.isValue();
- });
- if (parts.fail.length > 0) {
- failure(parts.fail.map(unite));
- } else {
- success(parts.pass.map(unite));
- }
- });
- };
- var unload = function (url) {
- var urlWithSuffix = Tools._addCacheSuffix(url);
- get$9(loadedStates, urlWithSuffix).each(function (state) {
- var count = --state.count;
- if (count === 0) {
- delete loadedStates[urlWithSuffix];
- removeStyle(state.id);
- }
- });
- };
- var unloadAll = function (urls) {
- each$k(urls, function (url) {
- unload(url);
- });
- };
- return {
- load: load,
- loadAll: loadAll,
- unload: unload,
- unloadAll: unloadAll,
- _setReferrerPolicy: _setReferrerPolicy
- };
- };
- var create$8 = function () {
- var map = new WeakMap();
- var forElement = function (referenceElement, settings) {
- var root = getRootNode(referenceElement);
- var rootDom = root.dom;
- return Optional.from(map.get(rootDom)).getOrThunk(function () {
- var sl = StyleSheetLoader(rootDom, settings);
- map.set(rootDom, sl);
- return sl;
- });
- };
- return { forElement: forElement };
- };
- var instance = create$8();
- var DomTreeWalker = function () {
- function DomTreeWalker(startNode, rootNode) {
- this.node = startNode;
- this.rootNode = rootNode;
- this.current = this.current.bind(this);
- this.next = this.next.bind(this);
- this.prev = this.prev.bind(this);
- this.prev2 = this.prev2.bind(this);
- }
- DomTreeWalker.prototype.current = function () {
- return this.node;
- };
- DomTreeWalker.prototype.next = function (shallow) {
- this.node = this.findSibling(this.node, 'firstChild', 'nextSibling', shallow);
- return this.node;
- };
- DomTreeWalker.prototype.prev = function (shallow) {
- this.node = this.findSibling(this.node, 'lastChild', 'previousSibling', shallow);
- return this.node;
- };
- DomTreeWalker.prototype.prev2 = function (shallow) {
- this.node = this.findPreviousNode(this.node, 'lastChild', 'previousSibling', shallow);
- return this.node;
- };
- DomTreeWalker.prototype.findSibling = function (node, startName, siblingName, shallow) {
- var sibling, parent;
- if (node) {
- if (!shallow && node[startName]) {
- return node[startName];
- }
- if (node !== this.rootNode) {
- sibling = node[siblingName];
- if (sibling) {
- return sibling;
- }
- for (parent = node.parentNode; parent && parent !== this.rootNode; parent = parent.parentNode) {
- sibling = parent[siblingName];
- if (sibling) {
- return sibling;
- }
- }
- }
- }
- };
- DomTreeWalker.prototype.findPreviousNode = function (node, startName, siblingName, shallow) {
- var sibling, parent, child;
- if (node) {
- sibling = node[siblingName];
- if (this.rootNode && sibling === this.rootNode) {
- return;
- }
- if (sibling) {
- if (!shallow) {
- for (child = sibling[startName]; child; child = child[startName]) {
- if (!child[startName]) {
- return child;
- }
- }
- }
- return sibling;
- }
- parent = node.parentNode;
- if (parent && parent !== this.rootNode) {
- return parent;
- }
- }
- };
- return DomTreeWalker;
- }();
- var blocks = [
- 'article',
- 'aside',
- 'details',
- 'div',
- 'dt',
- 'figcaption',
- 'footer',
- 'form',
- 'fieldset',
- 'header',
- 'hgroup',
- 'html',
- 'main',
- 'nav',
- 'section',
- 'summary',
- 'body',
- 'p',
- 'dl',
- 'multicol',
- 'dd',
- 'figure',
- 'address',
- 'center',
- 'blockquote',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'listing',
- 'xmp',
- 'pre',
- 'plaintext',
- 'menu',
- 'dir',
- 'ul',
- 'ol',
- 'li',
- 'hr',
- 'table',
- 'tbody',
- 'thead',
- 'tfoot',
- 'th',
- 'tr',
- 'td',
- 'caption'
- ];
- var tableCells = [
- 'td',
- 'th'
- ];
- var tableSections = [
- 'thead',
- 'tbody',
- 'tfoot'
- ];
- var textBlocks = [
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'p',
- 'div',
- 'address',
- 'pre',
- 'form',
- 'blockquote',
- 'center',
- 'dir',
- 'fieldset',
- 'header',
- 'footer',
- 'article',
- 'section',
- 'hgroup',
- 'aside',
- 'nav',
- 'figure'
- ];
- var headings = [
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6'
- ];
- var listItems$1 = [
- 'li',
- 'dd',
- 'dt'
- ];
- var lists = [
- 'ul',
- 'ol',
- 'dl'
- ];
- var wsElements = [
- 'pre',
- 'script',
- 'textarea',
- 'style'
- ];
- var lazyLookup = function (items) {
- var lookup;
- return function (node) {
- lookup = lookup ? lookup : mapToObject(items, always);
- return has$2(lookup, name(node));
- };
- };
- var isHeading = lazyLookup(headings);
- var isBlock$2 = lazyLookup(blocks);
- var isTable$2 = function (node) {
- return name(node) === 'table';
- };
- var isInline$1 = function (node) {
- return isElement$6(node) && !isBlock$2(node);
- };
- var isBr$4 = function (node) {
- return isElement$6(node) && name(node) === 'br';
- };
- var isTextBlock$2 = lazyLookup(textBlocks);
- var isList = lazyLookup(lists);
- var isListItem = lazyLookup(listItems$1);
- var isTableSection = lazyLookup(tableSections);
- var isTableCell$4 = lazyLookup(tableCells);
- var isWsPreserveElement = lazyLookup(wsElements);
- var ancestor$1 = function (scope, selector, isRoot) {
- return ancestor$2(scope, selector, isRoot).isSome();
- };
- var zeroWidth = '\uFEFF';
- var nbsp = '\xA0';
- var isZwsp$1 = function (char) {
- return char === zeroWidth;
- };
- var removeZwsp = function (s) {
- return s.replace(/\uFEFF/g, '');
- };
- var ZWSP$1 = zeroWidth;
- var isZwsp = isZwsp$1;
- var trim$2 = removeZwsp;
- var isElement$4 = isElement$5;
- var isText$6 = isText$7;
- var isCaretContainerBlock$1 = function (node) {
- if (isText$6(node)) {
- node = node.parentNode;
- }
- return isElement$4(node) && node.hasAttribute('data-mce-caret');
- };
- var isCaretContainerInline = function (node) {
- return isText$6(node) && isZwsp(node.data);
- };
- var isCaretContainer$2 = function (node) {
- return isCaretContainerBlock$1(node) || isCaretContainerInline(node);
- };
- var hasContent = function (node) {
- return node.firstChild !== node.lastChild || !isBr$5(node.firstChild);
- };
- var insertInline$1 = function (node, before) {
- var doc = node.ownerDocument;
- var textNode = doc.createTextNode(ZWSP$1);
- var parentNode = node.parentNode;
- if (!before) {
- var sibling = node.nextSibling;
- if (isText$6(sibling)) {
- if (isCaretContainer$2(sibling)) {
- return sibling;
- }
- if (startsWithCaretContainer$1(sibling)) {
- sibling.splitText(1);
- return sibling;
- }
- }
- if (node.nextSibling) {
- parentNode.insertBefore(textNode, node.nextSibling);
- } else {
- parentNode.appendChild(textNode);
- }
- } else {
- var sibling = node.previousSibling;
- if (isText$6(sibling)) {
- if (isCaretContainer$2(sibling)) {
- return sibling;
- }
- if (endsWithCaretContainer$1(sibling)) {
- return sibling.splitText(sibling.data.length - 1);
- }
- }
- parentNode.insertBefore(textNode, node);
- }
- return textNode;
- };
- var isBeforeInline = function (pos) {
- var container = pos.container();
- if (!isText$7(container)) {
- return false;
- }
- return container.data.charAt(pos.offset()) === ZWSP$1 || pos.isAtStart() && isCaretContainerInline(container.previousSibling);
- };
- var isAfterInline = function (pos) {
- var container = pos.container();
- if (!isText$7(container)) {
- return false;
- }
- return container.data.charAt(pos.offset() - 1) === ZWSP$1 || pos.isAtEnd() && isCaretContainerInline(container.nextSibling);
- };
- var createBogusBr = function () {
- var br = document.createElement('br');
- br.setAttribute('data-mce-bogus', '1');
- return br;
- };
- var insertBlock$1 = function (blockName, node, before) {
- var doc = node.ownerDocument;
- var blockNode = doc.createElement(blockName);
- blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after');
- blockNode.setAttribute('data-mce-bogus', 'all');
- blockNode.appendChild(createBogusBr());
- var parentNode = node.parentNode;
- if (!before) {
- if (node.nextSibling) {
- parentNode.insertBefore(blockNode, node.nextSibling);
- } else {
- parentNode.appendChild(blockNode);
- }
- } else {
- parentNode.insertBefore(blockNode, node);
- }
- return blockNode;
- };
- var startsWithCaretContainer$1 = function (node) {
- return isText$6(node) && node.data[0] === ZWSP$1;
- };
- var endsWithCaretContainer$1 = function (node) {
- return isText$6(node) && node.data[node.data.length - 1] === ZWSP$1;
- };
- var trimBogusBr = function (elm) {
- var brs = elm.getElementsByTagName('br');
- var lastBr = brs[brs.length - 1];
- if (isBogus$2(lastBr)) {
- lastBr.parentNode.removeChild(lastBr);
- }
- };
- var showCaretContainerBlock = function (caretContainer) {
- if (caretContainer && caretContainer.hasAttribute('data-mce-caret')) {
- trimBogusBr(caretContainer);
- caretContainer.removeAttribute('data-mce-caret');
- caretContainer.removeAttribute('data-mce-bogus');
- caretContainer.removeAttribute('style');
- caretContainer.removeAttribute('_moz_abspos');
- return caretContainer;
- }
- return null;
- };
- var isRangeInCaretContainerBlock = function (range) {
- return isCaretContainerBlock$1(range.startContainer);
- };
- var isContentEditableTrue$3 = isContentEditableTrue$4;
- var isContentEditableFalse$a = isContentEditableFalse$b;
- var isBr$3 = isBr$5;
- var isText$5 = isText$7;
- var isInvalidTextElement = matchNodeNames([
- 'script',
- 'style',
- 'textarea'
- ]);
- var isAtomicInline = matchNodeNames([
- 'img',
- 'input',
- 'textarea',
- 'hr',
- 'iframe',
- 'video',
- 'audio',
- 'object',
- 'embed'
- ]);
- var isTable$1 = matchNodeNames(['table']);
- var isCaretContainer$1 = isCaretContainer$2;
- var isCaretCandidate$3 = function (node) {
- if (isCaretContainer$1(node)) {
- return false;
- }
- if (isText$5(node)) {
- return !isInvalidTextElement(node.parentNode);
- }
- return isAtomicInline(node) || isBr$3(node) || isTable$1(node) || isNonUiContentEditableFalse(node);
- };
- var isUnselectable = function (node) {
- return isElement$5(node) && node.getAttribute('unselectable') === 'true';
- };
- var isNonUiContentEditableFalse = function (node) {
- return isUnselectable(node) === false && isContentEditableFalse$a(node);
- };
- var isInEditable = function (node, root) {
- for (node = node.parentNode; node && node !== root; node = node.parentNode) {
- if (isNonUiContentEditableFalse(node)) {
- return false;
- }
- if (isContentEditableTrue$3(node)) {
- return true;
- }
- }
- return true;
- };
- var isAtomicContentEditableFalse = function (node) {
- if (!isNonUiContentEditableFalse(node)) {
- return false;
- }
- return foldl(from(node.getElementsByTagName('*')), function (result, elm) {
- return result || isContentEditableTrue$3(elm);
- }, false) !== true;
- };
- var isAtomic$1 = function (node) {
- return isAtomicInline(node) || isAtomicContentEditableFalse(node);
- };
- var isEditableCaretCandidate$1 = function (node, root) {
- return isCaretCandidate$3(node) && isInEditable(node, root);
- };
- var whiteSpaceRegExp$1 = /^[ \t\r\n]*$/;
- var isWhitespaceText = function (text) {
- return whiteSpaceRegExp$1.test(text);
- };
- var hasWhitespacePreserveParent = function (node, rootNode) {
- var rootElement = SugarElement.fromDom(rootNode);
- var startNode = SugarElement.fromDom(node);
- return ancestor$1(startNode, 'pre,code', curry(eq, rootElement));
- };
- var isWhitespace = function (node, rootNode) {
- return isText$7(node) && isWhitespaceText(node.data) && hasWhitespacePreserveParent(node, rootNode) === false;
- };
- var isNamedAnchor = function (node) {
- return isElement$5(node) && node.nodeName === 'A' && !node.hasAttribute('href') && (node.hasAttribute('name') || node.hasAttribute('id'));
- };
- var isContent$1 = function (node, rootNode) {
- return isCaretCandidate$3(node) && isWhitespace(node, rootNode) === false || isNamedAnchor(node) || isBookmark(node);
- };
- var isBookmark = hasAttribute('data-mce-bookmark');
- var isBogus$1 = hasAttribute('data-mce-bogus');
- var isBogusAll = hasAttributeValue('data-mce-bogus', 'all');
- var isEmptyNode = function (targetNode, skipBogus) {
- var brCount = 0;
- if (isContent$1(targetNode, targetNode)) {
- return false;
- } else {
- var node = targetNode.firstChild;
- if (!node) {
- return true;
- }
- var walker = new DomTreeWalker(node, targetNode);
- do {
- if (skipBogus) {
- if (isBogusAll(node)) {
- node = walker.next(true);
- continue;
- }
- if (isBogus$1(node)) {
- node = walker.next();
- continue;
- }
- }
- if (isBr$5(node)) {
- brCount++;
- node = walker.next();
- continue;
- }
- if (isContent$1(node, targetNode)) {
- return false;
- }
- node = walker.next();
- } while (node);
- return brCount <= 1;
- }
- };
- var isEmpty$2 = function (elm, skipBogus) {
- if (skipBogus === void 0) {
- skipBogus = true;
- }
- return isEmptyNode(elm.dom, skipBogus);
- };
- var isSpan = function (node) {
- return node.nodeName.toLowerCase() === 'span';
- };
- var isInlineContent = function (node, root) {
- return isNonNullable(node) && (isContent$1(node, root) || isInline$1(SugarElement.fromDom(node)));
- };
- var surroundedByInlineContent = function (node, root) {
- var prev = new DomTreeWalker(node, root).prev(false);
- var next = new DomTreeWalker(node, root).next(false);
- var prevIsInline = isUndefined(prev) || isInlineContent(prev, root);
- var nextIsInline = isUndefined(next) || isInlineContent(next, root);
- return prevIsInline && nextIsInline;
- };
- var isBookmarkNode$2 = function (node) {
- return isSpan(node) && node.getAttribute('data-mce-type') === 'bookmark';
- };
- var isKeepTextNode = function (node, root) {
- return isText$7(node) && node.data.length > 0 && surroundedByInlineContent(node, root);
- };
- var isKeepElement = function (node) {
- return isElement$5(node) ? node.childNodes.length > 0 : false;
- };
- var isDocument = function (node) {
- return isDocumentFragment(node) || isDocument$1(node);
- };
- var trimNode = function (dom, node, root) {
- var rootNode = root || node;
- if (isElement$5(node) && isBookmarkNode$2(node)) {
- return node;
- }
- var children = node.childNodes;
- for (var i = children.length - 1; i >= 0; i--) {
- trimNode(dom, children[i], rootNode);
- }
- if (isElement$5(node)) {
- var currentChildren = node.childNodes;
- if (currentChildren.length === 1 && isBookmarkNode$2(currentChildren[0])) {
- node.parentNode.insertBefore(currentChildren[0], node);
- }
- }
- if (!isDocument(node) && !isContent$1(node, rootNode) && !isKeepElement(node) && !isKeepTextNode(node, rootNode)) {
- dom.remove(node);
- }
- return node;
- };
- var makeMap$3 = Tools.makeMap;
- var attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var rawCharsRegExp = /[<>&\"\']/g;
- var entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi;
- var asciiMap = {
- 128: '\u20AC',
- 130: '\u201A',
- 131: '\u0192',
- 132: '\u201E',
- 133: '\u2026',
- 134: '\u2020',
- 135: '\u2021',
- 136: '\u02c6',
- 137: '\u2030',
- 138: '\u0160',
- 139: '\u2039',
- 140: '\u0152',
- 142: '\u017d',
- 145: '\u2018',
- 146: '\u2019',
- 147: '\u201C',
- 148: '\u201D',
- 149: '\u2022',
- 150: '\u2013',
- 151: '\u2014',
- 152: '\u02DC',
- 153: '\u2122',
- 154: '\u0161',
- 155: '\u203A',
- 156: '\u0153',
- 158: '\u017e',
- 159: '\u0178'
- };
- var baseEntities = {
- '"': '"',
- '\'': ''',
- '<': '<',
- '>': '>',
- '&': '&',
- '`': '`'
- };
- var reverseEntities = {
- '<': '<',
- '>': '>',
- '&': '&',
- '"': '"',
- ''': '\''
- };
- var nativeDecode = function (text) {
- var elm = SugarElement.fromTag('div').dom;
- elm.innerHTML = text;
- return elm.textContent || elm.innerText || text;
- };
- var buildEntitiesLookup = function (items, radix) {
- var i, chr, entity;
- var lookup = {};
- if (items) {
- items = items.split(',');
- radix = radix || 10;
- for (i = 0; i < items.length; i += 2) {
- chr = String.fromCharCode(parseInt(items[i], radix));
- if (!baseEntities[chr]) {
- entity = '&' + items[i + 1] + ';';
- lookup[chr] = entity;
- lookup[entity] = chr;
- }
- }
- return lookup;
- }
- };
- var namedEntities = buildEntitiesLookup('50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);
- var encodeRaw = function (text, attr) {
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- return baseEntities[chr] || chr;
- });
- };
- var encodeAllRaw = function (text) {
- return ('' + text).replace(rawCharsRegExp, function (chr) {
- return baseEntities[chr] || chr;
- });
- };
- var encodeNumeric = function (text, attr) {
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- if (chr.length > 1) {
- return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
- }
- return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
- });
- };
- var encodeNamed = function (text, attr, entities) {
- entities = entities || namedEntities;
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- return baseEntities[chr] || entities[chr] || chr;
- });
- };
- var getEncodeFunc = function (name, entities) {
- var entitiesMap = buildEntitiesLookup(entities) || namedEntities;
- var encodeNamedAndNumeric = function (text, attr) {
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- if (baseEntities[chr] !== undefined) {
- return baseEntities[chr];
- }
- if (entitiesMap[chr] !== undefined) {
- return entitiesMap[chr];
- }
- if (chr.length > 1) {
- return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
- }
- return '&#' + chr.charCodeAt(0) + ';';
- });
- };
- var encodeCustomNamed = function (text, attr) {
- return encodeNamed(text, attr, entitiesMap);
- };
- var nameMap = makeMap$3(name.replace(/\+/g, ','));
- if (nameMap.named && nameMap.numeric) {
- return encodeNamedAndNumeric;
- }
- if (nameMap.named) {
- if (entities) {
- return encodeCustomNamed;
- }
- return encodeNamed;
- }
- if (nameMap.numeric) {
- return encodeNumeric;
- }
- return encodeRaw;
- };
- var decode = function (text) {
- return text.replace(entityRegExp, function (all, numeric) {
- if (numeric) {
- if (numeric.charAt(0).toLowerCase() === 'x') {
- numeric = parseInt(numeric.substr(1), 16);
- } else {
- numeric = parseInt(numeric, 10);
- }
- if (numeric > 65535) {
- numeric -= 65536;
- return String.fromCharCode(55296 + (numeric >> 10), 56320 + (numeric & 1023));
- }
- return asciiMap[numeric] || String.fromCharCode(numeric);
- }
- return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
- });
- };
- var Entities = {
- encodeRaw: encodeRaw,
- encodeAllRaw: encodeAllRaw,
- encodeNumeric: encodeNumeric,
- encodeNamed: encodeNamed,
- getEncodeFunc: getEncodeFunc,
- decode: decode
- };
- var mapCache = {}, dummyObj = {};
- var makeMap$2 = Tools.makeMap, each$h = Tools.each, extend$5 = Tools.extend, explode$3 = Tools.explode, inArray$2 = Tools.inArray;
- var split$1 = function (items, delim) {
- items = Tools.trim(items);
- return items ? items.split(delim || ' ') : [];
- };
- var compileSchema = function (type) {
- var schema = {};
- var globalAttributes, blockContent;
- var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
- var add = function (name, attributes, children) {
- var ni, attributesOrder, element;
- var arrayToMap = function (array, obj) {
- var map = {};
- var i, l;
- for (i = 0, l = array.length; i < l; i++) {
- map[array[i]] = obj || {};
- }
- return map;
- };
- children = children || [];
- attributes = attributes || '';
- if (typeof children === 'string') {
- children = split$1(children);
- }
- var names = split$1(name);
- ni = names.length;
- while (ni--) {
- attributesOrder = split$1([
- globalAttributes,
- attributes
- ].join(' '));
- element = {
- attributes: arrayToMap(attributesOrder),
- attributesOrder: attributesOrder,
- children: arrayToMap(children, dummyObj)
- };
- schema[names[ni]] = element;
- }
- };
- var addAttrs = function (name, attributes) {
- var ni, schemaItem, i, l;
- var names = split$1(name);
- ni = names.length;
- var attrs = split$1(attributes);
- while (ni--) {
- schemaItem = schema[names[ni]];
- for (i = 0, l = attrs.length; i < l; i++) {
- schemaItem.attributes[attrs[i]] = {};
- schemaItem.attributesOrder.push(attrs[i]);
- }
- }
- };
- if (mapCache[type]) {
- return mapCache[type];
- }
- globalAttributes = 'id accesskey class dir lang style tabindex title role';
- blockContent = 'address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul';
- phrasingContent = 'a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd ' + 'label map noscript object q s samp script select small span strong sub sup ' + 'textarea u var #text #comment';
- if (type !== 'html4') {
- globalAttributes += ' contenteditable contextmenu draggable dropzone ' + 'hidden spellcheck translate';
- blockContent += ' article aside details dialog figure main header footer hgroup section nav';
- phrasingContent += ' audio canvas command datalist mark meter output picture ' + 'progress time wbr video ruby bdi keygen';
- }
- if (type !== 'html5-strict') {
- globalAttributes += ' xml:lang';
- html4PhrasingContent = 'acronym applet basefont big font strike tt';
- phrasingContent = [
- phrasingContent,
- html4PhrasingContent
- ].join(' ');
- each$h(split$1(html4PhrasingContent), function (name) {
- add(name, '', phrasingContent);
- });
- html4BlockContent = 'center dir isindex noframes';
- blockContent = [
- blockContent,
- html4BlockContent
- ].join(' ');
- flowContent = [
- blockContent,
- phrasingContent
- ].join(' ');
- each$h(split$1(html4BlockContent), function (name) {
- add(name, '', flowContent);
- });
- }
- flowContent = flowContent || [
- blockContent,
- phrasingContent
- ].join(' ');
- add('html', 'manifest', 'head body');
- add('head', '', 'base command link meta noscript script style title');
- add('title hr noscript br');
- add('base', 'href target');
- add('link', 'href rel media hreflang type sizes hreflang');
- add('meta', 'name http-equiv content charset');
- add('style', 'media type scoped');
- add('script', 'src async defer type charset');
- add('body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + 'onpopstate onresize onscroll onstorage onunload', flowContent);
- add('address dt dd div caption', '', flowContent);
- add('h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn', '', phrasingContent);
- add('blockquote', 'cite', flowContent);
- add('ol', 'reversed start type', 'li');
- add('ul', '', 'li');
- add('li', 'value', flowContent);
- add('dl', '', 'dt dd');
- add('a', 'href target rel media hreflang type', phrasingContent);
- add('q', 'cite', phrasingContent);
- add('ins del', 'cite datetime', flowContent);
- add('img', 'src sizes srcset alt usemap ismap width height');
- add('iframe', 'src name width height', flowContent);
- add('embed', 'src type width height');
- add('object', 'data type typemustmatch name usemap form width height', [
- flowContent,
- 'param'
- ].join(' '));
- add('param', 'name value');
- add('map', 'name', [
- flowContent,
- 'area'
- ].join(' '));
- add('area', 'alt coords shape href target rel media hreflang type');
- add('table', 'border', 'caption colgroup thead tfoot tbody tr' + (type === 'html4' ? ' col' : ''));
- add('colgroup', 'span', 'col');
- add('col', 'span');
- add('tbody thead tfoot', '', 'tr');
- add('tr', '', 'td th');
- add('td', 'colspan rowspan headers', flowContent);
- add('th', 'colspan rowspan headers scope abbr', flowContent);
- add('form', 'accept-charset action autocomplete enctype method name novalidate target', flowContent);
- add('fieldset', 'disabled form name', [
- flowContent,
- 'legend'
- ].join(' '));
- add('label', 'form for', phrasingContent);
- add('input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width');
- add('button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', type === 'html4' ? flowContent : phrasingContent);
- add('select', 'disabled form multiple name required size', 'option optgroup');
- add('optgroup', 'disabled label', 'option');
- add('option', 'disabled label selected value');
- add('textarea', 'cols dirname disabled form maxlength name readonly required rows wrap');
- add('menu', 'type label', [
- flowContent,
- 'li'
- ].join(' '));
- add('noscript', '', flowContent);
- if (type !== 'html4') {
- add('wbr');
- add('ruby', '', [
- phrasingContent,
- 'rt rp'
- ].join(' '));
- add('figcaption', '', flowContent);
- add('mark rt rp summary bdi', '', phrasingContent);
- add('canvas', 'width height', flowContent);
- add('video', 'src crossorigin poster preload autoplay mediagroup loop ' + 'muted controls width height buffered', [
- flowContent,
- 'track source'
- ].join(' '));
- add('audio', 'src crossorigin preload autoplay mediagroup loop muted controls ' + 'buffered volume', [
- flowContent,
- 'track source'
- ].join(' '));
- add('picture', '', 'img source');
- add('source', 'src srcset type media sizes');
- add('track', 'kind src srclang label default');
- add('datalist', '', [
- phrasingContent,
- 'option'
- ].join(' '));
- add('article section nav aside main header footer', '', flowContent);
- add('hgroup', '', 'h1 h2 h3 h4 h5 h6');
- add('figure', '', [
- flowContent,
- 'figcaption'
- ].join(' '));
- add('time', 'datetime', phrasingContent);
- add('dialog', 'open', flowContent);
- add('command', 'type label icon disabled checked radiogroup command');
- add('output', 'for form name', phrasingContent);
- add('progress', 'value max', phrasingContent);
- add('meter', 'value min max low high optimum', phrasingContent);
- add('details', 'open', [
- flowContent,
- 'summary'
- ].join(' '));
- add('keygen', 'autofocus challenge disabled form keytype name');
- }
- if (type !== 'html5-strict') {
- addAttrs('script', 'language xml:space');
- addAttrs('style', 'xml:space');
- addAttrs('object', 'declare classid code codebase codetype archive standby align border hspace vspace');
- addAttrs('embed', 'align name hspace vspace');
- addAttrs('param', 'valuetype type');
- addAttrs('a', 'charset name rev shape coords');
- addAttrs('br', 'clear');
- addAttrs('applet', 'codebase archive code object alt name width height align hspace vspace');
- addAttrs('img', 'name longdesc align border hspace vspace');
- addAttrs('iframe', 'longdesc frameborder marginwidth marginheight scrolling align');
- addAttrs('font basefont', 'size color face');
- addAttrs('input', 'usemap align');
- addAttrs('select');
- addAttrs('textarea');
- addAttrs('h1 h2 h3 h4 h5 h6 div p legend caption', 'align');
- addAttrs('ul', 'type compact');
- addAttrs('li', 'type');
- addAttrs('ol dl menu dir', 'compact');
- addAttrs('pre', 'width xml:space');
- addAttrs('hr', 'align noshade size width');
- addAttrs('isindex', 'prompt');
- addAttrs('table', 'summary width frame rules cellspacing cellpadding align bgcolor');
- addAttrs('col', 'width align char charoff valign');
- addAttrs('colgroup', 'width align char charoff valign');
- addAttrs('thead', 'align char charoff valign');
- addAttrs('tr', 'align char charoff valign bgcolor');
- addAttrs('th', 'axis align char charoff valign nowrap bgcolor width height');
- addAttrs('form', 'accept');
- addAttrs('td', 'abbr axis scope align char charoff valign nowrap bgcolor width height');
- addAttrs('tfoot', 'align char charoff valign');
- addAttrs('tbody', 'align char charoff valign');
- addAttrs('area', 'nohref');
- addAttrs('body', 'background bgcolor text link vlink alink');
- }
- if (type !== 'html4') {
- addAttrs('input button select textarea', 'autofocus');
- addAttrs('input textarea', 'placeholder');
- addAttrs('a', 'download');
- addAttrs('link script img', 'crossorigin');
- addAttrs('img', 'loading');
- addAttrs('iframe', 'sandbox seamless allowfullscreen loading');
- }
- each$h(split$1('a form meter progress dfn'), function (name) {
- if (schema[name]) {
- delete schema[name].children[name];
- }
- });
- delete schema.caption.children.table;
- delete schema.script;
- mapCache[type] = schema;
- return schema;
- };
- var compileElementMap = function (value, mode) {
- var styles;
- if (value) {
- styles = {};
- if (typeof value === 'string') {
- value = { '*': value };
- }
- each$h(value, function (value, key) {
- styles[key] = styles[key.toUpperCase()] = mode === 'map' ? makeMap$2(value, /[, ]/) : explode$3(value, /[, ]/);
- });
- }
- return styles;
- };
- var Schema = function (settings) {
- var elements = {};
- var children = {};
- var patternElements = [];
- var customElementsMap = {}, specialElements = {};
- var createLookupTable = function (option, defaultValue, extendWith) {
- var value = settings[option];
- if (!value) {
- value = mapCache[option];
- if (!value) {
- value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
- value = extend$5(value, extendWith);
- mapCache[option] = value;
- }
- } else {
- value = makeMap$2(value, /[, ]/, makeMap$2(value.toUpperCase(), /[, ]/));
- }
- return value;
- };
- settings = settings || {};
- var schemaItems = compileSchema(settings.schema);
- if (settings.verify_html === false) {
- settings.valid_elements = '*[*]';
- }
- var validStyles = compileElementMap(settings.valid_styles);
- var invalidStyles = compileElementMap(settings.invalid_styles, 'map');
- var validClasses = compileElementMap(settings.valid_classes, 'map');
- var whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object code');
- var selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
- var shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + 'meta param embed source wbr track');
- var boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + 'noshade nowrap readonly selected autoplay loop controls');
- var nonEmptyOrMoveCaretBeforeOnEnter = 'td th iframe video audio object script code';
- var nonEmptyElementsMap = createLookupTable('non_empty_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' pre', shortEndedElementsMap);
- var moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' table', shortEndedElementsMap);
- var textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure');
- var blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
- var textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
- each$h((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) {
- specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
- });
- var patternToRegExp = function (str) {
- return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
- };
- var addValidElements = function (validElements) {
- var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, prefix, outputName, globalAttributes, globalAttributesOrder, value;
- var elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/, attrRuleRegExp = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/, hasPatternsRegExp = /[*?+]/;
- if (validElements) {
- var validElementsArr = split$1(validElements, ',');
- if (elements['@']) {
- globalAttributes = elements['@'].attributes;
- globalAttributesOrder = elements['@'].attributesOrder;
- }
- for (ei = 0, el = validElementsArr.length; ei < el; ei++) {
- matches = elementRuleRegExp.exec(validElementsArr[ei]);
- if (matches) {
- prefix = matches[1];
- elementName = matches[2];
- outputName = matches[3];
- attrData = matches[5];
- attributes = {};
- attributesOrder = [];
- element = {
- attributes: attributes,
- attributesOrder: attributesOrder
- };
- if (prefix === '#') {
- element.paddEmpty = true;
- }
- if (prefix === '-') {
- element.removeEmpty = true;
- }
- if (matches[4] === '!') {
- element.removeEmptyAttrs = true;
- }
- if (globalAttributes) {
- each$j(globalAttributes, function (value, key) {
- attributes[key] = value;
- });
- attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
- }
- if (attrData) {
- attrData = split$1(attrData, '|');
- for (ai = 0, al = attrData.length; ai < al; ai++) {
- matches = attrRuleRegExp.exec(attrData[ai]);
- if (matches) {
- attr = {};
- attrType = matches[1];
- attrName = matches[2].replace(/[\\:]:/g, ':');
- prefix = matches[3];
- value = matches[4];
- if (attrType === '!') {
- element.attributesRequired = element.attributesRequired || [];
- element.attributesRequired.push(attrName);
- attr.required = true;
- }
- if (attrType === '-') {
- delete attributes[attrName];
- attributesOrder.splice(inArray$2(attributesOrder, attrName), 1);
- continue;
- }
- if (prefix) {
- if (prefix === '=') {
- element.attributesDefault = element.attributesDefault || [];
- element.attributesDefault.push({
- name: attrName,
- value: value
- });
- attr.defaultValue = value;
- }
- if (prefix === ':') {
- element.attributesForced = element.attributesForced || [];
- element.attributesForced.push({
- name: attrName,
- value: value
- });
- attr.forcedValue = value;
- }
- if (prefix === '<') {
- attr.validValues = makeMap$2(value, '?');
- }
- }
- if (hasPatternsRegExp.test(attrName)) {
- element.attributePatterns = element.attributePatterns || [];
- attr.pattern = patternToRegExp(attrName);
- element.attributePatterns.push(attr);
- } else {
- if (!attributes[attrName]) {
- attributesOrder.push(attrName);
- }
- attributes[attrName] = attr;
- }
- }
- }
- }
- if (!globalAttributes && elementName === '@') {
- globalAttributes = attributes;
- globalAttributesOrder = attributesOrder;
- }
- if (outputName) {
- element.outputName = elementName;
- elements[outputName] = element;
- }
- if (hasPatternsRegExp.test(elementName)) {
- element.pattern = patternToRegExp(elementName);
- patternElements.push(element);
- } else {
- elements[elementName] = element;
- }
- }
- }
- }
- };
- var setValidElements = function (validElements) {
- elements = {};
- patternElements = [];
- addValidElements(validElements);
- each$h(schemaItems, function (element, name) {
- children[name] = element.children;
- });
- };
- var addCustomElements = function (customElements) {
- var customElementRegExp = /^(~)?(.+)$/;
- if (customElements) {
- mapCache.text_block_elements = mapCache.block_elements = null;
- each$h(split$1(customElements, ','), function (rule) {
- var matches = customElementRegExp.exec(rule), inline = matches[1] === '~', cloneName = inline ? 'span' : 'div', name = matches[2];
- children[name] = children[cloneName];
- customElementsMap[name] = cloneName;
- if (!inline) {
- blockElementsMap[name.toUpperCase()] = {};
- blockElementsMap[name] = {};
- }
- if (!elements[name]) {
- var customRule = elements[cloneName];
- customRule = extend$5({}, customRule);
- delete customRule.removeEmptyAttrs;
- delete customRule.removeEmpty;
- elements[name] = customRule;
- }
- each$h(children, function (element, elmName) {
- if (element[cloneName]) {
- children[elmName] = element = extend$5({}, children[elmName]);
- element[name] = element[cloneName];
- }
- });
- });
- }
- };
- var addValidChildren = function (validChildren) {
- var childRuleRegExp = /^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;
- mapCache[settings.schema] = null;
- if (validChildren) {
- each$h(split$1(validChildren, ','), function (rule) {
- var matches = childRuleRegExp.exec(rule);
- var parent, prefix;
- if (matches) {
- prefix = matches[1];
- if (prefix) {
- parent = children[matches[2]];
- } else {
- parent = children[matches[2]] = { '#comment': {} };
- }
- parent = children[matches[2]];
- each$h(split$1(matches[3], '|'), function (child) {
- if (prefix === '-') {
- delete parent[child];
- } else {
- parent[child] = {};
- }
- });
- }
- });
- }
- };
- var getElementRule = function (name) {
- var element = elements[name], i;
- if (element) {
- return element;
- }
- i = patternElements.length;
- while (i--) {
- element = patternElements[i];
- if (element.pattern.test(name)) {
- return element;
- }
- }
- };
- if (!settings.valid_elements) {
- each$h(schemaItems, function (element, name) {
- elements[name] = {
- attributes: element.attributes,
- attributesOrder: element.attributesOrder
- };
- children[name] = element.children;
- });
- if (settings.schema !== 'html5') {
- each$h(split$1('strong/b em/i'), function (item) {
- var items = split$1(item, '/');
- elements[items[1]].outputName = items[0];
- });
- }
- each$h(split$1('ol ul sub sup blockquote span font a table tbody strong em b i'), function (name) {
- if (elements[name]) {
- elements[name].removeEmpty = true;
- }
- });
- each$h(split$1('p h1 h2 h3 h4 h5 h6 th td pre div address caption li'), function (name) {
- elements[name].paddEmpty = true;
- });
- each$h(split$1('span'), function (name) {
- elements[name].removeEmptyAttrs = true;
- });
- } else {
- setValidElements(settings.valid_elements);
- }
- addCustomElements(settings.custom_elements);
- addValidChildren(settings.valid_children);
- addValidElements(settings.extended_valid_elements);
- addValidChildren('+ol[ul|ol],+ul[ul|ol]');
- each$h({
- dd: 'dl',
- dt: 'dl',
- li: 'ul ol',
- td: 'tr',
- th: 'tr',
- tr: 'tbody thead tfoot',
- tbody: 'table',
- thead: 'table',
- tfoot: 'table',
- legend: 'fieldset',
- area: 'map',
- param: 'video audio object'
- }, function (parents, item) {
- if (elements[item]) {
- elements[item].parentsRequired = split$1(parents);
- }
- });
- if (settings.invalid_elements) {
- each$h(explode$3(settings.invalid_elements), function (item) {
- if (elements[item]) {
- delete elements[item];
- }
- });
- }
- if (!getElementRule('span')) {
- addValidElements('span[!data-mce-type|*]');
- }
- var getValidStyles = constant(validStyles);
- var getInvalidStyles = constant(invalidStyles);
- var getValidClasses = constant(validClasses);
- var getBoolAttrs = constant(boolAttrMap);
- var getBlockElements = constant(blockElementsMap);
- var getTextBlockElements = constant(textBlockElementsMap);
- var getTextInlineElements = constant(textInlineElementsMap);
- var getShortEndedElements = constant(shortEndedElementsMap);
- var getSelfClosingElements = constant(selfClosingElementsMap);
- var getNonEmptyElements = constant(nonEmptyElementsMap);
- var getMoveCaretBeforeOnEnterElements = constant(moveCaretBeforeOnEnterElementsMap);
- var getWhiteSpaceElements = constant(whiteSpaceElementsMap);
- var getSpecialElements = constant(specialElements);
- var isValidChild = function (name, child) {
- var parent = children[name.toLowerCase()];
- return !!(parent && parent[child.toLowerCase()]);
- };
- var isValid = function (name, attr) {
- var attrPatterns, i;
- var rule = getElementRule(name);
- if (rule) {
- if (attr) {
- if (rule.attributes[attr]) {
- return true;
- }
- attrPatterns = rule.attributePatterns;
- if (attrPatterns) {
- i = attrPatterns.length;
- while (i--) {
- if (attrPatterns[i].pattern.test(name)) {
- return true;
- }
- }
- }
- } else {
- return true;
- }
- }
- return false;
- };
- var getCustomElements = constant(customElementsMap);
- return {
- children: children,
- elements: elements,
- getValidStyles: getValidStyles,
- getValidClasses: getValidClasses,
- getBlockElements: getBlockElements,
- getInvalidStyles: getInvalidStyles,
- getShortEndedElements: getShortEndedElements,
- getTextBlockElements: getTextBlockElements,
- getTextInlineElements: getTextInlineElements,
- getBoolAttrs: getBoolAttrs,
- getElementRule: getElementRule,
- getSelfClosingElements: getSelfClosingElements,
- getNonEmptyElements: getNonEmptyElements,
- getMoveCaretBeforeOnEnterElements: getMoveCaretBeforeOnEnterElements,
- getWhiteSpaceElements: getWhiteSpaceElements,
- getSpecialElements: getSpecialElements,
- isValidChild: isValidChild,
- isValid: isValid,
- getCustomElements: getCustomElements,
- addValidElements: addValidElements,
- setValidElements: setValidElements,
- addCustomElements: addCustomElements,
- addValidChildren: addValidChildren
- };
- };
- var toHex = function (match, r, g, b) {
- var hex = function (val) {
- val = parseInt(val, 10).toString(16);
- return val.length > 1 ? val : '0' + val;
- };
- return '#' + hex(r) + hex(g) + hex(b);
- };
- var Styles = function (settings, schema) {
- var _this = this;
- var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi;
- var urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;
- var styleRegExp = /\s*([^:]+):\s*([^;]+);?/g;
- var trimRightRegExp = /\s+$/;
- var i;
- var encodingLookup = {};
- var validStyles;
- var invalidStyles;
- var invisibleChar = zeroWidth;
- settings = settings || {};
- if (schema) {
- validStyles = schema.getValidStyles();
- invalidStyles = schema.getInvalidStyles();
- }
- var encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
- for (i = 0; i < encodingItems.length; i++) {
- encodingLookup[encodingItems[i]] = invisibleChar + i;
- encodingLookup[invisibleChar + i] = encodingItems[i];
- }
- return {
- toHex: function (color) {
- return color.replace(rgbRegExp, toHex);
- },
- parse: function (css) {
- var styles = {};
- var matches, name, value, isEncoded;
- var urlConverter = settings.url_converter;
- var urlConverterScope = settings.url_converter_scope || _this;
- var compress = function (prefix, suffix, noJoin) {
- var top = styles[prefix + '-top' + suffix];
- if (!top) {
- return;
- }
- var right = styles[prefix + '-right' + suffix];
- if (!right) {
- return;
- }
- var bottom = styles[prefix + '-bottom' + suffix];
- if (!bottom) {
- return;
- }
- var left = styles[prefix + '-left' + suffix];
- if (!left) {
- return;
- }
- var box = [
- top,
- right,
- bottom,
- left
- ];
- i = box.length - 1;
- while (i--) {
- if (box[i] !== box[i + 1]) {
- break;
- }
- }
- if (i > -1 && noJoin) {
- return;
- }
- styles[prefix + suffix] = i === -1 ? box[0] : box.join(' ');
- delete styles[prefix + '-top' + suffix];
- delete styles[prefix + '-right' + suffix];
- delete styles[prefix + '-bottom' + suffix];
- delete styles[prefix + '-left' + suffix];
- };
- var canCompress = function (key) {
- var value = styles[key], i;
- if (!value) {
- return;
- }
- value = value.split(' ');
- i = value.length;
- while (i--) {
- if (value[i] !== value[0]) {
- return false;
- }
- }
- styles[key] = value[0];
- return true;
- };
- var compress2 = function (target, a, b, c) {
- if (!canCompress(a)) {
- return;
- }
- if (!canCompress(b)) {
- return;
- }
- if (!canCompress(c)) {
- return;
- }
- styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
- delete styles[a];
- delete styles[b];
- delete styles[c];
- };
- var encode = function (str) {
- isEncoded = true;
- return encodingLookup[str];
- };
- var decode = function (str, keepSlashes) {
- if (isEncoded) {
- str = str.replace(/\uFEFF[0-9]/g, function (str) {
- return encodingLookup[str];
- });
- }
- if (!keepSlashes) {
- str = str.replace(/\\([\'\";:])/g, '$1');
- }
- return str;
- };
- var decodeSingleHexSequence = function (escSeq) {
- return String.fromCharCode(parseInt(escSeq.slice(1), 16));
- };
- var decodeHexSequences = function (value) {
- return value.replace(/\\[0-9a-f]+/gi, decodeSingleHexSequence);
- };
- var processUrl = function (match, url, url2, url3, str, str2) {
- str = str || str2;
- if (str) {
- str = decode(str);
- return '\'' + str.replace(/\'/g, '\\\'') + '\'';
- }
- url = decode(url || url2 || url3);
- if (!settings.allow_script_urls) {
- var scriptUrl = url.replace(/[\s\r\n]+/g, '');
- if (/(java|vb)script:/i.test(scriptUrl)) {
- return '';
- }
- if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
- return '';
- }
- }
- if (urlConverter) {
- url = urlConverter.call(urlConverterScope, url, 'style');
- }
- return 'url(\'' + url.replace(/\'/g, '\\\'') + '\')';
- };
- if (css) {
- css = css.replace(/[\u0000-\u001F]/g, '');
- css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function (str) {
- return str.replace(/[;:]/g, encode);
- });
- while (matches = styleRegExp.exec(css)) {
- styleRegExp.lastIndex = matches.index + matches[0].length;
- name = matches[1].replace(trimRightRegExp, '').toLowerCase();
- value = matches[2].replace(trimRightRegExp, '');
- if (name && value) {
- name = decodeHexSequences(name);
- value = decodeHexSequences(value);
- if (name.indexOf(invisibleChar) !== -1 || name.indexOf('"') !== -1) {
- continue;
- }
- if (!settings.allow_script_urls && (name === 'behavior' || /expression\s*\(|\/\*|\*\//.test(value))) {
- continue;
- }
- if (name === 'font-weight' && value === '700') {
- value = 'bold';
- } else if (name === 'color' || name === 'background-color') {
- value = value.toLowerCase();
- }
- value = value.replace(rgbRegExp, toHex);
- value = value.replace(urlOrStrRegExp, processUrl);
- styles[name] = isEncoded ? decode(value, true) : value;
- }
- }
- compress('border', '', true);
- compress('border', '-width');
- compress('border', '-color');
- compress('border', '-style');
- compress('padding', '');
- compress('margin', '');
- compress2('border', 'border-width', 'border-style', 'border-color');
- if (styles.border === 'medium none') {
- delete styles.border;
- }
- if (styles['border-image'] === 'none') {
- delete styles['border-image'];
- }
- }
- return styles;
- },
- serialize: function (styles, elementName) {
- var css = '';
- var serializeStyles = function (name) {
- var value;
- var styleList = validStyles[name];
- if (styleList) {
- for (var i_1 = 0, l = styleList.length; i_1 < l; i_1++) {
- name = styleList[i_1];
- value = styles[name];
- if (value) {
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
- }
- }
- }
- };
- var isValid = function (name, elementName) {
- var styleMap = invalidStyles['*'];
- if (styleMap && styleMap[name]) {
- return false;
- }
- styleMap = invalidStyles[elementName];
- return !(styleMap && styleMap[name]);
- };
- if (elementName && validStyles) {
- serializeStyles('*');
- serializeStyles(elementName);
- } else {
- each$j(styles, function (value, name) {
- if (value && (!invalidStyles || isValid(name, elementName))) {
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
- }
- });
- }
- return css;
- }
- };
- };
- var deprecated = {
- keyLocation: true,
- layerX: true,
- layerY: true,
- returnValue: true,
- webkitMovementX: true,
- webkitMovementY: true,
- keyIdentifier: true,
- mozPressure: true
- };
- var isNativeEvent = function (event) {
- return event instanceof Event || isFunction(event.initEvent);
- };
- var hasIsDefaultPrevented = function (event) {
- return event.isDefaultPrevented === always || event.isDefaultPrevented === never;
- };
- var needsNormalizing = function (event) {
- return isNullable(event.preventDefault) || isNativeEvent(event);
- };
- var clone$2 = function (originalEvent, data) {
- var event = data !== null && data !== void 0 ? data : {};
- for (var name_1 in originalEvent) {
- if (!has$2(deprecated, name_1)) {
- event[name_1] = originalEvent[name_1];
- }
- }
- if (isNonNullable(event.composedPath)) {
- event.composedPath = function () {
- return originalEvent.composedPath();
- };
- }
- return event;
- };
- var normalize$3 = function (type, originalEvent, fallbackTarget, data) {
- var _a;
- var event = clone$2(originalEvent, data);
- event.type = type;
- if (isNullable(event.target)) {
- event.target = (_a = event.srcElement) !== null && _a !== void 0 ? _a : fallbackTarget;
- }
- if (needsNormalizing(originalEvent)) {
- event.preventDefault = function () {
- event.defaultPrevented = true;
- event.isDefaultPrevented = always;
- if (isFunction(originalEvent.preventDefault)) {
- originalEvent.preventDefault();
- } else if (isNativeEvent(originalEvent)) {
- originalEvent.returnValue = false;
- }
- };
- event.stopPropagation = function () {
- event.cancelBubble = true;
- event.isPropagationStopped = always;
- if (isFunction(originalEvent.stopPropagation)) {
- originalEvent.stopPropagation();
- } else if (isNativeEvent(originalEvent)) {
- originalEvent.cancelBubble = true;
- }
- };
- event.stopImmediatePropagation = function () {
- event.isImmediatePropagationStopped = always;
- event.stopPropagation();
- };
- if (!hasIsDefaultPrevented(event)) {
- event.isDefaultPrevented = event.defaultPrevented === true ? always : never;
- event.isPropagationStopped = event.cancelBubble === true ? always : never;
- event.isImmediatePropagationStopped = never;
- }
- }
- return event;
- };
- var eventExpandoPrefix = 'mce-data-';
- var mouseEventRe = /^(?:mouse|contextmenu)|click/;
- var addEvent = function (target, name, callback, capture) {
- if (target.addEventListener) {
- target.addEventListener(name, callback, capture || false);
- } else if (target.attachEvent) {
- target.attachEvent('on' + name, callback);
- }
- };
- var removeEvent = function (target, name, callback, capture) {
- if (target.removeEventListener) {
- target.removeEventListener(name, callback, capture || false);
- } else if (target.detachEvent) {
- target.detachEvent('on' + name, callback);
- }
- };
- var isMouseEvent = function (event) {
- return isNonNullable(event) && mouseEventRe.test(event.type);
- };
- var fix = function (originalEvent, data) {
- var event = normalize$3(originalEvent.type, originalEvent, document, data);
- if (isMouseEvent(originalEvent) && isUndefined(originalEvent.pageX) && !isUndefined(originalEvent.clientX)) {
- var eventDoc = event.target.ownerDocument || document;
- var doc = eventDoc.documentElement;
- var body = eventDoc.body;
- var mouseEvent = event;
- mouseEvent.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
- mouseEvent.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
- }
- if (isUndefined(event.metaKey)) {
- event.metaKey = false;
- }
- return event;
- };
- var bindOnReady = function (win, callback, eventUtils) {
- var doc = win.document, event = { type: 'ready' };
- if (eventUtils.domLoaded) {
- callback(event);
- return;
- }
- var isDocReady = function () {
- return doc.readyState === 'complete' || doc.readyState === 'interactive' && doc.body;
- };
- var readyHandler = function () {
- removeEvent(win, 'DOMContentLoaded', readyHandler);
- removeEvent(win, 'load', readyHandler);
- if (!eventUtils.domLoaded) {
- eventUtils.domLoaded = true;
- callback(event);
- }
- win = null;
- };
- if (isDocReady()) {
- readyHandler();
- } else {
- addEvent(win, 'DOMContentLoaded', readyHandler);
- }
- if (!eventUtils.domLoaded) {
- addEvent(win, 'load', readyHandler);
- }
- };
- var EventUtils = function () {
- function EventUtils() {
- this.domLoaded = false;
- this.events = {};
- this.count = 1;
- this.expando = eventExpandoPrefix + (+new Date()).toString(32);
- this.hasMouseEnterLeave = 'onmouseenter' in document.documentElement;
- this.hasFocusIn = 'onfocusin' in document.documentElement;
- this.count = 1;
- }
- EventUtils.prototype.bind = function (target, names, callback, scope) {
- var self = this;
- var id, callbackList, i, name, fakeName, nativeHandler, capture;
- var win = window;
- var defaultNativeHandler = function (evt) {
- self.executeHandlers(fix(evt || win.event), id);
- };
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return;
- }
- if (!target[self.expando]) {
- id = self.count++;
- target[self.expando] = id;
- self.events[id] = {};
- } else {
- id = target[self.expando];
- }
- scope = scope || target;
- var namesList = names.split(' ');
- i = namesList.length;
- while (i--) {
- name = namesList[i];
- nativeHandler = defaultNativeHandler;
- fakeName = capture = false;
- if (name === 'DOMContentLoaded') {
- name = 'ready';
- }
- if (self.domLoaded && name === 'ready' && target.readyState === 'complete') {
- callback.call(scope, fix({ type: name }));
- continue;
- }
- if (!self.hasMouseEnterLeave) {
- fakeName = self.mouseEnterLeave[name];
- if (fakeName) {
- nativeHandler = function (evt) {
- var current = evt.currentTarget;
- var related = evt.relatedTarget;
- if (related && current.contains) {
- related = current.contains(related);
- } else {
- while (related && related !== current) {
- related = related.parentNode;
- }
- }
- if (!related) {
- evt = fix(evt || win.event);
- evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
- evt.target = current;
- self.executeHandlers(evt, id);
- }
- };
- }
- }
- if (!self.hasFocusIn && (name === 'focusin' || name === 'focusout')) {
- capture = true;
- fakeName = name === 'focusin' ? 'focus' : 'blur';
- nativeHandler = function (evt) {
- evt = fix(evt || win.event);
- evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
- self.executeHandlers(evt, id);
- };
- }
- callbackList = self.events[id][name];
- if (!callbackList) {
- self.events[id][name] = callbackList = [{
- func: callback,
- scope: scope
- }];
- callbackList.fakeName = fakeName;
- callbackList.capture = capture;
- callbackList.nativeHandler = nativeHandler;
- if (name === 'ready') {
- bindOnReady(target, nativeHandler, self);
- } else {
- addEvent(target, fakeName || name, nativeHandler, capture);
- }
- } else {
- if (name === 'ready' && self.domLoaded) {
- callback(fix({ type: name }));
- } else {
- callbackList.push({
- func: callback,
- scope: scope
- });
- }
- }
- }
- target = callbackList = null;
- return callback;
- };
- EventUtils.prototype.unbind = function (target, names, callback) {
- var callbackList, i, ci, name, eventMap;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return this;
- }
- var id = target[this.expando];
- if (id) {
- eventMap = this.events[id];
- if (names) {
- var namesList = names.split(' ');
- i = namesList.length;
- while (i--) {
- name = namesList[i];
- callbackList = eventMap[name];
- if (callbackList) {
- if (callback) {
- ci = callbackList.length;
- while (ci--) {
- if (callbackList[ci].func === callback) {
- var nativeHandler = callbackList.nativeHandler;
- var fakeName = callbackList.fakeName, capture = callbackList.capture;
- callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
- callbackList.nativeHandler = nativeHandler;
- callbackList.fakeName = fakeName;
- callbackList.capture = capture;
- eventMap[name] = callbackList;
- }
- }
- }
- if (!callback || callbackList.length === 0) {
- delete eventMap[name];
- removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
- }
- }
- }
- } else {
- each$j(eventMap, function (callbackList, name) {
- removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
- });
- eventMap = {};
- }
- for (name in eventMap) {
- if (has$2(eventMap, name)) {
- return this;
- }
- }
- delete this.events[id];
- try {
- delete target[this.expando];
- } catch (ex) {
- target[this.expando] = null;
- }
- }
- return this;
- };
- EventUtils.prototype.fire = function (target, name, args) {
- var id;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return this;
- }
- var event = fix({
- type: name,
- target: target
- }, args);
- do {
- id = target[this.expando];
- if (id) {
- this.executeHandlers(event, id);
- }
- target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
- } while (target && !event.isPropagationStopped());
- return this;
- };
- EventUtils.prototype.clean = function (target) {
- var i, children;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return this;
- }
- if (target[this.expando]) {
- this.unbind(target);
- }
- if (!target.getElementsByTagName) {
- target = target.document;
- }
- if (target && target.getElementsByTagName) {
- this.unbind(target);
- children = target.getElementsByTagName('*');
- i = children.length;
- while (i--) {
- target = children[i];
- if (target[this.expando]) {
- this.unbind(target);
- }
- }
- }
- return this;
- };
- EventUtils.prototype.destroy = function () {
- this.events = {};
- };
- EventUtils.prototype.cancel = function (e) {
- if (e) {
- e.preventDefault();
- e.stopImmediatePropagation();
- }
- return false;
- };
- EventUtils.prototype.executeHandlers = function (evt, id) {
- var container = this.events[id];
- var callbackList = container && container[evt.type];
- if (callbackList) {
- for (var i = 0, l = callbackList.length; i < l; i++) {
- var callback = callbackList[i];
- if (callback && callback.func.call(callback.scope, evt) === false) {
- evt.preventDefault();
- }
- if (evt.isImmediatePropagationStopped()) {
- return;
- }
- }
- }
- };
- EventUtils.Event = new EventUtils();
- return EventUtils;
- }();
- var support, Expr, getText, isXML, tokenize, compile, select$1, outermostContext, sortInput, hasDuplicate, setDocument, document$1, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = 'sizzle' + -new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- }
- return 0;
- }, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push$1 = arr.push, slice$1 = arr.slice, indexOf = arr.indexOf || function (elem) {
- var i = 0, len = this.length;
- for (; i < len; i++) {
- if (this[i] === elem) {
- return i;
- }
- }
- return -1;
- }, booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', whitespace = '[\\x20\\t\\r\\n\\f]', identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+', attributes = '\\[' + whitespace + '*(' + identifier + ')(?:' + whitespace + '*([*^$|!~]?=)' + whitespace + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + identifier + '))|)' + whitespace + '*\\]', pseudos = ':(' + identifier + ')(?:\\((' + '(\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|' + '((?:\\\\.|[^\\\\()[\\]]|' + attributes + ')*)|' + '.*' + ')\\)|)', rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g'), rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*'), rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*'), rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g'), rpseudo = new RegExp(pseudos), ridentifier = new RegExp('^' + identifier + '$'), matchExpr = {
- ID: new RegExp('^#(' + identifier + ')'),
- CLASS: new RegExp('^\\.(' + identifier + ')'),
- TAG: new RegExp('^(' + identifier + '|[*])'),
- ATTR: new RegExp('^' + attributes),
- PSEUDO: new RegExp('^' + pseudos),
- CHILD: new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + whitespace + '*(even|odd|(([+-]|)(\\d*)n|)' + whitespace + '*(?:([+-]|)' + whitespace + '*(\\d+)|))' + whitespace + '*\\)|)', 'i'),
- bool: new RegExp('^(?:' + booleans + ')$', 'i'),
- needsContext: new RegExp('^' + whitespace + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + whitespace + '*((?:-\\d)?\\d*)' + whitespace + '*\\)|)(?=[^-]|$)', 'i')
- }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr$1 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'), funescape = function (_, escaped, escapedWhitespace) {
- var high = '0x' + escaped - 65536;
- return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
- };
- try {
- push$1.apply(arr = slice$1.call(preferredDoc.childNodes), preferredDoc.childNodes);
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (e) {
- push$1 = {
- apply: arr.length ? function (target, els) {
- push_native.apply(target, slice$1.call(els));
- } : function (target, els) {
- var j = target.length, i = 0;
- while (target[j++] = els[i++]) {
- }
- target.length = j - 1;
- }
- };
- }
- var Sizzle = function (selector, context, results, seed) {
- var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
- if ((context ? context.ownerDocument || context : preferredDoc) !== document$1) {
- setDocument(context);
- }
- context = context || document$1;
- results = results || [];
- if (!selector || typeof selector !== 'string') {
- return results;
- }
- if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
- return [];
- }
- if (documentIsHTML && !seed) {
- if (match = rquickExpr$1.exec(selector)) {
- if (m = match[1]) {
- if (nodeType === 9) {
- elem = context.getElementById(m);
- if (elem && elem.parentNode) {
- if (elem.id === m) {
- results.push(elem);
- return results;
- }
- } else {
- return results;
- }
- } else {
- if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) {
- results.push(elem);
- return results;
- }
- }
- } else if (match[2]) {
- push$1.apply(results, context.getElementsByTagName(selector));
- return results;
- } else if ((m = match[3]) && support.getElementsByClassName) {
- push$1.apply(results, context.getElementsByClassName(m));
- return results;
- }
- }
- if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- nid = old = expando;
- newContext = context;
- newSelector = nodeType === 9 && selector;
- if (nodeType === 1 && context.nodeName.toLowerCase() !== 'object') {
- groups = tokenize(selector);
- if (old = context.getAttribute('id')) {
- nid = old.replace(rescape, '\\$&');
- } else {
- context.setAttribute('id', nid);
- }
- nid = '[id=\'' + nid + '\'] ';
- i = groups.length;
- while (i--) {
- groups[i] = nid + toSelector(groups[i]);
- }
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- newSelector = groups.join(',');
- }
- if (newSelector) {
- try {
- push$1.apply(results, newContext.querySelectorAll(newSelector));
- return results;
- } catch (qsaError) {
- } finally {
- if (!old) {
- context.removeAttribute('id');
- }
- }
- }
- }
- }
- return select$1(selector.replace(rtrim, '$1'), context, results, seed);
- };
- function createCache() {
- var keys = [];
- function cache(key, value) {
- if (keys.push(key + ' ') > Expr.cacheLength) {
- delete cache[keys.shift()];
- }
- return cache[key + ' '] = value;
- }
- return cache;
- }
- function markFunction(fn) {
- fn[expando] = true;
- return fn;
- }
- function siblingCheck(a, b) {
- var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
- if (diff) {
- return diff;
- }
- if (cur) {
- while (cur = cur.nextSibling) {
- if (cur === b) {
- return -1;
- }
- }
- }
- return a ? 1 : -1;
- }
- function createInputPseudo(type) {
- return function (elem) {
- var name = elem.nodeName.toLowerCase();
- return name === 'input' && elem.type === type;
- };
- }
- function createButtonPseudo(type) {
- return function (elem) {
- var name = elem.nodeName.toLowerCase();
- return (name === 'input' || name === 'button') && elem.type === type;
- };
- }
- function createPositionalPseudo(fn) {
- return markFunction(function (argument) {
- argument = +argument;
- return markFunction(function (seed, matches) {
- var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
- while (i--) {
- if (seed[j = matchIndexes[i]]) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
- }
- function testContext(context) {
- return context && typeof context.getElementsByTagName !== strundefined && context;
- }
- support = Sizzle.support = {};
- isXML = Sizzle.isXML = function (elem) {
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== 'HTML' : false;
- };
- setDocument = Sizzle.setDocument = function (node) {
- var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView;
- function getTop(win) {
- try {
- return win.top;
- } catch (ex) {
- }
- return null;
- }
- if (doc === document$1 || doc.nodeType !== 9 || !doc.documentElement) {
- return document$1;
- }
- document$1 = doc;
- docElem = doc.documentElement;
- documentIsHTML = !isXML(doc);
- if (parent && parent !== getTop(parent)) {
- if (parent.addEventListener) {
- parent.addEventListener('unload', function () {
- setDocument();
- }, false);
- } else if (parent.attachEvent) {
- parent.attachEvent('onunload', function () {
- setDocument();
- });
- }
- }
- support.attributes = true;
- support.getElementsByTagName = true;
- support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
- support.getById = true;
- Expr.find.ID = function (id, context) {
- if (typeof context.getElementById !== strundefined && documentIsHTML) {
- var m = context.getElementById(id);
- return m && m.parentNode ? [m] : [];
- }
- };
- Expr.filter.ID = function (id) {
- var attrId = id.replace(runescape, funescape);
- return function (elem) {
- return elem.getAttribute('id') === attrId;
- };
- };
- Expr.find.TAG = support.getElementsByTagName ? function (tag, context) {
- if (typeof context.getElementsByTagName !== strundefined) {
- return context.getElementsByTagName(tag);
- }
- } : function (tag, context) {
- var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag);
- if (tag === '*') {
- while (elem = results[i++]) {
- if (elem.nodeType === 1) {
- tmp.push(elem);
- }
- }
- return tmp;
- }
- return results;
- };
- Expr.find.CLASS = support.getElementsByClassName && function (className, context) {
- if (documentIsHTML) {
- return context.getElementsByClassName(className);
- }
- };
- rbuggyMatches = [];
- rbuggyQSA = [];
- support.disconnectedMatch = true;
- rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join('|'));
- rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join('|'));
- hasCompare = rnative.test(docElem.compareDocumentPosition);
- contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) {
- var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
- return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
- } : function (a, b) {
- if (b) {
- while (b = b.parentNode) {
- if (b === a) {
- return true;
- }
- }
- }
- return false;
- };
- sortOrder = hasCompare ? function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if (compare) {
- return compare;
- }
- compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
- if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
- if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
- return -1;
- }
- if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
- return 1;
- }
- return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
- }
- return compare & 4 ? -1 : 1;
- } : function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
- if (!aup || !bup) {
- return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
- } else if (aup === bup) {
- return siblingCheck(a, b);
- }
- cur = a;
- while (cur = cur.parentNode) {
- ap.unshift(cur);
- }
- cur = b;
- while (cur = cur.parentNode) {
- bp.unshift(cur);
- }
- while (ap[i] === bp[i]) {
- i++;
- }
- return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
- };
- return doc;
- };
- Sizzle.matches = function (expr, elements) {
- return Sizzle(expr, null, null, elements);
- };
- Sizzle.matchesSelector = function (elem, expr) {
- if ((elem.ownerDocument || elem) !== document$1) {
- setDocument(elem);
- }
- expr = expr.replace(rattributeQuotes, '=\'$1\']');
- if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
- return ret;
- }
- } catch (e) {
- }
- }
- return Sizzle(expr, document$1, null, [elem]).length > 0;
- };
- Sizzle.contains = function (context, elem) {
- if ((context.ownerDocument || context) !== document$1) {
- setDocument(context);
- }
- return contains(context, elem);
- };
- Sizzle.attr = function (elem, name) {
- if ((elem.ownerDocument || elem) !== document$1) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;
- return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
- };
- Sizzle.error = function (msg) {
- throw new Error('Syntax error, unrecognized expression: ' + msg);
- };
- Sizzle.uniqueSort = function (results) {
- var elem, duplicates = [], j = 0, i = 0;
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice(0);
- results.sort(sortOrder);
- if (hasDuplicate) {
- while (elem = results[i++]) {
- if (elem === results[i]) {
- j = duplicates.push(i);
- }
- }
- while (j--) {
- results.splice(duplicates[j], 1);
- }
- }
- sortInput = null;
- return results;
- };
- getText = Sizzle.getText = function (elem) {
- var node, ret = '', i = 0, nodeType = elem.nodeType;
- if (!nodeType) {
- while (node = elem[i++]) {
- ret += getText(node);
- }
- } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
- if (typeof elem.textContent === 'string') {
- return elem.textContent;
- } else {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- ret += getText(elem);
- }
- }
- } else if (nodeType === 3 || nodeType === 4) {
- return elem.nodeValue;
- }
- return ret;
- };
- Expr = Sizzle.selectors = {
- cacheLength: 50,
- createPseudo: markFunction,
- match: matchExpr,
- attrHandle: {},
- find: {},
- relative: {
- '>': {
- dir: 'parentNode',
- first: true
- },
- ' ': { dir: 'parentNode' },
- '+': {
- dir: 'previousSibling',
- first: true
- },
- '~': { dir: 'previousSibling' }
- },
- preFilter: {
- ATTR: function (match) {
- match[1] = match[1].replace(runescape, funescape);
- match[3] = (match[3] || match[4] || match[5] || '').replace(runescape, funescape);
- if (match[2] === '~=') {
- match[3] = ' ' + match[3] + ' ';
- }
- return match.slice(0, 4);
- },
- CHILD: function (match) {
- match[1] = match[1].toLowerCase();
- if (match[1].slice(0, 3) === 'nth') {
- if (!match[3]) {
- Sizzle.error(match[0]);
- }
- match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === 'even' || match[3] === 'odd'));
- match[5] = +(match[7] + match[8] || match[3] === 'odd');
- } else if (match[3]) {
- Sizzle.error(match[0]);
- }
- return match;
- },
- PSEUDO: function (match) {
- var excess, unquoted = !match[6] && match[2];
- if (matchExpr.CHILD.test(match[0])) {
- return null;
- }
- if (match[3]) {
- match[2] = match[4] || match[5] || '';
- } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(')', unquoted.length - excess) - unquoted.length)) {
- match[0] = match[0].slice(0, excess);
- match[2] = unquoted.slice(0, excess);
- }
- return match.slice(0, 3);
- }
- },
- filter: {
- TAG: function (nodeNameSelector) {
- var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return nodeNameSelector === '*' ? function () {
- return true;
- } : function (elem) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
- CLASS: function (className) {
- var pattern = classCache[className + ' '];
- return pattern || (pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && classCache(className, function (elem) {
- return pattern.test(typeof elem.className === 'string' && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute('class') || '');
- });
- },
- ATTR: function (name, operator, check) {
- return function (elem) {
- var result = Sizzle.attr(elem, name);
- if (result == null) {
- return operator === '!=';
- }
- if (!operator) {
- return true;
- }
- result += '';
- return operator === '=' ? result === check : operator === '!=' ? result !== check : operator === '^=' ? check && result.indexOf(check) === 0 : operator === '*=' ? check && result.indexOf(check) > -1 : operator === '$=' ? check && result.slice(-check.length) === check : operator === '~=' ? (' ' + result + ' ').indexOf(check) > -1 : operator === '|=' ? result === check || result.slice(0, check.length + 1) === check + '-' : false;
- };
- },
- CHILD: function (type, what, argument, first, last) {
- var simple = type.slice(0, 3) !== 'nth', forward = type.slice(-4) !== 'last', ofType = what === 'of-type';
- return first === 1 && last === 0 ? function (elem) {
- return !!elem.parentNode;
- } : function (elem, context, xml) {
- var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? 'nextSibling' : 'previousSibling', parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType;
- if (parent) {
- if (simple) {
- while (dir) {
- node = elem;
- while (node = node[dir]) {
- if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
- return false;
- }
- }
- start = dir = type === 'only' && !start && 'nextSibling';
- }
- return true;
- }
- start = [forward ? parent.firstChild : parent.lastChild];
- if (forward && useCache) {
- outerCache = parent[expando] || (parent[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent.childNodes[nodeIndex];
- while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
- if (node.nodeType === 1 && ++diff && node === elem) {
- outerCache[type] = [
- dirruns,
- nodeIndex,
- diff
- ];
- break;
- }
- }
- } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
- diff = cache[1];
- } else {
- while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
- if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
- if (useCache) {
- (node[expando] || (node[expando] = {}))[type] = [
- dirruns,
- diff
- ];
- }
- if (node === elem) {
- break;
- }
- }
- }
- }
- diff -= last;
- return diff === first || diff % first === 0 && diff / first >= 0;
- }
- };
- },
- PSEUDO: function (pseudo, argument) {
- var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error('unsupported pseudo: ' + pseudo);
- if (fn[expando]) {
- return fn(argument);
- }
- if (fn.length > 1) {
- args = [
- pseudo,
- pseudo,
- '',
- argument
- ];
- return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
- var idx, matched = fn(seed, argument), i = matched.length;
- while (i--) {
- idx = indexOf.call(seed, matched[i]);
- seed[idx] = !(matches[idx] = matched[i]);
- }
- }) : function (elem) {
- return fn(elem, 0, args);
- };
- }
- return fn;
- }
- },
- pseudos: {
- not: markFunction(function (selector) {
- var input = [], results = [], matcher = compile(selector.replace(rtrim, '$1'));
- return matcher[expando] ? markFunction(function (seed, matches, context, xml) {
- var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
- while (i--) {
- if (elem = unmatched[i]) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) : function (elem, context, xml) {
- input[0] = elem;
- matcher(input, null, xml, results);
- input[0] = null;
- return !results.pop();
- };
- }),
- has: markFunction(function (selector) {
- return function (elem) {
- return Sizzle(selector, elem).length > 0;
- };
- }),
- contains: markFunction(function (text) {
- text = text.replace(runescape, funescape);
- return function (elem) {
- return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
- };
- }),
- lang: markFunction(function (lang) {
- if (!ridentifier.test(lang || '')) {
- Sizzle.error('unsupported lang: ' + lang);
- }
- lang = lang.replace(runescape, funescape).toLowerCase();
- return function (elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute('xml:lang') || elem.getAttribute('lang')) {
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf(lang + '-') === 0;
- }
- } while ((elem = elem.parentNode) && elem.nodeType === 1);
- return false;
- };
- }),
- target: function (elem) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice(1) === elem.id;
- },
- root: function (elem) {
- return elem === docElem;
- },
- focus: function (elem) {
- return elem === document$1.activeElement && (!document$1.hasFocus || document$1.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
- enabled: function (elem) {
- return elem.disabled === false;
- },
- disabled: function (elem) {
- return elem.disabled === true;
- },
- checked: function (elem) {
- var nodeName = elem.nodeName.toLowerCase();
- return nodeName === 'input' && !!elem.checked || nodeName === 'option' && !!elem.selected;
- },
- selected: function (elem) {
- if (elem.parentNode) {
- elem.parentNode.selectedIndex;
- }
- return elem.selected === true;
- },
- empty: function (elem) {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
- return false;
- }
- }
- return true;
- },
- parent: function (elem) {
- return !Expr.pseudos.empty(elem);
- },
- header: function (elem) {
- return rheader.test(elem.nodeName);
- },
- input: function (elem) {
- return rinputs.test(elem.nodeName);
- },
- button: function (elem) {
- var name = elem.nodeName.toLowerCase();
- return name === 'input' && elem.type === 'button' || name === 'button';
- },
- text: function (elem) {
- var attr;
- return elem.nodeName.toLowerCase() === 'input' && elem.type === 'text' && ((attr = elem.getAttribute('type')) == null || attr.toLowerCase() === 'text');
- },
- first: createPositionalPseudo(function () {
- return [0];
- }),
- last: createPositionalPseudo(function (matchIndexes, length) {
- return [length - 1];
- }),
- eq: createPositionalPseudo(function (matchIndexes, length, argument) {
- return [argument < 0 ? argument + length : argument];
- }),
- even: createPositionalPseudo(function (matchIndexes, length) {
- var i = 0;
- for (; i < length; i += 2) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- odd: createPositionalPseudo(function (matchIndexes, length) {
- var i = 1;
- for (; i < length; i += 2) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- lt: createPositionalPseudo(function (matchIndexes, length, argument) {
- var i = argument < 0 ? argument + length : argument;
- for (; --i >= 0;) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- gt: createPositionalPseudo(function (matchIndexes, length, argument) {
- var i = argument < 0 ? argument + length : argument;
- for (; ++i < length;) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- })
- }
- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- each$k([
- 'radio',
- 'checkbox',
- 'file',
- 'password',
- 'image'
- ], function (i) {
- Expr.pseudos[i] = createInputPseudo(i);
- });
- each$k([
- 'submit',
- 'reset'
- ], function (i) {
- Expr.pseudos[i] = createButtonPseudo(i);
- });
- function setFilters() {
- }
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
- tokenize = Sizzle.tokenize = function (selector, parseOnly) {
- var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + ' '];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
- }
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
- while (soFar) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
- }
- groups.push(tokens = []);
- }
- matched = false;
- if (match = rcombinators.exec(soFar)) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: match[0].replace(rtrim, ' ')
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if (!Expr.filter.hasOwnProperty(type)) {
- continue;
- }
- if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice(matched.length);
- }
- }
- if (!matched) {
- break;
- }
- }
- return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0);
- };
- function toSelector(tokens) {
- var i = 0, len = tokens.length, selector = '';
- for (; i < len; i++) {
- selector += tokens[i].value;
- }
- return selector;
- }
- function addCombinator(matcher, combinator, base) {
- var dir = combinator.dir, checkNonElements = base && dir === 'parentNode', doneName = done++;
- return combinator.first ? function (elem, context, xml) {
- while (elem = elem[dir]) {
- if (elem.nodeType === 1 || checkNonElements) {
- return matcher(elem, context, xml);
- }
- }
- } : function (elem, context, xml) {
- var oldCache, outerCache, newCache = [
- dirruns,
- doneName
- ];
- if (xml) {
- while (elem = elem[dir]) {
- if (elem.nodeType === 1 || checkNonElements) {
- if (matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- } else {
- while (elem = elem[dir]) {
- if (elem.nodeType === 1 || checkNonElements) {
- outerCache = elem[expando] || (elem[expando] = {});
- if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
- return newCache[2] = oldCache[2];
- } else {
- outerCache[dir] = newCache;
- if (newCache[2] = matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- }
- }
- };
- }
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function (elem, context, xml) {
- var i = matchers.length;
- while (i--) {
- if (!matchers[i](elem, context, xml)) {
- return false;
- }
- }
- return true;
- } : matchers[0];
- }
- function multipleContexts(selector, contexts, results) {
- var i = 0, len = contexts.length;
- for (; i < len; i++) {
- Sizzle(selector, contexts[i], results);
- }
- return results;
- }
- function condense(unmatched, map, filter, context, xml) {
- var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
- for (; i < len; i++) {
- if (elem = unmatched[i]) {
- if (!filter || filter(elem, context, xml)) {
- newUnmatched.push(elem);
- if (mapped) {
- map.push(i);
- }
- }
- }
- }
- return newUnmatched;
- }
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- if (postFilter && !postFilter[expando]) {
- postFilter = setMatcher(postFilter);
- }
- if (postFinder && !postFinder[expando]) {
- postFinder = setMatcher(postFinder, postSelector);
- }
- return markFunction(function (seed, results, context, xml) {
- var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || '*', context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
- if (matcher) {
- matcher(matcherIn, matcherOut, context, xml);
- }
- if (postFilter) {
- temp = condense(matcherOut, postMap);
- postFilter(temp, [], context, xml);
- i = temp.length;
- while (i--) {
- if (elem = temp[i]) {
- matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
- }
- }
- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- temp = [];
- i = matcherOut.length;
- while (i--) {
- if (elem = matcherOut[i]) {
- temp.push(matcherIn[i] = elem);
- }
- }
- postFinder(null, matcherOut = [], temp, xml);
- }
- i = matcherOut.length;
- while (i--) {
- if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
- } else {
- matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
- } else {
- push$1.apply(results, matcherOut);
- }
- }
- });
- }
- function matcherFromTokens(tokens) {
- var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[' '], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) {
- return elem === checkContext;
- }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) {
- return indexOf.call(checkContext, elem) > -1;
- }, implicitRelative, true), matchers = [function (elem, context, xml) {
- var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- checkContext = null;
- return ret;
- }];
- for (; i < len; i++) {
- if (matcher = Expr.relative[tokens[i].type]) {
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
- if (matcher[expando]) {
- j = ++i;
- for (; j < len; j++) {
- if (Expr.relative[tokens[j].type]) {
- break;
- }
- }
- return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === ' ' ? '*' : '' })).replace(rtrim, '$1'), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
- }
- matchers.push(matcher);
- }
- }
- return elementMatcher(matchers);
- }
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) {
- var elem, j, matcher, matchedCount = 0, i = '0', unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG('*', outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
- if (outermost) {
- outermostContext = context !== document$1 && context;
- }
- for (; i !== len && (elem = elems[i]) != null; i++) {
- if (byElement && elem) {
- j = 0;
- while (matcher = elementMatchers[j++]) {
- if (matcher(elem, context, xml)) {
- results.push(elem);
- break;
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- }
- }
- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
- }
- if (seed) {
- unmatched.push(elem);
- }
- }
- }
- matchedCount += i;
- if (bySet && i !== matchedCount) {
- j = 0;
- while (matcher = setMatchers[j++]) {
- matcher(unmatched, setMatched, context, xml);
- }
- if (seed) {
- if (matchedCount > 0) {
- while (i--) {
- if (!(unmatched[i] || setMatched[i])) {
- setMatched[i] = pop.call(results);
- }
- }
- }
- setMatched = condense(setMatched);
- }
- push$1.apply(results, setMatched);
- if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
- Sizzle.uniqueSort(results);
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
- return unmatched;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- compile = Sizzle.compile = function (selector, match) {
- var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + ' '];
- if (!cached) {
- if (!match) {
- match = tokenize(selector);
- }
- i = match.length;
- while (i--) {
- cached = matcherFromTokens(match[i]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
- }
- }
- cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
- cached.selector = selector;
- }
- return cached;
- };
- select$1 = Sizzle.select = function (selector, context, results, seed) {
- var i, tokens, token, type, find, compiled = typeof selector === 'function' && selector, match = !seed && tokenize(selector = compiled.selector || selector);
- results = results || [];
- if (match.length === 1) {
- tokens = match[0] = match[0].slice(0);
- if (tokens.length > 2 && (token = tokens[0]).type === 'ID' && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
- context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];
- if (!context) {
- return results;
- } else if (compiled) {
- context = context.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- while (i--) {
- token = tokens[i];
- if (Expr.relative[type = token.type]) {
- break;
- }
- if (find = Expr.find[type]) {
- if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
- tokens.splice(i, 1);
- selector = seed.length && toSelector(tokens);
- if (!selector) {
- push$1.apply(results, seed);
- return results;
- }
- break;
- }
- }
- }
- }
- (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context);
- return results;
- };
- support.sortStable = expando.split('').sort(sortOrder).join('') === expando;
- support.detectDuplicates = !!hasDuplicate;
- setDocument();
- support.sortDetached = true;
- var doc = document;
- var push = Array.prototype.push;
- var slice = Array.prototype.slice;
- var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
- var Event$1 = EventUtils.Event;
- var skipUniques = Tools.makeMap('children,contents,next,prev');
- var isDefined = function (obj) {
- return typeof obj !== 'undefined';
- };
- var isString = function (obj) {
- return typeof obj === 'string';
- };
- var isWindow = function (obj) {
- return obj && obj === obj.window;
- };
- var createFragment$1 = function (html, fragDoc) {
- fragDoc = fragDoc || doc;
- var container = fragDoc.createElement('div');
- var frag = fragDoc.createDocumentFragment();
- container.innerHTML = html;
- var node;
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- return frag;
- };
- var domManipulate = function (targetNodes, sourceItem, callback, reverse) {
- var i;
- if (isString(sourceItem)) {
- sourceItem = createFragment$1(sourceItem, getElementDocument(targetNodes[0]));
- } else if (sourceItem.length && !sourceItem.nodeType) {
- sourceItem = DomQuery.makeArray(sourceItem);
- if (reverse) {
- for (i = sourceItem.length - 1; i >= 0; i--) {
- domManipulate(targetNodes, sourceItem[i], callback, reverse);
- }
- } else {
- for (i = 0; i < sourceItem.length; i++) {
- domManipulate(targetNodes, sourceItem[i], callback, reverse);
- }
- }
- return targetNodes;
- }
- if (sourceItem.nodeType) {
- i = targetNodes.length;
- while (i--) {
- callback.call(targetNodes[i], sourceItem);
- }
- }
- return targetNodes;
- };
- var hasClass = function (node, className) {
- return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
- };
- var wrap$2 = function (elements, wrapper, all) {
- var lastParent, newWrapper;
- wrapper = DomQuery(wrapper)[0];
- elements.each(function () {
- var self = this;
- if (!all || lastParent !== self.parentNode) {
- lastParent = self.parentNode;
- newWrapper = wrapper.cloneNode(false);
- self.parentNode.insertBefore(newWrapper, self);
- newWrapper.appendChild(self);
- } else {
- newWrapper.appendChild(self);
- }
- });
- return elements;
- };
- var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
- var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
- var propFix = {
- for: 'htmlFor',
- class: 'className',
- readonly: 'readOnly'
- };
- var cssFix = { float: 'cssFloat' };
- var attrHooks = {}, cssHooks = {};
- var DomQueryConstructor = function (selector, context) {
- return new DomQuery.fn.init(selector, context);
- };
- var inArray$1 = function (item, array) {
- var i;
- if (array.indexOf) {
- return array.indexOf(item);
- }
- i = array.length;
- while (i--) {
- if (array[i] === item) {
- return i;
- }
- }
- return -1;
- };
- var whiteSpaceRegExp = /^\s*|\s*$/g;
- var trim$1 = function (str) {
- return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, '');
- };
- var each$g = function (obj, callback) {
- var length, key, i, value;
- if (obj) {
- length = obj.length;
- if (length === undefined) {
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- value = obj[key];
- if (callback.call(value, key, value) === false) {
- break;
- }
- }
- }
- } else {
- for (i = 0; i < length; i++) {
- value = obj[i];
- if (callback.call(value, i, value) === false) {
- break;
- }
- }
- }
- }
- return obj;
- };
- var grep$2 = function (array, callback) {
- var out = [];
- each$g(array, function (i, item) {
- if (callback(item, i)) {
- out.push(item);
- }
- });
- return out;
- };
- var getElementDocument = function (element) {
- if (!element) {
- return doc;
- }
- if (element.nodeType === 9) {
- return element;
- }
- return element.ownerDocument;
- };
- DomQueryConstructor.fn = DomQueryConstructor.prototype = {
- constructor: DomQueryConstructor,
- selector: '',
- context: null,
- length: 0,
- init: function (selector, context) {
- var self = this;
- var match, node;
- if (!selector) {
- return self;
- }
- if (selector.nodeType) {
- self.context = self[0] = selector;
- self.length = 1;
- return self;
- }
- if (context && context.nodeType) {
- self.context = context;
- } else {
- if (context) {
- return DomQuery(selector).attr(context);
- }
- self.context = context = document;
- }
- if (isString(selector)) {
- self.selector = selector;
- if (selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) {
- match = [
- null,
- selector,
- null
- ];
- } else {
- match = rquickExpr.exec(selector);
- }
- if (match) {
- if (match[1]) {
- node = createFragment$1(selector, getElementDocument(context)).firstChild;
- while (node) {
- push.call(self, node);
- node = node.nextSibling;
- }
- } else {
- node = getElementDocument(context).getElementById(match[2]);
- if (!node) {
- return self;
- }
- if (node.id !== match[2]) {
- return self.find(selector);
- }
- self.length = 1;
- self[0] = node;
- }
- } else {
- return DomQuery(context).find(selector);
- }
- } else {
- this.add(selector, false);
- }
- return self;
- },
- toArray: function () {
- return Tools.toArray(this);
- },
- add: function (items, sort) {
- var self = this;
- var nodes, i;
- if (isString(items)) {
- return self.add(DomQuery(items));
- }
- if (sort !== false) {
- nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
- self.length = nodes.length;
- for (i = 0; i < nodes.length; i++) {
- self[i] = nodes[i];
- }
- } else {
- push.apply(self, DomQuery.makeArray(items));
- }
- return self;
- },
- attr: function (name, value) {
- var self = this;
- var hook;
- if (typeof name === 'object') {
- each$g(name, function (name, value) {
- self.attr(name, value);
- });
- } else if (isDefined(value)) {
- this.each(function () {
- var hook;
- if (this.nodeType === 1) {
- hook = attrHooks[name];
- if (hook && hook.set) {
- hook.set(this, value);
- return;
- }
- if (value === null) {
- this.removeAttribute(name, 2);
- } else {
- this.setAttribute(name, value, 2);
- }
- }
- });
- } else {
- if (self[0] && self[0].nodeType === 1) {
- hook = attrHooks[name];
- if (hook && hook.get) {
- return hook.get(self[0], name);
- }
- if (booleanMap[name]) {
- return self.prop(name) ? name : undefined;
- }
- value = self[0].getAttribute(name, 2);
- if (value === null) {
- value = undefined;
- }
- }
- return value;
- }
- return self;
- },
- removeAttr: function (name) {
- return this.attr(name, null);
- },
- prop: function (name, value) {
- var self = this;
- name = propFix[name] || name;
- if (typeof name === 'object') {
- each$g(name, function (name, value) {
- self.prop(name, value);
- });
- } else if (isDefined(value)) {
- this.each(function () {
- if (this.nodeType === 1) {
- this[name] = value;
- }
- });
- } else {
- if (self[0] && self[0].nodeType && name in self[0]) {
- return self[0][name];
- }
- return value;
- }
- return self;
- },
- css: function (name, value) {
- var self = this;
- var elm, hook;
- var camel = function (name) {
- return name.replace(/-(\D)/g, function (a, b) {
- return b.toUpperCase();
- });
- };
- var dashed = function (name) {
- return name.replace(/[A-Z]/g, function (a) {
- return '-' + a;
- });
- };
- if (typeof name === 'object') {
- each$g(name, function (name, value) {
- self.css(name, value);
- });
- } else {
- if (isDefined(value)) {
- name = camel(name);
- if (typeof value === 'number' && !numericCssMap[name]) {
- value = value.toString() + 'px';
- }
- self.each(function () {
- var style = this.style;
- hook = cssHooks[name];
- if (hook && hook.set) {
- hook.set(this, value);
- return;
- }
- try {
- this.style[cssFix[name] || name] = value;
- } catch (ex) {
- }
- if (value === null || value === '') {
- if (style.removeProperty) {
- style.removeProperty(dashed(name));
- } else {
- style.removeAttribute(name);
- }
- }
- });
- } else {
- elm = self[0];
- hook = cssHooks[name];
- if (hook && hook.get) {
- return hook.get(elm);
- }
- if (elm.ownerDocument.defaultView) {
- try {
- return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
- } catch (ex) {
- return undefined;
- }
- } else if (elm.currentStyle) {
- return elm.currentStyle[camel(name)];
- } else {
- return '';
- }
- }
- }
- return self;
- },
- remove: function () {
- var self = this;
- var node, i = this.length;
- while (i--) {
- node = self[i];
- Event$1.clean(node);
- if (node.parentNode) {
- node.parentNode.removeChild(node);
- }
- }
- return this;
- },
- empty: function () {
- var self = this;
- var node, i = this.length;
- while (i--) {
- node = self[i];
- while (node.firstChild) {
- node.removeChild(node.firstChild);
- }
- }
- return this;
- },
- html: function (value) {
- var self = this;
- var i;
- if (isDefined(value)) {
- i = self.length;
- try {
- while (i--) {
- self[i].innerHTML = value;
- }
- } catch (ex) {
- DomQuery(self[i]).empty().append(value);
- }
- return self;
- }
- return self[0] ? self[0].innerHTML : '';
- },
- text: function (value) {
- var self = this;
- var i;
- if (isDefined(value)) {
- i = self.length;
- while (i--) {
- if ('innerText' in self[i]) {
- self[i].innerText = value;
- } else {
- self[0].textContent = value;
- }
- }
- return self;
- }
- return self[0] ? self[0].innerText || self[0].textContent : '';
- },
- append: function () {
- return domManipulate(this, arguments, function (node) {
- if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
- this.appendChild(node);
- }
- });
- },
- prepend: function () {
- return domManipulate(this, arguments, function (node) {
- if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
- this.insertBefore(node, this.firstChild);
- }
- }, true);
- },
- before: function () {
- var self = this;
- if (self[0] && self[0].parentNode) {
- return domManipulate(self, arguments, function (node) {
- this.parentNode.insertBefore(node, this);
- });
- }
- return self;
- },
- after: function () {
- var self = this;
- if (self[0] && self[0].parentNode) {
- return domManipulate(self, arguments, function (node) {
- this.parentNode.insertBefore(node, this.nextSibling);
- }, true);
- }
- return self;
- },
- appendTo: function (val) {
- DomQuery(val).append(this);
- return this;
- },
- prependTo: function (val) {
- DomQuery(val).prepend(this);
- return this;
- },
- replaceWith: function (content) {
- return this.before(content).remove();
- },
- wrap: function (content) {
- return wrap$2(this, content);
- },
- wrapAll: function (content) {
- return wrap$2(this, content, true);
- },
- wrapInner: function (content) {
- this.each(function () {
- DomQuery(this).contents().wrapAll(content);
- });
- return this;
- },
- unwrap: function () {
- return this.parent().each(function () {
- DomQuery(this).replaceWith(this.childNodes);
- });
- },
- clone: function () {
- var result = [];
- this.each(function () {
- result.push(this.cloneNode(true));
- });
- return DomQuery(result);
- },
- addClass: function (className) {
- return this.toggleClass(className, true);
- },
- removeClass: function (className) {
- return this.toggleClass(className, false);
- },
- toggleClass: function (className, state) {
- var self = this;
- if (typeof className !== 'string') {
- return self;
- }
- if (className.indexOf(' ') !== -1) {
- each$g(className.split(' '), function () {
- self.toggleClass(this, state);
- });
- } else {
- self.each(function (index, node) {
- var classState = hasClass(node, className);
- if (classState !== state) {
- var existingClassName = node.className;
- if (classState) {
- node.className = trim$1((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
- } else {
- node.className += existingClassName ? ' ' + className : className;
- }
- }
- });
- }
- return self;
- },
- hasClass: function (className) {
- return hasClass(this[0], className);
- },
- each: function (callback) {
- return each$g(this, callback);
- },
- on: function (name, callback) {
- return this.each(function () {
- Event$1.bind(this, name, callback);
- });
- },
- off: function (name, callback) {
- return this.each(function () {
- Event$1.unbind(this, name, callback);
- });
- },
- trigger: function (name) {
- return this.each(function () {
- if (typeof name === 'object') {
- Event$1.fire(this, name.type, name);
- } else {
- Event$1.fire(this, name);
- }
- });
- },
- show: function () {
- return this.css('display', '');
- },
- hide: function () {
- return this.css('display', 'none');
- },
- slice: function () {
- return DomQuery(slice.apply(this, arguments));
- },
- eq: function (index) {
- return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
- },
- first: function () {
- return this.eq(0);
- },
- last: function () {
- return this.eq(-1);
- },
- find: function (selector) {
- var i, l;
- var ret = [];
- for (i = 0, l = this.length; i < l; i++) {
- DomQuery.find(selector, this[i], ret);
- }
- return DomQuery(ret);
- },
- filter: function (selector) {
- if (typeof selector === 'function') {
- return DomQuery(grep$2(this.toArray(), function (item, i) {
- return selector(i, item);
- }));
- }
- return DomQuery(DomQuery.filter(selector, this.toArray()));
- },
- closest: function (selector) {
- var result = [];
- if (selector instanceof DomQuery) {
- selector = selector[0];
- }
- this.each(function (i, node) {
- while (node) {
- if (typeof selector === 'string' && DomQuery(node).is(selector)) {
- result.push(node);
- break;
- } else if (node === selector) {
- result.push(node);
- break;
- }
- node = node.parentNode;
- }
- });
- return DomQuery(result);
- },
- offset: function (offset) {
- var elm, doc, docElm;
- var x = 0, y = 0, pos;
- if (!offset) {
- elm = this[0];
- if (elm) {
- doc = elm.ownerDocument;
- docElm = doc.documentElement;
- if (elm.getBoundingClientRect) {
- pos = elm.getBoundingClientRect();
- x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
- y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
- }
- }
- return {
- left: x,
- top: y
- };
- }
- return this.css(offset);
- },
- push: push,
- sort: Array.prototype.sort,
- splice: Array.prototype.splice
- };
- Tools.extend(DomQueryConstructor, {
- extend: Tools.extend,
- makeArray: function (object) {
- if (isWindow(object) || object.nodeType) {
- return [object];
- }
- return Tools.toArray(object);
- },
- inArray: inArray$1,
- isArray: Tools.isArray,
- each: each$g,
- trim: trim$1,
- grep: grep$2,
- find: Sizzle,
- expr: Sizzle.selectors,
- unique: Sizzle.uniqueSort,
- text: Sizzle.getText,
- contains: Sizzle.contains,
- filter: function (expr, elems, not) {
- var i = elems.length;
- if (not) {
- expr = ':not(' + expr + ')';
- }
- while (i--) {
- if (elems[i].nodeType !== 1) {
- elems.splice(i, 1);
- }
- }
- if (elems.length === 1) {
- elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
- } else {
- elems = DomQuery.find.matches(expr, elems);
- }
- return elems;
- }
- });
- var dir = function (el, prop, until) {
- var matched = [];
- var cur = el[prop];
- if (typeof until !== 'string' && until instanceof DomQuery) {
- until = until[0];
- }
- while (cur && cur.nodeType !== 9) {
- if (until !== undefined) {
- if (cur === until) {
- break;
- }
- if (typeof until === 'string' && DomQuery(cur).is(until)) {
- break;
- }
- }
- if (cur.nodeType === 1) {
- matched.push(cur);
- }
- cur = cur[prop];
- }
- return matched;
- };
- var sibling$1 = function (node, siblingName, nodeType, until) {
- var result = [];
- if (until instanceof DomQuery) {
- until = until[0];
- }
- for (; node; node = node[siblingName]) {
- if (nodeType && node.nodeType !== nodeType) {
- continue;
- }
- if (until !== undefined) {
- if (node === until) {
- break;
- }
- if (typeof until === 'string' && DomQuery(node).is(until)) {
- break;
- }
- }
- result.push(node);
- }
- return result;
- };
- var firstSibling = function (node, siblingName, nodeType) {
- for (node = node[siblingName]; node; node = node[siblingName]) {
- if (node.nodeType === nodeType) {
- return node;
- }
- }
- return null;
- };
- each$g({
- parent: function (node) {
- var parent = node.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function (node) {
- return dir(node, 'parentNode');
- },
- next: function (node) {
- return firstSibling(node, 'nextSibling', 1);
- },
- prev: function (node) {
- return firstSibling(node, 'previousSibling', 1);
- },
- children: function (node) {
- return sibling$1(node.firstChild, 'nextSibling', 1);
- },
- contents: function (node) {
- return Tools.toArray((node.nodeName === 'iframe' ? node.contentDocument || node.contentWindow.document : node).childNodes);
- }
- }, function (name, fn) {
- DomQueryConstructor.fn[name] = function (selector) {
- var self = this;
- var result = [];
- self.each(function () {
- var nodes = fn.call(result, this, selector, result);
- if (nodes) {
- if (DomQuery.isArray(nodes)) {
- result.push.apply(result, nodes);
- } else {
- result.push(nodes);
- }
- }
- });
- if (this.length > 1) {
- if (!skipUniques[name]) {
- result = DomQuery.unique(result);
- }
- if (name.indexOf('parents') === 0) {
- result = result.reverse();
- }
- }
- var wrappedResult = DomQuery(result);
- if (selector) {
- return wrappedResult.filter(selector);
- }
- return wrappedResult;
- };
- });
- each$g({
- parentsUntil: function (node, until) {
- return dir(node, 'parentNode', until);
- },
- nextUntil: function (node, until) {
- return sibling$1(node, 'nextSibling', 1, until).slice(1);
- },
- prevUntil: function (node, until) {
- return sibling$1(node, 'previousSibling', 1, until).slice(1);
- }
- }, function (name, fn) {
- DomQueryConstructor.fn[name] = function (selector, filter) {
- var self = this;
- var result = [];
- self.each(function () {
- var nodes = fn.call(result, this, selector, result);
- if (nodes) {
- if (DomQuery.isArray(nodes)) {
- result.push.apply(result, nodes);
- } else {
- result.push(nodes);
- }
- }
- });
- if (this.length > 1) {
- result = DomQuery.unique(result);
- if (name.indexOf('parents') === 0 || name === 'prevUntil') {
- result = result.reverse();
- }
- }
- var wrappedResult = DomQuery(result);
- if (filter) {
- return wrappedResult.filter(filter);
- }
- return wrappedResult;
- };
- });
- DomQueryConstructor.fn.is = function (selector) {
- return !!selector && this.filter(selector).length > 0;
- };
- DomQueryConstructor.fn.init.prototype = DomQueryConstructor.fn;
- DomQueryConstructor.overrideDefaults = function (callback) {
- var defaults;
- var sub = function (selector, context) {
- defaults = defaults || callback();
- if (arguments.length === 0) {
- selector = defaults.element;
- }
- if (!context) {
- context = defaults.context;
- }
- return new sub.fn.init(selector, context);
- };
- DomQuery.extend(sub, this);
- return sub;
- };
- DomQueryConstructor.attrHooks = attrHooks;
- DomQueryConstructor.cssHooks = cssHooks;
- var DomQuery = DomQueryConstructor;
- var each$f = Tools.each;
- var grep$1 = Tools.grep;
- var isIE = Env.ie;
- var simpleSelectorRe = /^([a-z0-9],?)+$/i;
- var setupAttrHooks = function (styles, settings, getContext) {
- var keepValues = settings.keep_values;
- var keepUrlHook = {
- set: function ($elm, value, name) {
- if (settings.url_converter && value !== null) {
- value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name, $elm[0]);
- }
- $elm.attr('data-mce-' + name, value).attr(name, value);
- },
- get: function ($elm, name) {
- return $elm.attr('data-mce-' + name) || $elm.attr(name);
- }
- };
- var attrHooks = {
- style: {
- set: function ($elm, value) {
- if (value !== null && typeof value === 'object') {
- $elm.css(value);
- return;
- }
- if (keepValues) {
- $elm.attr('data-mce-style', value);
- }
- if (value !== null && typeof value === 'string') {
- $elm.removeAttr('style');
- $elm.css(styles.parse(value));
- } else {
- $elm.attr('style', value);
- }
- },
- get: function ($elm) {
- var value = $elm.attr('data-mce-style') || $elm.attr('style');
- value = styles.serialize(styles.parse(value), $elm[0].nodeName);
- return value;
- }
- }
- };
- if (keepValues) {
- attrHooks.href = attrHooks.src = keepUrlHook;
- }
- return attrHooks;
- };
- var updateInternalStyleAttr = function (styles, $elm) {
- var rawValue = $elm.attr('style');
- var value = styles.serialize(styles.parse(rawValue), $elm[0].nodeName);
- if (!value) {
- value = null;
- }
- $elm.attr('data-mce-style', value);
- };
- var findNodeIndex = function (node, normalized) {
- var idx = 0, lastNodeType, nodeType;
- if (node) {
- for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
- nodeType = node.nodeType;
- if (normalized && nodeType === 3) {
- if (nodeType === lastNodeType || !node.nodeValue.length) {
- continue;
- }
- }
- idx++;
- lastNodeType = nodeType;
- }
- }
- return idx;
- };
- var DOMUtils = function (doc, settings) {
- if (settings === void 0) {
- settings = {};
- }
- var addedStyles = {};
- var win = window;
- var files = {};
- var counter = 0;
- var stdMode = true;
- var boxModel = true;
- var styleSheetLoader = instance.forElement(SugarElement.fromDom(doc), {
- contentCssCors: settings.contentCssCors,
- referrerPolicy: settings.referrerPolicy
- });
- var boundEvents = [];
- var schema = settings.schema ? settings.schema : Schema({});
- var styles = Styles({
- url_converter: settings.url_converter,
- url_converter_scope: settings.url_converter_scope
- }, settings.schema);
- var events = settings.ownEvents ? new EventUtils() : EventUtils.Event;
- var blockElementsMap = schema.getBlockElements();
- var $ = DomQuery.overrideDefaults(function () {
- return {
- context: doc,
- element: self.getRoot()
- };
- });
- var isBlock = function (node) {
- if (typeof node === 'string') {
- return !!blockElementsMap[node];
- } else if (node) {
- var type = node.nodeType;
- if (type) {
- return !!(type === 1 && blockElementsMap[node.nodeName]);
- }
- }
- return false;
- };
- var get = function (elm) {
- return elm && doc && isString$1(elm) ? doc.getElementById(elm) : elm;
- };
- var $$ = function (elm) {
- return $(typeof elm === 'string' ? get(elm) : elm);
- };
- var getAttrib = function (elm, name, defaultVal) {
- var hook, value;
- var $elm = $$(elm);
- if ($elm.length) {
- hook = attrHooks[name];
- if (hook && hook.get) {
- value = hook.get($elm, name);
- } else {
- value = $elm.attr(name);
- }
- }
- if (typeof value === 'undefined') {
- value = defaultVal || '';
- }
- return value;
- };
- var getAttribs = function (elm) {
- var node = get(elm);
- if (!node) {
- return [];
- }
- return node.attributes;
- };
- var setAttrib = function (elm, name, value) {
- if (value === '') {
- value = null;
- }
- var $elm = $$(elm);
- var originalValue = $elm.attr(name);
- if (!$elm.length) {
- return;
- }
- var hook = attrHooks[name];
- if (hook && hook.set) {
- hook.set($elm, value, name);
- } else {
- $elm.attr(name, value);
- }
- if (originalValue !== value && settings.onSetAttrib) {
- settings.onSetAttrib({
- attrElm: $elm,
- attrName: name,
- attrValue: value
- });
- }
- };
- var clone = function (node, deep) {
- if (!isIE || node.nodeType !== 1 || deep) {
- return node.cloneNode(deep);
- } else {
- var clone_1 = doc.createElement(node.nodeName);
- each$f(getAttribs(node), function (attr) {
- setAttrib(clone_1, attr.nodeName, getAttrib(node, attr.nodeName));
- });
- return clone_1;
- }
- };
- var getRoot = function () {
- return settings.root_element || doc.body;
- };
- var getViewPort = function (argWin) {
- var vp = getBounds(argWin);
- return {
- x: vp.x,
- y: vp.y,
- w: vp.width,
- h: vp.height
- };
- };
- var getPos$1 = function (elm, rootElm) {
- return getPos(doc.body, get(elm), rootElm);
- };
- var setStyle = function (elm, name, value) {
- var $elm = isString$1(name) ? $$(elm).css(name, value) : $$(elm).css(name);
- if (settings.update_styles) {
- updateInternalStyleAttr(styles, $elm);
- }
- };
- var setStyles = function (elm, stylesArg) {
- var $elm = $$(elm).css(stylesArg);
- if (settings.update_styles) {
- updateInternalStyleAttr(styles, $elm);
- }
- };
- var getStyle = function (elm, name, computed) {
- var $elm = $$(elm);
- if (computed) {
- return $elm.css(name);
- }
- name = name.replace(/-(\D)/g, function (a, b) {
- return b.toUpperCase();
- });
- if (name === 'float') {
- name = Env.browser.isIE() ? 'styleFloat' : 'cssFloat';
- }
- return $elm[0] && $elm[0].style ? $elm[0].style[name] : undefined;
- };
- var getSize = function (elm) {
- var w, h;
- elm = get(elm);
- w = getStyle(elm, 'width');
- h = getStyle(elm, 'height');
- if (w.indexOf('px') === -1) {
- w = 0;
- }
- if (h.indexOf('px') === -1) {
- h = 0;
- }
- return {
- w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
- h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
- };
- };
- var getRect = function (elm) {
- elm = get(elm);
- var pos = getPos$1(elm);
- var size = getSize(elm);
- return {
- x: pos.x,
- y: pos.y,
- w: size.w,
- h: size.h
- };
- };
- var is = function (elm, selector) {
- var i;
- if (!elm) {
- return false;
- }
- if (!Array.isArray(elm)) {
- if (selector === '*') {
- return elm.nodeType === 1;
- }
- if (simpleSelectorRe.test(selector)) {
- var selectors = selector.toLowerCase().split(/,/);
- var elmName = elm.nodeName.toLowerCase();
- for (i = selectors.length - 1; i >= 0; i--) {
- if (selectors[i] === elmName) {
- return true;
- }
- }
- return false;
- }
- if (elm.nodeType && elm.nodeType !== 1) {
- return false;
- }
- }
- var elms = !Array.isArray(elm) ? [elm] : elm;
- return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
- };
- var getParents = function (elm, selector, root, collect) {
- var result = [];
- var selectorVal;
- var node = get(elm);
- collect = collect === undefined;
- root = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null);
- if (Tools.is(selector, 'string')) {
- selectorVal = selector;
- if (selector === '*') {
- selector = function (node) {
- return node.nodeType === 1;
- };
- } else {
- selector = function (node) {
- return is(node, selectorVal);
- };
- }
- }
- while (node) {
- if (node === root || isNullable(node.nodeType) || isDocument$1(node) || isDocumentFragment(node)) {
- break;
- }
- if (!selector || typeof selector === 'function' && selector(node)) {
- if (collect) {
- result.push(node);
- } else {
- return [node];
- }
- }
- node = node.parentNode;
- }
- return collect ? result : null;
- };
- var getParent = function (node, selector, root) {
- var parents = getParents(node, selector, root, false);
- return parents && parents.length > 0 ? parents[0] : null;
- };
- var _findSib = function (node, selector, name) {
- var func = selector;
- if (node) {
- if (typeof selector === 'string') {
- func = function (node) {
- return is(node, selector);
- };
- }
- for (node = node[name]; node; node = node[name]) {
- if (typeof func === 'function' && func(node)) {
- return node;
- }
- }
- }
- return null;
- };
- var getNext = function (node, selector) {
- return _findSib(node, selector, 'nextSibling');
- };
- var getPrev = function (node, selector) {
- return _findSib(node, selector, 'previousSibling');
- };
- var select = function (selector, scope) {
- return Sizzle(selector, get(scope) || settings.root_element || doc, []);
- };
- var run = function (elm, func, scope) {
- var result;
- var node = typeof elm === 'string' ? get(elm) : elm;
- if (!node) {
- return false;
- }
- if (Tools.isArray(node) && (node.length || node.length === 0)) {
- result = [];
- each$f(node, function (elm, i) {
- if (elm) {
- result.push(func.call(scope, typeof elm === 'string' ? get(elm) : elm, i));
- }
- });
- return result;
- }
- var context = scope ? scope : this;
- return func.call(context, node);
- };
- var setAttribs = function (elm, attrs) {
- $$(elm).each(function (i, node) {
- each$f(attrs, function (value, name) {
- setAttrib(node, name, value);
- });
- });
- };
- var setHTML = function (elm, html) {
- var $elm = $$(elm);
- if (isIE) {
- $elm.each(function (i, target) {
- if (target.canHaveHTML === false) {
- return;
- }
- while (target.firstChild) {
- target.removeChild(target.firstChild);
- }
- try {
- target.innerHTML = '<br>' + html;
- target.removeChild(target.firstChild);
- } catch (ex) {
- DomQuery('<div></div>').html('<br>' + html).contents().slice(1).appendTo(target);
- }
- return html;
- });
- } else {
- $elm.html(html);
- }
- };
- var add = function (parentElm, name, attrs, html, create) {
- return run(parentElm, function (parentElm) {
- var newElm = typeof name === 'string' ? doc.createElement(name) : name;
- setAttribs(newElm, attrs);
- if (html) {
- if (typeof html !== 'string' && html.nodeType) {
- newElm.appendChild(html);
- } else if (typeof html === 'string') {
- setHTML(newElm, html);
- }
- }
- return !create ? parentElm.appendChild(newElm) : newElm;
- });
- };
- var create = function (name, attrs, html) {
- return add(doc.createElement(name), name, attrs, html, true);
- };
- var decode = Entities.decode;
- var encode = Entities.encodeAllRaw;
- var createHTML = function (name, attrs, html) {
- var outHtml = '', key;
- outHtml += '<' + name;
- for (key in attrs) {
- if (hasNonNullableKey(attrs, key)) {
- outHtml += ' ' + key + '="' + encode(attrs[key]) + '"';
- }
- }
- if (typeof html !== 'undefined') {
- return outHtml + '>' + html + '</' + name + '>';
- }
- return outHtml + ' />';
- };
- var createFragment = function (html) {
- var node;
- var container = doc.createElement('div');
- var frag = doc.createDocumentFragment();
- frag.appendChild(container);
- if (html) {
- container.innerHTML = html;
- }
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- frag.removeChild(container);
- return frag;
- };
- var remove = function (node, keepChildren) {
- var $node = $$(node);
- if (keepChildren) {
- $node.each(function () {
- var child;
- while (child = this.firstChild) {
- if (child.nodeType === 3 && child.data.length === 0) {
- this.removeChild(child);
- } else {
- this.parentNode.insertBefore(child, this);
- }
- }
- }).remove();
- } else {
- $node.remove();
- }
- return $node.length > 1 ? $node.toArray() : $node[0];
- };
- var removeAllAttribs = function (e) {
- return run(e, function (e) {
- var i;
- var attrs = e.attributes;
- for (i = attrs.length - 1; i >= 0; i--) {
- e.removeAttributeNode(attrs.item(i));
- }
- });
- };
- var parseStyle = function (cssText) {
- return styles.parse(cssText);
- };
- var serializeStyle = function (stylesArg, name) {
- return styles.serialize(stylesArg, name);
- };
- var addStyle = function (cssText) {
- var head, styleElm;
- if (self !== DOMUtils.DOM && doc === document) {
- if (addedStyles[cssText]) {
- return;
- }
- addedStyles[cssText] = true;
- }
- styleElm = doc.getElementById('mceDefaultStyles');
- if (!styleElm) {
- styleElm = doc.createElement('style');
- styleElm.id = 'mceDefaultStyles';
- styleElm.type = 'text/css';
- head = doc.getElementsByTagName('head')[0];
- if (head.firstChild) {
- head.insertBefore(styleElm, head.firstChild);
- } else {
- head.appendChild(styleElm);
- }
- }
- if (styleElm.styleSheet) {
- styleElm.styleSheet.cssText += cssText;
- } else {
- styleElm.appendChild(doc.createTextNode(cssText));
- }
- };
- var loadCSS = function (urls) {
- if (!urls) {
- urls = '';
- }
- each$k(urls.split(','), function (url) {
- files[url] = true;
- styleSheetLoader.load(url, noop);
- });
- };
- var toggleClass = function (elm, cls, state) {
- $$(elm).toggleClass(cls, state).each(function () {
- if (this.className === '') {
- DomQuery(this).attr('class', null);
- }
- });
- };
- var addClass = function (elm, cls) {
- $$(elm).addClass(cls);
- };
- var removeClass = function (elm, cls) {
- toggleClass(elm, cls, false);
- };
- var hasClass = function (elm, cls) {
- return $$(elm).hasClass(cls);
- };
- var show = function (elm) {
- $$(elm).show();
- };
- var hide = function (elm) {
- $$(elm).hide();
- };
- var isHidden = function (elm) {
- return $$(elm).css('display') === 'none';
- };
- var uniqueId = function (prefix) {
- return (!prefix ? 'mce_' : prefix) + counter++;
- };
- var getOuterHTML = function (elm) {
- var node = typeof elm === 'string' ? get(elm) : elm;
- return isElement$5(node) ? node.outerHTML : DomQuery('<div></div>').append(DomQuery(node).clone()).html();
- };
- var setOuterHTML = function (elm, html) {
- $$(elm).each(function () {
- try {
- if ('outerHTML' in this) {
- this.outerHTML = html;
- return;
- }
- } catch (ex) {
- }
- remove(DomQuery(this).html(html), true);
- });
- };
- var insertAfter = function (node, reference) {
- var referenceNode = get(reference);
- return run(node, function (node) {
- var parent = referenceNode.parentNode;
- var nextSibling = referenceNode.nextSibling;
- if (nextSibling) {
- parent.insertBefore(node, nextSibling);
- } else {
- parent.appendChild(node);
- }
- return node;
- });
- };
- var replace = function (newElm, oldElm, keepChildren) {
- return run(oldElm, function (oldElm) {
- if (Tools.is(oldElm, 'array')) {
- newElm = newElm.cloneNode(true);
- }
- if (keepChildren) {
- each$f(grep$1(oldElm.childNodes), function (node) {
- newElm.appendChild(node);
- });
- }
- return oldElm.parentNode.replaceChild(newElm, oldElm);
- });
- };
- var rename = function (elm, name) {
- var newElm;
- if (elm.nodeName !== name.toUpperCase()) {
- newElm = create(name);
- each$f(getAttribs(elm), function (attrNode) {
- setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.nodeName));
- });
- replace(newElm, elm, true);
- }
- return newElm || elm;
- };
- var findCommonAncestor = function (a, b) {
- var ps = a, pe;
- while (ps) {
- pe = b;
- while (pe && ps !== pe) {
- pe = pe.parentNode;
- }
- if (ps === pe) {
- break;
- }
- ps = ps.parentNode;
- }
- if (!ps && a.ownerDocument) {
- return a.ownerDocument.documentElement;
- }
- return ps;
- };
- var toHex = function (rgbVal) {
- return styles.toHex(Tools.trim(rgbVal));
- };
- var isNonEmptyElement = function (node) {
- if (isElement$5(node)) {
- var isNamedAnchor = node.nodeName.toLowerCase() === 'a' && !getAttrib(node, 'href') && getAttrib(node, 'id');
- if (getAttrib(node, 'name') || getAttrib(node, 'data-mce-bookmark') || isNamedAnchor) {
- return true;
- }
- }
- return false;
- };
- var isEmpty = function (node, elements) {
- var type, name, brCount = 0;
- if (isNonEmptyElement(node)) {
- return false;
- }
- node = node.firstChild;
- if (node) {
- var walker = new DomTreeWalker(node, node.parentNode);
- var whitespace = schema ? schema.getWhiteSpaceElements() : {};
- elements = elements || (schema ? schema.getNonEmptyElements() : null);
- do {
- type = node.nodeType;
- if (isElement$5(node)) {
- var bogusVal = node.getAttribute('data-mce-bogus');
- if (bogusVal) {
- node = walker.next(bogusVal === 'all');
- continue;
- }
- name = node.nodeName.toLowerCase();
- if (elements && elements[name]) {
- if (name === 'br') {
- brCount++;
- node = walker.next();
- continue;
- }
- return false;
- }
- if (isNonEmptyElement(node)) {
- return false;
- }
- }
- if (type === 8) {
- return false;
- }
- if (type === 3 && !isWhitespaceText(node.nodeValue)) {
- return false;
- }
- if (type === 3 && node.parentNode && whitespace[node.parentNode.nodeName] && isWhitespaceText(node.nodeValue)) {
- return false;
- }
- node = walker.next();
- } while (node);
- }
- return brCount <= 1;
- };
- var createRng = function () {
- return doc.createRange();
- };
- var split = function (parentElm, splitElm, replacementElm) {
- var range = createRng();
- var beforeFragment;
- var afterFragment;
- var parentNode;
- if (parentElm && splitElm) {
- range.setStart(parentElm.parentNode, findNodeIndex(parentElm));
- range.setEnd(splitElm.parentNode, findNodeIndex(splitElm));
- beforeFragment = range.extractContents();
- range = createRng();
- range.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1);
- range.setEnd(parentElm.parentNode, findNodeIndex(parentElm) + 1);
- afterFragment = range.extractContents();
- parentNode = parentElm.parentNode;
- parentNode.insertBefore(trimNode(self, beforeFragment), parentElm);
- if (replacementElm) {
- parentNode.insertBefore(replacementElm, parentElm);
- } else {
- parentNode.insertBefore(splitElm, parentElm);
- }
- parentNode.insertBefore(trimNode(self, afterFragment), parentElm);
- remove(parentElm);
- return replacementElm || splitElm;
- }
- };
- var bind = function (target, name, func, scope) {
- if (Tools.isArray(target)) {
- var i = target.length;
- var rv = [];
- while (i--) {
- rv[i] = bind(target[i], name, func, scope);
- }
- return rv;
- }
- if (settings.collect && (target === doc || target === win)) {
- boundEvents.push([
- target,
- name,
- func,
- scope
- ]);
- }
- var output = events.bind(target, name, func, scope || self);
- return output;
- };
- var unbind = function (target, name, func) {
- if (Tools.isArray(target)) {
- var i = target.length;
- var rv = [];
- while (i--) {
- rv[i] = unbind(target[i], name, func);
- }
- return rv;
- } else {
- if (boundEvents.length > 0 && (target === doc || target === win)) {
- var i = boundEvents.length;
- while (i--) {
- var item = boundEvents[i];
- if (target === item[0] && (!name || name === item[1]) && (!func || func === item[2])) {
- events.unbind(item[0], item[1], item[2]);
- }
- }
- }
- return events.unbind(target, name, func);
- }
- };
- var fire = function (target, name, evt) {
- return events.fire(target, name, evt);
- };
- var getContentEditable = function (node) {
- if (node && isElement$5(node)) {
- var contentEditable = node.getAttribute('data-mce-contenteditable');
- if (contentEditable && contentEditable !== 'inherit') {
- return contentEditable;
- }
- return node.contentEditable !== 'inherit' ? node.contentEditable : null;
- } else {
- return null;
- }
- };
- var getContentEditableParent = function (node) {
- var root = getRoot();
- var state = null;
- for (; node && node !== root; node = node.parentNode) {
- state = getContentEditable(node);
- if (state !== null) {
- break;
- }
- }
- return state;
- };
- var destroy = function () {
- if (boundEvents.length > 0) {
- var i = boundEvents.length;
- while (i--) {
- var item = boundEvents[i];
- events.unbind(item[0], item[1], item[2]);
- }
- }
- each$j(files, function (_, url) {
- styleSheetLoader.unload(url);
- delete files[url];
- });
- if (Sizzle.setDocument) {
- Sizzle.setDocument();
- }
- };
- var isChildOf = function (node, parent) {
- if (!isIE) {
- return node === parent || parent.contains(node);
- } else {
- while (node) {
- if (parent === node) {
- return true;
- }
- node = node.parentNode;
- }
- return false;
- }
- };
- var dumpRng = function (r) {
- return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset;
- };
- var self = {
- doc: doc,
- settings: settings,
- win: win,
- files: files,
- stdMode: stdMode,
- boxModel: boxModel,
- styleSheetLoader: styleSheetLoader,
- boundEvents: boundEvents,
- styles: styles,
- schema: schema,
- events: events,
- isBlock: isBlock,
- $: $,
- $$: $$,
- root: null,
- clone: clone,
- getRoot: getRoot,
- getViewPort: getViewPort,
- getRect: getRect,
- getSize: getSize,
- getParent: getParent,
- getParents: getParents,
- get: get,
- getNext: getNext,
- getPrev: getPrev,
- select: select,
- is: is,
- add: add,
- create: create,
- createHTML: createHTML,
- createFragment: createFragment,
- remove: remove,
- setStyle: setStyle,
- getStyle: getStyle,
- setStyles: setStyles,
- removeAllAttribs: removeAllAttribs,
- setAttrib: setAttrib,
- setAttribs: setAttribs,
- getAttrib: getAttrib,
- getPos: getPos$1,
- parseStyle: parseStyle,
- serializeStyle: serializeStyle,
- addStyle: addStyle,
- loadCSS: loadCSS,
- addClass: addClass,
- removeClass: removeClass,
- hasClass: hasClass,
- toggleClass: toggleClass,
- show: show,
- hide: hide,
- isHidden: isHidden,
- uniqueId: uniqueId,
- setHTML: setHTML,
- getOuterHTML: getOuterHTML,
- setOuterHTML: setOuterHTML,
- decode: decode,
- encode: encode,
- insertAfter: insertAfter,
- replace: replace,
- rename: rename,
- findCommonAncestor: findCommonAncestor,
- toHex: toHex,
- run: run,
- getAttribs: getAttribs,
- isEmpty: isEmpty,
- createRng: createRng,
- nodeIndex: findNodeIndex,
- split: split,
- bind: bind,
- unbind: unbind,
- fire: fire,
- getContentEditable: getContentEditable,
- getContentEditableParent: getContentEditableParent,
- destroy: destroy,
- isChildOf: isChildOf,
- dumpRng: dumpRng
- };
- var attrHooks = setupAttrHooks(styles, settings, constant(self));
- return self;
- };
- DOMUtils.DOM = DOMUtils(document);
- DOMUtils.nodeIndex = findNodeIndex;
- var DOM$a = DOMUtils.DOM;
- var each$e = Tools.each, grep = Tools.grep;
- var QUEUED = 0;
- var LOADING = 1;
- var LOADED = 2;
- var FAILED = 3;
- var ScriptLoader = function () {
- function ScriptLoader(settings) {
- if (settings === void 0) {
- settings = {};
- }
- this.states = {};
- this.queue = [];
- this.scriptLoadedCallbacks = {};
- this.queueLoadedCallbacks = [];
- this.loading = 0;
- this.settings = settings;
- }
- ScriptLoader.prototype._setReferrerPolicy = function (referrerPolicy) {
- this.settings.referrerPolicy = referrerPolicy;
- };
- ScriptLoader.prototype.loadScript = function (url, success, failure) {
- var dom = DOM$a;
- var elm;
- var cleanup = function () {
- dom.remove(id);
- if (elm) {
- elm.onerror = elm.onload = elm = null;
- }
- };
- var done = function () {
- cleanup();
- success();
- };
- var error = function () {
- cleanup();
- if (isFunction(failure)) {
- failure();
- } else {
- if (typeof console !== 'undefined' && console.log) {
- console.log('Failed to load script: ' + url);
- }
- }
- };
- var id = dom.uniqueId();
- elm = document.createElement('script');
- elm.id = id;
- elm.type = 'text/javascript';
- elm.src = Tools._addCacheSuffix(url);
- if (this.settings.referrerPolicy) {
- dom.setAttrib(elm, 'referrerpolicy', this.settings.referrerPolicy);
- }
- elm.onload = done;
- elm.onerror = error;
- (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
- };
- ScriptLoader.prototype.isDone = function (url) {
- return this.states[url] === LOADED;
- };
- ScriptLoader.prototype.markDone = function (url) {
- this.states[url] = LOADED;
- };
- ScriptLoader.prototype.add = function (url, success, scope, failure) {
- var state = this.states[url];
- this.queue.push(url);
- if (state === undefined) {
- this.states[url] = QUEUED;
- }
- if (success) {
- if (!this.scriptLoadedCallbacks[url]) {
- this.scriptLoadedCallbacks[url] = [];
- }
- this.scriptLoadedCallbacks[url].push({
- success: success,
- failure: failure,
- scope: scope || this
- });
- }
- };
- ScriptLoader.prototype.load = function (url, success, scope, failure) {
- return this.add(url, success, scope, failure);
- };
- ScriptLoader.prototype.remove = function (url) {
- delete this.states[url];
- delete this.scriptLoadedCallbacks[url];
- };
- ScriptLoader.prototype.loadQueue = function (success, scope, failure) {
- this.loadScripts(this.queue, success, scope, failure);
- };
- ScriptLoader.prototype.loadScripts = function (scripts, success, scope, failure) {
- var self = this;
- var failures = [];
- var execCallbacks = function (name, url) {
- each$e(self.scriptLoadedCallbacks[url], function (callback) {
- if (isFunction(callback[name])) {
- callback[name].call(callback.scope);
- }
- });
- self.scriptLoadedCallbacks[url] = undefined;
- };
- self.queueLoadedCallbacks.push({
- success: success,
- failure: failure,
- scope: scope || this
- });
- var loadScripts = function () {
- var loadingScripts = grep(scripts);
- scripts.length = 0;
- each$e(loadingScripts, function (url) {
- if (self.states[url] === LOADED) {
- execCallbacks('success', url);
- return;
- }
- if (self.states[url] === FAILED) {
- execCallbacks('failure', url);
- return;
- }
- if (self.states[url] !== LOADING) {
- self.states[url] = LOADING;
- self.loading++;
- self.loadScript(url, function () {
- self.states[url] = LOADED;
- self.loading--;
- execCallbacks('success', url);
- loadScripts();
- }, function () {
- self.states[url] = FAILED;
- self.loading--;
- failures.push(url);
- execCallbacks('failure', url);
- loadScripts();
- });
- }
- });
- if (!self.loading) {
- var notifyCallbacks = self.queueLoadedCallbacks.slice(0);
- self.queueLoadedCallbacks.length = 0;
- each$e(notifyCallbacks, function (callback) {
- if (failures.length === 0) {
- if (isFunction(callback.success)) {
- callback.success.call(callback.scope);
- }
- } else {
- if (isFunction(callback.failure)) {
- callback.failure.call(callback.scope, failures);
- }
- }
- });
- }
- };
- loadScripts();
- };
- ScriptLoader.ScriptLoader = new ScriptLoader();
- return ScriptLoader;
- }();
- var Cell = function (initial) {
- var value = initial;
- var get = function () {
- return value;
- };
- var set = function (v) {
- value = v;
- };
- return {
- get: get,
- set: set
- };
- };
- var isRaw = function (str) {
- return isObject(str) && has$2(str, 'raw');
- };
- var isTokenised = function (str) {
- return isArray$1(str) && str.length > 1;
- };
- var data = {};
- var currentCode = Cell('en');
- var getLanguageData = function () {
- return get$9(data, currentCode.get());
- };
- var getData = function () {
- return map$2(data, function (value) {
- return __assign({}, value);
- });
- };
- var setCode = function (newCode) {
- if (newCode) {
- currentCode.set(newCode);
- }
- };
- var getCode = function () {
- return currentCode.get();
- };
- var add$4 = function (code, items) {
- var langData = data[code];
- if (!langData) {
- data[code] = langData = {};
- }
- each$j(items, function (translation, name) {
- langData[name.toLowerCase()] = translation;
- });
- };
- var translate = function (text) {
- var langData = getLanguageData().getOr({});
- var toString = function (obj) {
- if (isFunction(obj)) {
- return Object.prototype.toString.call(obj);
- }
- return !isEmpty(obj) ? '' + obj : '';
- };
- var isEmpty = function (text) {
- return text === '' || text === null || text === undefined;
- };
- var getLangData = function (text) {
- var textstr = toString(text);
- return get$9(langData, textstr.toLowerCase()).map(toString).getOr(textstr);
- };
- var removeContext = function (str) {
- return str.replace(/{context:\w+}$/, '');
- };
- if (isEmpty(text)) {
- return '';
- }
- if (isRaw(text)) {
- return toString(text.raw);
- }
- if (isTokenised(text)) {
- var values_1 = text.slice(1);
- var substitued = getLangData(text[0]).replace(/\{([0-9]+)\}/g, function ($1, $2) {
- return has$2(values_1, $2) ? toString(values_1[$2]) : $1;
- });
- return removeContext(substitued);
- }
- return removeContext(getLangData(text));
- };
- var isRtl$1 = function () {
- return getLanguageData().bind(function (items) {
- return get$9(items, '_dir');
- }).exists(function (dir) {
- return dir === 'rtl';
- });
- };
- var hasCode = function (code) {
- return has$2(data, code);
- };
- var I18n = {
- getData: getData,
- setCode: setCode,
- getCode: getCode,
- add: add$4,
- translate: translate,
- isRtl: isRtl$1,
- hasCode: hasCode
- };
- var AddOnManager = function () {
- var items = [];
- var urls = {};
- var lookup = {};
- var _listeners = [];
- var runListeners = function (name, state) {
- var matchedListeners = filter$4(_listeners, function (listener) {
- return listener.name === name && listener.state === state;
- });
- each$k(matchedListeners, function (listener) {
- return listener.callback();
- });
- };
- var get = function (name) {
- if (lookup[name]) {
- return lookup[name].instance;
- }
- return undefined;
- };
- var dependencies = function (name) {
- var result;
- if (lookup[name]) {
- result = lookup[name].dependencies;
- }
- return result || [];
- };
- var requireLangPack = function (name, languages) {
- if (AddOnManager.languageLoad !== false) {
- waitFor(name, function () {
- var language = I18n.getCode();
- var wrappedLanguages = ',' + (languages || '') + ',';
- if (!language || languages && wrappedLanguages.indexOf(',' + language + ',') === -1) {
- return;
- }
- ScriptLoader.ScriptLoader.add(urls[name] + '/langs/' + language + '.js');
- }, 'loaded');
- }
- };
- var add = function (id, addOn, dependencies) {
- var addOnConstructor = addOn;
- items.push(addOnConstructor);
- lookup[id] = {
- instance: addOnConstructor,
- dependencies: dependencies
- };
- runListeners(id, 'added');
- return addOnConstructor;
- };
- var remove = function (name) {
- delete urls[name];
- delete lookup[name];
- };
- var createUrl = function (baseUrl, dep) {
- if (typeof dep === 'object') {
- return dep;
- }
- return typeof baseUrl === 'string' ? {
- prefix: '',
- resource: dep,
- suffix: ''
- } : {
- prefix: baseUrl.prefix,
- resource: dep,
- suffix: baseUrl.suffix
- };
- };
- var addComponents = function (pluginName, scripts) {
- var pluginUrl = urls[pluginName];
- each$k(scripts, function (script) {
- ScriptLoader.ScriptLoader.add(pluginUrl + '/' + script);
- });
- };
- var loadDependencies = function (name, addOnUrl, success, scope) {
- var deps = dependencies(name);
- each$k(deps, function (dep) {
- var newUrl = createUrl(addOnUrl, dep);
- load(newUrl.resource, newUrl, undefined, undefined);
- });
- if (success) {
- if (scope) {
- success.call(scope);
- } else {
- success.call(ScriptLoader);
- }
- }
- };
- var load = function (name, addOnUrl, success, scope, failure) {
- if (urls[name]) {
- return;
- }
- var urlString = typeof addOnUrl === 'string' ? addOnUrl : addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
- if (urlString.indexOf('/') !== 0 && urlString.indexOf('://') === -1) {
- urlString = AddOnManager.baseURL + '/' + urlString;
- }
- urls[name] = urlString.substring(0, urlString.lastIndexOf('/'));
- var done = function () {
- runListeners(name, 'loaded');
- loadDependencies(name, addOnUrl, success, scope);
- };
- if (lookup[name]) {
- done();
- } else {
- ScriptLoader.ScriptLoader.add(urlString, done, scope, failure);
- }
- };
- var waitFor = function (name, callback, state) {
- if (state === void 0) {
- state = 'added';
- }
- if (has$2(lookup, name) && state === 'added') {
- callback();
- } else if (has$2(urls, name) && state === 'loaded') {
- callback();
- } else {
- _listeners.push({
- name: name,
- state: state,
- callback: callback
- });
- }
- };
- return {
- items: items,
- urls: urls,
- lookup: lookup,
- _listeners: _listeners,
- get: get,
- dependencies: dependencies,
- requireLangPack: requireLangPack,
- add: add,
- remove: remove,
- createUrl: createUrl,
- addComponents: addComponents,
- load: load,
- waitFor: waitFor
- };
- };
- AddOnManager.languageLoad = true;
- AddOnManager.baseURL = '';
- AddOnManager.PluginManager = AddOnManager();
- AddOnManager.ThemeManager = AddOnManager();
- var singleton = function (doRevoke) {
- var subject = Cell(Optional.none());
- var revoke = function () {
- return subject.get().each(doRevoke);
- };
- var clear = function () {
- revoke();
- subject.set(Optional.none());
- };
- var isSet = function () {
- return subject.get().isSome();
- };
- var get = function () {
- return subject.get();
- };
- var set = function (s) {
- revoke();
- subject.set(Optional.some(s));
- };
- return {
- clear: clear,
- isSet: isSet,
- get: get,
- set: set
- };
- };
- var value = function () {
- var subject = singleton(noop);
- var on = function (f) {
- return subject.get().each(f);
- };
- return __assign(__assign({}, subject), { on: on });
- };
- var first = function (fn, rate) {
- var timer = null;
- var cancel = function () {
- if (!isNull(timer)) {
- clearTimeout(timer);
- timer = null;
- }
- };
- var throttle = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (isNull(timer)) {
- timer = setTimeout(function () {
- timer = null;
- fn.apply(null, args);
- }, rate);
- }
- };
- return {
- cancel: cancel,
- throttle: throttle
- };
- };
- var last = function (fn, rate) {
- var timer = null;
- var cancel = function () {
- if (!isNull(timer)) {
- clearTimeout(timer);
- timer = null;
- }
- };
- var throttle = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- cancel();
- timer = setTimeout(function () {
- timer = null;
- fn.apply(null, args);
- }, rate);
- };
- return {
- cancel: cancel,
- throttle: throttle
- };
- };
- var read$4 = function (element, attr) {
- var value = get$6(element, attr);
- return value === undefined || value === '' ? [] : value.split(' ');
- };
- var add$3 = function (element, attr, id) {
- var old = read$4(element, attr);
- var nu = old.concat([id]);
- set$1(element, attr, nu.join(' '));
- return true;
- };
- var remove$5 = function (element, attr, id) {
- var nu = filter$4(read$4(element, attr), function (v) {
- return v !== id;
- });
- if (nu.length > 0) {
- set$1(element, attr, nu.join(' '));
- } else {
- remove$6(element, attr);
- }
- return false;
- };
- var supports = function (element) {
- return element.dom.classList !== undefined;
- };
- var get$4 = function (element) {
- return read$4(element, 'class');
- };
- var add$2 = function (element, clazz) {
- return add$3(element, 'class', clazz);
- };
- var remove$4 = function (element, clazz) {
- return remove$5(element, 'class', clazz);
- };
- var add$1 = function (element, clazz) {
- if (supports(element)) {
- element.dom.classList.add(clazz);
- } else {
- add$2(element, clazz);
- }
- };
- var cleanClass = function (element) {
- var classList = supports(element) ? element.dom.classList : get$4(element);
- if (classList.length === 0) {
- remove$6(element, 'class');
- }
- };
- var remove$3 = function (element, clazz) {
- if (supports(element)) {
- var classList = element.dom.classList;
- classList.remove(clazz);
- } else {
- remove$4(element, clazz);
- }
- cleanClass(element);
- };
- var has = function (element, clazz) {
- return supports(element) && element.dom.classList.contains(clazz);
- };
- var descendants$1 = function (scope, predicate) {
- var result = [];
- each$k(children(scope), function (x) {
- if (predicate(x)) {
- result = result.concat([x]);
- }
- result = result.concat(descendants$1(x, predicate));
- });
- return result;
- };
- var descendants = function (scope, selector) {
- return all(selector, scope);
- };
- var annotation = constant('mce-annotation');
- var dataAnnotation = constant('data-mce-annotation');
- var dataAnnotationId = constant('data-mce-annotation-uid');
- var identify = function (editor, annotationName) {
- var rng = editor.selection.getRng();
- var start = SugarElement.fromDom(rng.startContainer);
- var root = SugarElement.fromDom(editor.getBody());
- var selector = annotationName.fold(function () {
- return '.' + annotation();
- }, function (an) {
- return '[' + dataAnnotation() + '="' + an + '"]';
- });
- var newStart = child$1(start, rng.startOffset).getOr(start);
- var closest = closest$2(newStart, selector, function (n) {
- return eq(n, root);
- });
- var getAttr = function (c, property) {
- if (has$1(c, property)) {
- return Optional.some(get$6(c, property));
- } else {
- return Optional.none();
- }
- };
- return closest.bind(function (c) {
- return getAttr(c, '' + dataAnnotationId()).bind(function (uid) {
- return getAttr(c, '' + dataAnnotation()).map(function (name) {
- var elements = findMarkers(editor, uid);
- return {
- uid: uid,
- name: name,
- elements: elements
- };
- });
- });
- });
- };
- var isAnnotation = function (elem) {
- return isElement$6(elem) && has(elem, annotation());
- };
- var findMarkers = function (editor, uid) {
- var body = SugarElement.fromDom(editor.getBody());
- return descendants(body, '[' + dataAnnotationId() + '="' + uid + '"]');
- };
- var findAll = function (editor, name) {
- var body = SugarElement.fromDom(editor.getBody());
- var markers = descendants(body, '[' + dataAnnotation() + '="' + name + '"]');
- var directory = {};
- each$k(markers, function (m) {
- var uid = get$6(m, dataAnnotationId());
- var nodesAlready = get$9(directory, uid).getOr([]);
- directory[uid] = nodesAlready.concat([m]);
- });
- return directory;
- };
- var setup$n = function (editor, _registry) {
- var changeCallbacks = Cell({});
- var initData = function () {
- return {
- listeners: [],
- previous: value()
- };
- };
- var withCallbacks = function (name, f) {
- updateCallbacks(name, function (data) {
- f(data);
- return data;
- });
- };
- var updateCallbacks = function (name, f) {
- var callbackMap = changeCallbacks.get();
- var data = get$9(callbackMap, name).getOrThunk(initData);
- var outputData = f(data);
- callbackMap[name] = outputData;
- changeCallbacks.set(callbackMap);
- };
- var fireCallbacks = function (name, uid, elements) {
- withCallbacks(name, function (data) {
- each$k(data.listeners, function (f) {
- return f(true, name, {
- uid: uid,
- nodes: map$3(elements, function (elem) {
- return elem.dom;
- })
- });
- });
- });
- };
- var fireNoAnnotation = function (name) {
- withCallbacks(name, function (data) {
- each$k(data.listeners, function (f) {
- return f(false, name);
- });
- });
- };
- var onNodeChange = last(function () {
- var callbackMap = changeCallbacks.get();
- var annotations = sort(keys(callbackMap));
- each$k(annotations, function (name) {
- updateCallbacks(name, function (data) {
- var prev = data.previous.get();
- identify(editor, Optional.some(name)).fold(function () {
- if (prev.isSome()) {
- fireNoAnnotation(name);
- data.previous.clear();
- }
- }, function (_a) {
- var uid = _a.uid, name = _a.name, elements = _a.elements;
- if (!is$1(prev, uid)) {
- fireCallbacks(name, uid, elements);
- data.previous.set(uid);
- }
- });
- return {
- previous: data.previous,
- listeners: data.listeners
- };
- });
- });
- }, 30);
- editor.on('remove', function () {
- onNodeChange.cancel();
- });
- editor.on('NodeChange', function () {
- onNodeChange.throttle();
- });
- var addListener = function (name, f) {
- updateCallbacks(name, function (data) {
- return {
- previous: data.previous,
- listeners: data.listeners.concat([f])
- };
- });
- };
- return { addListener: addListener };
- };
- var setup$m = function (editor, registry) {
- var identifyParserNode = function (span) {
- return Optional.from(span.attr(dataAnnotation())).bind(registry.lookup);
- };
- editor.on('init', function () {
- editor.serializer.addNodeFilter('span', function (spans) {
- each$k(spans, function (span) {
- identifyParserNode(span).each(function (settings) {
- if (settings.persistent === false) {
- span.unwrap();
- }
- });
- });
- });
- });
- };
- var create$7 = function () {
- var annotations = {};
- var register = function (name, settings) {
- annotations[name] = {
- name: name,
- settings: settings
- };
- };
- var lookup = function (name) {
- return get$9(annotations, name).map(function (a) {
- return a.settings;
- });
- };
- return {
- register: register,
- lookup: lookup
- };
- };
- var unique = 0;
- var generate = function (prefix) {
- var date = new Date();
- var time = date.getTime();
- var random = Math.floor(Math.random() * 1000000000);
- unique++;
- return prefix + '_' + random + unique + String(time);
- };
- var add = function (element, classes) {
- each$k(classes, function (x) {
- add$1(element, x);
- });
- };
- var fromHtml = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- return children(SugarElement.fromDom(div));
- };
- var fromDom$1 = function (nodes) {
- return map$3(nodes, SugarElement.fromDom);
- };
- var get$3 = function (element) {
- return element.dom.innerHTML;
- };
- var set = function (element, content) {
- var owner = owner$1(element);
- var docDom = owner.dom;
- var fragment = SugarElement.fromDom(docDom.createDocumentFragment());
- var contentElements = fromHtml(content, docDom);
- append(fragment, contentElements);
- empty(element);
- append$1(element, fragment);
- };
- var clone$1 = function (original, isDeep) {
- return SugarElement.fromDom(original.dom.cloneNode(isDeep));
- };
- var shallow = function (original) {
- return clone$1(original, false);
- };
- var deep$1 = function (original) {
- return clone$1(original, true);
- };
- var TextWalker = function (startNode, rootNode, isBoundary) {
- if (isBoundary === void 0) {
- isBoundary = never;
- }
- var walker = new DomTreeWalker(startNode, rootNode);
- var walk = function (direction) {
- var next;
- do {
- next = walker[direction]();
- } while (next && !isText$7(next) && !isBoundary(next));
- return Optional.from(next).filter(isText$7);
- };
- return {
- current: function () {
- return Optional.from(walker.current()).filter(isText$7);
- },
- next: function () {
- return walk('next');
- },
- prev: function () {
- return walk('prev');
- },
- prev2: function () {
- return walk('prev2');
- }
- };
- };
- var TextSeeker = function (dom, isBoundary) {
- var isBlockBoundary = isBoundary ? isBoundary : function (node) {
- return dom.isBlock(node) || isBr$5(node) || isContentEditableFalse$b(node);
- };
- var walk = function (node, offset, walker, process) {
- if (isText$7(node)) {
- var newOffset = process(node, offset, node.data);
- if (newOffset !== -1) {
- return Optional.some({
- container: node,
- offset: newOffset
- });
- }
- }
- return walker().bind(function (next) {
- return walk(next.container, next.offset, walker, process);
- });
- };
- var backwards = function (node, offset, process, root) {
- var walker = TextWalker(node, root, isBlockBoundary);
- return walk(node, offset, function () {
- return walker.prev().map(function (prev) {
- return {
- container: prev,
- offset: prev.length
- };
- });
- }, process).getOrNull();
- };
- var forwards = function (node, offset, process, root) {
- var walker = TextWalker(node, root, isBlockBoundary);
- return walk(node, offset, function () {
- return walker.next().map(function (next) {
- return {
- container: next,
- offset: 0
- };
- });
- }, process).getOrNull();
- };
- return {
- backwards: backwards,
- forwards: forwards
- };
- };
- var round$2 = Math.round;
- var clone = function (rect) {
- if (!rect) {
- return {
- left: 0,
- top: 0,
- bottom: 0,
- right: 0,
- width: 0,
- height: 0
- };
- }
- return {
- left: round$2(rect.left),
- top: round$2(rect.top),
- bottom: round$2(rect.bottom),
- right: round$2(rect.right),
- width: round$2(rect.width),
- height: round$2(rect.height)
- };
- };
- var collapse = function (rect, toStart) {
- rect = clone(rect);
- if (toStart) {
- rect.right = rect.left;
- } else {
- rect.left = rect.left + rect.width;
- rect.right = rect.left;
- }
- rect.width = 0;
- return rect;
- };
- var isEqual = function (rect1, rect2) {
- return rect1.left === rect2.left && rect1.top === rect2.top && rect1.bottom === rect2.bottom && rect1.right === rect2.right;
- };
- var isValidOverflow = function (overflowY, rect1, rect2) {
- return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
- };
- var isAbove$1 = function (rect1, rect2) {
- var halfHeight = Math.min(rect2.height / 2, rect1.height / 2);
- if (rect1.bottom - halfHeight < rect2.top) {
- return true;
- }
- if (rect1.top > rect2.bottom) {
- return false;
- }
- return isValidOverflow(rect2.top - rect1.bottom, rect1, rect2);
- };
- var isBelow$1 = function (rect1, rect2) {
- if (rect1.top > rect2.bottom) {
- return true;
- }
- if (rect1.bottom < rect2.top) {
- return false;
- }
- return isValidOverflow(rect2.bottom - rect1.top, rect1, rect2);
- };
- var containsXY = function (rect, clientX, clientY) {
- return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
- };
- var clamp$2 = function (value, min, max) {
- return Math.min(Math.max(value, min), max);
- };
- var getSelectedNode = function (range) {
- var startContainer = range.startContainer, startOffset = range.startOffset;
- if (startContainer.hasChildNodes() && range.endOffset === startOffset + 1) {
- return startContainer.childNodes[startOffset];
- }
- return null;
- };
- var getNode$1 = function (container, offset) {
- if (isElement$5(container) && container.hasChildNodes()) {
- var childNodes = container.childNodes;
- var safeOffset = clamp$2(offset, 0, childNodes.length - 1);
- return childNodes[safeOffset];
- } else {
- return container;
- }
- };
- var getNodeUnsafe = function (container, offset) {
- if (offset < 0 && isElement$5(container) && container.hasChildNodes()) {
- return undefined;
- } else {
- return getNode$1(container, offset);
- }
- };
- var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\uA670-\uA672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]');
- var isExtendingChar = function (ch) {
- return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch);
- };
- var or = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return function (x) {
- for (var i = 0; i < args.length; i++) {
- if (args[i](x)) {
- return true;
- }
- }
- return false;
- };
- };
- var and = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return function (x) {
- for (var i = 0; i < args.length; i++) {
- if (!args[i](x)) {
- return false;
- }
- }
- return true;
- };
- };
- var isElement$3 = isElement$5;
- var isCaretCandidate$2 = isCaretCandidate$3;
- var isBlock$1 = matchStyleValues('display', 'block table');
- var isFloated = matchStyleValues('float', 'left right');
- var isValidElementCaretCandidate = and(isElement$3, isCaretCandidate$2, not(isFloated));
- var isNotPre = not(matchStyleValues('white-space', 'pre pre-line pre-wrap'));
- var isText$4 = isText$7;
- var isBr$2 = isBr$5;
- var nodeIndex$1 = DOMUtils.nodeIndex;
- var resolveIndex$1 = getNodeUnsafe;
- var createRange$1 = function (doc) {
- return 'createRange' in doc ? doc.createRange() : DOMUtils.DOM.createRng();
- };
- var isWhiteSpace$1 = function (chr) {
- return chr && /[\r\n\t ]/.test(chr);
- };
- var isRange = function (rng) {
- return !!rng.setStart && !!rng.setEnd;
- };
- var isHiddenWhiteSpaceRange = function (range) {
- var container = range.startContainer;
- var offset = range.startOffset;
- if (isWhiteSpace$1(range.toString()) && isNotPre(container.parentNode) && isText$7(container)) {
- var text = container.data;
- if (isWhiteSpace$1(text[offset - 1]) || isWhiteSpace$1(text[offset + 1])) {
- return true;
- }
- }
- return false;
- };
- var getBrClientRect = function (brNode) {
- var doc = brNode.ownerDocument;
- var rng = createRange$1(doc);
- var nbsp$1 = doc.createTextNode(nbsp);
- var parentNode = brNode.parentNode;
- parentNode.insertBefore(nbsp$1, brNode);
- rng.setStart(nbsp$1, 0);
- rng.setEnd(nbsp$1, 1);
- var clientRect = clone(rng.getBoundingClientRect());
- parentNode.removeChild(nbsp$1);
- return clientRect;
- };
- var getBoundingClientRectWebKitText = function (rng) {
- var sc = rng.startContainer;
- var ec = rng.endContainer;
- var so = rng.startOffset;
- var eo = rng.endOffset;
- if (sc === ec && isText$7(ec) && so === 0 && eo === 1) {
- var newRng = rng.cloneRange();
- newRng.setEndAfter(ec);
- return getBoundingClientRect$1(newRng);
- } else {
- return null;
- }
- };
- var isZeroRect = function (r) {
- return r.left === 0 && r.right === 0 && r.top === 0 && r.bottom === 0;
- };
- var getBoundingClientRect$1 = function (item) {
- var clientRect;
- var clientRects = item.getClientRects();
- if (clientRects.length > 0) {
- clientRect = clone(clientRects[0]);
- } else {
- clientRect = clone(item.getBoundingClientRect());
- }
- if (!isRange(item) && isBr$2(item) && isZeroRect(clientRect)) {
- return getBrClientRect(item);
- }
- if (isZeroRect(clientRect) && isRange(item)) {
- return getBoundingClientRectWebKitText(item);
- }
- return clientRect;
- };
- var collapseAndInflateWidth = function (clientRect, toStart) {
- var newClientRect = collapse(clientRect, toStart);
- newClientRect.width = 1;
- newClientRect.right = newClientRect.left + 1;
- return newClientRect;
- };
- var getCaretPositionClientRects = function (caretPosition) {
- var clientRects = [];
- var addUniqueAndValidRect = function (clientRect) {
- if (clientRect.height === 0) {
- return;
- }
- if (clientRects.length > 0) {
- if (isEqual(clientRect, clientRects[clientRects.length - 1])) {
- return;
- }
- }
- clientRects.push(clientRect);
- };
- var addCharacterOffset = function (container, offset) {
- var range = createRange$1(container.ownerDocument);
- if (offset < container.data.length) {
- if (isExtendingChar(container.data[offset])) {
- return clientRects;
- }
- if (isExtendingChar(container.data[offset - 1])) {
- range.setStart(container, offset);
- range.setEnd(container, offset + 1);
- if (!isHiddenWhiteSpaceRange(range)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), false));
- return clientRects;
- }
- }
- }
- if (offset > 0) {
- range.setStart(container, offset - 1);
- range.setEnd(container, offset);
- if (!isHiddenWhiteSpaceRange(range)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), false));
- }
- }
- if (offset < container.data.length) {
- range.setStart(container, offset);
- range.setEnd(container, offset + 1);
- if (!isHiddenWhiteSpaceRange(range)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), true));
- }
- }
- };
- var container = caretPosition.container();
- var offset = caretPosition.offset();
- if (isText$4(container)) {
- addCharacterOffset(container, offset);
- return clientRects;
- }
- if (isElement$3(container)) {
- if (caretPosition.isAtEnd()) {
- var node = resolveIndex$1(container, offset);
- if (isText$4(node)) {
- addCharacterOffset(node, node.data.length);
- }
- if (isValidElementCaretCandidate(node) && !isBr$2(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), false));
- }
- } else {
- var node = resolveIndex$1(container, offset);
- if (isText$4(node)) {
- addCharacterOffset(node, 0);
- }
- if (isValidElementCaretCandidate(node) && caretPosition.isAtEnd()) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), false));
- return clientRects;
- }
- var beforeNode = resolveIndex$1(caretPosition.container(), caretPosition.offset() - 1);
- if (isValidElementCaretCandidate(beforeNode) && !isBr$2(beforeNode)) {
- if (isBlock$1(beforeNode) || isBlock$1(node) || !isValidElementCaretCandidate(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(beforeNode), false));
- }
- }
- if (isValidElementCaretCandidate(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), true));
- }
- }
- }
- return clientRects;
- };
- var CaretPosition = function (container, offset, clientRects) {
- var isAtStart = function () {
- if (isText$4(container)) {
- return offset === 0;
- }
- return offset === 0;
- };
- var isAtEnd = function () {
- if (isText$4(container)) {
- return offset >= container.data.length;
- }
- return offset >= container.childNodes.length;
- };
- var toRange = function () {
- var range = createRange$1(container.ownerDocument);
- range.setStart(container, offset);
- range.setEnd(container, offset);
- return range;
- };
- var getClientRects = function () {
- if (!clientRects) {
- clientRects = getCaretPositionClientRects(CaretPosition(container, offset));
- }
- return clientRects;
- };
- var isVisible = function () {
- return getClientRects().length > 0;
- };
- var isEqual = function (caretPosition) {
- return caretPosition && container === caretPosition.container() && offset === caretPosition.offset();
- };
- var getNode = function (before) {
- return resolveIndex$1(container, before ? offset - 1 : offset);
- };
- return {
- container: constant(container),
- offset: constant(offset),
- toRange: toRange,
- getClientRects: getClientRects,
- isVisible: isVisible,
- isAtStart: isAtStart,
- isAtEnd: isAtEnd,
- isEqual: isEqual,
- getNode: getNode
- };
- };
- CaretPosition.fromRangeStart = function (range) {
- return CaretPosition(range.startContainer, range.startOffset);
- };
- CaretPosition.fromRangeEnd = function (range) {
- return CaretPosition(range.endContainer, range.endOffset);
- };
- CaretPosition.after = function (node) {
- return CaretPosition(node.parentNode, nodeIndex$1(node) + 1);
- };
- CaretPosition.before = function (node) {
- return CaretPosition(node.parentNode, nodeIndex$1(node));
- };
- CaretPosition.isAbove = function (pos1, pos2) {
- return lift2(head(pos2.getClientRects()), last$2(pos1.getClientRects()), isAbove$1).getOr(false);
- };
- CaretPosition.isBelow = function (pos1, pos2) {
- return lift2(last$2(pos2.getClientRects()), head(pos1.getClientRects()), isBelow$1).getOr(false);
- };
- CaretPosition.isAtStart = function (pos) {
- return pos ? pos.isAtStart() : false;
- };
- CaretPosition.isAtEnd = function (pos) {
- return pos ? pos.isAtEnd() : false;
- };
- CaretPosition.isTextPosition = function (pos) {
- return pos ? isText$7(pos.container()) : false;
- };
- CaretPosition.isElementPosition = function (pos) {
- return CaretPosition.isTextPosition(pos) === false;
- };
- var trimEmptyTextNode$1 = function (dom, node) {
- if (isText$7(node) && node.data.length === 0) {
- dom.remove(node);
- }
- };
- var insertNode = function (dom, rng, node) {
- rng.insertNode(node);
- trimEmptyTextNode$1(dom, node.previousSibling);
- trimEmptyTextNode$1(dom, node.nextSibling);
- };
- var insertFragment = function (dom, rng, frag) {
- var firstChild = Optional.from(frag.firstChild);
- var lastChild = Optional.from(frag.lastChild);
- rng.insertNode(frag);
- firstChild.each(function (child) {
- return trimEmptyTextNode$1(dom, child.previousSibling);
- });
- lastChild.each(function (child) {
- return trimEmptyTextNode$1(dom, child.nextSibling);
- });
- };
- var rangeInsertNode = function (dom, rng, node) {
- if (isDocumentFragment(node)) {
- insertFragment(dom, rng, node);
- } else {
- insertNode(dom, rng, node);
- }
- };
- var isText$3 = isText$7;
- var isBogus = isBogus$2;
- var nodeIndex = DOMUtils.nodeIndex;
- var normalizedParent = function (node) {
- var parentNode = node.parentNode;
- if (isBogus(parentNode)) {
- return normalizedParent(parentNode);
- }
- return parentNode;
- };
- var getChildNodes = function (node) {
- if (!node) {
- return [];
- }
- return reduce(node.childNodes, function (result, node) {
- if (isBogus(node) && node.nodeName !== 'BR') {
- result = result.concat(getChildNodes(node));
- } else {
- result.push(node);
- }
- return result;
- }, []);
- };
- var normalizedTextOffset = function (node, offset) {
- while (node = node.previousSibling) {
- if (!isText$3(node)) {
- break;
- }
- offset += node.data.length;
- }
- return offset;
- };
- var equal = function (a) {
- return function (b) {
- return a === b;
- };
- };
- var normalizedNodeIndex = function (node) {
- var nodes, index;
- nodes = getChildNodes(normalizedParent(node));
- index = findIndex$1(nodes, equal(node), node);
- nodes = nodes.slice(0, index + 1);
- var numTextFragments = reduce(nodes, function (result, node, i) {
- if (isText$3(node) && isText$3(nodes[i - 1])) {
- result++;
- }
- return result;
- }, 0);
- nodes = filter$2(nodes, matchNodeNames([node.nodeName]));
- index = findIndex$1(nodes, equal(node), node);
- return index - numTextFragments;
- };
- var createPathItem = function (node) {
- var name;
- if (isText$3(node)) {
- name = 'text()';
- } else {
- name = node.nodeName.toLowerCase();
- }
- return name + '[' + normalizedNodeIndex(node) + ']';
- };
- var parentsUntil$1 = function (root, node, predicate) {
- var parents = [];
- for (node = node.parentNode; node !== root; node = node.parentNode) {
- if (predicate && predicate(node)) {
- break;
- }
- parents.push(node);
- }
- return parents;
- };
- var create$6 = function (root, caretPosition) {
- var container, offset, path = [], outputOffset, childNodes, parents;
- container = caretPosition.container();
- offset = caretPosition.offset();
- if (isText$3(container)) {
- outputOffset = normalizedTextOffset(container, offset);
- } else {
- childNodes = container.childNodes;
- if (offset >= childNodes.length) {
- outputOffset = 'after';
- offset = childNodes.length - 1;
- } else {
- outputOffset = 'before';
- }
- container = childNodes[offset];
- }
- path.push(createPathItem(container));
- parents = parentsUntil$1(root, container);
- parents = filter$2(parents, not(isBogus$2));
- path = path.concat(map$1(parents, function (node) {
- return createPathItem(node);
- }));
- return path.reverse().join('/') + ',' + outputOffset;
- };
- var resolvePathItem = function (node, name, index) {
- var nodes = getChildNodes(node);
- nodes = filter$2(nodes, function (node, index) {
- return !isText$3(node) || !isText$3(nodes[index - 1]);
- });
- nodes = filter$2(nodes, matchNodeNames([name]));
- return nodes[index];
- };
- var findTextPosition = function (container, offset) {
- var node = container, targetOffset = 0, dataLen;
- while (isText$3(node)) {
- dataLen = node.data.length;
- if (offset >= targetOffset && offset <= targetOffset + dataLen) {
- container = node;
- offset = offset - targetOffset;
- break;
- }
- if (!isText$3(node.nextSibling)) {
- container = node;
- offset = dataLen;
- break;
- }
- targetOffset += dataLen;
- node = node.nextSibling;
- }
- if (isText$3(container) && offset > container.data.length) {
- offset = container.data.length;
- }
- return CaretPosition(container, offset);
- };
- var resolve$2 = function (root, path) {
- var offset;
- if (!path) {
- return null;
- }
- var parts = path.split(',');
- var paths = parts[0].split('/');
- offset = parts.length > 1 ? parts[1] : 'before';
- var container = reduce(paths, function (result, value) {
- var match = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(value);
- if (!match) {
- return null;
- }
- if (match[1] === 'text()') {
- match[1] = '#text';
- }
- return resolvePathItem(result, match[1], parseInt(match[2], 10));
- }, root);
- if (!container) {
- return null;
- }
- if (!isText$3(container)) {
- if (offset === 'after') {
- offset = nodeIndex(container) + 1;
- } else {
- offset = nodeIndex(container);
- }
- return CaretPosition(container.parentNode, offset);
- }
- return findTextPosition(container, parseInt(offset, 10));
- };
- var isContentEditableFalse$9 = isContentEditableFalse$b;
- var getNormalizedTextOffset = function (trim, container, offset) {
- var node, trimmedOffset;
- trimmedOffset = trim(container.data.slice(0, offset)).length;
- for (node = container.previousSibling; node && isText$7(node); node = node.previousSibling) {
- trimmedOffset += trim(node.data).length;
- }
- return trimmedOffset;
- };
- var getPoint = function (dom, trim, normalized, rng, start) {
- var container = rng[start ? 'startContainer' : 'endContainer'];
- var offset = rng[start ? 'startOffset' : 'endOffset'];
- var point = [];
- var childNodes, after = 0;
- var root = dom.getRoot();
- if (isText$7(container)) {
- point.push(normalized ? getNormalizedTextOffset(trim, container, offset) : offset);
- } else {
- childNodes = container.childNodes;
- if (offset >= childNodes.length && childNodes.length) {
- after = 1;
- offset = Math.max(0, childNodes.length - 1);
- }
- point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
- }
- for (; container && container !== root; container = container.parentNode) {
- point.push(dom.nodeIndex(container, normalized));
- }
- return point;
- };
- var getLocation = function (trim, selection, normalized, rng) {
- var dom = selection.dom, bookmark = {};
- bookmark.start = getPoint(dom, trim, normalized, rng, true);
- if (!selection.isCollapsed()) {
- bookmark.end = getPoint(dom, trim, normalized, rng, false);
- }
- if (isRangeInCaretContainerBlock(rng)) {
- bookmark.isFakeCaret = true;
- }
- return bookmark;
- };
- var findIndex = function (dom, name, element) {
- var count = 0;
- Tools.each(dom.select(name), function (node) {
- if (node.getAttribute('data-mce-bogus') === 'all') {
- return;
- }
- if (node === element) {
- return false;
- }
- count++;
- });
- return count;
- };
- var moveEndPoint$1 = function (rng, start) {
- var container, offset, childNodes;
- var prefix = start ? 'start' : 'end';
- container = rng[prefix + 'Container'];
- offset = rng[prefix + 'Offset'];
- if (isElement$5(container) && container.nodeName === 'TR') {
- childNodes = container.childNodes;
- container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
- if (container) {
- offset = start ? 0 : container.childNodes.length;
- rng['set' + (start ? 'Start' : 'End')](container, offset);
- }
- }
- };
- var normalizeTableCellSelection = function (rng) {
- moveEndPoint$1(rng, true);
- moveEndPoint$1(rng, false);
- return rng;
- };
- var findSibling = function (node, offset) {
- var sibling;
- if (isElement$5(node)) {
- node = getNode$1(node, offset);
- if (isContentEditableFalse$9(node)) {
- return node;
- }
- }
- if (isCaretContainer$2(node)) {
- if (isText$7(node) && isCaretContainerBlock$1(node)) {
- node = node.parentNode;
- }
- sibling = node.previousSibling;
- if (isContentEditableFalse$9(sibling)) {
- return sibling;
- }
- sibling = node.nextSibling;
- if (isContentEditableFalse$9(sibling)) {
- return sibling;
- }
- }
- };
- var findAdjacentContentEditableFalseElm = function (rng) {
- return findSibling(rng.startContainer, rng.startOffset) || findSibling(rng.endContainer, rng.endOffset);
- };
- var getOffsetBookmark = function (trim, normalized, selection) {
- var element = selection.getNode();
- var name = element ? element.nodeName : null;
- var rng = selection.getRng();
- if (isContentEditableFalse$9(element) || name === 'IMG') {
- return {
- name: name,
- index: findIndex(selection.dom, name, element)
- };
- }
- var sibling = findAdjacentContentEditableFalseElm(rng);
- if (sibling) {
- name = sibling.tagName;
- return {
- name: name,
- index: findIndex(selection.dom, name, sibling)
- };
- }
- return getLocation(trim, selection, normalized, rng);
- };
- var getCaretBookmark = function (selection) {
- var rng = selection.getRng();
- return {
- start: create$6(selection.dom.getRoot(), CaretPosition.fromRangeStart(rng)),
- end: create$6(selection.dom.getRoot(), CaretPosition.fromRangeEnd(rng))
- };
- };
- var getRangeBookmark = function (selection) {
- return { rng: selection.getRng() };
- };
- var createBookmarkSpan = function (dom, id, filled) {
- var args = {
- 'data-mce-type': 'bookmark',
- id: id,
- 'style': 'overflow:hidden;line-height:0px'
- };
- return filled ? dom.create('span', args, '') : dom.create('span', args);
- };
- var getPersistentBookmark = function (selection, filled) {
- var dom = selection.dom;
- var rng = selection.getRng();
- var id = dom.uniqueId();
- var collapsed = selection.isCollapsed();
- var element = selection.getNode();
- var name = element.nodeName;
- if (name === 'IMG') {
- return {
- name: name,
- index: findIndex(dom, name, element)
- };
- }
- var rng2 = normalizeTableCellSelection(rng.cloneRange());
- if (!collapsed) {
- rng2.collapse(false);
- var endBookmarkNode = createBookmarkSpan(dom, id + '_end', filled);
- rangeInsertNode(dom, rng2, endBookmarkNode);
- }
- rng = normalizeTableCellSelection(rng);
- rng.collapse(true);
- var startBookmarkNode = createBookmarkSpan(dom, id + '_start', filled);
- rangeInsertNode(dom, rng, startBookmarkNode);
- selection.moveToBookmark({
- id: id,
- keep: true
- });
- return { id: id };
- };
- var getBookmark$2 = function (selection, type, normalized) {
- if (type === 2) {
- return getOffsetBookmark(trim$2, normalized, selection);
- } else if (type === 3) {
- return getCaretBookmark(selection);
- } else if (type) {
- return getRangeBookmark(selection);
- } else {
- return getPersistentBookmark(selection, false);
- }
- };
- var getUndoBookmark = curry(getOffsetBookmark, identity, true);
- var DOM$9 = DOMUtils.DOM;
- var defaultPreviewStyles = 'font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow';
- var getBodySetting = function (editor, name, defaultValue) {
- var value = editor.getParam(name, defaultValue);
- if (value.indexOf('=') !== -1) {
- var bodyObj = editor.getParam(name, '', 'hash');
- return get$9(bodyObj, editor.id).getOr(defaultValue);
- } else {
- return value;
- }
- };
- var getIframeAttrs = function (editor) {
- return editor.getParam('iframe_attrs', {});
- };
- var getDocType = function (editor) {
- return editor.getParam('doctype', '<!DOCTYPE html>');
- };
- var getDocumentBaseUrl = function (editor) {
- return editor.getParam('document_base_url', '');
- };
- var getBodyId = function (editor) {
- return getBodySetting(editor, 'body_id', 'tinymce');
- };
- var getBodyClass = function (editor) {
- return getBodySetting(editor, 'body_class', '');
- };
- var getContentSecurityPolicy = function (editor) {
- return editor.getParam('content_security_policy', '');
- };
- var shouldPutBrInPre$1 = function (editor) {
- return editor.getParam('br_in_pre', true);
- };
- var getForcedRootBlock = function (editor) {
- if (editor.getParam('force_p_newlines', false)) {
- return 'p';
- }
- var block = editor.getParam('forced_root_block', 'p');
- if (block === false) {
- return '';
- } else if (block === true) {
- return 'p';
- } else {
- return block;
- }
- };
- var getForcedRootBlockAttrs = function (editor) {
- return editor.getParam('forced_root_block_attrs', {});
- };
- var getBrNewLineSelector = function (editor) {
- return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
- };
- var getNoNewLineSelector = function (editor) {
- return editor.getParam('no_newline_selector', '');
- };
- var shouldKeepStyles = function (editor) {
- return editor.getParam('keep_styles', true);
- };
- var shouldEndContainerOnEmptyBlock = function (editor) {
- return editor.getParam('end_container_on_empty_block', false);
- };
- var getFontStyleValues = function (editor) {
- return Tools.explode(editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'));
- };
- var getFontSizeClasses = function (editor) {
- return Tools.explode(editor.getParam('font_size_classes', ''));
- };
- var getImagesDataImgFilter = function (editor) {
- return editor.getParam('images_dataimg_filter', always, 'function');
- };
- var isAutomaticUploadsEnabled = function (editor) {
- return editor.getParam('automatic_uploads', true, 'boolean');
- };
- var shouldReuseFileName = function (editor) {
- return editor.getParam('images_reuse_filename', false, 'boolean');
- };
- var shouldReplaceBlobUris = function (editor) {
- return editor.getParam('images_replace_blob_uris', true, 'boolean');
- };
- var getIconPackName = function (editor) {
- return editor.getParam('icons', '', 'string');
- };
- var getIconsUrl = function (editor) {
- return editor.getParam('icons_url', '', 'string');
- };
- var getImageUploadUrl = function (editor) {
- return editor.getParam('images_upload_url', '', 'string');
- };
- var getImageUploadBasePath = function (editor) {
- return editor.getParam('images_upload_base_path', '', 'string');
- };
- var getImagesUploadCredentials = function (editor) {
- return editor.getParam('images_upload_credentials', false, 'boolean');
- };
- var getImagesUploadHandler = function (editor) {
- return editor.getParam('images_upload_handler', null, 'function');
- };
- var shouldUseContentCssCors = function (editor) {
- return editor.getParam('content_css_cors', false, 'boolean');
- };
- var getReferrerPolicy = function (editor) {
- return editor.getParam('referrer_policy', '', 'string');
- };
- var getLanguageCode = function (editor) {
- return editor.getParam('language', 'en', 'string');
- };
- var getLanguageUrl = function (editor) {
- return editor.getParam('language_url', '', 'string');
- };
- var shouldIndentUseMargin = function (editor) {
- return editor.getParam('indent_use_margin', false);
- };
- var getIndentation = function (editor) {
- return editor.getParam('indentation', '40px', 'string');
- };
- var getContentCss = function (editor) {
- var contentCss = editor.getParam('content_css');
- if (isString$1(contentCss)) {
- return map$3(contentCss.split(','), trim$4);
- } else if (isArray$1(contentCss)) {
- return contentCss;
- } else if (contentCss === false || editor.inline) {
- return [];
- } else {
- return ['default'];
- }
- };
- var getFontCss = function (editor) {
- var fontCss = editor.getParam('font_css', []);
- return isArray$1(fontCss) ? fontCss : map$3(fontCss.split(','), trim$4);
- };
- var getDirectionality = function (editor) {
- return editor.getParam('directionality', I18n.isRtl() ? 'rtl' : undefined);
- };
- var getInlineBoundarySelector = function (editor) {
- return editor.getParam('inline_boundaries_selector', 'a[href],code,.mce-annotation', 'string');
- };
- var getObjectResizing = function (editor) {
- var selector = editor.getParam('object_resizing');
- if (selector === false || Env.iOS) {
- return false;
- } else {
- return isString$1(selector) ? selector : 'table,img,figure.image,div,video,iframe';
- }
- };
- var getResizeImgProportional = function (editor) {
- return editor.getParam('resize_img_proportional', true, 'boolean');
- };
- var getPlaceholder = function (editor) {
- return editor.getParam('placeholder', DOM$9.getAttrib(editor.getElement(), 'placeholder'), 'string');
- };
- var getEventRoot = function (editor) {
- return editor.getParam('event_root');
- };
- var getServiceMessage = function (editor) {
- return editor.getParam('service_message');
- };
- var getTheme = function (editor) {
- return editor.getParam('theme');
- };
- var shouldValidate = function (editor) {
- return editor.getParam('validate');
- };
- var isInlineBoundariesEnabled = function (editor) {
- return editor.getParam('inline_boundaries') !== false;
- };
- var getFormats = function (editor) {
- return editor.getParam('formats');
- };
- var getPreviewStyles = function (editor) {
- var style = editor.getParam('preview_styles', defaultPreviewStyles);
- if (isString$1(style)) {
- return style;
- } else {
- return '';
- }
- };
- var canFormatEmptyLines = function (editor) {
- return editor.getParam('format_empty_lines', false, 'boolean');
- };
- var getCustomUiSelector = function (editor) {
- return editor.getParam('custom_ui_selector', '', 'string');
- };
- var getThemeUrl = function (editor) {
- return editor.getParam('theme_url');
- };
- var isInline = function (editor) {
- return editor.getParam('inline');
- };
- var hasHiddenInput = function (editor) {
- return editor.getParam('hidden_input');
- };
- var shouldPatchSubmit = function (editor) {
- return editor.getParam('submit_patch');
- };
- var isEncodingXml = function (editor) {
- return editor.getParam('encoding') === 'xml';
- };
- var shouldAddFormSubmitTrigger = function (editor) {
- return editor.getParam('add_form_submit_trigger');
- };
- var shouldAddUnloadTrigger = function (editor) {
- return editor.getParam('add_unload_trigger');
- };
- var hasForcedRootBlock = function (editor) {
- return getForcedRootBlock(editor) !== '';
- };
- var getCustomUndoRedoLevels = function (editor) {
- return editor.getParam('custom_undo_redo_levels', 0, 'number');
- };
- var shouldDisableNodeChange = function (editor) {
- return editor.getParam('disable_nodechange');
- };
- var isReadOnly$1 = function (editor) {
- return editor.getParam('readonly');
- };
- var hasContentCssCors = function (editor) {
- return editor.getParam('content_css_cors');
- };
- var getPlugins = function (editor) {
- return editor.getParam('plugins', '', 'string');
- };
- var getExternalPlugins$1 = function (editor) {
- return editor.getParam('external_plugins');
- };
- var shouldBlockUnsupportedDrop = function (editor) {
- return editor.getParam('block_unsupported_drop', true, 'boolean');
- };
- var isVisualAidsEnabled = function (editor) {
- return editor.getParam('visual', true, 'boolean');
- };
- var getVisualAidsTableClass = function (editor) {
- return editor.getParam('visual_table_class', 'mce-item-table', 'string');
- };
- var getVisualAidsAnchorClass = function (editor) {
- return editor.getParam('visual_anchor_class', 'mce-item-anchor', 'string');
- };
- var getIframeAriaText = function (editor) {
- return editor.getParam('iframe_aria_text', 'Rich Text Area. Press ALT-0 for help.', 'string');
- };
- var isElement$2 = isElement$5;
- var isText$2 = isText$7;
- var removeNode$1 = function (node) {
- var parentNode = node.parentNode;
- if (parentNode) {
- parentNode.removeChild(node);
- }
- };
- var trimCount = function (text) {
- var trimmedText = trim$2(text);
- return {
- count: text.length - trimmedText.length,
- text: trimmedText
- };
- };
- var deleteZwspChars = function (caretContainer) {
- var idx;
- while ((idx = caretContainer.data.lastIndexOf(ZWSP$1)) !== -1) {
- caretContainer.deleteData(idx, 1);
- }
- };
- var removeUnchanged = function (caretContainer, pos) {
- remove$2(caretContainer);
- return pos;
- };
- var removeTextAndReposition = function (caretContainer, pos) {
- var before = trimCount(caretContainer.data.substr(0, pos.offset()));
- var after = trimCount(caretContainer.data.substr(pos.offset()));
- var text = before.text + after.text;
- if (text.length > 0) {
- deleteZwspChars(caretContainer);
- return CaretPosition(caretContainer, pos.offset() - before.count);
- } else {
- return pos;
- }
- };
- var removeElementAndReposition = function (caretContainer, pos) {
- var parentNode = pos.container();
- var newPosition = indexOf$2(from(parentNode.childNodes), caretContainer).map(function (index) {
- return index < pos.offset() ? CaretPosition(parentNode, pos.offset() - 1) : pos;
- }).getOr(pos);
- remove$2(caretContainer);
- return newPosition;
- };
- var removeTextCaretContainer = function (caretContainer, pos) {
- return isText$2(caretContainer) && pos.container() === caretContainer ? removeTextAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
- };
- var removeElementCaretContainer = function (caretContainer, pos) {
- return pos.container() === caretContainer.parentNode ? removeElementAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
- };
- var removeAndReposition = function (container, pos) {
- return CaretPosition.isTextPosition(pos) ? removeTextCaretContainer(container, pos) : removeElementCaretContainer(container, pos);
- };
- var remove$2 = function (caretContainerNode) {
- if (isElement$2(caretContainerNode) && isCaretContainer$2(caretContainerNode)) {
- if (hasContent(caretContainerNode)) {
- caretContainerNode.removeAttribute('data-mce-caret');
- } else {
- removeNode$1(caretContainerNode);
- }
- }
- if (isText$2(caretContainerNode)) {
- deleteZwspChars(caretContainerNode);
- if (caretContainerNode.data.length === 0) {
- removeNode$1(caretContainerNode);
- }
- }
- };
- var browser$2 = detect().browser;
- var isContentEditableFalse$8 = isContentEditableFalse$b;
- var isMedia$1 = isMedia$2;
- var isTableCell$3 = isTableCell$5;
- var inlineFakeCaretSelector = '*[contentEditable=false],video,audio,embed,object';
- var getAbsoluteClientRect = function (root, element, before) {
- var clientRect = collapse(element.getBoundingClientRect(), before);
- var scrollX;
- var scrollY;
- if (root.tagName === 'BODY') {
- var docElm = root.ownerDocument.documentElement;
- scrollX = root.scrollLeft || docElm.scrollLeft;
- scrollY = root.scrollTop || docElm.scrollTop;
- } else {
- var rootRect = root.getBoundingClientRect();
- scrollX = root.scrollLeft - rootRect.left;
- scrollY = root.scrollTop - rootRect.top;
- }
- clientRect.left += scrollX;
- clientRect.right += scrollX;
- clientRect.top += scrollY;
- clientRect.bottom += scrollY;
- clientRect.width = 1;
- var margin = element.offsetWidth - element.clientWidth;
- if (margin > 0) {
- if (before) {
- margin *= -1;
- }
- clientRect.left += margin;
- clientRect.right += margin;
- }
- return clientRect;
- };
- var trimInlineCaretContainers = function (root) {
- var fakeCaretTargetNodes = descendants(SugarElement.fromDom(root), inlineFakeCaretSelector);
- for (var i = 0; i < fakeCaretTargetNodes.length; i++) {
- var node = fakeCaretTargetNodes[i].dom;
- var sibling = node.previousSibling;
- if (endsWithCaretContainer$1(sibling)) {
- var data = sibling.data;
- if (data.length === 1) {
- sibling.parentNode.removeChild(sibling);
- } else {
- sibling.deleteData(data.length - 1, 1);
- }
- }
- sibling = node.nextSibling;
- if (startsWithCaretContainer$1(sibling)) {
- var data = sibling.data;
- if (data.length === 1) {
- sibling.parentNode.removeChild(sibling);
- } else {
- sibling.deleteData(0, 1);
- }
- }
- }
- };
- var FakeCaret = function (editor, root, isBlock, hasFocus) {
- var lastVisualCaret = value();
- var cursorInterval;
- var caretContainerNode;
- var rootBlock = getForcedRootBlock(editor);
- var caretBlock = rootBlock.length > 0 ? rootBlock : 'p';
- var show = function (before, element) {
- var rng;
- hide();
- if (isTableCell$3(element)) {
- return null;
- }
- if (isBlock(element)) {
- caretContainerNode = insertBlock$1(caretBlock, element, before);
- var clientRect = getAbsoluteClientRect(root, element, before);
- DomQuery(caretContainerNode).css('top', clientRect.top);
- var caret = DomQuery('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(__assign({}, clientRect)).appendTo(root)[0];
- lastVisualCaret.set({
- caret: caret,
- element: element,
- before: before
- });
- if (before) {
- DomQuery(caret).addClass('mce-visual-caret-before');
- }
- startBlink();
- rng = element.ownerDocument.createRange();
- rng.setStart(caretContainerNode, 0);
- rng.setEnd(caretContainerNode, 0);
- } else {
- caretContainerNode = insertInline$1(element, before);
- rng = element.ownerDocument.createRange();
- if (isInlineFakeCaretTarget(caretContainerNode.nextSibling)) {
- rng.setStart(caretContainerNode, 0);
- rng.setEnd(caretContainerNode, 0);
- } else {
- rng.setStart(caretContainerNode, 1);
- rng.setEnd(caretContainerNode, 1);
- }
- return rng;
- }
- return rng;
- };
- var hide = function () {
- trimInlineCaretContainers(root);
- if (caretContainerNode) {
- remove$2(caretContainerNode);
- caretContainerNode = null;
- }
- lastVisualCaret.on(function (caretState) {
- DomQuery(caretState.caret).remove();
- lastVisualCaret.clear();
- });
- if (cursorInterval) {
- Delay.clearInterval(cursorInterval);
- cursorInterval = undefined;
- }
- };
- var startBlink = function () {
- cursorInterval = Delay.setInterval(function () {
- if (hasFocus()) {
- DomQuery('div.mce-visual-caret', root).toggleClass('mce-visual-caret-hidden');
- } else {
- DomQuery('div.mce-visual-caret', root).addClass('mce-visual-caret-hidden');
- }
- }, 500);
- };
- var reposition = function () {
- lastVisualCaret.on(function (caretState) {
- var clientRect = getAbsoluteClientRect(root, caretState.element, caretState.before);
- DomQuery(caretState.caret).css(__assign({}, clientRect));
- });
- };
- var destroy = function () {
- return Delay.clearInterval(cursorInterval);
- };
- var getCss = function () {
- return '.mce-visual-caret {' + 'position: absolute;' + 'background-color: black;' + 'background-color: currentcolor;' + '}' + '.mce-visual-caret-hidden {' + 'display: none;' + '}' + '*[data-mce-caret] {' + 'position: absolute;' + 'left: -1000px;' + 'right: auto;' + 'top: 0;' + 'margin: 0;' + 'padding: 0;' + '}';
- };
- return {
- show: show,
- hide: hide,
- getCss: getCss,
- reposition: reposition,
- destroy: destroy
- };
- };
- var isFakeCaretTableBrowser = function () {
- return browser$2.isIE() || browser$2.isEdge() || browser$2.isFirefox();
- };
- var isInlineFakeCaretTarget = function (node) {
- return isContentEditableFalse$8(node) || isMedia$1(node);
- };
- var isFakeCaretTarget = function (node) {
- return isInlineFakeCaretTarget(node) || isTable$3(node) && isFakeCaretTableBrowser();
- };
- var isContentEditableFalse$7 = isContentEditableFalse$b;
- var isMedia = isMedia$2;
- var isBlockLike = matchStyleValues('display', 'block table table-cell table-caption list-item');
- var isCaretContainer = isCaretContainer$2;
- var isCaretContainerBlock = isCaretContainerBlock$1;
- var isElement$1 = isElement$5;
- var isCaretCandidate$1 = isCaretCandidate$3;
- var isForwards = function (direction) {
- return direction > 0;
- };
- var isBackwards = function (direction) {
- return direction < 0;
- };
- var skipCaretContainers = function (walk, shallow) {
- var node;
- while (node = walk(shallow)) {
- if (!isCaretContainerBlock(node)) {
- return node;
- }
- }
- return null;
- };
- var findNode$1 = function (node, direction, predicateFn, rootNode, shallow) {
- var walker = new DomTreeWalker(node, rootNode);
- var isCefOrCaretContainer = isContentEditableFalse$7(node) || isCaretContainerBlock(node);
- if (isBackwards(direction)) {
- if (isCefOrCaretContainer) {
- node = skipCaretContainers(walker.prev.bind(walker), true);
- if (predicateFn(node)) {
- return node;
- }
- }
- while (node = skipCaretContainers(walker.prev.bind(walker), shallow)) {
- if (predicateFn(node)) {
- return node;
- }
- }
- }
- if (isForwards(direction)) {
- if (isCefOrCaretContainer) {
- node = skipCaretContainers(walker.next.bind(walker), true);
- if (predicateFn(node)) {
- return node;
- }
- }
- while (node = skipCaretContainers(walker.next.bind(walker), shallow)) {
- if (predicateFn(node)) {
- return node;
- }
- }
- }
- return null;
- };
- var getParentBlock$2 = function (node, rootNode) {
- while (node && node !== rootNode) {
- if (isBlockLike(node)) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- };
- var isInSameBlock = function (caretPosition1, caretPosition2, rootNode) {
- return getParentBlock$2(caretPosition1.container(), rootNode) === getParentBlock$2(caretPosition2.container(), rootNode);
- };
- var getChildNodeAtRelativeOffset = function (relativeOffset, caretPosition) {
- if (!caretPosition) {
- return null;
- }
- var container = caretPosition.container();
- var offset = caretPosition.offset();
- if (!isElement$1(container)) {
- return null;
- }
- return container.childNodes[offset + relativeOffset];
- };
- var beforeAfter = function (before, node) {
- var range = node.ownerDocument.createRange();
- if (before) {
- range.setStartBefore(node);
- range.setEndBefore(node);
- } else {
- range.setStartAfter(node);
- range.setEndAfter(node);
- }
- return range;
- };
- var isNodesInSameBlock = function (root, node1, node2) {
- return getParentBlock$2(node1, root) === getParentBlock$2(node2, root);
- };
- var lean = function (left, root, node) {
- var siblingName = left ? 'previousSibling' : 'nextSibling';
- while (node && node !== root) {
- var sibling = node[siblingName];
- if (isCaretContainer(sibling)) {
- sibling = sibling[siblingName];
- }
- if (isContentEditableFalse$7(sibling) || isMedia(sibling)) {
- if (isNodesInSameBlock(root, sibling, node)) {
- return sibling;
- }
- break;
- }
- if (isCaretCandidate$1(sibling)) {
- break;
- }
- node = node.parentNode;
- }
- return null;
- };
- var before$2 = curry(beforeAfter, true);
- var after$2 = curry(beforeAfter, false);
- var normalizeRange = function (direction, root, range) {
- var node;
- var leanLeft = curry(lean, true, root);
- var leanRight = curry(lean, false, root);
- var container = range.startContainer;
- var offset = range.startOffset;
- if (isCaretContainerBlock$1(container)) {
- if (!isElement$1(container)) {
- container = container.parentNode;
- }
- var location_1 = container.getAttribute('data-mce-caret');
- if (location_1 === 'before') {
- node = container.nextSibling;
- if (isFakeCaretTarget(node)) {
- return before$2(node);
- }
- }
- if (location_1 === 'after') {
- node = container.previousSibling;
- if (isFakeCaretTarget(node)) {
- return after$2(node);
- }
- }
- }
- if (!range.collapsed) {
- return range;
- }
- if (isText$7(container)) {
- if (isCaretContainer(container)) {
- if (direction === 1) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- }
- if (direction === -1) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- }
- return range;
- }
- if (endsWithCaretContainer$1(container) && offset >= container.data.length - 1) {
- if (direction === 1) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- }
- return range;
- }
- if (startsWithCaretContainer$1(container) && offset <= 1) {
- if (direction === -1) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- }
- return range;
- }
- if (offset === container.data.length) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- return range;
- }
- if (offset === 0) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- return range;
- }
- }
- return range;
- };
- var getRelativeCefElm = function (forward, caretPosition) {
- return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, caretPosition)).filter(isContentEditableFalse$7);
- };
- var getNormalizedRangeEndPoint = function (direction, root, range) {
- var normalizedRange = normalizeRange(direction, root, range);
- if (direction === -1) {
- return CaretPosition.fromRangeStart(normalizedRange);
- }
- return CaretPosition.fromRangeEnd(normalizedRange);
- };
- var getElementFromPosition = function (pos) {
- return Optional.from(pos.getNode()).map(SugarElement.fromDom);
- };
- var getElementFromPrevPosition = function (pos) {
- return Optional.from(pos.getNode(true)).map(SugarElement.fromDom);
- };
- var getVisualCaretPosition = function (walkFn, caretPosition) {
- while (caretPosition = walkFn(caretPosition)) {
- if (caretPosition.isVisible()) {
- return caretPosition;
- }
- }
- return caretPosition;
- };
- var isMoveInsideSameBlock = function (from, to) {
- var inSameBlock = isInSameBlock(from, to);
- if (!inSameBlock && isBr$5(from.getNode())) {
- return true;
- }
- return inSameBlock;
- };
- var HDirection;
- (function (HDirection) {
- HDirection[HDirection['Backwards'] = -1] = 'Backwards';
- HDirection[HDirection['Forwards'] = 1] = 'Forwards';
- }(HDirection || (HDirection = {})));
- var isContentEditableFalse$6 = isContentEditableFalse$b;
- var isText$1 = isText$7;
- var isElement = isElement$5;
- var isBr$1 = isBr$5;
- var isCaretCandidate = isCaretCandidate$3;
- var isAtomic = isAtomic$1;
- var isEditableCaretCandidate = isEditableCaretCandidate$1;
- var getParents$3 = function (node, root) {
- var parents = [];
- while (node && node !== root) {
- parents.push(node);
- node = node.parentNode;
- }
- return parents;
- };
- var nodeAtIndex = function (container, offset) {
- if (container.hasChildNodes() && offset < container.childNodes.length) {
- return container.childNodes[offset];
- }
- return null;
- };
- var getCaretCandidatePosition = function (direction, node) {
- if (isForwards(direction)) {
- if (isCaretCandidate(node.previousSibling) && !isText$1(node.previousSibling)) {
- return CaretPosition.before(node);
- }
- if (isText$1(node)) {
- return CaretPosition(node, 0);
- }
- }
- if (isBackwards(direction)) {
- if (isCaretCandidate(node.nextSibling) && !isText$1(node.nextSibling)) {
- return CaretPosition.after(node);
- }
- if (isText$1(node)) {
- return CaretPosition(node, node.data.length);
- }
- }
- if (isBackwards(direction)) {
- if (isBr$1(node)) {
- return CaretPosition.before(node);
- }
- return CaretPosition.after(node);
- }
- return CaretPosition.before(node);
- };
- var moveForwardFromBr = function (root, nextNode) {
- var nextSibling = nextNode.nextSibling;
- if (nextSibling && isCaretCandidate(nextSibling)) {
- if (isText$1(nextSibling)) {
- return CaretPosition(nextSibling, 0);
- } else {
- return CaretPosition.before(nextSibling);
- }
- } else {
- return findCaretPosition$1(HDirection.Forwards, CaretPosition.after(nextNode), root);
- }
- };
- var findCaretPosition$1 = function (direction, startPos, root) {
- var node;
- var nextNode;
- var innerNode;
- var caretPosition;
- if (!isElement(root) || !startPos) {
- return null;
- }
- if (startPos.isEqual(CaretPosition.after(root)) && root.lastChild) {
- caretPosition = CaretPosition.after(root.lastChild);
- if (isBackwards(direction) && isCaretCandidate(root.lastChild) && isElement(root.lastChild)) {
- return isBr$1(root.lastChild) ? CaretPosition.before(root.lastChild) : caretPosition;
- }
- } else {
- caretPosition = startPos;
- }
- var container = caretPosition.container();
- var offset = caretPosition.offset();
- if (isText$1(container)) {
- if (isBackwards(direction) && offset > 0) {
- return CaretPosition(container, --offset);
- }
- if (isForwards(direction) && offset < container.length) {
- return CaretPosition(container, ++offset);
- }
- node = container;
- } else {
- if (isBackwards(direction) && offset > 0) {
- nextNode = nodeAtIndex(container, offset - 1);
- if (isCaretCandidate(nextNode)) {
- if (!isAtomic(nextNode)) {
- innerNode = findNode$1(nextNode, direction, isEditableCaretCandidate, nextNode);
- if (innerNode) {
- if (isText$1(innerNode)) {
- return CaretPosition(innerNode, innerNode.data.length);
- }
- return CaretPosition.after(innerNode);
- }
- }
- if (isText$1(nextNode)) {
- return CaretPosition(nextNode, nextNode.data.length);
- }
- return CaretPosition.before(nextNode);
- }
- }
- if (isForwards(direction) && offset < container.childNodes.length) {
- nextNode = nodeAtIndex(container, offset);
- if (isCaretCandidate(nextNode)) {
- if (isBr$1(nextNode)) {
- return moveForwardFromBr(root, nextNode);
- }
- if (!isAtomic(nextNode)) {
- innerNode = findNode$1(nextNode, direction, isEditableCaretCandidate, nextNode);
- if (innerNode) {
- if (isText$1(innerNode)) {
- return CaretPosition(innerNode, 0);
- }
- return CaretPosition.before(innerNode);
- }
- }
- if (isText$1(nextNode)) {
- return CaretPosition(nextNode, 0);
- }
- return CaretPosition.after(nextNode);
- }
- }
- node = nextNode ? nextNode : caretPosition.getNode();
- }
- if (isForwards(direction) && caretPosition.isAtEnd() || isBackwards(direction) && caretPosition.isAtStart()) {
- node = findNode$1(node, direction, always, root, true);
- if (isEditableCaretCandidate(node, root)) {
- return getCaretCandidatePosition(direction, node);
- }
- }
- nextNode = findNode$1(node, direction, isEditableCaretCandidate, root);
- var rootContentEditableFalseElm = last$1(filter$4(getParents$3(container, root), isContentEditableFalse$6));
- if (rootContentEditableFalseElm && (!nextNode || !rootContentEditableFalseElm.contains(nextNode))) {
- if (isForwards(direction)) {
- caretPosition = CaretPosition.after(rootContentEditableFalseElm);
- } else {
- caretPosition = CaretPosition.before(rootContentEditableFalseElm);
- }
- return caretPosition;
- }
- if (nextNode) {
- return getCaretCandidatePosition(direction, nextNode);
- }
- return null;
- };
- var CaretWalker = function (root) {
- return {
- next: function (caretPosition) {
- return findCaretPosition$1(HDirection.Forwards, caretPosition, root);
- },
- prev: function (caretPosition) {
- return findCaretPosition$1(HDirection.Backwards, caretPosition, root);
- }
- };
- };
- var walkToPositionIn = function (forward, root, start) {
- var position = forward ? CaretPosition.before(start) : CaretPosition.after(start);
- return fromPosition(forward, root, position);
- };
- var afterElement = function (node) {
- return isBr$5(node) ? CaretPosition.before(node) : CaretPosition.after(node);
- };
- var isBeforeOrStart = function (position) {
- if (CaretPosition.isTextPosition(position)) {
- return position.offset() === 0;
- } else {
- return isCaretCandidate$3(position.getNode());
- }
- };
- var isAfterOrEnd = function (position) {
- if (CaretPosition.isTextPosition(position)) {
- var container = position.container();
- return position.offset() === container.data.length;
- } else {
- return isCaretCandidate$3(position.getNode(true));
- }
- };
- var isBeforeAfterSameElement = function (from, to) {
- return !CaretPosition.isTextPosition(from) && !CaretPosition.isTextPosition(to) && from.getNode() === to.getNode(true);
- };
- var isAtBr = function (position) {
- return !CaretPosition.isTextPosition(position) && isBr$5(position.getNode());
- };
- var shouldSkipPosition = function (forward, from, to) {
- if (forward) {
- return !isBeforeAfterSameElement(from, to) && !isAtBr(from) && isAfterOrEnd(from) && isBeforeOrStart(to);
- } else {
- return !isBeforeAfterSameElement(to, from) && isBeforeOrStart(from) && isAfterOrEnd(to);
- }
- };
- var fromPosition = function (forward, root, pos) {
- var walker = CaretWalker(root);
- return Optional.from(forward ? walker.next(pos) : walker.prev(pos));
- };
- var navigate = function (forward, root, from) {
- return fromPosition(forward, root, from).bind(function (to) {
- if (isInSameBlock(from, to, root) && shouldSkipPosition(forward, from, to)) {
- return fromPosition(forward, root, to);
- } else {
- return Optional.some(to);
- }
- });
- };
- var navigateIgnore = function (forward, root, from, ignoreFilter) {
- return navigate(forward, root, from).bind(function (pos) {
- return ignoreFilter(pos) ? navigateIgnore(forward, root, pos, ignoreFilter) : Optional.some(pos);
- });
- };
- var positionIn = function (forward, element) {
- var startNode = forward ? element.firstChild : element.lastChild;
- if (isText$7(startNode)) {
- return Optional.some(CaretPosition(startNode, forward ? 0 : startNode.data.length));
- } else if (startNode) {
- if (isCaretCandidate$3(startNode)) {
- return Optional.some(forward ? CaretPosition.before(startNode) : afterElement(startNode));
- } else {
- return walkToPositionIn(forward, element, startNode);
- }
- } else {
- return Optional.none();
- }
- };
- var nextPosition = curry(fromPosition, true);
- var prevPosition = curry(fromPosition, false);
- var firstPositionIn = curry(positionIn, true);
- var lastPositionIn = curry(positionIn, false);
- var CARET_ID$1 = '_mce_caret';
- var isCaretNode = function (node) {
- return isElement$5(node) && node.id === CARET_ID$1;
- };
- var getParentCaretContainer = function (body, node) {
- while (node && node !== body) {
- if (node.id === CARET_ID$1) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- };
- var isStringPathBookmark = function (bookmark) {
- return isString$1(bookmark.start);
- };
- var isRangeBookmark = function (bookmark) {
- return has$2(bookmark, 'rng');
- };
- var isIdBookmark = function (bookmark) {
- return has$2(bookmark, 'id');
- };
- var isIndexBookmark = function (bookmark) {
- return has$2(bookmark, 'name');
- };
- var isPathBookmark = function (bookmark) {
- return Tools.isArray(bookmark.start);
- };
- var addBogus = function (dom, node) {
- if (isElement$5(node) && dom.isBlock(node) && !node.innerHTML && !Env.ie) {
- node.innerHTML = '<br data-mce-bogus="1" />';
- }
- return node;
- };
- var resolveCaretPositionBookmark = function (dom, bookmark) {
- var pos;
- var rng = dom.createRng();
- pos = resolve$2(dom.getRoot(), bookmark.start);
- rng.setStart(pos.container(), pos.offset());
- pos = resolve$2(dom.getRoot(), bookmark.end);
- rng.setEnd(pos.container(), pos.offset());
- return rng;
- };
- var insertZwsp = function (node, rng) {
- var textNode = node.ownerDocument.createTextNode(ZWSP$1);
- node.appendChild(textNode);
- rng.setStart(textNode, 0);
- rng.setEnd(textNode, 0);
- };
- var isEmpty$1 = function (node) {
- return node.hasChildNodes() === false;
- };
- var tryFindRangePosition = function (node, rng) {
- return lastPositionIn(node).fold(never, function (pos) {
- rng.setStart(pos.container(), pos.offset());
- rng.setEnd(pos.container(), pos.offset());
- return true;
- });
- };
- var padEmptyCaretContainer = function (root, node, rng) {
- if (isEmpty$1(node) && getParentCaretContainer(root, node)) {
- insertZwsp(node, rng);
- return true;
- } else {
- return false;
- }
- };
- var setEndPoint = function (dom, start, bookmark, rng) {
- var point = bookmark[start ? 'start' : 'end'];
- var i, node, offset, children;
- var root = dom.getRoot();
- if (point) {
- offset = point[0];
- for (node = root, i = point.length - 1; i >= 1; i--) {
- children = node.childNodes;
- if (padEmptyCaretContainer(root, node, rng)) {
- return true;
- }
- if (point[i] > children.length - 1) {
- if (padEmptyCaretContainer(root, node, rng)) {
- return true;
- }
- return tryFindRangePosition(node, rng);
- }
- node = children[point[i]];
- }
- if (node.nodeType === 3) {
- offset = Math.min(point[0], node.nodeValue.length);
- }
- if (node.nodeType === 1) {
- offset = Math.min(point[0], node.childNodes.length);
- }
- if (start) {
- rng.setStart(node, offset);
- } else {
- rng.setEnd(node, offset);
- }
- }
- return true;
- };
- var isValidTextNode = function (node) {
- return isText$7(node) && node.data.length > 0;
- };
- var restoreEndPoint = function (dom, suffix, bookmark) {
- var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev;
- var keep = bookmark.keep;
- var container, offset;
- if (marker) {
- node = marker.parentNode;
- if (suffix === 'start') {
- if (!keep) {
- idx = dom.nodeIndex(marker);
- } else {
- if (marker.hasChildNodes()) {
- node = marker.firstChild;
- idx = 1;
- } else if (isValidTextNode(marker.nextSibling)) {
- node = marker.nextSibling;
- idx = 0;
- } else if (isValidTextNode(marker.previousSibling)) {
- node = marker.previousSibling;
- idx = marker.previousSibling.data.length;
- } else {
- node = marker.parentNode;
- idx = dom.nodeIndex(marker) + 1;
- }
- }
- container = node;
- offset = idx;
- } else {
- if (!keep) {
- idx = dom.nodeIndex(marker);
- } else {
- if (marker.hasChildNodes()) {
- node = marker.firstChild;
- idx = 1;
- } else if (isValidTextNode(marker.previousSibling)) {
- node = marker.previousSibling;
- idx = marker.previousSibling.data.length;
- } else {
- node = marker.parentNode;
- idx = dom.nodeIndex(marker);
- }
- }
- container = node;
- offset = idx;
- }
- if (!keep) {
- prev = marker.previousSibling;
- next = marker.nextSibling;
- Tools.each(Tools.grep(marker.childNodes), function (node) {
- if (isText$7(node)) {
- node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
- }
- });
- while (marker = dom.get(bookmark.id + '_' + suffix)) {
- dom.remove(marker, true);
- }
- if (prev && next && prev.nodeType === next.nodeType && isText$7(prev) && !Env.opera) {
- idx = prev.nodeValue.length;
- prev.appendData(next.nodeValue);
- dom.remove(next);
- container = prev;
- offset = idx;
- }
- }
- return Optional.some(CaretPosition(container, offset));
- } else {
- return Optional.none();
- }
- };
- var resolvePaths = function (dom, bookmark) {
- var rng = dom.createRng();
- if (setEndPoint(dom, true, bookmark, rng) && setEndPoint(dom, false, bookmark, rng)) {
- return Optional.some(rng);
- } else {
- return Optional.none();
- }
- };
- var resolveId = function (dom, bookmark) {
- var startPos = restoreEndPoint(dom, 'start', bookmark);
- var endPos = restoreEndPoint(dom, 'end', bookmark);
- return lift2(startPos, endPos.or(startPos), function (spos, epos) {
- var rng = dom.createRng();
- rng.setStart(addBogus(dom, spos.container()), spos.offset());
- rng.setEnd(addBogus(dom, epos.container()), epos.offset());
- return rng;
- });
- };
- var resolveIndex = function (dom, bookmark) {
- return Optional.from(dom.select(bookmark.name)[bookmark.index]).map(function (elm) {
- var rng = dom.createRng();
- rng.selectNode(elm);
- return rng;
- });
- };
- var resolve$1 = function (selection, bookmark) {
- var dom = selection.dom;
- if (bookmark) {
- if (isPathBookmark(bookmark)) {
- return resolvePaths(dom, bookmark);
- } else if (isStringPathBookmark(bookmark)) {
- return Optional.some(resolveCaretPositionBookmark(dom, bookmark));
- } else if (isIdBookmark(bookmark)) {
- return resolveId(dom, bookmark);
- } else if (isIndexBookmark(bookmark)) {
- return resolveIndex(dom, bookmark);
- } else if (isRangeBookmark(bookmark)) {
- return Optional.some(bookmark.rng);
- }
- }
- return Optional.none();
- };
- var getBookmark$1 = function (selection, type, normalized) {
- return getBookmark$2(selection, type, normalized);
- };
- var moveToBookmark = function (selection, bookmark) {
- resolve$1(selection, bookmark).each(function (rng) {
- selection.setRng(rng);
- });
- };
- var isBookmarkNode$1 = function (node) {
- return isElement$5(node) && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
- };
- var is = function (expected) {
- return function (actual) {
- return expected === actual;
- };
- };
- var isNbsp = is(nbsp);
- var isWhiteSpace = function (chr) {
- return chr !== '' && ' \f\n\r\t\x0B'.indexOf(chr) !== -1;
- };
- var isContent = function (chr) {
- return !isWhiteSpace(chr) && !isNbsp(chr);
- };
- var isNode = function (node) {
- return !!node.nodeType;
- };
- var isInlineBlock = function (node) {
- return node && /^(IMG)$/.test(node.nodeName);
- };
- var moveStart = function (dom, selection, rng) {
- var offset = rng.startOffset;
- var container = rng.startContainer;
- if (container === rng.endContainer) {
- if (isInlineBlock(container.childNodes[offset])) {
- return;
- }
- }
- if (isElement$5(container)) {
- var nodes = container.childNodes;
- var walker = void 0;
- if (offset < nodes.length) {
- container = nodes[offset];
- walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock));
- } else {
- container = nodes[nodes.length - 1];
- walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock));
- walker.next(true);
- }
- for (var node = walker.current(); node; node = walker.next()) {
- if (isText$7(node) && !isWhiteSpaceNode$1(node)) {
- rng.setStart(node, 0);
- selection.setRng(rng);
- return;
- }
- }
- }
- };
- var getNonWhiteSpaceSibling = function (node, next, inc) {
- if (node) {
- var nextName = next ? 'nextSibling' : 'previousSibling';
- for (node = inc ? node : node[nextName]; node; node = node[nextName]) {
- if (isElement$5(node) || !isWhiteSpaceNode$1(node)) {
- return node;
- }
- }
- }
- };
- var isTextBlock$1 = function (editor, name) {
- if (isNode(name)) {
- name = name.nodeName;
- }
- return !!editor.schema.getTextBlockElements()[name.toLowerCase()];
- };
- var isValid = function (ed, parent, child) {
- return ed.schema.isValidChild(parent, child);
- };
- var isWhiteSpaceNode$1 = function (node, allowSpaces) {
- if (allowSpaces === void 0) {
- allowSpaces = false;
- }
- if (isNonNullable(node) && isText$7(node)) {
- var data = allowSpaces ? node.data.replace(/ /g, '\xA0') : node.data;
- return isWhitespaceText(data);
- } else {
- return false;
- }
- };
- var isEmptyTextNode$1 = function (node) {
- return isNonNullable(node) && isText$7(node) && node.length === 0;
- };
- var replaceVars = function (value, vars) {
- if (isFunction(value)) {
- value = value(vars);
- } else if (isNonNullable(vars)) {
- value = value.replace(/%(\w+)/g, function (str, name) {
- return vars[name] || str;
- });
- }
- return value;
- };
- var isEq$5 = function (str1, str2) {
- str1 = str1 || '';
- str2 = str2 || '';
- str1 = '' + (str1.nodeName || str1);
- str2 = '' + (str2.nodeName || str2);
- return str1.toLowerCase() === str2.toLowerCase();
- };
- var normalizeStyleValue = function (dom, value, name) {
- if (name === 'color' || name === 'backgroundColor') {
- value = dom.toHex(value);
- }
- if (name === 'fontWeight' && value === 700) {
- value = 'bold';
- }
- if (name === 'fontFamily') {
- value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
- }
- return '' + value;
- };
- var getStyle = function (dom, node, name) {
- return normalizeStyleValue(dom, dom.getStyle(node, name), name);
- };
- var getTextDecoration = function (dom, node) {
- var decoration;
- dom.getParent(node, function (n) {
- decoration = dom.getStyle(n, 'text-decoration');
- return decoration && decoration !== 'none';
- });
- return decoration;
- };
- var getParents$2 = function (dom, node, selector) {
- return dom.getParents(node, selector, dom.getRoot());
- };
- var isVariableFormatName = function (editor, formatName) {
- var hasVariableValues = function (format) {
- var isVariableValue = function (val) {
- return val.length > 1 && val.charAt(0) === '%';
- };
- return exists([
- 'styles',
- 'attributes'
- ], function (key) {
- return get$9(format, key).exists(function (field) {
- var fieldValues = isArray$1(field) ? field : values(field);
- return exists(fieldValues, isVariableValue);
- });
- });
- };
- return exists(editor.formatter.get(formatName), hasVariableValues);
- };
- var areSimilarFormats = function (editor, formatName, otherFormatName) {
- var validKeys = [
- 'inline',
- 'block',
- 'selector',
- 'attributes',
- 'styles',
- 'classes'
- ];
- var filterObj = function (format) {
- return filter$3(format, function (_, key) {
- return exists(validKeys, function (validKey) {
- return validKey === key;
- });
- });
- };
- return exists(editor.formatter.get(formatName), function (fmt1) {
- var filteredFmt1 = filterObj(fmt1);
- return exists(editor.formatter.get(otherFormatName), function (fmt2) {
- var filteredFmt2 = filterObj(fmt2);
- return equal$1(filteredFmt1, filteredFmt2);
- });
- });
- };
- var isBlockFormat = function (format) {
- return hasNonNullableKey(format, 'block');
- };
- var isSelectorFormat = function (format) {
- return hasNonNullableKey(format, 'selector');
- };
- var isInlineFormat = function (format) {
- return hasNonNullableKey(format, 'inline');
- };
- var isMixedFormat = function (format) {
- return isSelectorFormat(format) && isInlineFormat(format) && is$1(get$9(format, 'mixed'), true);
- };
- var shouldExpandToSelector = function (format) {
- return isSelectorFormat(format) && format.expand !== false && !isInlineFormat(format);
- };
- var isBookmarkNode = isBookmarkNode$1;
- var getParents$1 = getParents$2;
- var isWhiteSpaceNode = isWhiteSpaceNode$1;
- var isTextBlock = isTextBlock$1;
- var isBogusBr = function (node) {
- return isBr$5(node) && node.getAttribute('data-mce-bogus') && !node.nextSibling;
- };
- var findParentContentEditable = function (dom, node) {
- var parent = node;
- while (parent) {
- if (isElement$5(parent) && dom.getContentEditable(parent)) {
- return dom.getContentEditable(parent) === 'false' ? parent : node;
- }
- parent = parent.parentNode;
- }
- return node;
- };
- var walkText = function (start, node, offset, predicate) {
- var str = node.data;
- for (var i = offset; start ? i >= 0 : i < str.length; start ? i-- : i++) {
- if (predicate(str.charAt(i))) {
- return start ? i + 1 : i;
- }
- }
- return -1;
- };
- var findSpace = function (start, node, offset) {
- return walkText(start, node, offset, function (c) {
- return isNbsp(c) || isWhiteSpace(c);
- });
- };
- var findContent = function (start, node, offset) {
- return walkText(start, node, offset, isContent);
- };
- var findWordEndPoint = function (dom, body, container, offset, start, includeTrailingSpaces) {
- var lastTextNode;
- var rootNode = dom.getParent(container, dom.isBlock) || body;
- var walk = function (container, offset, pred) {
- var textSeeker = TextSeeker(dom);
- var walker = start ? textSeeker.backwards : textSeeker.forwards;
- return Optional.from(walker(container, offset, function (text, textOffset) {
- if (isBookmarkNode(text.parentNode)) {
- return -1;
- } else {
- lastTextNode = text;
- return pred(start, text, textOffset);
- }
- }, rootNode));
- };
- var spaceResult = walk(container, offset, findSpace);
- return spaceResult.bind(function (result) {
- return includeTrailingSpaces ? walk(result.container, result.offset + (start ? -1 : 0), findContent) : Optional.some(result);
- }).orThunk(function () {
- return lastTextNode ? Optional.some({
- container: lastTextNode,
- offset: start ? 0 : lastTextNode.length
- }) : Optional.none();
- });
- };
- var findSelectorEndPoint = function (dom, formatList, rng, container, siblingName) {
- if (isText$7(container) && isEmpty$3(container.data) && container[siblingName]) {
- container = container[siblingName];
- }
- var parents = getParents$1(dom, container);
- for (var i = 0; i < parents.length; i++) {
- for (var y = 0; y < formatList.length; y++) {
- var curFormat = formatList[y];
- if (isNonNullable(curFormat.collapsed) && curFormat.collapsed !== rng.collapsed) {
- continue;
- }
- if (isSelectorFormat(curFormat) && dom.is(parents[i], curFormat.selector)) {
- return parents[i];
- }
- }
- }
- return container;
- };
- var findBlockEndPoint = function (editor, formatList, container, siblingName) {
- var node = container;
- var dom = editor.dom;
- var root = dom.getRoot();
- var format = formatList[0];
- if (isBlockFormat(format)) {
- node = format.wrapper ? null : dom.getParent(container, format.block, root);
- }
- if (!node) {
- var scopeRoot = dom.getParent(container, 'LI,TD,TH');
- node = dom.getParent(isText$7(container) ? container.parentNode : container, function (node) {
- return node !== root && isTextBlock(editor, node);
- }, scopeRoot);
- }
- if (node && isBlockFormat(format) && format.wrapper) {
- node = getParents$1(dom, node, 'ul,ol').reverse()[0] || node;
- }
- if (!node) {
- node = container;
- while (node[siblingName] && !dom.isBlock(node[siblingName])) {
- node = node[siblingName];
- if (isEq$5(node, 'br')) {
- break;
- }
- }
- }
- return node || container;
- };
- var isAtBlockBoundary$1 = function (dom, root, container, siblingName) {
- var parent = container.parentNode;
- if (isNonNullable(container[siblingName])) {
- return false;
- } else if (parent === root || isNullable(parent) || dom.isBlock(parent)) {
- return true;
- } else {
- return isAtBlockBoundary$1(dom, root, parent, siblingName);
- }
- };
- var findParentContainer = function (dom, formatList, container, offset, start) {
- var parent = container;
- var siblingName = start ? 'previousSibling' : 'nextSibling';
- var root = dom.getRoot();
- if (isText$7(container) && !isWhiteSpaceNode(container)) {
- if (start ? offset > 0 : offset < container.data.length) {
- return container;
- }
- }
- while (true) {
- if (!formatList[0].block_expand && dom.isBlock(parent)) {
- return parent;
- }
- for (var sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
- var allowSpaces = isText$7(sibling) && !isAtBlockBoundary$1(dom, root, sibling, siblingName);
- if (!isBookmarkNode(sibling) && !isBogusBr(sibling) && !isWhiteSpaceNode(sibling, allowSpaces)) {
- return parent;
- }
- }
- if (parent === root || parent.parentNode === root) {
- container = parent;
- break;
- }
- parent = parent.parentNode;
- }
- return container;
- };
- var isSelfOrParentBookmark = function (container) {
- return isBookmarkNode(container.parentNode) || isBookmarkNode(container);
- };
- var expandRng = function (editor, rng, formatList, includeTrailingSpace) {
- if (includeTrailingSpace === void 0) {
- includeTrailingSpace = false;
- }
- var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
- var dom = editor.dom;
- var format = formatList[0];
- if (isElement$5(startContainer) && startContainer.hasChildNodes()) {
- startContainer = getNode$1(startContainer, startOffset);
- if (isText$7(startContainer)) {
- startOffset = 0;
- }
- }
- if (isElement$5(endContainer) && endContainer.hasChildNodes()) {
- endContainer = getNode$1(endContainer, rng.collapsed ? endOffset : endOffset - 1);
- if (isText$7(endContainer)) {
- endOffset = endContainer.nodeValue.length;
- }
- }
- startContainer = findParentContentEditable(dom, startContainer);
- endContainer = findParentContentEditable(dom, endContainer);
- if (isSelfOrParentBookmark(startContainer)) {
- startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
- if (rng.collapsed) {
- startContainer = startContainer.previousSibling || startContainer;
- } else {
- startContainer = startContainer.nextSibling || startContainer;
- }
- if (isText$7(startContainer)) {
- startOffset = rng.collapsed ? startContainer.length : 0;
- }
- }
- if (isSelfOrParentBookmark(endContainer)) {
- endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
- if (rng.collapsed) {
- endContainer = endContainer.nextSibling || endContainer;
- } else {
- endContainer = endContainer.previousSibling || endContainer;
- }
- if (isText$7(endContainer)) {
- endOffset = rng.collapsed ? 0 : endContainer.length;
- }
- }
- if (rng.collapsed) {
- var startPoint = findWordEndPoint(dom, editor.getBody(), startContainer, startOffset, true, includeTrailingSpace);
- startPoint.each(function (_a) {
- var container = _a.container, offset = _a.offset;
- startContainer = container;
- startOffset = offset;
- });
- var endPoint = findWordEndPoint(dom, editor.getBody(), endContainer, endOffset, false, includeTrailingSpace);
- endPoint.each(function (_a) {
- var container = _a.container, offset = _a.offset;
- endContainer = container;
- endOffset = offset;
- });
- }
- if (isInlineFormat(format) || format.block_expand) {
- if (!isInlineFormat(format) || (!isText$7(startContainer) || startOffset === 0)) {
- startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
- }
- if (!isInlineFormat(format) || (!isText$7(endContainer) || endOffset === endContainer.nodeValue.length)) {
- endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
- }
- }
- if (shouldExpandToSelector(format)) {
- startContainer = findSelectorEndPoint(dom, formatList, rng, startContainer, 'previousSibling');
- endContainer = findSelectorEndPoint(dom, formatList, rng, endContainer, 'nextSibling');
- }
- if (isBlockFormat(format) || isSelectorFormat(format)) {
- startContainer = findBlockEndPoint(editor, formatList, startContainer, 'previousSibling');
- endContainer = findBlockEndPoint(editor, formatList, endContainer, 'nextSibling');
- if (isBlockFormat(format)) {
- if (!dom.isBlock(startContainer)) {
- startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
- }
- if (!dom.isBlock(endContainer)) {
- endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
- }
- }
- }
- if (isElement$5(startContainer)) {
- startOffset = dom.nodeIndex(startContainer);
- startContainer = startContainer.parentNode;
- }
- if (isElement$5(endContainer)) {
- endOffset = dom.nodeIndex(endContainer) + 1;
- endContainer = endContainer.parentNode;
- }
- return {
- startContainer: startContainer,
- startOffset: startOffset,
- endContainer: endContainer,
- endOffset: endOffset
- };
- };
- var walk$2 = function (dom, rng, callback) {
- var startOffset = rng.startOffset;
- var startContainer = getNode$1(rng.startContainer, startOffset);
- var endOffset = rng.endOffset;
- var endContainer = getNode$1(rng.endContainer, endOffset - 1);
- var exclude = function (nodes) {
- var firstNode = nodes[0];
- if (isText$7(firstNode) && firstNode === startContainer && startOffset >= firstNode.data.length) {
- nodes.splice(0, 1);
- }
- var lastNode = nodes[nodes.length - 1];
- if (endOffset === 0 && nodes.length > 0 && lastNode === endContainer && isText$7(lastNode)) {
- nodes.splice(nodes.length - 1, 1);
- }
- return nodes;
- };
- var collectSiblings = function (node, name, endNode) {
- var siblings = [];
- for (; node && node !== endNode; node = node[name]) {
- siblings.push(node);
- }
- return siblings;
- };
- var findEndPoint = function (node, root) {
- return dom.getParent(node, function (node) {
- return node.parentNode === root;
- }, root);
- };
- var walkBoundary = function (startNode, endNode, next) {
- var siblingName = next ? 'nextSibling' : 'previousSibling';
- for (var node = startNode, parent_1 = node.parentNode; node && node !== endNode; node = parent_1) {
- parent_1 = node.parentNode;
- var siblings_1 = collectSiblings(node === startNode ? node : node[siblingName], siblingName);
- if (siblings_1.length) {
- if (!next) {
- siblings_1.reverse();
- }
- callback(exclude(siblings_1));
- }
- }
- };
- if (startContainer === endContainer) {
- return callback(exclude([startContainer]));
- }
- var ancestor = dom.findCommonAncestor(startContainer, endContainer);
- if (dom.isChildOf(startContainer, endContainer)) {
- return walkBoundary(startContainer, ancestor, true);
- }
- if (dom.isChildOf(endContainer, startContainer)) {
- return walkBoundary(endContainer, ancestor);
- }
- var startPoint = findEndPoint(startContainer, ancestor) || startContainer;
- var endPoint = findEndPoint(endContainer, ancestor) || endContainer;
- walkBoundary(startContainer, startPoint, true);
- var siblings = collectSiblings(startPoint === startContainer ? startPoint : startPoint.nextSibling, 'nextSibling', endPoint === endContainer ? endPoint.nextSibling : endPoint);
- if (siblings.length) {
- callback(exclude(siblings));
- }
- walkBoundary(endContainer, endPoint);
- };
- var getRanges = function (selection) {
- var ranges = [];
- if (selection) {
- for (var i = 0; i < selection.rangeCount; i++) {
- ranges.push(selection.getRangeAt(i));
- }
- }
- return ranges;
- };
- var getSelectedNodes = function (ranges) {
- return bind(ranges, function (range) {
- var node = getSelectedNode(range);
- return node ? [SugarElement.fromDom(node)] : [];
- });
- };
- var hasMultipleRanges = function (selection) {
- return getRanges(selection).length > 1;
- };
- var getCellsFromRanges = function (ranges) {
- return filter$4(getSelectedNodes(ranges), isTableCell$4);
- };
- var getCellsFromElement = function (elm) {
- return descendants(elm, 'td[data-mce-selected],th[data-mce-selected]');
- };
- var getCellsFromElementOrRanges = function (ranges, element) {
- var selectedCells = getCellsFromElement(element);
- return selectedCells.length > 0 ? selectedCells : getCellsFromRanges(ranges);
- };
- var getCellsFromEditor = function (editor) {
- return getCellsFromElementOrRanges(getRanges(editor.selection.getSel()), SugarElement.fromDom(editor.getBody()));
- };
- var getClosestTable = function (cell, isRoot) {
- return ancestor$2(cell, 'table', isRoot);
- };
- var getStartNode = function (rng) {
- var sc = rng.startContainer, so = rng.startOffset;
- if (isText$7(sc)) {
- return so === 0 ? Optional.some(SugarElement.fromDom(sc)) : Optional.none();
- } else {
- return Optional.from(sc.childNodes[so]).map(SugarElement.fromDom);
- }
- };
- var getEndNode = function (rng) {
- var ec = rng.endContainer, eo = rng.endOffset;
- if (isText$7(ec)) {
- return eo === ec.data.length ? Optional.some(SugarElement.fromDom(ec)) : Optional.none();
- } else {
- return Optional.from(ec.childNodes[eo - 1]).map(SugarElement.fromDom);
- }
- };
- var getFirstChildren = function (node) {
- return firstChild(node).fold(constant([node]), function (child) {
- return [node].concat(getFirstChildren(child));
- });
- };
- var getLastChildren$1 = function (node) {
- return lastChild(node).fold(constant([node]), function (child) {
- if (name(child) === 'br') {
- return prevSibling(child).map(function (sibling) {
- return [node].concat(getLastChildren$1(sibling));
- }).getOr([]);
- } else {
- return [node].concat(getLastChildren$1(child));
- }
- });
- };
- var hasAllContentsSelected = function (elm, rng) {
- return lift2(getStartNode(rng), getEndNode(rng), function (startNode, endNode) {
- var start = find$3(getFirstChildren(elm), curry(eq, startNode));
- var end = find$3(getLastChildren$1(elm), curry(eq, endNode));
- return start.isSome() && end.isSome();
- }).getOr(false);
- };
- var moveEndPoint = function (dom, rng, node, start) {
- var root = node, walker = new DomTreeWalker(node, root);
- var moveCaretBeforeOnEnterElementsMap = filter$3(dom.schema.getMoveCaretBeforeOnEnterElements(), function (_, name) {
- return !contains$3([
- 'td',
- 'th',
- 'table'
- ], name.toLowerCase());
- });
- do {
- if (isText$7(node) && Tools.trim(node.nodeValue).length !== 0) {
- if (start) {
- rng.setStart(node, 0);
- } else {
- rng.setEnd(node, node.nodeValue.length);
- }
- return;
- }
- if (moveCaretBeforeOnEnterElementsMap[node.nodeName]) {
- if (start) {
- rng.setStartBefore(node);
- } else {
- if (node.nodeName === 'BR') {
- rng.setEndBefore(node);
- } else {
- rng.setEndAfter(node);
- }
- }
- return;
- }
- } while (node = start ? walker.next() : walker.prev());
- if (root.nodeName === 'BODY') {
- if (start) {
- rng.setStart(root, 0);
- } else {
- rng.setEnd(root, root.childNodes.length);
- }
- }
- };
- var hasAnyRanges = function (editor) {
- var sel = editor.selection.getSel();
- return sel && sel.rangeCount > 0;
- };
- var runOnRanges = function (editor, executor) {
- var fakeSelectionNodes = getCellsFromEditor(editor);
- if (fakeSelectionNodes.length > 0) {
- each$k(fakeSelectionNodes, function (elem) {
- var node = elem.dom;
- var fakeNodeRng = editor.dom.createRng();
- fakeNodeRng.setStartBefore(node);
- fakeNodeRng.setEndAfter(node);
- executor(fakeNodeRng, true);
- });
- } else {
- executor(editor.selection.getRng(), false);
- }
- };
- var preserve = function (selection, fillBookmark, executor) {
- var bookmark = getPersistentBookmark(selection, fillBookmark);
- executor(bookmark);
- selection.moveToBookmark(bookmark);
- };
- var NodeValue = function (is, name) {
- var get = function (element) {
- if (!is(element)) {
- throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
- }
- return getOption(element).getOr('');
- };
- var getOption = function (element) {
- return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
- };
- var set = function (element, value) {
- if (!is(element)) {
- throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
- }
- element.dom.nodeValue = value;
- };
- return {
- get: get,
- getOption: getOption,
- set: set
- };
- };
- var api$1 = NodeValue(isText$8, 'text');
- var get$2 = function (element) {
- return api$1.get(element);
- };
- var isZeroWidth = function (elem) {
- return isText$8(elem) && get$2(elem) === ZWSP$1;
- };
- var context = function (editor, elem, wrapName, nodeName) {
- return parent(elem).fold(function () {
- return 'skipping';
- }, function (parent) {
- if (nodeName === 'br' || isZeroWidth(elem)) {
- return 'valid';
- } else if (isAnnotation(elem)) {
- return 'existing';
- } else if (isCaretNode(elem.dom)) {
- return 'caret';
- } else if (!isValid(editor, wrapName, nodeName) || !isValid(editor, name(parent), wrapName)) {
- return 'invalid-child';
- } else {
- return 'valid';
- }
- });
- };
- var applyWordGrab = function (editor, rng) {
- var r = expandRng(editor, rng, [{ inline: 'span' }]);
- rng.setStart(r.startContainer, r.startOffset);
- rng.setEnd(r.endContainer, r.endOffset);
- editor.selection.setRng(rng);
- };
- var makeAnnotation = function (eDoc, _a, annotationName, decorate) {
- var _b = _a.uid, uid = _b === void 0 ? generate('mce-annotation') : _b, data = __rest(_a, ['uid']);
- var master = SugarElement.fromTag('span', eDoc);
- add$1(master, annotation());
- set$1(master, '' + dataAnnotationId(), uid);
- set$1(master, '' + dataAnnotation(), annotationName);
- var _c = decorate(uid, data), _d = _c.attributes, attributes = _d === void 0 ? {} : _d, _e = _c.classes, classes = _e === void 0 ? [] : _e;
- setAll$1(master, attributes);
- add(master, classes);
- return master;
- };
- var annotate = function (editor, rng, annotationName, decorate, data) {
- var newWrappers = [];
- var master = makeAnnotation(editor.getDoc(), data, annotationName, decorate);
- var wrapper = value();
- var finishWrapper = function () {
- wrapper.clear();
- };
- var getOrOpenWrapper = function () {
- return wrapper.get().getOrThunk(function () {
- var nu = shallow(master);
- newWrappers.push(nu);
- wrapper.set(nu);
- return nu;
- });
- };
- var processElements = function (elems) {
- each$k(elems, processElement);
- };
- var processElement = function (elem) {
- var ctx = context(editor, elem, 'span', name(elem));
- switch (ctx) {
- case 'invalid-child': {
- finishWrapper();
- var children$1 = children(elem);
- processElements(children$1);
- finishWrapper();
- break;
- }
- case 'valid': {
- var w = getOrOpenWrapper();
- wrap$3(elem, w);
- break;
- }
- }
- };
- var processNodes = function (nodes) {
- var elems = map$3(nodes, SugarElement.fromDom);
- processElements(elems);
- };
- walk$2(editor.dom, rng, function (nodes) {
- finishWrapper();
- processNodes(nodes);
- });
- return newWrappers;
- };
- var annotateWithBookmark = function (editor, name, settings, data) {
- editor.undoManager.transact(function () {
- var selection = editor.selection;
- var initialRng = selection.getRng();
- var hasFakeSelection = getCellsFromEditor(editor).length > 0;
- if (initialRng.collapsed && !hasFakeSelection) {
- applyWordGrab(editor, initialRng);
- }
- if (selection.getRng().collapsed && !hasFakeSelection) {
- var wrapper = makeAnnotation(editor.getDoc(), data, name, settings.decorate);
- set(wrapper, nbsp);
- selection.getRng().insertNode(wrapper.dom);
- selection.select(wrapper.dom);
- } else {
- preserve(selection, false, function () {
- runOnRanges(editor, function (selectionRng) {
- annotate(editor, selectionRng, name, settings.decorate, data);
- });
- });
- }
- });
- };
- var Annotator = function (editor) {
- var registry = create$7();
- setup$m(editor, registry);
- var changes = setup$n(editor);
- return {
- register: function (name, settings) {
- registry.register(name, settings);
- },
- annotate: function (name, data) {
- registry.lookup(name).each(function (settings) {
- annotateWithBookmark(editor, name, settings, data);
- });
- },
- annotationChanged: function (name, callback) {
- changes.addListener(name, callback);
- },
- remove: function (name) {
- identify(editor, Optional.some(name)).each(function (_a) {
- var elements = _a.elements;
- each$k(elements, unwrap);
- });
- },
- getAll: function (name) {
- var directory = findAll(editor, name);
- return map$2(directory, function (elems) {
- return map$3(elems, function (elem) {
- return elem.dom;
- });
- });
- }
- };
- };
- var BookmarkManager = function (selection) {
- return {
- getBookmark: curry(getBookmark$1, selection),
- moveToBookmark: curry(moveToBookmark, selection)
- };
- };
- BookmarkManager.isBookmarkNode = isBookmarkNode$1;
- var getContentEditableRoot$1 = function (root, node) {
- while (node && node !== root) {
- if (isContentEditableTrue$4(node) || isContentEditableFalse$b(node)) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- };
- var isXYWithinRange = function (clientX, clientY, range) {
- if (range.collapsed) {
- return false;
- }
- if (Env.browser.isIE() && range.startOffset === range.endOffset - 1 && range.startContainer === range.endContainer) {
- var elm = range.startContainer.childNodes[range.startOffset];
- if (isElement$5(elm)) {
- return exists(elm.getClientRects(), function (rect) {
- return containsXY(rect, clientX, clientY);
- });
- }
- }
- return exists(range.getClientRects(), function (rect) {
- return containsXY(rect, clientX, clientY);
- });
- };
- var firePreProcess = function (editor, args) {
- return editor.fire('PreProcess', args);
- };
- var firePostProcess = function (editor, args) {
- return editor.fire('PostProcess', args);
- };
- var fireRemove = function (editor) {
- return editor.fire('remove');
- };
- var fireDetach = function (editor) {
- return editor.fire('detach');
- };
- var fireSwitchMode = function (editor, mode) {
- return editor.fire('SwitchMode', { mode: mode });
- };
- var fireObjectResizeStart = function (editor, target, width, height, origin) {
- editor.fire('ObjectResizeStart', {
- target: target,
- width: width,
- height: height,
- origin: origin
- });
- };
- var fireObjectResized = function (editor, target, width, height, origin) {
- editor.fire('ObjectResized', {
- target: target,
- width: width,
- height: height,
- origin: origin
- });
- };
- var firePreInit = function (editor) {
- return editor.fire('PreInit');
- };
- var firePostRender = function (editor) {
- return editor.fire('PostRender');
- };
- var fireInit = function (editor) {
- return editor.fire('Init');
- };
- var firePlaceholderToggle = function (editor, state) {
- return editor.fire('PlaceholderToggle', { state: state });
- };
- var fireError = function (editor, errorType, error) {
- return editor.fire(errorType, error);
- };
- var fireFormatApply = function (editor, format, node, vars) {
- return editor.fire('FormatApply', {
- format: format,
- node: node,
- vars: vars
- });
- };
- var fireFormatRemove = function (editor, format, node, vars) {
- return editor.fire('FormatRemove', {
- format: format,
- node: node,
- vars: vars
- });
- };
- var VK = {
- BACKSPACE: 8,
- DELETE: 46,
- DOWN: 40,
- ENTER: 13,
- ESC: 27,
- LEFT: 37,
- RIGHT: 39,
- SPACEBAR: 32,
- TAB: 9,
- UP: 38,
- PAGE_UP: 33,
- PAGE_DOWN: 34,
- END: 35,
- HOME: 36,
- modifierPressed: function (e) {
- return e.shiftKey || e.ctrlKey || e.altKey || VK.metaKeyPressed(e);
- },
- metaKeyPressed: function (e) {
- return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey;
- }
- };
- var isContentEditableFalse$5 = isContentEditableFalse$b;
- var ControlSelection = function (selection, editor) {
- var elementSelectionAttr = 'data-mce-selected';
- var dom = editor.dom, each = Tools.each;
- var selectedElm, selectedElmGhost, resizeHelper, selectedHandle, resizeBackdrop;
- var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
- var width, height;
- var editableDoc = editor.getDoc(), rootDocument = document;
- var abs = Math.abs, round = Math.round, rootElement = editor.getBody();
- var startScrollWidth, startScrollHeight;
- var resizeHandles = {
- nw: [
- 0,
- 0,
- -1,
- -1
- ],
- ne: [
- 1,
- 0,
- 1,
- -1
- ],
- se: [
- 1,
- 1,
- 1,
- 1
- ],
- sw: [
- 0,
- 1,
- -1,
- 1
- ]
- };
- var isImage = function (elm) {
- return elm && (elm.nodeName === 'IMG' || editor.dom.is(elm, 'figure.image'));
- };
- var isMedia = function (elm) {
- return isMedia$2(elm) || dom.hasClass(elm, 'mce-preview-object');
- };
- var isEventOnImageOutsideRange = function (evt, range) {
- if (evt.type === 'longpress' || evt.type.indexOf('touch') === 0) {
- var touch = evt.touches[0];
- return isImage(evt.target) && !isXYWithinRange(touch.clientX, touch.clientY, range);
- } else {
- return isImage(evt.target) && !isXYWithinRange(evt.clientX, evt.clientY, range);
- }
- };
- var contextMenuSelectImage = function (evt) {
- var target = evt.target;
- if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) {
- editor.selection.select(target);
- }
- };
- var getResizeTargets = function (elm) {
- if (dom.is(elm, 'figure.image')) {
- return [elm.querySelector('img')];
- } else if (dom.hasClass(elm, 'mce-preview-object') && isNonNullable(elm.firstElementChild)) {
- return [
- elm,
- elm.firstElementChild
- ];
- } else {
- return [elm];
- }
- };
- var isResizable = function (elm) {
- var selector = getObjectResizing(editor);
- if (!selector) {
- return false;
- }
- if (elm.getAttribute('data-mce-resize') === 'false') {
- return false;
- }
- if (elm === editor.getBody()) {
- return false;
- }
- if (dom.hasClass(elm, 'mce-preview-object')) {
- return is$2(SugarElement.fromDom(elm.firstElementChild), selector);
- } else {
- return is$2(SugarElement.fromDom(elm), selector);
- }
- };
- var createGhostElement = function (elm) {
- if (isMedia(elm)) {
- return dom.create('img', { src: Env.transparentSrc });
- } else {
- return elm.cloneNode(true);
- }
- };
- var setSizeProp = function (element, name, value) {
- if (isNonNullable(value)) {
- var targets = getResizeTargets(element);
- each$k(targets, function (target) {
- if (target.style[name] || !editor.schema.isValid(target.nodeName.toLowerCase(), name)) {
- dom.setStyle(target, name, value);
- } else {
- dom.setAttrib(target, name, '' + value);
- }
- });
- }
- };
- var setGhostElmSize = function (ghostElm, width, height) {
- setSizeProp(ghostElm, 'width', width);
- setSizeProp(ghostElm, 'height', height);
- };
- var resizeGhostElement = function (e) {
- var deltaX, deltaY, proportional;
- var resizeHelperX, resizeHelperY;
- deltaX = e.screenX - startX;
- deltaY = e.screenY - startY;
- width = deltaX * selectedHandle[2] + startW;
- height = deltaY * selectedHandle[3] + startH;
- width = width < 5 ? 5 : width;
- height = height < 5 ? 5 : height;
- if ((isImage(selectedElm) || isMedia(selectedElm)) && getResizeImgProportional(editor) !== false) {
- proportional = !VK.modifierPressed(e);
- } else {
- proportional = VK.modifierPressed(e);
- }
- if (proportional) {
- if (abs(deltaX) > abs(deltaY)) {
- height = round(width * ratio);
- width = round(height / ratio);
- } else {
- width = round(height / ratio);
- height = round(width * ratio);
- }
- }
- setGhostElmSize(selectedElmGhost, width, height);
- resizeHelperX = selectedHandle.startPos.x + deltaX;
- resizeHelperY = selectedHandle.startPos.y + deltaY;
- resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
- resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
- dom.setStyles(resizeHelper, {
- left: resizeHelperX,
- top: resizeHelperY,
- display: 'block'
- });
- resizeHelper.innerHTML = width + ' × ' + height;
- if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
- dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
- }
- if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
- dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
- }
- deltaX = rootElement.scrollWidth - startScrollWidth;
- deltaY = rootElement.scrollHeight - startScrollHeight;
- if (deltaX + deltaY !== 0) {
- dom.setStyles(resizeHelper, {
- left: resizeHelperX - deltaX,
- top: resizeHelperY - deltaY
- });
- }
- if (!resizeStarted) {
- fireObjectResizeStart(editor, selectedElm, startW, startH, 'corner-' + selectedHandle.name);
- resizeStarted = true;
- }
- };
- var endGhostResize = function () {
- var wasResizeStarted = resizeStarted;
- resizeStarted = false;
- if (wasResizeStarted) {
- setSizeProp(selectedElm, 'width', width);
- setSizeProp(selectedElm, 'height', height);
- }
- dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
- dom.unbind(editableDoc, 'mouseup', endGhostResize);
- if (rootDocument !== editableDoc) {
- dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
- dom.unbind(rootDocument, 'mouseup', endGhostResize);
- }
- dom.remove(selectedElmGhost);
- dom.remove(resizeHelper);
- dom.remove(resizeBackdrop);
- showResizeRect(selectedElm);
- if (wasResizeStarted) {
- fireObjectResized(editor, selectedElm, width, height, 'corner-' + selectedHandle.name);
- dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
- }
- editor.nodeChanged();
- };
- var showResizeRect = function (targetElm) {
- unbindResizeHandleEvents();
- var position = dom.getPos(targetElm, rootElement);
- var selectedElmX = position.x;
- var selectedElmY = position.y;
- var rect = targetElm.getBoundingClientRect();
- var targetWidth = rect.width || rect.right - rect.left;
- var targetHeight = rect.height || rect.bottom - rect.top;
- if (selectedElm !== targetElm) {
- hideResizeRect();
- selectedElm = targetElm;
- width = height = 0;
- }
- var e = editor.fire('ObjectSelected', { target: targetElm });
- var selectedValue = dom.getAttrib(selectedElm, elementSelectionAttr, '1');
- if (isResizable(targetElm) && !e.isDefaultPrevented()) {
- each(resizeHandles, function (handle, name) {
- var handleElm;
- var startDrag = function (e) {
- var target = getResizeTargets(selectedElm)[0];
- startX = e.screenX;
- startY = e.screenY;
- startW = target.clientWidth;
- startH = target.clientHeight;
- ratio = startH / startW;
- selectedHandle = handle;
- selectedHandle.name = name;
- selectedHandle.startPos = {
- x: targetWidth * handle[0] + selectedElmX,
- y: targetHeight * handle[1] + selectedElmY
- };
- startScrollWidth = rootElement.scrollWidth;
- startScrollHeight = rootElement.scrollHeight;
- resizeBackdrop = dom.add(rootElement, 'div', {
- 'class': 'mce-resize-backdrop',
- 'data-mce-bogus': 'all'
- });
- dom.setStyles(resizeBackdrop, {
- position: 'fixed',
- left: '0',
- top: '0',
- width: '100%',
- height: '100%'
- });
- selectedElmGhost = createGhostElement(selectedElm);
- dom.addClass(selectedElmGhost, 'mce-clonedresizable');
- dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
- selectedElmGhost.contentEditable = 'false';
- dom.setStyles(selectedElmGhost, {
- left: selectedElmX,
- top: selectedElmY,
- margin: 0
- });
- setGhostElmSize(selectedElmGhost, targetWidth, targetHeight);
- selectedElmGhost.removeAttribute(elementSelectionAttr);
- rootElement.appendChild(selectedElmGhost);
- dom.bind(editableDoc, 'mousemove', resizeGhostElement);
- dom.bind(editableDoc, 'mouseup', endGhostResize);
- if (rootDocument !== editableDoc) {
- dom.bind(rootDocument, 'mousemove', resizeGhostElement);
- dom.bind(rootDocument, 'mouseup', endGhostResize);
- }
- resizeHelper = dom.add(rootElement, 'div', {
- 'class': 'mce-resize-helper',
- 'data-mce-bogus': 'all'
- }, startW + ' × ' + startH);
- };
- handleElm = dom.get('mceResizeHandle' + name);
- if (handleElm) {
- dom.remove(handleElm);
- }
- handleElm = dom.add(rootElement, 'div', {
- 'id': 'mceResizeHandle' + name,
- 'data-mce-bogus': 'all',
- 'class': 'mce-resizehandle',
- 'unselectable': true,
- 'style': 'cursor:' + name + '-resize; margin:0; padding:0'
- });
- if (Env.ie === 11) {
- handleElm.contentEditable = false;
- }
- dom.bind(handleElm, 'mousedown', function (e) {
- e.stopImmediatePropagation();
- e.preventDefault();
- startDrag(e);
- });
- handle.elm = handleElm;
- dom.setStyles(handleElm, {
- left: targetWidth * handle[0] + selectedElmX - handleElm.offsetWidth / 2,
- top: targetHeight * handle[1] + selectedElmY - handleElm.offsetHeight / 2
- });
- });
- } else {
- hideResizeRect();
- }
- if (!dom.getAttrib(selectedElm, elementSelectionAttr)) {
- selectedElm.setAttribute(elementSelectionAttr, selectedValue);
- }
- };
- var hideResizeRect = function () {
- unbindResizeHandleEvents();
- if (selectedElm) {
- selectedElm.removeAttribute(elementSelectionAttr);
- }
- each$j(resizeHandles, function (value, name) {
- var handleElm = dom.get('mceResizeHandle' + name);
- if (handleElm) {
- dom.unbind(handleElm);
- dom.remove(handleElm);
- }
- });
- };
- var updateResizeRect = function (e) {
- var startElm, controlElm;
- var isChildOrEqual = function (node, parent) {
- if (node) {
- do {
- if (node === parent) {
- return true;
- }
- } while (node = node.parentNode);
- }
- };
- if (resizeStarted || editor.removed) {
- return;
- }
- each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function (img) {
- img.removeAttribute(elementSelectionAttr);
- });
- controlElm = e.type === 'mousedown' ? e.target : selection.getNode();
- controlElm = dom.$(controlElm).closest('table,img,figure.image,hr,video,span.mce-preview-object')[0];
- if (isChildOrEqual(controlElm, rootElement)) {
- disableGeckoResize();
- startElm = selection.getStart(true);
- if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
- showResizeRect(controlElm);
- return;
- }
- }
- hideResizeRect();
- };
- var isWithinContentEditableFalse = function (elm) {
- return isContentEditableFalse$5(getContentEditableRoot$1(editor.getBody(), elm));
- };
- var unbindResizeHandleEvents = function () {
- each$j(resizeHandles, function (handle) {
- if (handle.elm) {
- dom.unbind(handle.elm);
- delete handle.elm;
- }
- });
- };
- var disableGeckoResize = function () {
- try {
- editor.getDoc().execCommand('enableObjectResizing', false, 'false');
- } catch (ex) {
- }
- };
- editor.on('init', function () {
- disableGeckoResize();
- if (Env.browser.isIE() || Env.browser.isEdge()) {
- editor.on('mousedown click', function (e) {
- var target = e.target, nodeName = target.nodeName;
- if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName) && !isWithinContentEditableFalse(target)) {
- if (e.button !== 2) {
- editor.selection.select(target, nodeName === 'TABLE');
- }
- if (e.type === 'mousedown') {
- editor.nodeChanged();
- }
- }
- });
- var handleMSControlSelect_1 = function (e) {
- var delayedSelect = function (node) {
- Delay.setEditorTimeout(editor, function () {
- return editor.selection.select(node);
- });
- };
- if (isWithinContentEditableFalse(e.target) || isMedia$2(e.target)) {
- e.preventDefault();
- delayedSelect(e.target);
- return;
- }
- if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
- e.preventDefault();
- if (e.target.tagName === 'IMG') {
- delayedSelect(e.target);
- }
- }
- };
- dom.bind(rootElement, 'mscontrolselect', handleMSControlSelect_1);
- editor.on('remove', function () {
- return dom.unbind(rootElement, 'mscontrolselect', handleMSControlSelect_1);
- });
- }
- var throttledUpdateResizeRect = Delay.throttle(function (e) {
- if (!editor.composing) {
- updateResizeRect(e);
- }
- });
- editor.on('nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged', throttledUpdateResizeRect);
- editor.on('keyup compositionend', function (e) {
- if (selectedElm && selectedElm.nodeName === 'TABLE') {
- throttledUpdateResizeRect(e);
- }
- });
- editor.on('hide blur', hideResizeRect);
- editor.on('contextmenu longpress', contextMenuSelectImage, true);
- });
- editor.on('remove', unbindResizeHandleEvents);
- var destroy = function () {
- selectedElm = selectedElmGhost = resizeBackdrop = null;
- };
- return {
- isResizable: isResizable,
- showResizeRect: showResizeRect,
- hideResizeRect: hideResizeRect,
- updateResizeRect: updateResizeRect,
- destroy: destroy
- };
- };
- var hasCeProperty = function (node) {
- return isContentEditableTrue$4(node) || isContentEditableFalse$b(node);
- };
- var findParent$1 = function (node, rootNode, predicate) {
- while (node && node !== rootNode) {
- if (predicate(node)) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- };
- var findClosestIeRange = function (clientX, clientY, doc) {
- var rects;
- var element = doc.elementFromPoint(clientX, clientY);
- var rng = doc.body.createTextRange();
- if (!element || element.tagName === 'HTML') {
- element = doc.body;
- }
- rng.moveToElementText(element);
- rects = Tools.toArray(rng.getClientRects());
- rects = rects.sort(function (a, b) {
- a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY));
- b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY));
- return a - b;
- });
- if (rects.length > 0) {
- clientY = (rects[0].bottom + rects[0].top) / 2;
- try {
- rng.moveToPoint(clientX, clientY);
- rng.collapse(true);
- return rng;
- } catch (ex) {
- }
- }
- return null;
- };
- var moveOutOfContentEditableFalse = function (rng, rootNode) {
- var parentElement = rng && rng.parentElement ? rng.parentElement() : null;
- return isContentEditableFalse$b(findParent$1(parentElement, rootNode, hasCeProperty)) ? null : rng;
- };
- var fromPoint = function (clientX, clientY, doc) {
- var rng, point;
- var pointDoc = doc;
- if (pointDoc.caretPositionFromPoint) {
- point = pointDoc.caretPositionFromPoint(clientX, clientY);
- if (point) {
- rng = doc.createRange();
- rng.setStart(point.offsetNode, point.offset);
- rng.collapse(true);
- }
- } else if (pointDoc.caretRangeFromPoint) {
- rng = pointDoc.caretRangeFromPoint(clientX, clientY);
- } else if (pointDoc.body.createTextRange) {
- rng = pointDoc.body.createTextRange();
- try {
- rng.moveToPoint(clientX, clientY);
- rng.collapse(true);
- } catch (ex) {
- rng = findClosestIeRange(clientX, clientY, doc);
- }
- return moveOutOfContentEditableFalse(rng, doc.body);
- }
- return rng;
- };
- var isEq$4 = function (rng1, rng2) {
- return rng1 && rng2 && (rng1.startContainer === rng2.startContainer && rng1.startOffset === rng2.startOffset) && (rng1.endContainer === rng2.endContainer && rng1.endOffset === rng2.endOffset);
- };
- var findParent = function (node, rootNode, predicate) {
- while (node && node !== rootNode) {
- if (predicate(node)) {
- return node;
- }
- node = node.parentNode;
- }
- return null;
- };
- var hasParent$1 = function (node, rootNode, predicate) {
- return findParent(node, rootNode, predicate) !== null;
- };
- var hasParentWithName = function (node, rootNode, name) {
- return hasParent$1(node, rootNode, function (node) {
- return node.nodeName === name;
- });
- };
- var isTable = function (node) {
- return node && node.nodeName === 'TABLE';
- };
- var isTableCell$2 = function (node) {
- return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
- };
- var isCeFalseCaretContainer = function (node, rootNode) {
- return isCaretContainer$2(node) && hasParent$1(node, rootNode, isCaretNode) === false;
- };
- var hasBrBeforeAfter = function (dom, node, left) {
- var walker = new DomTreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || dom.getRoot());
- while (node = walker[left ? 'prev' : 'next']()) {
- if (isBr$5(node)) {
- return true;
- }
- }
- };
- var isPrevNode = function (node, name) {
- return node.previousSibling && node.previousSibling.nodeName === name;
- };
- var hasContentEditableFalseParent = function (body, node) {
- while (node && node !== body) {
- if (isContentEditableFalse$b(node)) {
- return true;
- }
- node = node.parentNode;
- }
- return false;
- };
- var findTextNodeRelative = function (dom, isAfterNode, collapsed, left, startNode) {
- var lastInlineElement;
- var body = dom.getRoot();
- var node;
- var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
- var parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
- if (left && isBr$5(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) {
- return Optional.some(CaretPosition(startNode.parentNode, dom.nodeIndex(startNode)));
- }
- var walker = new DomTreeWalker(startNode, parentBlockContainer);
- while (node = walker[left ? 'prev' : 'next']()) {
- if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) {
- return Optional.none();
- }
- if (isText$7(node) && node.nodeValue.length > 0) {
- if (hasParentWithName(node, body, 'A') === false) {
- return Optional.some(CaretPosition(node, left ? node.nodeValue.length : 0));
- }
- return Optional.none();
- }
- if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
- return Optional.none();
- }
- lastInlineElement = node;
- }
- if (collapsed && lastInlineElement) {
- return Optional.some(CaretPosition(lastInlineElement, 0));
- }
- return Optional.none();
- };
- var normalizeEndPoint = function (dom, collapsed, start, rng) {
- var container, offset;
- var body = dom.getRoot();
- var node;
- var directionLeft, normalized = false;
- container = rng[(start ? 'start' : 'end') + 'Container'];
- offset = rng[(start ? 'start' : 'end') + 'Offset'];
- var isAfterNode = isElement$5(container) && offset === container.childNodes.length;
- var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
- directionLeft = start;
- if (isCaretContainer$2(container)) {
- return Optional.none();
- }
- if (isElement$5(container) && offset > container.childNodes.length - 1) {
- directionLeft = false;
- }
- if (isDocument$1(container)) {
- container = body;
- offset = 0;
- }
- if (container === body) {
- if (directionLeft) {
- node = container.childNodes[offset > 0 ? offset - 1 : 0];
- if (node) {
- if (isCaretContainer$2(node)) {
- return Optional.none();
- }
- if (nonEmptyElementsMap[node.nodeName] || isTable(node)) {
- return Optional.none();
- }
- }
- }
- if (container.hasChildNodes()) {
- offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
- container = container.childNodes[offset];
- offset = isText$7(container) && isAfterNode ? container.data.length : 0;
- if (!collapsed && container === body.lastChild && isTable(container)) {
- return Optional.none();
- }
- if (hasContentEditableFalseParent(body, container) || isCaretContainer$2(container)) {
- return Optional.none();
- }
- if (container.hasChildNodes() && isTable(container) === false) {
- node = container;
- var walker = new DomTreeWalker(container, body);
- do {
- if (isContentEditableFalse$b(node) || isCaretContainer$2(node)) {
- normalized = false;
- break;
- }
- if (isText$7(node) && node.nodeValue.length > 0) {
- offset = directionLeft ? 0 : node.nodeValue.length;
- container = node;
- normalized = true;
- break;
- }
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell$2(node)) {
- offset = dom.nodeIndex(node);
- container = node.parentNode;
- if (!directionLeft) {
- offset++;
- }
- normalized = true;
- break;
- }
- } while (node = directionLeft ? walker.next() : walker.prev());
- }
- }
- }
- if (collapsed) {
- if (isText$7(container) && offset === 0) {
- findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each(function (pos) {
- container = pos.container();
- offset = pos.offset();
- normalized = true;
- });
- }
- if (isElement$5(container)) {
- node = container.childNodes[offset];
- if (!node) {
- node = container.childNodes[offset - 1];
- }
- if (node && isBr$5(node) && !isPrevNode(node, 'A') && !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) {
- findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each(function (pos) {
- container = pos.container();
- offset = pos.offset();
- normalized = true;
- });
- }
- }
- }
- if (directionLeft && !collapsed && isText$7(container) && offset === container.nodeValue.length) {
- findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each(function (pos) {
- container = pos.container();
- offset = pos.offset();
- normalized = true;
- });
- }
- return normalized ? Optional.some(CaretPosition(container, offset)) : Optional.none();
- };
- var normalize$2 = function (dom, rng) {
- var collapsed = rng.collapsed, normRng = rng.cloneRange();
- var startPos = CaretPosition.fromRangeStart(rng);
- normalizeEndPoint(dom, collapsed, true, normRng).each(function (pos) {
- if (!collapsed || !CaretPosition.isAbove(startPos, pos)) {
- normRng.setStart(pos.container(), pos.offset());
- }
- });
- if (!collapsed) {
- normalizeEndPoint(dom, collapsed, false, normRng).each(function (pos) {
- normRng.setEnd(pos.container(), pos.offset());
- });
- }
- if (collapsed) {
- normRng.collapse(true);
- }
- return isEq$4(rng, normRng) ? Optional.none() : Optional.some(normRng);
- };
- var splitText = function (node, offset) {
- return node.splitText(offset);
- };
- var split = function (rng) {
- var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
- if (startContainer === endContainer && isText$7(startContainer)) {
- if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
- endContainer = splitText(startContainer, startOffset);
- startContainer = endContainer.previousSibling;
- if (endOffset > startOffset) {
- endOffset = endOffset - startOffset;
- startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
- endOffset = endContainer.nodeValue.length;
- startOffset = 0;
- } else {
- endOffset = 0;
- }
- }
- } else {
- if (isText$7(startContainer) && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
- startContainer = splitText(startContainer, startOffset);
- startOffset = 0;
- }
- if (isText$7(endContainer) && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
- endContainer = splitText(endContainer, endOffset).previousSibling;
- endOffset = endContainer.nodeValue.length;
- }
- }
- return {
- startContainer: startContainer,
- startOffset: startOffset,
- endContainer: endContainer,
- endOffset: endOffset
- };
- };
- var RangeUtils = function (dom) {
- var walk = function (rng, callback) {
- return walk$2(dom, rng, callback);
- };
- var split$1 = split;
- var normalize = function (rng) {
- return normalize$2(dom, rng).fold(never, function (normalizedRng) {
- rng.setStart(normalizedRng.startContainer, normalizedRng.startOffset);
- rng.setEnd(normalizedRng.endContainer, normalizedRng.endOffset);
- return true;
- });
- };
- return {
- walk: walk,
- split: split$1,
- normalize: normalize
- };
- };
- RangeUtils.compareRanges = isEq$4;
- RangeUtils.getCaretRangeFromPoint = fromPoint;
- RangeUtils.getSelectedNode = getSelectedNode;
- RangeUtils.getNode = getNode$1;
- var Dimension = function (name, getOffset) {
- var set = function (element, h) {
- if (!isNumber(h) && !h.match(/^[0-9]+$/)) {
- throw new Error(name + '.set accepts only positive integer values. Value was ' + h);
- }
- var dom = element.dom;
- if (isSupported(dom)) {
- dom.style[name] = h + 'px';
- }
- };
- var get = function (element) {
- var r = getOffset(element);
- if (r <= 0 || r === null) {
- var css = get$5(element, name);
- return parseFloat(css) || 0;
- }
- return r;
- };
- var getOuter = get;
- var aggregate = function (element, properties) {
- return foldl(properties, function (acc, property) {
- var val = get$5(element, property);
- var value = val === undefined ? 0 : parseInt(val, 10);
- return isNaN(value) ? acc : acc + value;
- }, 0);
- };
- var max = function (element, value, properties) {
- var cumulativeInclusions = aggregate(element, properties);
- var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0;
- return absoluteMax;
- };
- return {
- set: set,
- get: get,
- getOuter: getOuter,
- aggregate: aggregate,
- max: max
- };
- };
- var api = Dimension('height', function (element) {
- var dom = element.dom;
- return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight;
- });
- var get$1 = function (element) {
- return api.get(element);
- };
- var walkUp = function (navigation, doc) {
- var frame = navigation.view(doc);
- return frame.fold(constant([]), function (f) {
- var parent = navigation.owner(f);
- var rest = walkUp(navigation, parent);
- return [f].concat(rest);
- });
- };
- var pathTo = function (element, navigation) {
- var d = navigation.owner(element);
- return walkUp(navigation, d);
- };
- var view = function (doc) {
- var _a;
- var element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement);
- return element.map(SugarElement.fromDom);
- };
- var owner = function (element) {
- return documentOrOwner(element);
- };
- var Navigation = /*#__PURE__*/Object.freeze({
- __proto__: null,
- view: view,
- owner: owner
- });
- var find$1 = function (element) {
- var doc = SugarElement.fromDom(document);
- var scroll = get$8(doc);
- var frames = pathTo(element, Navigation);
- var offset = viewport(element);
- var r = foldr(frames, function (b, a) {
- var loc = viewport(a);
- return {
- left: b.left + loc.left,
- top: b.top + loc.top
- };
- }, {
- left: 0,
- top: 0
- });
- return SugarPosition(r.left + offset.left + scroll.left, r.top + offset.top + scroll.top);
- };
- var excludeFromDescend = function (element) {
- return name(element) === 'textarea';
- };
- var fireScrollIntoViewEvent = function (editor, data) {
- var scrollEvent = editor.fire('ScrollIntoView', data);
- return scrollEvent.isDefaultPrevented();
- };
- var fireAfterScrollIntoViewEvent = function (editor, data) {
- editor.fire('AfterScrollIntoView', data);
- };
- var descend = function (element, offset) {
- var children$1 = children(element);
- if (children$1.length === 0 || excludeFromDescend(element)) {
- return {
- element: element,
- offset: offset
- };
- } else if (offset < children$1.length && !excludeFromDescend(children$1[offset])) {
- return {
- element: children$1[offset],
- offset: 0
- };
- } else {
- var last = children$1[children$1.length - 1];
- if (excludeFromDescend(last)) {
- return {
- element: element,
- offset: offset
- };
- } else {
- if (name(last) === 'img') {
- return {
- element: last,
- offset: 1
- };
- } else if (isText$8(last)) {
- return {
- element: last,
- offset: get$2(last).length
- };
- } else {
- return {
- element: last,
- offset: children(last).length
- };
- }
- }
- }
- };
- var markerInfo = function (element, cleanupFun) {
- var pos = absolute(element);
- var height = get$1(element);
- return {
- element: element,
- bottom: pos.top + height,
- height: height,
- pos: pos,
- cleanup: cleanupFun
- };
- };
- var createMarker = function (element, offset) {
- var startPoint = descend(element, offset);
- var span = SugarElement.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">' + ZWSP$1 + '</span>');
- before$4(startPoint.element, span);
- return markerInfo(span, function () {
- return remove$7(span);
- });
- };
- var elementMarker = function (element) {
- return markerInfo(SugarElement.fromDom(element), noop);
- };
- var withMarker = function (editor, f, rng, alignToTop) {
- preserveWith(editor, function (_s, _e) {
- return applyWithMarker(editor, f, rng, alignToTop);
- }, rng);
- };
- var withScrollEvents = function (editor, doc, f, marker, alignToTop) {
- var data = {
- elm: marker.element.dom,
- alignToTop: alignToTop
- };
- if (fireScrollIntoViewEvent(editor, data)) {
- return;
- }
- var scrollTop = get$8(doc).top;
- f(doc, scrollTop, marker, alignToTop);
- fireAfterScrollIntoViewEvent(editor, data);
- };
- var applyWithMarker = function (editor, f, rng, alignToTop) {
- var body = SugarElement.fromDom(editor.getBody());
- var doc = SugarElement.fromDom(editor.getDoc());
- reflow(body);
- var marker = createMarker(SugarElement.fromDom(rng.startContainer), rng.startOffset);
- withScrollEvents(editor, doc, f, marker, alignToTop);
- marker.cleanup();
- };
- var withElement = function (editor, element, f, alignToTop) {
- var doc = SugarElement.fromDom(editor.getDoc());
- withScrollEvents(editor, doc, f, elementMarker(element), alignToTop);
- };
- var preserveWith = function (editor, f, rng) {
- var startElement = rng.startContainer;
- var startOffset = rng.startOffset;
- var endElement = rng.endContainer;
- var endOffset = rng.endOffset;
- f(SugarElement.fromDom(startElement), SugarElement.fromDom(endElement));
- var newRng = editor.dom.createRng();
- newRng.setStart(startElement, startOffset);
- newRng.setEnd(endElement, endOffset);
- editor.selection.setRng(rng);
- };
- var scrollToMarker = function (marker, viewHeight, alignToTop, doc) {
- var pos = marker.pos;
- if (alignToTop) {
- to(pos.left, pos.top, doc);
- } else {
- var y = pos.top - viewHeight + marker.height;
- to(pos.left, y, doc);
- }
- };
- var intoWindowIfNeeded = function (doc, scrollTop, viewHeight, marker, alignToTop) {
- var viewportBottom = viewHeight + scrollTop;
- var markerTop = marker.pos.top;
- var markerBottom = marker.bottom;
- var largerThanViewport = markerBottom - markerTop >= viewHeight;
- if (markerTop < scrollTop) {
- scrollToMarker(marker, viewHeight, alignToTop !== false, doc);
- } else if (markerTop > viewportBottom) {
- var align = largerThanViewport ? alignToTop !== false : alignToTop === true;
- scrollToMarker(marker, viewHeight, align, doc);
- } else if (markerBottom > viewportBottom && !largerThanViewport) {
- scrollToMarker(marker, viewHeight, alignToTop === true, doc);
- }
- };
- var intoWindow = function (doc, scrollTop, marker, alignToTop) {
- var viewHeight = doc.dom.defaultView.innerHeight;
- intoWindowIfNeeded(doc, scrollTop, viewHeight, marker, alignToTop);
- };
- var intoFrame = function (doc, scrollTop, marker, alignToTop) {
- var frameViewHeight = doc.dom.defaultView.innerHeight;
- intoWindowIfNeeded(doc, scrollTop, frameViewHeight, marker, alignToTop);
- var op = find$1(marker.element);
- var viewportBounds = getBounds(window);
- if (op.top < viewportBounds.y) {
- intoView(marker.element, alignToTop !== false);
- } else if (op.top > viewportBounds.bottom) {
- intoView(marker.element, alignToTop === true);
- }
- };
- var rangeIntoWindow = function (editor, rng, alignToTop) {
- return withMarker(editor, intoWindow, rng, alignToTop);
- };
- var elementIntoWindow = function (editor, element, alignToTop) {
- return withElement(editor, element, intoWindow, alignToTop);
- };
- var rangeIntoFrame = function (editor, rng, alignToTop) {
- return withMarker(editor, intoFrame, rng, alignToTop);
- };
- var elementIntoFrame = function (editor, element, alignToTop) {
- return withElement(editor, element, intoFrame, alignToTop);
- };
- var scrollElementIntoView = function (editor, element, alignToTop) {
- var scroller = editor.inline ? elementIntoWindow : elementIntoFrame;
- scroller(editor, element, alignToTop);
- };
- var scrollRangeIntoView = function (editor, rng, alignToTop) {
- var scroller = editor.inline ? rangeIntoWindow : rangeIntoFrame;
- scroller(editor, rng, alignToTop);
- };
- var getDocument = function () {
- return SugarElement.fromDom(document);
- };
- var focus$1 = function (element) {
- return element.dom.focus();
- };
- var hasFocus$1 = function (element) {
- var root = getRootNode(element).dom;
- return element.dom === root.activeElement;
- };
- var active = function (root) {
- if (root === void 0) {
- root = getDocument();
- }
- return Optional.from(root.dom.activeElement).map(SugarElement.fromDom);
- };
- var search = function (element) {
- return active(getRootNode(element)).filter(function (e) {
- return element.dom.contains(e.dom);
- });
- };
- var create$5 = function (start, soffset, finish, foffset) {
- return {
- start: start,
- soffset: soffset,
- finish: finish,
- foffset: foffset
- };
- };
- var SimRange = { create: create$5 };
- var adt$1 = Adt.generate([
- { before: ['element'] },
- {
- on: [
- 'element',
- 'offset'
- ]
- },
- { after: ['element'] }
- ]);
- var cata = function (subject, onBefore, onOn, onAfter) {
- return subject.fold(onBefore, onOn, onAfter);
- };
- var getStart$2 = function (situ) {
- return situ.fold(identity, identity, identity);
- };
- var before$1 = adt$1.before;
- var on = adt$1.on;
- var after$1 = adt$1.after;
- var Situ = {
- before: before$1,
- on: on,
- after: after$1,
- cata: cata,
- getStart: getStart$2
- };
- var adt = Adt.generate([
- { domRange: ['rng'] },
- {
- relative: [
- 'startSitu',
- 'finishSitu'
- ]
- },
- {
- exact: [
- 'start',
- 'soffset',
- 'finish',
- 'foffset'
- ]
- }
- ]);
- var exactFromRange = function (simRange) {
- return adt.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset);
- };
- var getStart$1 = function (selection) {
- return selection.match({
- domRange: function (rng) {
- return SugarElement.fromDom(rng.startContainer);
- },
- relative: function (startSitu, _finishSitu) {
- return Situ.getStart(startSitu);
- },
- exact: function (start, _soffset, _finish, _foffset) {
- return start;
- }
- });
- };
- var domRange = adt.domRange;
- var relative = adt.relative;
- var exact = adt.exact;
- var getWin = function (selection) {
- var start = getStart$1(selection);
- return defaultView(start);
- };
- var range = SimRange.create;
- var SimSelection = {
- domRange: domRange,
- relative: relative,
- exact: exact,
- exactFromRange: exactFromRange,
- getWin: getWin,
- range: range
- };
- var browser$1 = detect().browser;
- var clamp$1 = function (offset, element) {
- var max = isText$8(element) ? get$2(element).length : children(element).length + 1;
- if (offset > max) {
- return max;
- } else if (offset < 0) {
- return 0;
- }
- return offset;
- };
- var normalizeRng = function (rng) {
- return SimSelection.range(rng.start, clamp$1(rng.soffset, rng.start), rng.finish, clamp$1(rng.foffset, rng.finish));
- };
- var isOrContains = function (root, elm) {
- return !isRestrictedNode(elm.dom) && (contains$1(root, elm) || eq(root, elm));
- };
- var isRngInRoot = function (root) {
- return function (rng) {
- return isOrContains(root, rng.start) && isOrContains(root, rng.finish);
- };
- };
- var shouldStore = function (editor) {
- return editor.inline === true || browser$1.isIE();
- };
- var nativeRangeToSelectionRange = function (r) {
- return SimSelection.range(SugarElement.fromDom(r.startContainer), r.startOffset, SugarElement.fromDom(r.endContainer), r.endOffset);
- };
- var readRange = function (win) {
- var selection = win.getSelection();
- var rng = !selection || selection.rangeCount === 0 ? Optional.none() : Optional.from(selection.getRangeAt(0));
- return rng.map(nativeRangeToSelectionRange);
- };
- var getBookmark = function (root) {
- var win = defaultView(root);
- return readRange(win.dom).filter(isRngInRoot(root));
- };
- var validate = function (root, bookmark) {
- return Optional.from(bookmark).filter(isRngInRoot(root)).map(normalizeRng);
- };
- var bookmarkToNativeRng = function (bookmark) {
- var rng = document.createRange();
- try {
- rng.setStart(bookmark.start.dom, bookmark.soffset);
- rng.setEnd(bookmark.finish.dom, bookmark.foffset);
- return Optional.some(rng);
- } catch (_) {
- return Optional.none();
- }
- };
- var store = function (editor) {
- var newBookmark = shouldStore(editor) ? getBookmark(SugarElement.fromDom(editor.getBody())) : Optional.none();
- editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
- };
- var storeNative = function (editor, rng) {
- var root = SugarElement.fromDom(editor.getBody());
- var range = shouldStore(editor) ? Optional.from(rng) : Optional.none();
- var newBookmark = range.map(nativeRangeToSelectionRange).filter(isRngInRoot(root));
- editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
- };
- var getRng = function (editor) {
- var bookmark = editor.bookmark ? editor.bookmark : Optional.none();
- return bookmark.bind(function (x) {
- return validate(SugarElement.fromDom(editor.getBody()), x);
- }).bind(bookmarkToNativeRng);
- };
- var restore = function (editor) {
- getRng(editor).each(function (rng) {
- return editor.selection.setRng(rng);
- });
- };
- var isEditorUIElement$1 = function (elm) {
- var className = elm.className.toString();
- return className.indexOf('tox-') !== -1 || className.indexOf('mce-') !== -1;
- };
- var FocusManager = { isEditorUIElement: isEditorUIElement$1 };
- var isManualNodeChange = function (e) {
- return e.type === 'nodechange' && e.selectionChange;
- };
- var registerPageMouseUp = function (editor, throttledStore) {
- var mouseUpPage = function () {
- throttledStore.throttle();
- };
- DOMUtils.DOM.bind(document, 'mouseup', mouseUpPage);
- editor.on('remove', function () {
- DOMUtils.DOM.unbind(document, 'mouseup', mouseUpPage);
- });
- };
- var registerFocusOut = function (editor) {
- editor.on('focusout', function () {
- store(editor);
- });
- };
- var registerMouseUp = function (editor, throttledStore) {
- editor.on('mouseup touchend', function (_e) {
- throttledStore.throttle();
- });
- };
- var registerEditorEvents = function (editor, throttledStore) {
- var browser = detect().browser;
- if (browser.isIE()) {
- registerFocusOut(editor);
- } else {
- registerMouseUp(editor, throttledStore);
- }
- editor.on('keyup NodeChange', function (e) {
- if (!isManualNodeChange(e)) {
- store(editor);
- }
- });
- };
- var register$3 = function (editor) {
- var throttledStore = first(function () {
- store(editor);
- }, 0);
- editor.on('init', function () {
- if (editor.inline) {
- registerPageMouseUp(editor, throttledStore);
- }
- registerEditorEvents(editor, throttledStore);
- });
- editor.on('remove', function () {
- throttledStore.cancel();
- });
- };
- var documentFocusInHandler;
- var DOM$8 = DOMUtils.DOM;
- var isEditorUIElement = function (elm) {
- return FocusManager.isEditorUIElement(elm);
- };
- var isEditorContentAreaElement = function (elm) {
- var classList = elm.classList;
- if (classList !== undefined) {
- return classList.contains('tox-edit-area') || classList.contains('tox-edit-area__iframe') || classList.contains('mce-content-body');
- } else {
- return false;
- }
- };
- var isUIElement = function (editor, elm) {
- var customSelector = getCustomUiSelector(editor);
- var parent = DOM$8.getParent(elm, function (elm) {
- return isEditorUIElement(elm) || (customSelector ? editor.dom.is(elm, customSelector) : false);
- });
- return parent !== null;
- };
- var getActiveElement = function (editor) {
- try {
- var root = getRootNode(SugarElement.fromDom(editor.getElement()));
- return active(root).fold(function () {
- return document.body;
- }, function (x) {
- return x.dom;
- });
- } catch (ex) {
- return document.body;
- }
- };
- var registerEvents$1 = function (editorManager, e) {
- var editor = e.editor;
- register$3(editor);
- editor.on('focusin', function () {
- var focusedEditor = editorManager.focusedEditor;
- if (focusedEditor !== editor) {
- if (focusedEditor) {
- focusedEditor.fire('blur', { focusedEditor: editor });
- }
- editorManager.setActive(editor);
- editorManager.focusedEditor = editor;
- editor.fire('focus', { blurredEditor: focusedEditor });
- editor.focus(true);
- }
- });
- editor.on('focusout', function () {
- Delay.setEditorTimeout(editor, function () {
- var focusedEditor = editorManager.focusedEditor;
- if (!isUIElement(editor, getActiveElement(editor)) && focusedEditor === editor) {
- editor.fire('blur', { focusedEditor: null });
- editorManager.focusedEditor = null;
- }
- });
- });
- if (!documentFocusInHandler) {
- documentFocusInHandler = function (e) {
- var activeEditor = editorManager.activeEditor;
- if (activeEditor) {
- getOriginalEventTarget(e).each(function (target) {
- if (target.ownerDocument === document) {
- if (target !== document.body && !isUIElement(activeEditor, target) && editorManager.focusedEditor === activeEditor) {
- activeEditor.fire('blur', { focusedEditor: null });
- editorManager.focusedEditor = null;
- }
- }
- });
- }
- };
- DOM$8.bind(document, 'focusin', documentFocusInHandler);
- }
- };
- var unregisterDocumentEvents = function (editorManager, e) {
- if (editorManager.focusedEditor === e.editor) {
- editorManager.focusedEditor = null;
- }
- if (!editorManager.activeEditor) {
- DOM$8.unbind(document, 'focusin', documentFocusInHandler);
- documentFocusInHandler = null;
- }
- };
- var setup$l = function (editorManager) {
- editorManager.on('AddEditor', curry(registerEvents$1, editorManager));
- editorManager.on('RemoveEditor', curry(unregisterDocumentEvents, editorManager));
- };
- var getContentEditableHost = function (editor, node) {
- return editor.dom.getParent(node, function (node) {
- return editor.dom.getContentEditable(node) === 'true';
- });
- };
- var getCollapsedNode = function (rng) {
- return rng.collapsed ? Optional.from(getNode$1(rng.startContainer, rng.startOffset)).map(SugarElement.fromDom) : Optional.none();
- };
- var getFocusInElement = function (root, rng) {
- return getCollapsedNode(rng).bind(function (node) {
- if (isTableSection(node)) {
- return Optional.some(node);
- } else if (contains$1(root, node) === false) {
- return Optional.some(root);
- } else {
- return Optional.none();
- }
- });
- };
- var normalizeSelection$1 = function (editor, rng) {
- getFocusInElement(SugarElement.fromDom(editor.getBody()), rng).bind(function (elm) {
- return firstPositionIn(elm.dom);
- }).fold(function () {
- editor.selection.normalize();
- return;
- }, function (caretPos) {
- return editor.selection.setRng(caretPos.toRange());
- });
- };
- var focusBody = function (body) {
- if (body.setActive) {
- try {
- body.setActive();
- } catch (ex) {
- body.focus();
- }
- } else {
- body.focus();
- }
- };
- var hasElementFocus = function (elm) {
- return hasFocus$1(elm) || search(elm).isSome();
- };
- var hasIframeFocus = function (editor) {
- return editor.iframeElement && hasFocus$1(SugarElement.fromDom(editor.iframeElement));
- };
- var hasInlineFocus = function (editor) {
- var rawBody = editor.getBody();
- return rawBody && hasElementFocus(SugarElement.fromDom(rawBody));
- };
- var hasUiFocus = function (editor) {
- var dos = getRootNode(SugarElement.fromDom(editor.getElement()));
- return active(dos).filter(function (elem) {
- return !isEditorContentAreaElement(elem.dom) && isUIElement(editor, elem.dom);
- }).isSome();
- };
- var hasFocus = function (editor) {
- return editor.inline ? hasInlineFocus(editor) : hasIframeFocus(editor);
- };
- var hasEditorOrUiFocus = function (editor) {
- return hasFocus(editor) || hasUiFocus(editor);
- };
- var focusEditor = function (editor) {
- var selection = editor.selection;
- var body = editor.getBody();
- var rng = selection.getRng();
- editor.quirks.refreshContentEditable();
- if (editor.bookmark !== undefined && hasFocus(editor) === false) {
- getRng(editor).each(function (bookmarkRng) {
- editor.selection.setRng(bookmarkRng);
- rng = bookmarkRng;
- });
- }
- var contentEditableHost = getContentEditableHost(editor, selection.getNode());
- if (editor.$.contains(body, contentEditableHost)) {
- focusBody(contentEditableHost);
- normalizeSelection$1(editor, rng);
- activateEditor(editor);
- return;
- }
- if (!editor.inline) {
- if (!Env.opera) {
- focusBody(body);
- }
- editor.getWin().focus();
- }
- if (Env.gecko || editor.inline) {
- focusBody(body);
- normalizeSelection$1(editor, rng);
- }
- activateEditor(editor);
- };
- var activateEditor = function (editor) {
- return editor.editorManager.setActive(editor);
- };
- var focus = function (editor, skipFocus) {
- if (editor.removed) {
- return;
- }
- if (skipFocus) {
- activateEditor(editor);
- } else {
- focusEditor(editor);
- }
- };
- var getEndpointElement = function (root, rng, start, real, resolve) {
- var container = start ? rng.startContainer : rng.endContainer;
- var offset = start ? rng.startOffset : rng.endOffset;
- return Optional.from(container).map(SugarElement.fromDom).map(function (elm) {
- return !real || !rng.collapsed ? child$1(elm, resolve(elm, offset)).getOr(elm) : elm;
- }).bind(function (elm) {
- return isElement$6(elm) ? Optional.some(elm) : parent(elm).filter(isElement$6);
- }).map(function (elm) {
- return elm.dom;
- }).getOr(root);
- };
- var getStart = function (root, rng, real) {
- return getEndpointElement(root, rng, true, real, function (elm, offset) {
- return Math.min(childNodesCount(elm), offset);
- });
- };
- var getEnd = function (root, rng, real) {
- return getEndpointElement(root, rng, false, real, function (elm, offset) {
- return offset > 0 ? offset - 1 : offset;
- });
- };
- var skipEmptyTextNodes = function (node, forwards) {
- var orig = node;
- while (node && isText$7(node) && node.length === 0) {
- node = forwards ? node.nextSibling : node.previousSibling;
- }
- return node || orig;
- };
- var getNode = function (root, rng) {
- var elm, startContainer, endContainer;
- if (!rng) {
- return root;
- }
- startContainer = rng.startContainer;
- endContainer = rng.endContainer;
- var startOffset = rng.startOffset;
- var endOffset = rng.endOffset;
- elm = rng.commonAncestorContainer;
- if (!rng.collapsed) {
- if (startContainer === endContainer) {
- if (endOffset - startOffset < 2) {
- if (startContainer.hasChildNodes()) {
- elm = startContainer.childNodes[startOffset];
- }
- }
- }
- if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
- if (startContainer.length === startOffset) {
- startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
- } else {
- startContainer = startContainer.parentNode;
- }
- if (endOffset === 0) {
- endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
- } else {
- endContainer = endContainer.parentNode;
- }
- if (startContainer && startContainer === endContainer) {
- return startContainer;
- }
- }
- }
- if (elm && elm.nodeType === 3) {
- return elm.parentNode;
- }
- return elm;
- };
- var getSelectedBlocks = function (dom, rng, startElm, endElm) {
- var node;
- var selectedBlocks = [];
- var root = dom.getRoot();
- startElm = dom.getParent(startElm || getStart(root, rng, rng.collapsed), dom.isBlock);
- endElm = dom.getParent(endElm || getEnd(root, rng, rng.collapsed), dom.isBlock);
- if (startElm && startElm !== root) {
- selectedBlocks.push(startElm);
- }
- if (startElm && endElm && startElm !== endElm) {
- node = startElm;
- var walker = new DomTreeWalker(startElm, root);
- while ((node = walker.next()) && node !== endElm) {
- if (dom.isBlock(node)) {
- selectedBlocks.push(node);
- }
- }
- }
- if (endElm && startElm !== endElm && endElm !== root) {
- selectedBlocks.push(endElm);
- }
- return selectedBlocks;
- };
- var select = function (dom, node, content) {
- return Optional.from(node).map(function (node) {
- var idx = dom.nodeIndex(node);
- var rng = dom.createRng();
- rng.setStart(node.parentNode, idx);
- rng.setEnd(node.parentNode, idx + 1);
- if (content) {
- moveEndPoint(dom, rng, node, true);
- moveEndPoint(dom, rng, node, false);
- }
- return rng;
- });
- };
- var processRanges = function (editor, ranges) {
- return map$3(ranges, function (range) {
- var evt = editor.fire('GetSelectionRange', { range: range });
- return evt.range !== range ? evt.range : range;
- });
- };
- var typeLookup = {
- '#text': 3,
- '#comment': 8,
- '#cdata': 4,
- '#pi': 7,
- '#doctype': 10,
- '#document-fragment': 11
- };
- var walk$1 = function (node, root, prev) {
- var startName = prev ? 'lastChild' : 'firstChild';
- var siblingName = prev ? 'prev' : 'next';
- if (node[startName]) {
- return node[startName];
- }
- if (node !== root) {
- var sibling = node[siblingName];
- if (sibling) {
- return sibling;
- }
- for (var parent_1 = node.parent; parent_1 && parent_1 !== root; parent_1 = parent_1.parent) {
- sibling = parent_1[siblingName];
- if (sibling) {
- return sibling;
- }
- }
- }
- };
- var isEmptyTextNode = function (node) {
- if (!isWhitespaceText(node.value)) {
- return false;
- }
- var parentNode = node.parent;
- if (parentNode && (parentNode.name !== 'span' || parentNode.attr('style')) && /^[ ]+$/.test(node.value)) {
- return false;
- }
- return true;
- };
- var isNonEmptyElement = function (node) {
- var isNamedAnchor = node.name === 'a' && !node.attr('href') && node.attr('id');
- return node.attr('name') || node.attr('id') && !node.firstChild || node.attr('data-mce-bookmark') || isNamedAnchor;
- };
- var AstNode = function () {
- function AstNode(name, type) {
- this.name = name;
- this.type = type;
- if (type === 1) {
- this.attributes = [];
- this.attributes.map = {};
- }
- }
- AstNode.create = function (name, attrs) {
- var node = new AstNode(name, typeLookup[name] || 1);
- if (attrs) {
- each$j(attrs, function (value, attrName) {
- node.attr(attrName, value);
- });
- }
- return node;
- };
- AstNode.prototype.replace = function (node) {
- var self = this;
- if (node.parent) {
- node.remove();
- }
- self.insert(node, self);
- self.remove();
- return self;
- };
- AstNode.prototype.attr = function (name, value) {
- var self = this;
- var attrs;
- if (typeof name !== 'string') {
- if (name !== undefined && name !== null) {
- each$j(name, function (value, key) {
- self.attr(key, value);
- });
- }
- return self;
- }
- if (attrs = self.attributes) {
- if (value !== undefined) {
- if (value === null) {
- if (name in attrs.map) {
- delete attrs.map[name];
- var i = attrs.length;
- while (i--) {
- if (attrs[i].name === name) {
- attrs.splice(i, 1);
- return self;
- }
- }
- }
- return self;
- }
- if (name in attrs.map) {
- var i = attrs.length;
- while (i--) {
- if (attrs[i].name === name) {
- attrs[i].value = value;
- break;
- }
- }
- } else {
- attrs.push({
- name: name,
- value: value
- });
- }
- attrs.map[name] = value;
- return self;
- }
- return attrs.map[name];
- }
- };
- AstNode.prototype.clone = function () {
- var self = this;
- var clone = new AstNode(self.name, self.type);
- var selfAttrs;
- if (selfAttrs = self.attributes) {
- var cloneAttrs = [];
- cloneAttrs.map = {};
- for (var i = 0, l = selfAttrs.length; i < l; i++) {
- var selfAttr = selfAttrs[i];
- if (selfAttr.name !== 'id') {
- cloneAttrs[cloneAttrs.length] = {
- name: selfAttr.name,
- value: selfAttr.value
- };
- cloneAttrs.map[selfAttr.name] = selfAttr.value;
- }
- }
- clone.attributes = cloneAttrs;
- }
- clone.value = self.value;
- clone.shortEnded = self.shortEnded;
- return clone;
- };
- AstNode.prototype.wrap = function (wrapper) {
- var self = this;
- self.parent.insert(wrapper, self);
- wrapper.append(self);
- return self;
- };
- AstNode.prototype.unwrap = function () {
- var self = this;
- for (var node = self.firstChild; node;) {
- var next = node.next;
- self.insert(node, self, true);
- node = next;
- }
- self.remove();
- };
- AstNode.prototype.remove = function () {
- var self = this, parent = self.parent, next = self.next, prev = self.prev;
- if (parent) {
- if (parent.firstChild === self) {
- parent.firstChild = next;
- if (next) {
- next.prev = null;
- }
- } else {
- prev.next = next;
- }
- if (parent.lastChild === self) {
- parent.lastChild = prev;
- if (prev) {
- prev.next = null;
- }
- } else {
- next.prev = prev;
- }
- self.parent = self.next = self.prev = null;
- }
- return self;
- };
- AstNode.prototype.append = function (node) {
- var self = this;
- if (node.parent) {
- node.remove();
- }
- var last = self.lastChild;
- if (last) {
- last.next = node;
- node.prev = last;
- self.lastChild = node;
- } else {
- self.lastChild = self.firstChild = node;
- }
- node.parent = self;
- return node;
- };
- AstNode.prototype.insert = function (node, refNode, before) {
- if (node.parent) {
- node.remove();
- }
- var parent = refNode.parent || this;
- if (before) {
- if (refNode === parent.firstChild) {
- parent.firstChild = node;
- } else {
- refNode.prev.next = node;
- }
- node.prev = refNode.prev;
- node.next = refNode;
- refNode.prev = node;
- } else {
- if (refNode === parent.lastChild) {
- parent.lastChild = node;
- } else {
- refNode.next.prev = node;
- }
- node.next = refNode.next;
- node.prev = refNode;
- refNode.next = node;
- }
- node.parent = parent;
- return node;
- };
- AstNode.prototype.getAll = function (name) {
- var self = this;
- var collection = [];
- for (var node = self.firstChild; node; node = walk$1(node, self)) {
- if (node.name === name) {
- collection.push(node);
- }
- }
- return collection;
- };
- AstNode.prototype.children = function () {
- var self = this;
- var collection = [];
- for (var node = self.firstChild; node; node = node.next) {
- collection.push(node);
- }
- return collection;
- };
- AstNode.prototype.empty = function () {
- var self = this;
- if (self.firstChild) {
- var nodes = [];
- for (var node = self.firstChild; node; node = walk$1(node, self)) {
- nodes.push(node);
- }
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
- }
- }
- self.firstChild = self.lastChild = null;
- return self;
- };
- AstNode.prototype.isEmpty = function (elements, whitespace, predicate) {
- if (whitespace === void 0) {
- whitespace = {};
- }
- var self = this;
- var node = self.firstChild;
- if (isNonEmptyElement(self)) {
- return false;
- }
- if (node) {
- do {
- if (node.type === 1) {
- if (node.attr('data-mce-bogus')) {
- continue;
- }
- if (elements[node.name]) {
- return false;
- }
- if (isNonEmptyElement(node)) {
- return false;
- }
- }
- if (node.type === 8) {
- return false;
- }
- if (node.type === 3 && !isEmptyTextNode(node)) {
- return false;
- }
- if (node.type === 3 && node.parent && whitespace[node.parent.name] && isWhitespaceText(node.value)) {
- return false;
- }
- if (predicate && predicate(node)) {
- return false;
- }
- } while (node = walk$1(node, self));
- }
- return true;
- };
- AstNode.prototype.walk = function (prev) {
- return walk$1(this, null, prev);
- };
- return AstNode;
- }();
- var extractBase64DataUris = function (html) {
- var dataImageUri = /data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi;
- var chunks = [];
- var uris = {};
- var prefix = generate('img');
- var matches;
- var index = 0;
- var count = 0;
- while (matches = dataImageUri.exec(html)) {
- var uri = matches[0];
- var imageId = prefix + '_' + count++;
- uris[imageId] = uri;
- if (index < matches.index) {
- chunks.push(html.substr(index, matches.index - index));
- }
- chunks.push(imageId);
- index = matches.index + uri.length;
- }
- var re = new RegExp(prefix + '_[0-9]+', 'g');
- if (index === 0) {
- return {
- prefix: prefix,
- uris: uris,
- html: html,
- re: re
- };
- } else {
- if (index < html.length) {
- chunks.push(html.substr(index));
- }
- return {
- prefix: prefix,
- uris: uris,
- html: chunks.join(''),
- re: re
- };
- }
- };
- var restoreDataUris = function (html, result) {
- return html.replace(result.re, function (imageId) {
- return get$9(result.uris, imageId).getOr(imageId);
- });
- };
- var parseDataUri$1 = function (uri) {
- var matches = /data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(uri);
- if (matches) {
- return Optional.some({
- type: matches[1],
- data: decodeURIComponent(matches[2])
- });
- } else {
- return Optional.none();
- }
- };
- var each$d = Tools.each, trim = Tools.trim;
- var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
- var DEFAULT_PORTS = {
- ftp: 21,
- http: 80,
- https: 443,
- mailto: 25
- };
- var safeSvgDataUrlElements = [
- 'img',
- 'video'
- ];
- var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
- if (isNonNullable(allowSvgDataUrls)) {
- return !allowSvgDataUrls;
- } else {
- return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
- }
- };
- var isInvalidUri = function (settings, uri, tagName) {
- if (settings.allow_html_data_urls) {
- return false;
- } else if (/^data:image\//i.test(uri)) {
- return blockSvgDataUris(settings.allow_svg_data_urls, tagName) && /^data:image\/svg\+xml/i.test(uri);
- } else {
- return /^data:/i.test(uri);
- }
- };
- var URI = function () {
- function URI(url, settings) {
- url = trim(url);
- this.settings = settings || {};
- var baseUri = this.settings.base_uri;
- var self = this;
- if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
- self.source = url;
- return;
- }
- var isProtocolRelative = url.indexOf('//') === 0;
- if (url.indexOf('/') === 0 && !isProtocolRelative) {
- url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
- }
- if (!/^[\w\-]*:?\/\//.test(url)) {
- var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
- if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
- url = '//mce_host' + self.toAbsPath(baseUrl, url);
- } else {
- var match = /([^#?]*)([#?]?.*)/.exec(url);
- url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
- }
- }
- url = url.replace(/@@/g, '(mce_at)');
- var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
- each$d(queryParts, function (v, i) {
- var part = urlMatch[i];
- if (part) {
- part = part.replace(/\(mce_at\)/g, '@@');
- }
- self[v] = part;
- });
- if (baseUri) {
- if (!self.protocol) {
- self.protocol = baseUri.protocol;
- }
- if (!self.userInfo) {
- self.userInfo = baseUri.userInfo;
- }
- if (!self.port && self.host === 'mce_host') {
- self.port = baseUri.port;
- }
- if (!self.host || self.host === 'mce_host') {
- self.host = baseUri.host;
- }
- self.source = '';
- }
- if (isProtocolRelative) {
- self.protocol = '';
- }
- }
- URI.parseDataUri = function (uri) {
- var type;
- var uriComponents = decodeURIComponent(uri).split(',');
- var matches = /data:([^;]+)/.exec(uriComponents[0]);
- if (matches) {
- type = matches[1];
- }
- return {
- type: type,
- data: uriComponents[1]
- };
- };
- URI.isDomSafe = function (uri, context, options) {
- if (options === void 0) {
- options = {};
- }
- if (options.allow_script_urls) {
- return true;
- } else {
- var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
- try {
- decodedUri = decodeURIComponent(decodedUri);
- } catch (ex) {
- decodedUri = unescape(decodedUri);
- }
- if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
- return false;
- }
- return !isInvalidUri(options, decodedUri, context);
- }
- };
- URI.getDocumentBaseUrl = function (loc) {
- var baseUrl;
- if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
- baseUrl = loc.href;
- } else {
- baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
- }
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
- baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
- if (!/[\/\\]$/.test(baseUrl)) {
- baseUrl += '/';
- }
- }
- return baseUrl;
- };
- URI.prototype.setPath = function (path) {
- var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
- this.path = pathMatch[0];
- this.directory = pathMatch[1];
- this.file = pathMatch[2];
- this.source = '';
- this.getURI();
- };
- URI.prototype.toRelative = function (uri) {
- var output;
- if (uri === './') {
- return uri;
- }
- var relativeUri = new URI(uri, { base_uri: this });
- if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
- return relativeUri.getURI();
- }
- var tu = this.getURI(), uu = relativeUri.getURI();
- if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
- return tu;
- }
- output = this.toRelPath(this.path, relativeUri.path);
- if (relativeUri.query) {
- output += '?' + relativeUri.query;
- }
- if (relativeUri.anchor) {
- output += '#' + relativeUri.anchor;
- }
- return output;
- };
- URI.prototype.toAbsolute = function (uri, noHost) {
- var absoluteUri = new URI(uri, { base_uri: this });
- return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
- };
- URI.prototype.isSameOrigin = function (uri) {
- if (this.host == uri.host && this.protocol == uri.protocol) {
- if (this.port == uri.port) {
- return true;
- }
- var defaultPort = DEFAULT_PORTS[this.protocol];
- if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
- return true;
- }
- }
- return false;
- };
- URI.prototype.toRelPath = function (base, path) {
- var breakPoint = 0, out = '', i, l;
- var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
- var items = path.split('/');
- if (normalizedBase.length >= items.length) {
- for (i = 0, l = normalizedBase.length; i < l; i++) {
- if (i >= items.length || normalizedBase[i] !== items[i]) {
- breakPoint = i + 1;
- break;
- }
- }
- }
- if (normalizedBase.length < items.length) {
- for (i = 0, l = items.length; i < l; i++) {
- if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
- breakPoint = i + 1;
- break;
- }
- }
- }
- if (breakPoint === 1) {
- return path;
- }
- for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
- out += '../';
- }
- for (i = breakPoint - 1, l = items.length; i < l; i++) {
- if (i !== breakPoint - 1) {
- out += '/' + items[i];
- } else {
- out += items[i];
- }
- }
- return out;
- };
- URI.prototype.toAbsPath = function (base, path) {
- var i, nb = 0, o = [], outPath;
- var tr = /\/$/.test(path) ? '/' : '';
- var normalizedBase = base.split('/');
- var normalizedPath = path.split('/');
- each$d(normalizedBase, function (k) {
- if (k) {
- o.push(k);
- }
- });
- normalizedBase = o;
- for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
- if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
- continue;
- }
- if (normalizedPath[i] === '..') {
- nb++;
- continue;
- }
- if (nb > 0) {
- nb--;
- continue;
- }
- o.push(normalizedPath[i]);
- }
- i = normalizedBase.length - nb;
- if (i <= 0) {
- outPath = reverse(o).join('/');
- } else {
- outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
- }
- if (outPath.indexOf('/') !== 0) {
- outPath = '/' + outPath;
- }
- if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
- outPath += tr;
- }
- return outPath;
- };
- URI.prototype.getURI = function (noProtoHost) {
- if (noProtoHost === void 0) {
- noProtoHost = false;
- }
- var s;
- if (!this.source || noProtoHost) {
- s = '';
- if (!noProtoHost) {
- if (this.protocol) {
- s += this.protocol + '://';
- } else {
- s += '//';
- }
- if (this.userInfo) {
- s += this.userInfo + '@';
- }
- if (this.host) {
- s += this.host;
- }
- if (this.port) {
- s += ':' + this.port;
- }
- }
- if (this.path) {
- s += this.path;
- }
- if (this.query) {
- s += '?' + this.query;
- }
- if (this.anchor) {
- s += '#' + this.anchor;
- }
- this.source = s;
- }
- return this.source;
- };
- return URI;
- }();
- var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
- var isValidPrefixAttrName = function (name) {
- return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
- };
- var findMatchingEndTagIndex = function (schema, html, startIndex) {
- var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
- var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
- var shortEndedElements = schema.getShortEndedElements();
- var count = 1, index = startIndex;
- while (count !== 0) {
- startTagRegExp.lastIndex = index;
- while (true) {
- var startMatch = startTagRegExp.exec(html);
- if (startMatch === null) {
- return index;
- } else if (startMatch[1] === '!') {
- if (startsWith(startMatch[2], '--')) {
- index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
- } else {
- index = findCommentEndIndex(html, true, startMatch.index + 1);
- }
- break;
- } else {
- endTagRegExp.lastIndex = startTagRegExp.lastIndex;
- var endMatch = endTagRegExp.exec(html);
- if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
- continue;
- }
- if (startMatch[1] === '/') {
- count -= 1;
- } else if (!has$2(shortEndedElements, startMatch[2])) {
- count += 1;
- }
- index = startTagRegExp.lastIndex + endMatch[0].length;
- break;
- }
- }
- }
- return index;
- };
- var isConditionalComment = function (html, startIndex) {
- return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(html.substr(startIndex));
- };
- var findCommentEndIndex = function (html, isBogus, startIndex) {
- if (startIndex === void 0) {
- startIndex = 0;
- }
- var lcHtml = html.toLowerCase();
- if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) {
- var endIfIndex = lcHtml.indexOf('[endif]', startIndex);
- return lcHtml.indexOf('>', endIfIndex);
- } else {
- if (isBogus) {
- var endIndex = lcHtml.indexOf('>', startIndex);
- return endIndex !== -1 ? endIndex : lcHtml.length;
- } else {
- var endCommentRegexp = /--!?>/g;
- endCommentRegexp.lastIndex = startIndex;
- var match = endCommentRegexp.exec(html);
- return match ? match.index + match[0].length : lcHtml.length;
- }
- }
- };
- var checkBogusAttribute = function (regExp, attrString) {
- var matches = regExp.exec(attrString);
- if (matches) {
- var name_1 = matches[1];
- var value = matches[2];
- return typeof name_1 === 'string' && name_1.toLowerCase() === 'data-mce-bogus' ? value : null;
- } else {
- return null;
- }
- };
- var SaxParser = function (settings, schema) {
- var _a;
- if (schema === void 0) {
- schema = Schema();
- }
- settings = settings || {};
- var doc = (_a = settings.document) !== null && _a !== void 0 ? _a : document;
- var form = doc.createElement('form');
- if (settings.fix_self_closing !== false) {
- settings.fix_self_closing = true;
- }
- var comment = settings.comment ? settings.comment : noop;
- var cdata = settings.cdata ? settings.cdata : noop;
- var text = settings.text ? settings.text : noop;
- var start = settings.start ? settings.start : noop;
- var end = settings.end ? settings.end : noop;
- var pi = settings.pi ? settings.pi : noop;
- var doctype = settings.doctype ? settings.doctype : noop;
- var parseInternal = function (base64Extract, format) {
- if (format === void 0) {
- format = 'html';
- }
- var html = base64Extract.html;
- var matches, index = 0, value, endRegExp;
- var stack = [];
- var attrList, i, textData, name;
- var isInternalElement, isShortEnded;
- var elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
- var attributesRequired, attributesDefault, attributesForced;
- var anyAttributesRequired, attrValue, idCount = 0;
- var decode = Entities.decode;
- var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
- var parsingMode = format === 'html' ? 0 : 1;
- var processEndTag = function (name) {
- var pos, i;
- pos = stack.length;
- while (pos--) {
- if (stack[pos].name === name) {
- break;
- }
- }
- if (pos >= 0) {
- for (i = stack.length - 1; i >= pos; i--) {
- name = stack[i];
- if (name.valid) {
- end(name.name);
- }
- }
- stack.length = pos;
- }
- };
- var processText = function (value, raw) {
- return text(restoreDataUris(value, base64Extract), raw);
- };
- var processComment = function (value) {
- if (value === '') {
- return;
- }
- if (value.charAt(0) === '>') {
- value = ' ' + value;
- }
- if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
- value = ' ' + value;
- }
- comment(restoreDataUris(value, base64Extract));
- };
- var processAttr = function (value) {
- return restoreDataUris(value, base64Extract);
- };
- var processMalformedComment = function (value, startIndex) {
- var startTag = value || '';
- var isBogus = !startsWith(startTag, '--');
- var endIndex = findCommentEndIndex(html, isBogus, startIndex);
- value = html.substr(startIndex, endIndex - startIndex);
- processComment(isBogus ? startTag + value : value);
- return endIndex + 1;
- };
- var parseAttribute = function (tagName, name, value, val2, val3) {
- name = name.toLowerCase();
- value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
- if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
- var attrRule = validAttributesMap[name];
- if (!attrRule && validAttributePatterns) {
- var i_1 = validAttributePatterns.length;
- while (i_1--) {
- attrRule = validAttributePatterns[i_1];
- if (attrRule.pattern.test(name)) {
- break;
- }
- }
- if (i_1 === -1) {
- attrRule = null;
- }
- }
- if (!attrRule) {
- return;
- }
- if (attrRule.validValues && !(value in attrRule.validValues)) {
- return;
- }
- }
- var isNameOrId = name === 'name' || name === 'id';
- if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
- return;
- }
- if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
- return;
- }
- if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
- return;
- }
- attrList.map[name] = value;
- attrList.push({
- name: name,
- value: value
- });
- };
- var tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|' + '(?:!(--)?)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^\'">]+(?:"[^"]*"|\'[^\']*\'))*[^"\'>]*(?:"[^">]*|\'[^\'>]*)?|\\s*|\\/)>)' + ')', 'g');
- var attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
- var shortEndedElements = schema.getShortEndedElements();
- var selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
- var fillAttrsMap = schema.getBoolAttrs();
- var validate = settings.validate;
- var removeInternalElements = settings.remove_internals;
- var fixSelfClosing = settings.fix_self_closing;
- var specialElements = schema.getSpecialElements();
- var processHtml = html + '>';
- while (matches = tokenRegExp.exec(processHtml)) {
- var matchText = matches[0];
- if (index < matches.index) {
- processText(decode(html.substr(index, matches.index - index)));
- }
- if (value = matches[7]) {
- value = value.toLowerCase();
- if (value.charAt(0) === ':') {
- value = value.substr(1);
- }
- processEndTag(value);
- } else if (value = matches[8]) {
- if (matches.index + matchText.length > html.length) {
- processText(decode(html.substr(matches.index)));
- index = matches.index + matchText.length;
- continue;
- }
- value = value.toLowerCase();
- if (value.charAt(0) === ':') {
- value = value.substr(1);
- }
- isShortEnded = value in shortEndedElements;
- if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
- processEndTag(value);
- }
- var bogusValue = checkBogusAttribute(attrRegExp, matches[9]);
- if (bogusValue !== null) {
- if (bogusValue === 'all') {
- index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
- tokenRegExp.lastIndex = index;
- continue;
- }
- isValidElement = false;
- }
- if (!validate || (elementRule = schema.getElementRule(value))) {
- isValidElement = true;
- if (validate) {
- validAttributesMap = elementRule.attributes;
- validAttributePatterns = elementRule.attributePatterns;
- }
- if (attribsValue = matches[9]) {
- isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
- if (isInternalElement && removeInternalElements) {
- isValidElement = false;
- }
- attrList = [];
- attrList.map = {};
- attribsValue.replace(attrRegExp, function (match, name, val, val2, val3) {
- parseAttribute(value, name, val, val2, val3);
- return '';
- });
- } else {
- attrList = [];
- attrList.map = {};
- }
- if (validate && !isInternalElement) {
- attributesRequired = elementRule.attributesRequired;
- attributesDefault = elementRule.attributesDefault;
- attributesForced = elementRule.attributesForced;
- anyAttributesRequired = elementRule.removeEmptyAttrs;
- if (anyAttributesRequired && !attrList.length) {
- isValidElement = false;
- }
- if (attributesForced) {
- i = attributesForced.length;
- while (i--) {
- attr = attributesForced[i];
- name = attr.name;
- attrValue = attr.value;
- if (attrValue === '{$uid}') {
- attrValue = 'mce_' + idCount++;
- }
- attrList.map[name] = attrValue;
- attrList.push({
- name: name,
- value: attrValue
- });
- }
- }
- if (attributesDefault) {
- i = attributesDefault.length;
- while (i--) {
- attr = attributesDefault[i];
- name = attr.name;
- if (!(name in attrList.map)) {
- attrValue = attr.value;
- if (attrValue === '{$uid}') {
- attrValue = 'mce_' + idCount++;
- }
- attrList.map[name] = attrValue;
- attrList.push({
- name: name,
- value: attrValue
- });
- }
- }
- }
- if (attributesRequired) {
- i = attributesRequired.length;
- while (i--) {
- if (attributesRequired[i] in attrList.map) {
- break;
- }
- }
- if (i === -1) {
- isValidElement = false;
- }
- }
- if (attr = attrList.map['data-mce-bogus']) {
- if (attr === 'all') {
- index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
- tokenRegExp.lastIndex = index;
- continue;
- }
- isValidElement = false;
- }
- }
- if (isValidElement) {
- start(value, attrList, isShortEnded);
- }
- } else {
- isValidElement = false;
- }
- if (endRegExp = specialElements[value]) {
- endRegExp.lastIndex = index = matches.index + matchText.length;
- if (matches = endRegExp.exec(html)) {
- if (isValidElement) {
- textData = html.substr(index, matches.index - index);
- }
- index = matches.index + matches[0].length;
- } else {
- textData = html.substr(index);
- index = html.length;
- }
- if (isValidElement) {
- if (textData.length > 0) {
- processText(textData, true);
- }
- end(value);
- }
- tokenRegExp.lastIndex = index;
- continue;
- }
- if (!isShortEnded) {
- if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
- stack.push({
- name: value,
- valid: isValidElement
- });
- } else if (isValidElement) {
- end(value);
- }
- }
- } else if (value = matches[1]) {
- processComment(value);
- } else if (value = matches[2]) {
- var isValidCdataSection = parsingMode === 1 || settings.preserve_cdata || stack.length > 0 && schema.isValidChild(stack[stack.length - 1].name, '#cdata');
- if (isValidCdataSection) {
- cdata(value);
- } else {
- index = processMalformedComment('', matches.index + 2);
- tokenRegExp.lastIndex = index;
- continue;
- }
- } else if (value = matches[3]) {
- doctype(value);
- } else if ((value = matches[4]) || matchText === '<!') {
- index = processMalformedComment(value, matches.index + matchText.length);
- tokenRegExp.lastIndex = index;
- continue;
- } else if (value = matches[5]) {
- if (parsingMode === 1) {
- pi(value, matches[6]);
- } else {
- index = processMalformedComment('?', matches.index + 2);
- tokenRegExp.lastIndex = index;
- continue;
- }
- }
- index = matches.index + matchText.length;
- }
- if (index < html.length) {
- processText(decode(html.substr(index)));
- }
- for (i = stack.length - 1; i >= 0; i--) {
- value = stack[i];
- if (value.valid) {
- end(value.name);
- }
- }
- };
- var parse = function (html, format) {
- if (format === void 0) {
- format = 'html';
- }
- parseInternal(extractBase64DataUris(html), format);
- };
- return { parse: parse };
- };
- SaxParser.findEndTag = findMatchingEndTagIndex;
- var trimHtml = function (tempAttrs, html) {
- var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
- return html.replace(trimContentRegExp, '');
- };
- var trimInternal = function (serializer, html) {
- var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
- var schema = serializer.schema;
- var content = trimHtml(serializer.getTempAttrs(), html);
- var shortEndedElements = schema.getShortEndedElements();
- var matches;
- while (matches = bogusAllRegExp.exec(content)) {
- var index = bogusAllRegExp.lastIndex;
- var matchLength = matches[0].length;
- var endTagIndex = void 0;
- if (shortEndedElements[matches[1]]) {
- endTagIndex = index;
- } else {
- endTagIndex = SaxParser.findEndTag(schema, content, index);
- }
- content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
- bogusAllRegExp.lastIndex = index - matchLength;
- }
- return trim$2(content);
- };
- var trimExternal = trimInternal;
- var trimEmptyContents = function (editor, html) {
- var blockName = getForcedRootBlock(editor);
- var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
- return html.replace(emptyRegExp, '');
- };
- var setupArgs$3 = function (args, format) {
- return __assign(__assign({}, args), {
- format: format,
- get: true,
- getInner: true
- });
- };
- var getContentFromBody = function (editor, args, format, body) {
- var defaultedArgs = setupArgs$3(args, format);
- var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeGetContent', defaultedArgs);
- var content;
- if (updatedArgs.format === 'raw') {
- content = Tools.trim(trimExternal(editor.serializer, body.innerHTML));
- } else if (updatedArgs.format === 'text') {
- content = editor.dom.isEmpty(body) ? '' : trim$2(body.innerText || body.textContent);
- } else if (updatedArgs.format === 'tree') {
- content = editor.serializer.serialize(body, updatedArgs);
- } else {
- content = trimEmptyContents(editor, editor.serializer.serialize(body, updatedArgs));
- }
- if (!contains$3([
- 'text',
- 'tree'
- ], updatedArgs.format) && !isWsPreserveElement(SugarElement.fromDom(body))) {
- updatedArgs.content = Tools.trim(content);
- } else {
- updatedArgs.content = content;
- }
- if (updatedArgs.no_events) {
- return updatedArgs.content;
- } else {
- return editor.fire('GetContent', updatedArgs).content;
- }
- };
- var getContentInternal = function (editor, args, format) {
- return Optional.from(editor.getBody()).fold(constant(args.format === 'tree' ? new AstNode('body', 11) : ''), function (body) {
- return getContentFromBody(editor, args, format, body);
- });
- };
- var each$c = Tools.each;
- var ElementUtils = function (dom) {
- var compare = function (node1, node2) {
- if (node1.nodeName !== node2.nodeName) {
- return false;
- }
- var getAttribs = function (node) {
- var attribs = {};
- each$c(dom.getAttribs(node), function (attr) {
- var name = attr.nodeName.toLowerCase();
- if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
- attribs[name] = dom.getAttrib(node, name);
- }
- });
- return attribs;
- };
- var compareObjects = function (obj1, obj2) {
- var value, name;
- for (name in obj1) {
- if (has$2(obj1, name)) {
- value = obj2[name];
- if (typeof value === 'undefined') {
- return false;
- }
- if (obj1[name] !== value) {
- return false;
- }
- delete obj2[name];
- }
- }
- for (name in obj2) {
- if (has$2(obj2, name)) {
- return false;
- }
- }
- return true;
- };
- if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
- return false;
- }
- if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
- return false;
- }
- return !isBookmarkNode$1(node1) && !isBookmarkNode$1(node2);
- };
- return { compare: compare };
- };
- var makeMap$1 = Tools.makeMap;
- var Writer = function (settings) {
- var html = [];
- settings = settings || {};
- var indent = settings.indent;
- var indentBefore = makeMap$1(settings.indent_before || '');
- var indentAfter = makeMap$1(settings.indent_after || '');
- var encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
- var htmlOutput = settings.element_format === 'html';
- return {
- start: function (name, attrs, empty) {
- var i, l, attr, value;
- if (indent && indentBefore[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
- }
- }
- html.push('<', name);
- if (attrs) {
- for (i = 0, l = attrs.length; i < l; i++) {
- attr = attrs[i];
- html.push(' ', attr.name, '="', encode(attr.value, true), '"');
- }
- }
- if (!empty || htmlOutput) {
- html[html.length] = '>';
- } else {
- html[html.length] = ' />';
- }
- if (empty && indent && indentAfter[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
- }
- }
- },
- end: function (name) {
- var value;
- html.push('</', name, '>');
- if (indent && indentAfter[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
- }
- }
- },
- text: function (text, raw) {
- if (text.length > 0) {
- html[html.length] = raw ? text : encode(text);
- }
- },
- cdata: function (text) {
- html.push('<![CDATA[', text, ']]>');
- },
- comment: function (text) {
- html.push('<!--', text, '-->');
- },
- pi: function (name, text) {
- if (text) {
- html.push('<?', name, ' ', encode(text), '?>');
- } else {
- html.push('<?', name, '?>');
- }
- if (indent) {
- html.push('\n');
- }
- },
- doctype: function (text) {
- html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
- },
- reset: function () {
- html.length = 0;
- },
- getContent: function () {
- return html.join('').replace(/\n$/, '');
- }
- };
- };
- var HtmlSerializer = function (settings, schema) {
- if (schema === void 0) {
- schema = Schema();
- }
- var writer = Writer(settings);
- settings = settings || {};
- settings.validate = 'validate' in settings ? settings.validate : true;
- var serialize = function (node) {
- var validate = settings.validate;
- var handlers = {
- 3: function (node) {
- writer.text(node.value, node.raw);
- },
- 8: function (node) {
- writer.comment(node.value);
- },
- 7: function (node) {
- writer.pi(node.name, node.value);
- },
- 10: function (node) {
- writer.doctype(node.value);
- },
- 4: function (node) {
- writer.cdata(node.value);
- },
- 11: function (node) {
- if (node = node.firstChild) {
- do {
- walk(node);
- } while (node = node.next);
- }
- }
- };
- writer.reset();
- var walk = function (node) {
- var handler = handlers[node.type];
- if (!handler) {
- var name_1 = node.name;
- var isEmpty = node.shortEnded;
- var attrs = node.attributes;
- if (validate && attrs && attrs.length > 1) {
- var sortedAttrs = [];
- sortedAttrs.map = {};
- var elementRule = schema.getElementRule(node.name);
- if (elementRule) {
- for (var i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
- var attrName = elementRule.attributesOrder[i];
- if (attrName in attrs.map) {
- var attrValue = attrs.map[attrName];
- sortedAttrs.map[attrName] = attrValue;
- sortedAttrs.push({
- name: attrName,
- value: attrValue
- });
- }
- }
- for (var i = 0, l = attrs.length; i < l; i++) {
- var attrName = attrs[i].name;
- if (!(attrName in sortedAttrs.map)) {
- var attrValue = attrs.map[attrName];
- sortedAttrs.map[attrName] = attrValue;
- sortedAttrs.push({
- name: attrName,
- value: attrValue
- });
- }
- }
- attrs = sortedAttrs;
- }
- }
- writer.start(node.name, attrs, isEmpty);
- if (!isEmpty) {
- if (node = node.firstChild) {
- do {
- walk(node);
- } while (node = node.next);
- }
- writer.end(name_1);
- }
- } else {
- handler(node);
- }
- };
- if (node.type === 1 && !settings.inner) {
- walk(node);
- } else {
- handlers[11](node);
- }
- return writer.getContent();
- };
- return { serialize: serialize };
- };
- var nonInheritableStyles = new Set();
- (function () {
- var nonInheritableStylesArr = [
- 'margin',
- 'margin-left',
- 'margin-right',
- 'margin-top',
- 'margin-bottom',
- 'padding',
- 'padding-left',
- 'padding-right',
- 'padding-top',
- 'padding-bottom',
- 'border',
- 'border-width',
- 'border-style',
- 'border-color',
- 'background',
- 'background-attachment',
- 'background-clip',
- 'background-color',
- 'background-image',
- 'background-origin',
- 'background-position',
- 'background-repeat',
- 'background-size',
- 'float',
- 'position',
- 'left',
- 'right',
- 'top',
- 'bottom',
- 'z-index',
- 'display',
- 'transform',
- 'width',
- 'max-width',
- 'min-width',
- 'height',
- 'max-height',
- 'min-height',
- 'overflow',
- 'overflow-x',
- 'overflow-y',
- 'text-overflow',
- 'vertical-align',
- 'transition',
- 'transition-delay',
- 'transition-duration',
- 'transition-property',
- 'transition-timing-function'
- ];
- each$k(nonInheritableStylesArr, function (style) {
- nonInheritableStyles.add(style);
- });
- }());
- var shorthandStyleProps = [
- 'font',
- 'text-decoration',
- 'text-emphasis'
- ];
- var getStyleProps = function (dom, node) {
- return keys(dom.parseStyle(dom.getAttrib(node, 'style')));
- };
- var isNonInheritableStyle = function (style) {
- return nonInheritableStyles.has(style);
- };
- var hasInheritableStyles = function (dom, node) {
- return forall(getStyleProps(dom, node), function (style) {
- return !isNonInheritableStyle(style);
- });
- };
- var getLonghandStyleProps = function (styles) {
- return filter$4(styles, function (style) {
- return exists(shorthandStyleProps, function (prop) {
- return startsWith(style, prop);
- });
- });
- };
- var hasStyleConflict = function (dom, node, parentNode) {
- var nodeStyleProps = getStyleProps(dom, node);
- var parentNodeStyleProps = getStyleProps(dom, parentNode);
- var valueMismatch = function (prop) {
- var nodeValue = dom.getStyle(node, prop);
- var parentValue = dom.getStyle(parentNode, prop);
- return isNotEmpty(nodeValue) && isNotEmpty(parentValue) && nodeValue !== parentValue;
- };
- return exists(nodeStyleProps, function (nodeStyleProp) {
- var propExists = function (props) {
- return exists(props, function (prop) {
- return prop === nodeStyleProp;
- });
- };
- if (!propExists(parentNodeStyleProps) && propExists(shorthandStyleProps)) {
- var longhandProps = getLonghandStyleProps(parentNodeStyleProps);
- return exists(longhandProps, valueMismatch);
- } else {
- return valueMismatch(nodeStyleProp);
- }
- });
- };
- var isChar = function (forward, predicate, pos) {
- return Optional.from(pos.container()).filter(isText$7).exists(function (text) {
- var delta = forward ? 0 : -1;
- return predicate(text.data.charAt(pos.offset() + delta));
- });
- };
- var isBeforeSpace = curry(isChar, true, isWhiteSpace);
- var isAfterSpace = curry(isChar, false, isWhiteSpace);
- var isEmptyText = function (pos) {
- var container = pos.container();
- return isText$7(container) && (container.data.length === 0 || isZwsp(container.data) && BookmarkManager.isBookmarkNode(container.parentNode));
- };
- var matchesElementPosition = function (before, predicate) {
- return function (pos) {
- return Optional.from(getChildNodeAtRelativeOffset(before ? 0 : -1, pos)).filter(predicate).isSome();
- };
- };
- var isImageBlock = function (node) {
- return isImg(node) && get$5(SugarElement.fromDom(node), 'display') === 'block';
- };
- var isCefNode = function (node) {
- return isContentEditableFalse$b(node) && !isBogusAll$1(node);
- };
- var isBeforeImageBlock = matchesElementPosition(true, isImageBlock);
- var isAfterImageBlock = matchesElementPosition(false, isImageBlock);
- var isBeforeMedia = matchesElementPosition(true, isMedia$2);
- var isAfterMedia = matchesElementPosition(false, isMedia$2);
- var isBeforeTable = matchesElementPosition(true, isTable$3);
- var isAfterTable = matchesElementPosition(false, isTable$3);
- var isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode);
- var isAfterContentEditableFalse = matchesElementPosition(false, isCefNode);
- var getLastChildren = function (elm) {
- var children = [];
- var rawNode = elm.dom;
- while (rawNode) {
- children.push(SugarElement.fromDom(rawNode));
- rawNode = rawNode.lastChild;
- }
- return children;
- };
- var removeTrailingBr = function (elm) {
- var allBrs = descendants(elm, 'br');
- var brs = filter$4(getLastChildren(elm).slice(-1), isBr$4);
- if (allBrs.length === brs.length) {
- each$k(brs, remove$7);
- }
- };
- var fillWithPaddingBr = function (elm) {
- empty(elm);
- append$1(elm, SugarElement.fromHtml('<br data-mce-bogus="1">'));
- };
- var trimBlockTrailingBr = function (elm) {
- lastChild(elm).each(function (lastChild) {
- prevSibling(lastChild).each(function (lastChildPrevSibling) {
- if (isBlock$2(elm) && isBr$4(lastChild) && isBlock$2(lastChildPrevSibling)) {
- remove$7(lastChild);
- }
- });
- });
- };
- var dropLast = function (xs) {
- return xs.slice(0, -1);
- };
- var parentsUntil = function (start, root, predicate) {
- if (contains$1(root, start)) {
- return dropLast(parents$1(start, function (elm) {
- return predicate(elm) || eq(elm, root);
- }));
- } else {
- return [];
- }
- };
- var parents = function (start, root) {
- return parentsUntil(start, root, never);
- };
- var parentsAndSelf = function (start, root) {
- return [start].concat(parents(start, root));
- };
- var navigateIgnoreEmptyTextNodes = function (forward, root, from) {
- return navigateIgnore(forward, root, from, isEmptyText);
- };
- var getClosestBlock$1 = function (root, pos) {
- return find$3(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
- };
- var isAtBeforeAfterBlockBoundary = function (forward, root, pos) {
- return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) {
- return getClosestBlock$1(root, pos).fold(function () {
- return isInSameBlock(newPos, pos, root.dom) === false;
- }, function (fromBlock) {
- return isInSameBlock(newPos, pos, root.dom) === false && contains$1(fromBlock, SugarElement.fromDom(newPos.container()));
- });
- });
- };
- var isAtBlockBoundary = function (forward, root, pos) {
- return getClosestBlock$1(root, pos).fold(function () {
- return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) {
- return isInSameBlock(newPos, pos, root.dom) === false;
- });
- }, function (parent) {
- return navigateIgnoreEmptyTextNodes(forward, parent.dom, pos).isNone();
- });
- };
- var isAtStartOfBlock = curry(isAtBlockBoundary, false);
- var isAtEndOfBlock = curry(isAtBlockBoundary, true);
- var isBeforeBlock = curry(isAtBeforeAfterBlockBoundary, false);
- var isAfterBlock = curry(isAtBeforeAfterBlockBoundary, true);
- var isBr = function (pos) {
- return getElementFromPosition(pos).exists(isBr$4);
- };
- var findBr = function (forward, root, pos) {
- var parentBlocks = filter$4(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
- var scope = head(parentBlocks).getOr(root);
- return fromPosition(forward, scope.dom, pos).filter(isBr);
- };
- var isBeforeBr$1 = function (root, pos) {
- return getElementFromPosition(pos).exists(isBr$4) || findBr(true, root, pos).isSome();
- };
- var isAfterBr = function (root, pos) {
- return getElementFromPrevPosition(pos).exists(isBr$4) || findBr(false, root, pos).isSome();
- };
- var findPreviousBr = curry(findBr, false);
- var findNextBr = curry(findBr, true);
- var isInMiddleOfText = function (pos) {
- return CaretPosition.isTextPosition(pos) && !pos.isAtStart() && !pos.isAtEnd();
- };
- var getClosestBlock = function (root, pos) {
- var parentBlocks = filter$4(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
- return head(parentBlocks).getOr(root);
- };
- var hasSpaceBefore = function (root, pos) {
- if (isInMiddleOfText(pos)) {
- return isAfterSpace(pos);
- } else {
- return isAfterSpace(pos) || prevPosition(getClosestBlock(root, pos).dom, pos).exists(isAfterSpace);
- }
- };
- var hasSpaceAfter = function (root, pos) {
- if (isInMiddleOfText(pos)) {
- return isBeforeSpace(pos);
- } else {
- return isBeforeSpace(pos) || nextPosition(getClosestBlock(root, pos).dom, pos).exists(isBeforeSpace);
- }
- };
- var isPreValue = function (value) {
- return contains$3([
- 'pre',
- 'pre-wrap'
- ], value);
- };
- var isInPre = function (pos) {
- return getElementFromPosition(pos).bind(function (elm) {
- return closest$3(elm, isElement$6);
- }).exists(function (elm) {
- return isPreValue(get$5(elm, 'white-space'));
- });
- };
- var isAtBeginningOfBody = function (root, pos) {
- return prevPosition(root.dom, pos).isNone();
- };
- var isAtEndOfBody = function (root, pos) {
- return nextPosition(root.dom, pos).isNone();
- };
- var isAtLineBoundary = function (root, pos) {
- return isAtBeginningOfBody(root, pos) || isAtEndOfBody(root, pos) || isAtStartOfBlock(root, pos) || isAtEndOfBlock(root, pos) || isAfterBr(root, pos) || isBeforeBr$1(root, pos);
- };
- var needsToHaveNbsp = function (root, pos) {
- if (isInPre(pos)) {
- return false;
- } else {
- return isAtLineBoundary(root, pos) || hasSpaceBefore(root, pos) || hasSpaceAfter(root, pos);
- }
- };
- var needsToBeNbspLeft = function (root, pos) {
- if (isInPre(pos)) {
- return false;
- } else {
- return isAtStartOfBlock(root, pos) || isBeforeBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos);
- }
- };
- var leanRight = function (pos) {
- var container = pos.container();
- var offset = pos.offset();
- if (isText$7(container) && offset < container.data.length) {
- return CaretPosition(container, offset + 1);
- } else {
- return pos;
- }
- };
- var needsToBeNbspRight = function (root, pos) {
- if (isInPre(pos)) {
- return false;
- } else {
- return isAtEndOfBlock(root, pos) || isAfterBlock(root, pos) || isBeforeBr$1(root, pos) || hasSpaceAfter(root, pos);
- }
- };
- var needsToBeNbsp = function (root, pos) {
- return needsToBeNbspLeft(root, pos) || needsToBeNbspRight(root, leanRight(pos));
- };
- var isNbspAt = function (text, offset) {
- return isNbsp(text.charAt(offset));
- };
- var hasNbsp = function (pos) {
- var container = pos.container();
- return isText$7(container) && contains$2(container.data, nbsp);
- };
- var normalizeNbspMiddle = function (text) {
- var chars = text.split('');
- return map$3(chars, function (chr, i) {
- if (isNbsp(chr) && i > 0 && i < chars.length - 1 && isContent(chars[i - 1]) && isContent(chars[i + 1])) {
- return ' ';
- } else {
- return chr;
- }
- }).join('');
- };
- var normalizeNbspAtStart = function (root, node) {
- var text = node.data;
- var firstPos = CaretPosition(node, 0);
- if (isNbspAt(text, 0) && !needsToBeNbsp(root, firstPos)) {
- node.data = ' ' + text.slice(1);
- return true;
- } else {
- return false;
- }
- };
- var normalizeNbspInMiddleOfTextNode = function (node) {
- var text = node.data;
- var newText = normalizeNbspMiddle(text);
- if (newText !== text) {
- node.data = newText;
- return true;
- } else {
- return false;
- }
- };
- var normalizeNbspAtEnd = function (root, node) {
- var text = node.data;
- var lastPos = CaretPosition(node, text.length - 1);
- if (isNbspAt(text, text.length - 1) && !needsToBeNbsp(root, lastPos)) {
- node.data = text.slice(0, -1) + ' ';
- return true;
- } else {
- return false;
- }
- };
- var normalizeNbsps = function (root, pos) {
- return Optional.some(pos).filter(hasNbsp).bind(function (pos) {
- var container = pos.container();
- var normalized = normalizeNbspAtStart(root, container) || normalizeNbspInMiddleOfTextNode(container) || normalizeNbspAtEnd(root, container);
- return normalized ? Optional.some(pos) : Optional.none();
- });
- };
- var normalizeNbspsInEditor = function (editor) {
- var root = SugarElement.fromDom(editor.getBody());
- if (editor.selection.isCollapsed()) {
- normalizeNbsps(root, CaretPosition.fromRangeStart(editor.selection.getRng())).each(function (pos) {
- editor.selection.setRng(pos.toRange());
- });
- }
- };
- var normalizeContent = function (content, isStartOfContent, isEndOfContent) {
- var result = foldl(content, function (acc, c) {
- if (isWhiteSpace(c) || isNbsp(c)) {
- if (acc.previousCharIsSpace || acc.str === '' && isStartOfContent || acc.str.length === content.length - 1 && isEndOfContent) {
- return {
- previousCharIsSpace: false,
- str: acc.str + nbsp
- };
- } else {
- return {
- previousCharIsSpace: true,
- str: acc.str + ' '
- };
- }
- } else {
- return {
- previousCharIsSpace: false,
- str: acc.str + c
- };
- }
- }, {
- previousCharIsSpace: false,
- str: ''
- });
- return result.str;
- };
- var normalize$1 = function (node, offset, count) {
- if (count === 0) {
- return;
- }
- var elm = SugarElement.fromDom(node);
- var root = ancestor$3(elm, isBlock$2).getOr(elm);
- var whitespace = node.data.slice(offset, offset + count);
- var isEndOfContent = offset + count >= node.data.length && needsToBeNbspRight(root, CaretPosition(node, node.data.length));
- var isStartOfContent = offset === 0 && needsToBeNbspLeft(root, CaretPosition(node, 0));
- node.replaceData(offset, count, normalizeContent(whitespace, isStartOfContent, isEndOfContent));
- };
- var normalizeWhitespaceAfter = function (node, offset) {
- var content = node.data.slice(offset);
- var whitespaceCount = content.length - lTrim(content).length;
- normalize$1(node, offset, whitespaceCount);
- };
- var normalizeWhitespaceBefore = function (node, offset) {
- var content = node.data.slice(0, offset);
- var whitespaceCount = content.length - rTrim(content).length;
- normalize$1(node, offset - whitespaceCount, whitespaceCount);
- };
- var mergeTextNodes = function (prevNode, nextNode, normalizeWhitespace, mergeToPrev) {
- if (mergeToPrev === void 0) {
- mergeToPrev = true;
- }
- var whitespaceOffset = rTrim(prevNode.data).length;
- var newNode = mergeToPrev ? prevNode : nextNode;
- var removeNode = mergeToPrev ? nextNode : prevNode;
- if (mergeToPrev) {
- newNode.appendData(removeNode.data);
- } else {
- newNode.insertData(0, removeNode.data);
- }
- remove$7(SugarElement.fromDom(removeNode));
- if (normalizeWhitespace) {
- normalizeWhitespaceAfter(newNode, whitespaceOffset);
- }
- return newNode;
- };
- var needsReposition = function (pos, elm) {
- var container = pos.container();
- var offset = pos.offset();
- return CaretPosition.isTextPosition(pos) === false && container === elm.parentNode && offset > CaretPosition.before(elm).offset();
- };
- var reposition = function (elm, pos) {
- return needsReposition(pos, elm) ? CaretPosition(pos.container(), pos.offset() - 1) : pos;
- };
- var beforeOrStartOf = function (node) {
- return isText$7(node) ? CaretPosition(node, 0) : CaretPosition.before(node);
- };
- var afterOrEndOf = function (node) {
- return isText$7(node) ? CaretPosition(node, node.data.length) : CaretPosition.after(node);
- };
- var getPreviousSiblingCaretPosition = function (elm) {
- if (isCaretCandidate$3(elm.previousSibling)) {
- return Optional.some(afterOrEndOf(elm.previousSibling));
- } else {
- return elm.previousSibling ? lastPositionIn(elm.previousSibling) : Optional.none();
- }
- };
- var getNextSiblingCaretPosition = function (elm) {
- if (isCaretCandidate$3(elm.nextSibling)) {
- return Optional.some(beforeOrStartOf(elm.nextSibling));
- } else {
- return elm.nextSibling ? firstPositionIn(elm.nextSibling) : Optional.none();
- }
- };
- var findCaretPositionBackwardsFromElm = function (rootElement, elm) {
- var startPosition = CaretPosition.before(elm.previousSibling ? elm.previousSibling : elm.parentNode);
- return prevPosition(rootElement, startPosition).fold(function () {
- return nextPosition(rootElement, CaretPosition.after(elm));
- }, Optional.some);
- };
- var findCaretPositionForwardsFromElm = function (rootElement, elm) {
- return nextPosition(rootElement, CaretPosition.after(elm)).fold(function () {
- return prevPosition(rootElement, CaretPosition.before(elm));
- }, Optional.some);
- };
- var findCaretPositionBackwards = function (rootElement, elm) {
- return getPreviousSiblingCaretPosition(elm).orThunk(function () {
- return getNextSiblingCaretPosition(elm);
- }).orThunk(function () {
- return findCaretPositionBackwardsFromElm(rootElement, elm);
- });
- };
- var findCaretPositionForward = function (rootElement, elm) {
- return getNextSiblingCaretPosition(elm).orThunk(function () {
- return getPreviousSiblingCaretPosition(elm);
- }).orThunk(function () {
- return findCaretPositionForwardsFromElm(rootElement, elm);
- });
- };
- var findCaretPosition = function (forward, rootElement, elm) {
- return forward ? findCaretPositionForward(rootElement, elm) : findCaretPositionBackwards(rootElement, elm);
- };
- var findCaretPosOutsideElmAfterDelete = function (forward, rootElement, elm) {
- return findCaretPosition(forward, rootElement, elm).map(curry(reposition, elm));
- };
- var setSelection$1 = function (editor, forward, pos) {
- pos.fold(function () {
- editor.focus();
- }, function (pos) {
- editor.selection.setRng(pos.toRange(), forward);
- });
- };
- var eqRawNode = function (rawNode) {
- return function (elm) {
- return elm.dom === rawNode;
- };
- };
- var isBlock = function (editor, elm) {
- return elm && has$2(editor.schema.getBlockElements(), name(elm));
- };
- var paddEmptyBlock = function (elm) {
- if (isEmpty$2(elm)) {
- var br = SugarElement.fromHtml('<br data-mce-bogus="1">');
- empty(elm);
- append$1(elm, br);
- return Optional.some(CaretPosition.before(br.dom));
- } else {
- return Optional.none();
- }
- };
- var deleteNormalized = function (elm, afterDeletePosOpt, normalizeWhitespace) {
- var prevTextOpt = prevSibling(elm).filter(isText$8);
- var nextTextOpt = nextSibling(elm).filter(isText$8);
- remove$7(elm);
- return lift3(prevTextOpt, nextTextOpt, afterDeletePosOpt, function (prev, next, pos) {
- var prevNode = prev.dom, nextNode = next.dom;
- var offset = prevNode.data.length;
- mergeTextNodes(prevNode, nextNode, normalizeWhitespace);
- return pos.container() === nextNode ? CaretPosition(prevNode, offset) : pos;
- }).orThunk(function () {
- if (normalizeWhitespace) {
- prevTextOpt.each(function (elm) {
- return normalizeWhitespaceBefore(elm.dom, elm.dom.length);
- });
- nextTextOpt.each(function (elm) {
- return normalizeWhitespaceAfter(elm.dom, 0);
- });
- }
- return afterDeletePosOpt;
- });
- };
- var isInlineElement = function (editor, element) {
- return has$2(editor.schema.getTextInlineElements(), name(element));
- };
- var deleteElement$2 = function (editor, forward, elm, moveCaret) {
- if (moveCaret === void 0) {
- moveCaret = true;
- }
- var afterDeletePos = findCaretPosOutsideElmAfterDelete(forward, editor.getBody(), elm.dom);
- var parentBlock = ancestor$3(elm, curry(isBlock, editor), eqRawNode(editor.getBody()));
- var normalizedAfterDeletePos = deleteNormalized(elm, afterDeletePos, isInlineElement(editor, elm));
- if (editor.dom.isEmpty(editor.getBody())) {
- editor.setContent('');
- editor.selection.setCursorLocation();
- } else {
- parentBlock.bind(paddEmptyBlock).fold(function () {
- if (moveCaret) {
- setSelection$1(editor, forward, normalizedAfterDeletePos);
- }
- }, function (paddPos) {
- if (moveCaret) {
- setSelection$1(editor, forward, Optional.some(paddPos));
- }
- });
- }
- };
- var isRootFromElement = function (root) {
- return function (cur) {
- return eq(root, cur);
- };
- };
- var getTableCells = function (table) {
- return descendants(table, 'td,th');
- };
- var getTableDetailsFromRange = function (rng, isRoot) {
- var getTable = function (node) {
- return getClosestTable(SugarElement.fromDom(node), isRoot);
- };
- var startTable = getTable(rng.startContainer);
- var endTable = getTable(rng.endContainer);
- var isStartInTable = startTable.isSome();
- var isEndInTable = endTable.isSome();
- var isSameTable = lift2(startTable, endTable, eq).getOr(false);
- var isMultiTable = !isSameTable && isStartInTable && isEndInTable;
- return {
- startTable: startTable,
- endTable: endTable,
- isStartInTable: isStartInTable,
- isEndInTable: isEndInTable,
- isSameTable: isSameTable,
- isMultiTable: isMultiTable
- };
- };
- var tableCellRng = function (start, end) {
- return {
- start: start,
- end: end
- };
- };
- var tableSelection = function (rng, table, cells) {
- return {
- rng: rng,
- table: table,
- cells: cells
- };
- };
- var deleteAction = Adt.generate([
- {
- singleCellTable: [
- 'rng',
- 'cell'
- ]
- },
- { fullTable: ['table'] },
- {
- partialTable: [
- 'cells',
- 'outsideDetails'
- ]
- },
- {
- multiTable: [
- 'startTableCells',
- 'endTableCells',
- 'betweenRng'
- ]
- }
- ]);
- var getClosestCell$1 = function (container, isRoot) {
- return closest$2(SugarElement.fromDom(container), 'td,th', isRoot);
- };
- var isExpandedCellRng = function (cellRng) {
- return !eq(cellRng.start, cellRng.end);
- };
- var getTableFromCellRng = function (cellRng, isRoot) {
- return getClosestTable(cellRng.start, isRoot).bind(function (startParentTable) {
- return getClosestTable(cellRng.end, isRoot).bind(function (endParentTable) {
- return someIf(eq(startParentTable, endParentTable), startParentTable);
- });
- });
- };
- var isSingleCellTable = function (cellRng, isRoot) {
- return !isExpandedCellRng(cellRng) && getTableFromCellRng(cellRng, isRoot).exists(function (table) {
- var rows = table.dom.rows;
- return rows.length === 1 && rows[0].cells.length === 1;
- });
- };
- var getCellRng = function (rng, isRoot) {
- var startCell = getClosestCell$1(rng.startContainer, isRoot);
- var endCell = getClosestCell$1(rng.endContainer, isRoot);
- return lift2(startCell, endCell, tableCellRng);
- };
- var getCellRangeFromStartTable = function (isRoot) {
- return function (startCell) {
- return getClosestTable(startCell, isRoot).bind(function (table) {
- return last$2(getTableCells(table)).map(function (endCell) {
- return tableCellRng(startCell, endCell);
- });
- });
- };
- };
- var getCellRangeFromEndTable = function (isRoot) {
- return function (endCell) {
- return getClosestTable(endCell, isRoot).bind(function (table) {
- return head(getTableCells(table)).map(function (startCell) {
- return tableCellRng(startCell, endCell);
- });
- });
- };
- };
- var getTableSelectionFromCellRng = function (isRoot) {
- return function (cellRng) {
- return getTableFromCellRng(cellRng, isRoot).map(function (table) {
- return tableSelection(cellRng, table, getTableCells(table));
- });
- };
- };
- var getTableSelections = function (cellRng, selectionDetails, rng, isRoot) {
- if (rng.collapsed || !cellRng.forall(isExpandedCellRng)) {
- return Optional.none();
- } else if (selectionDetails.isSameTable) {
- var sameTableSelection = cellRng.bind(getTableSelectionFromCellRng(isRoot));
- return Optional.some({
- start: sameTableSelection,
- end: sameTableSelection
- });
- } else {
- var startCell = getClosestCell$1(rng.startContainer, isRoot);
- var endCell = getClosestCell$1(rng.endContainer, isRoot);
- var startTableSelection = startCell.bind(getCellRangeFromStartTable(isRoot)).bind(getTableSelectionFromCellRng(isRoot));
- var endTableSelection = endCell.bind(getCellRangeFromEndTable(isRoot)).bind(getTableSelectionFromCellRng(isRoot));
- return Optional.some({
- start: startTableSelection,
- end: endTableSelection
- });
- }
- };
- var getCellIndex = function (cells, cell) {
- return findIndex$2(cells, function (x) {
- return eq(x, cell);
- });
- };
- var getSelectedCells = function (tableSelection) {
- return lift2(getCellIndex(tableSelection.cells, tableSelection.rng.start), getCellIndex(tableSelection.cells, tableSelection.rng.end), function (startIndex, endIndex) {
- return tableSelection.cells.slice(startIndex, endIndex + 1);
- });
- };
- var isSingleCellTableContentSelected = function (optCellRng, rng, isRoot) {
- return optCellRng.exists(function (cellRng) {
- return isSingleCellTable(cellRng, isRoot) && hasAllContentsSelected(cellRng.start, rng);
- });
- };
- var unselectCells = function (rng, selectionDetails) {
- var startTable = selectionDetails.startTable, endTable = selectionDetails.endTable;
- var otherContentRng = rng.cloneRange();
- startTable.each(function (table) {
- return otherContentRng.setStartAfter(table.dom);
- });
- endTable.each(function (table) {
- return otherContentRng.setEndBefore(table.dom);
- });
- return otherContentRng;
- };
- var handleSingleTable = function (cellRng, selectionDetails, rng, isRoot) {
- return getTableSelections(cellRng, selectionDetails, rng, isRoot).bind(function (_a) {
- var start = _a.start, end = _a.end;
- return start.or(end);
- }).bind(function (tableSelection) {
- var isSameTable = selectionDetails.isSameTable;
- var selectedCells = getSelectedCells(tableSelection).getOr([]);
- if (isSameTable && tableSelection.cells.length === selectedCells.length) {
- return Optional.some(deleteAction.fullTable(tableSelection.table));
- } else if (selectedCells.length > 0) {
- if (isSameTable) {
- return Optional.some(deleteAction.partialTable(selectedCells, Optional.none()));
- } else {
- var otherContentRng = unselectCells(rng, selectionDetails);
- return Optional.some(deleteAction.partialTable(selectedCells, Optional.some(__assign(__assign({}, selectionDetails), { rng: otherContentRng }))));
- }
- } else {
- return Optional.none();
- }
- });
- };
- var handleMultiTable = function (cellRng, selectionDetails, rng, isRoot) {
- return getTableSelections(cellRng, selectionDetails, rng, isRoot).bind(function (_a) {
- var start = _a.start, end = _a.end;
- var startTableSelectedCells = start.bind(getSelectedCells).getOr([]);
- var endTableSelectedCells = end.bind(getSelectedCells).getOr([]);
- if (startTableSelectedCells.length > 0 && endTableSelectedCells.length > 0) {
- var otherContentRng = unselectCells(rng, selectionDetails);
- return Optional.some(deleteAction.multiTable(startTableSelectedCells, endTableSelectedCells, otherContentRng));
- } else {
- return Optional.none();
- }
- });
- };
- var getActionFromRange = function (root, rng) {
- var isRoot = isRootFromElement(root);
- var optCellRng = getCellRng(rng, isRoot);
- var selectionDetails = getTableDetailsFromRange(rng, isRoot);
- if (isSingleCellTableContentSelected(optCellRng, rng, isRoot)) {
- return optCellRng.map(function (cellRng) {
- return deleteAction.singleCellTable(rng, cellRng.start);
- });
- } else if (selectionDetails.isMultiTable) {
- return handleMultiTable(optCellRng, selectionDetails, rng, isRoot);
- } else {
- return handleSingleTable(optCellRng, selectionDetails, rng, isRoot);
- }
- };
- var freefallRtl = function (root) {
- var child = isComment$1(root) ? prevSibling(root) : lastChild(root);
- return child.bind(freefallRtl).orThunk(function () {
- return Optional.some(root);
- });
- };
- var cleanCells = function (cells) {
- return each$k(cells, function (cell) {
- remove$6(cell, 'contenteditable');
- fillWithPaddingBr(cell);
- });
- };
- var getOutsideBlock = function (editor, container) {
- return Optional.from(editor.dom.getParent(container, editor.dom.isBlock)).map(SugarElement.fromDom);
- };
- var handleEmptyBlock = function (editor, startInTable, emptyBlock) {
- emptyBlock.each(function (block) {
- if (startInTable) {
- remove$7(block);
- } else {
- fillWithPaddingBr(block);
- editor.selection.setCursorLocation(block.dom, 0);
- }
- });
- };
- var deleteContentInsideCell = function (editor, cell, rng, isFirstCellInSelection) {
- var insideTableRng = rng.cloneRange();
- if (isFirstCellInSelection) {
- insideTableRng.setStart(rng.startContainer, rng.startOffset);
- insideTableRng.setEndAfter(cell.dom.lastChild);
- } else {
- insideTableRng.setStartBefore(cell.dom.firstChild);
- insideTableRng.setEnd(rng.endContainer, rng.endOffset);
- }
- deleteCellContents(editor, insideTableRng, cell, false);
- };
- var collapseAndRestoreCellSelection = function (editor) {
- var selectedCells = getCellsFromEditor(editor);
- var selectedNode = SugarElement.fromDom(editor.selection.getNode());
- if (isTableCell$5(selectedNode.dom) && isEmpty$2(selectedNode)) {
- editor.selection.setCursorLocation(selectedNode.dom, 0);
- } else {
- editor.selection.collapse(true);
- }
- if (selectedCells.length > 1 && exists(selectedCells, function (cell) {
- return eq(cell, selectedNode);
- })) {
- set$1(selectedNode, 'data-mce-selected', '1');
- }
- };
- var emptySingleTableCells = function (editor, cells, outsideDetails) {
- var editorRng = editor.selection.getRng();
- var cellsToClean = outsideDetails.bind(function (_a) {
- var rng = _a.rng, isStartInTable = _a.isStartInTable;
- var outsideBlock = getOutsideBlock(editor, isStartInTable ? rng.endContainer : rng.startContainer);
- rng.deleteContents();
- handleEmptyBlock(editor, isStartInTable, outsideBlock.filter(isEmpty$2));
- var endPointCell = isStartInTable ? cells[0] : cells[cells.length - 1];
- deleteContentInsideCell(editor, endPointCell, editorRng, isStartInTable);
- if (!isEmpty$2(endPointCell)) {
- return Optional.some(isStartInTable ? cells.slice(1) : cells.slice(0, -1));
- } else {
- return Optional.none();
- }
- }).getOr(cells);
- cleanCells(cellsToClean);
- collapseAndRestoreCellSelection(editor);
- return true;
- };
- var emptyMultiTableCells = function (editor, startTableCells, endTableCells, betweenRng) {
- var rng = editor.selection.getRng();
- var startCell = startTableCells[0];
- var endCell = endTableCells[endTableCells.length - 1];
- deleteContentInsideCell(editor, startCell, rng, true);
- deleteContentInsideCell(editor, endCell, rng, false);
- var startTableCellsToClean = isEmpty$2(startCell) ? startTableCells : startTableCells.slice(1);
- var endTableCellsToClean = isEmpty$2(endCell) ? endTableCells : endTableCells.slice(0, -1);
- cleanCells(startTableCellsToClean.concat(endTableCellsToClean));
- betweenRng.deleteContents();
- collapseAndRestoreCellSelection(editor);
- return true;
- };
- var deleteCellContents = function (editor, rng, cell, moveSelection) {
- if (moveSelection === void 0) {
- moveSelection = true;
- }
- rng.deleteContents();
- var lastNode = freefallRtl(cell).getOr(cell);
- var lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock));
- if (isEmpty$2(lastBlock)) {
- fillWithPaddingBr(lastBlock);
- if (moveSelection) {
- editor.selection.setCursorLocation(lastBlock.dom, 0);
- }
- }
- if (!eq(cell, lastBlock)) {
- var additionalCleanupNodes = is$1(parent(lastBlock), cell) ? [] : siblings(lastBlock);
- each$k(additionalCleanupNodes.concat(children(cell)), function (node) {
- if (!eq(node, lastBlock) && !contains$1(node, lastBlock) && isEmpty$2(node)) {
- remove$7(node);
- }
- });
- }
- return true;
- };
- var deleteTableElement = function (editor, table) {
- deleteElement$2(editor, false, table);
- return true;
- };
- var deleteCellRange = function (editor, rootElm, rng) {
- return getActionFromRange(rootElm, rng).map(function (action) {
- return action.fold(curry(deleteCellContents, editor), curry(deleteTableElement, editor), curry(emptySingleTableCells, editor), curry(emptyMultiTableCells, editor));
- });
- };
- var deleteCaptionRange = function (editor, caption) {
- return emptyElement(editor, caption);
- };
- var deleteTableRange = function (editor, rootElm, rng, startElm) {
- return getParentCaption(rootElm, startElm).fold(function () {
- return deleteCellRange(editor, rootElm, rng);
- }, function (caption) {
- return deleteCaptionRange(editor, caption);
- }).getOr(false);
- };
- var deleteRange$2 = function (editor, startElm, selectedCells) {
- var rootNode = SugarElement.fromDom(editor.getBody());
- var rng = editor.selection.getRng();
- return selectedCells.length !== 0 ? emptySingleTableCells(editor, selectedCells, Optional.none()) : deleteTableRange(editor, rootNode, rng, startElm);
- };
- var getParentCell = function (rootElm, elm) {
- return find$3(parentsAndSelf(elm, rootElm), isTableCell$4);
- };
- var getParentCaption = function (rootElm, elm) {
- return find$3(parentsAndSelf(elm, rootElm), isTag('caption'));
- };
- var deleteBetweenCells = function (editor, rootElm, forward, fromCell, from) {
- return navigate(forward, editor.getBody(), from).bind(function (to) {
- return getParentCell(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCell) {
- return eq(toCell, fromCell) === false;
- });
- });
- };
- var emptyElement = function (editor, elm) {
- fillWithPaddingBr(elm);
- editor.selection.setCursorLocation(elm.dom, 0);
- return Optional.some(true);
- };
- var isDeleteOfLastCharPos = function (fromCaption, forward, from, to) {
- return firstPositionIn(fromCaption.dom).bind(function (first) {
- return lastPositionIn(fromCaption.dom).map(function (last) {
- return forward ? from.isEqual(first) && to.isEqual(last) : from.isEqual(last) && to.isEqual(first);
- });
- }).getOr(true);
- };
- var emptyCaretCaption = function (editor, elm) {
- return emptyElement(editor, elm);
- };
- var validateCaretCaption = function (rootElm, fromCaption, to) {
- return getParentCaption(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCaption) {
- return eq(toCaption, fromCaption) === false;
- });
- };
- var deleteCaretInsideCaption = function (editor, rootElm, forward, fromCaption, from) {
- return navigate(forward, editor.getBody(), from).bind(function (to) {
- return isDeleteOfLastCharPos(fromCaption, forward, from, to) ? emptyCaretCaption(editor, fromCaption) : validateCaretCaption(rootElm, fromCaption, to);
- }).or(Optional.some(true));
- };
- var deleteCaretCells = function (editor, forward, rootElm, startElm) {
- var from = CaretPosition.fromRangeStart(editor.selection.getRng());
- return getParentCell(rootElm, startElm).bind(function (fromCell) {
- return isEmpty$2(fromCell) ? emptyElement(editor, fromCell) : deleteBetweenCells(editor, rootElm, forward, fromCell, from);
- }).getOr(false);
- };
- var deleteCaretCaption = function (editor, forward, rootElm, fromCaption) {
- var from = CaretPosition.fromRangeStart(editor.selection.getRng());
- return isEmpty$2(fromCaption) ? emptyElement(editor, fromCaption) : deleteCaretInsideCaption(editor, rootElm, forward, fromCaption, from);
- };
- var isNearTable = function (forward, pos) {
- return forward ? isBeforeTable(pos) : isAfterTable(pos);
- };
- var isBeforeOrAfterTable = function (editor, forward) {
- var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
- return isNearTable(forward, fromPos) || fromPosition(forward, editor.getBody(), fromPos).exists(function (pos) {
- return isNearTable(forward, pos);
- });
- };
- var deleteCaret$3 = function (editor, forward, startElm) {
- var rootElm = SugarElement.fromDom(editor.getBody());
- return getParentCaption(rootElm, startElm).fold(function () {
- return deleteCaretCells(editor, forward, rootElm, startElm) || isBeforeOrAfterTable(editor, forward);
- }, function (fromCaption) {
- return deleteCaretCaption(editor, forward, rootElm, fromCaption).getOr(false);
- });
- };
- var backspaceDelete$9 = function (editor, forward) {
- var startElm = SugarElement.fromDom(editor.selection.getStart(true));
- var cells = getCellsFromEditor(editor);
- return editor.selection.isCollapsed() && cells.length === 0 ? deleteCaret$3(editor, forward, startElm) : deleteRange$2(editor, startElm, cells);
- };
- var createRange = function (sc, so, ec, eo) {
- var rng = document.createRange();
- rng.setStart(sc, so);
- rng.setEnd(ec, eo);
- return rng;
- };
- var normalizeBlockSelectionRange = function (rng) {
- var startPos = CaretPosition.fromRangeStart(rng);
- var endPos = CaretPosition.fromRangeEnd(rng);
- var rootNode = rng.commonAncestorContainer;
- return fromPosition(false, rootNode, endPos).map(function (newEndPos) {
- if (!isInSameBlock(startPos, endPos, rootNode) && isInSameBlock(startPos, newEndPos, rootNode)) {
- return createRange(startPos.container(), startPos.offset(), newEndPos.container(), newEndPos.offset());
- } else {
- return rng;
- }
- }).getOr(rng);
- };
- var normalize = function (rng) {
- return rng.collapsed ? rng : normalizeBlockSelectionRange(rng);
- };
- var hasOnlyOneChild$1 = function (node) {
- return node.firstChild && node.firstChild === node.lastChild;
- };
- var isPaddingNode = function (node) {
- return node.name === 'br' || node.value === nbsp;
- };
- var isPaddedEmptyBlock = function (schema, node) {
- var blockElements = schema.getBlockElements();
- return blockElements[node.name] && hasOnlyOneChild$1(node) && isPaddingNode(node.firstChild);
- };
- var isEmptyFragmentElement = function (schema, node) {
- var nonEmptyElements = schema.getNonEmptyElements();
- return node && (node.isEmpty(nonEmptyElements) || isPaddedEmptyBlock(schema, node));
- };
- var isListFragment = function (schema, fragment) {
- var firstChild = fragment.firstChild;
- var lastChild = fragment.lastChild;
- if (firstChild && firstChild.name === 'meta') {
- firstChild = firstChild.next;
- }
- if (lastChild && lastChild.attr('id') === 'mce_marker') {
- lastChild = lastChild.prev;
- }
- if (isEmptyFragmentElement(schema, lastChild)) {
- lastChild = lastChild.prev;
- }
- if (!firstChild || firstChild !== lastChild) {
- return false;
- }
- return firstChild.name === 'ul' || firstChild.name === 'ol';
- };
- var cleanupDomFragment = function (domFragment) {
- var firstChild = domFragment.firstChild;
- var lastChild = domFragment.lastChild;
- if (firstChild && firstChild.nodeName === 'META') {
- firstChild.parentNode.removeChild(firstChild);
- }
- if (lastChild && lastChild.id === 'mce_marker') {
- lastChild.parentNode.removeChild(lastChild);
- }
- return domFragment;
- };
- var toDomFragment = function (dom, serializer, fragment) {
- var html = serializer.serialize(fragment);
- var domFragment = dom.createFragment(html);
- return cleanupDomFragment(domFragment);
- };
- var listItems = function (elm) {
- return filter$4(elm.childNodes, function (child) {
- return child.nodeName === 'LI';
- });
- };
- var isPadding = function (node) {
- return node.data === nbsp || isBr$5(node);
- };
- var isListItemPadded = function (node) {
- return node && node.firstChild && node.firstChild === node.lastChild && isPadding(node.firstChild);
- };
- var isEmptyOrPadded = function (elm) {
- return !elm.firstChild || isListItemPadded(elm);
- };
- var trimListItems = function (elms) {
- return elms.length > 0 && isEmptyOrPadded(elms[elms.length - 1]) ? elms.slice(0, -1) : elms;
- };
- var getParentLi = function (dom, node) {
- var parentBlock = dom.getParent(node, dom.isBlock);
- return parentBlock && parentBlock.nodeName === 'LI' ? parentBlock : null;
- };
- var isParentBlockLi = function (dom, node) {
- return !!getParentLi(dom, node);
- };
- var getSplit = function (parentNode, rng) {
- var beforeRng = rng.cloneRange();
- var afterRng = rng.cloneRange();
- beforeRng.setStartBefore(parentNode);
- afterRng.setEndAfter(parentNode);
- return [
- beforeRng.cloneContents(),
- afterRng.cloneContents()
- ];
- };
- var findFirstIn = function (node, rootNode) {
- var caretPos = CaretPosition.before(node);
- var caretWalker = CaretWalker(rootNode);
- var newCaretPos = caretWalker.next(caretPos);
- return newCaretPos ? newCaretPos.toRange() : null;
- };
- var findLastOf = function (node, rootNode) {
- var caretPos = CaretPosition.after(node);
- var caretWalker = CaretWalker(rootNode);
- var newCaretPos = caretWalker.prev(caretPos);
- return newCaretPos ? newCaretPos.toRange() : null;
- };
- var insertMiddle = function (target, elms, rootNode, rng) {
- var parts = getSplit(target, rng);
- var parentElm = target.parentNode;
- parentElm.insertBefore(parts[0], target);
- Tools.each(elms, function (li) {
- parentElm.insertBefore(li, target);
- });
- parentElm.insertBefore(parts[1], target);
- parentElm.removeChild(target);
- return findLastOf(elms[elms.length - 1], rootNode);
- };
- var insertBefore$1 = function (target, elms, rootNode) {
- var parentElm = target.parentNode;
- Tools.each(elms, function (elm) {
- parentElm.insertBefore(elm, target);
- });
- return findFirstIn(target, rootNode);
- };
- var insertAfter$1 = function (target, elms, rootNode, dom) {
- dom.insertAfter(elms.reverse(), target);
- return findLastOf(elms[0], rootNode);
- };
- var insertAtCaret$1 = function (serializer, dom, rng, fragment) {
- var domFragment = toDomFragment(dom, serializer, fragment);
- var liTarget = getParentLi(dom, rng.startContainer);
- var liElms = trimListItems(listItems(domFragment.firstChild));
- var BEGINNING = 1, END = 2;
- var rootNode = dom.getRoot();
- var isAt = function (location) {
- var caretPos = CaretPosition.fromRangeStart(rng);
- var caretWalker = CaretWalker(dom.getRoot());
- var newPos = location === BEGINNING ? caretWalker.prev(caretPos) : caretWalker.next(caretPos);
- return newPos ? getParentLi(dom, newPos.getNode()) !== liTarget : true;
- };
- if (isAt(BEGINNING)) {
- return insertBefore$1(liTarget, liElms, rootNode);
- } else if (isAt(END)) {
- return insertAfter$1(liTarget, liElms, rootNode, dom);
- }
- return insertMiddle(liTarget, liElms, rootNode, rng);
- };
- var trimOrPadLeftRight = function (dom, rng, html) {
- var root = SugarElement.fromDom(dom.getRoot());
- if (needsToBeNbspLeft(root, CaretPosition.fromRangeStart(rng))) {
- html = html.replace(/^ /, ' ');
- } else {
- html = html.replace(/^ /, ' ');
- }
- if (needsToBeNbspRight(root, CaretPosition.fromRangeEnd(rng))) {
- html = html.replace(/( | )(<br( \/)>)?$/, ' ');
- } else {
- html = html.replace(/ (<br( \/)?>)?$/, ' ');
- }
- return html;
- };
- var isTableCell$1 = isTableCell$5;
- var isTableCellContentSelected = function (dom, rng, cell) {
- if (cell !== null) {
- var endCell = dom.getParent(rng.endContainer, isTableCell$1);
- return cell === endCell && hasAllContentsSelected(SugarElement.fromDom(cell), rng);
- } else {
- return false;
- }
- };
- var validInsertion = function (editor, value, parentNode) {
- if (parentNode.getAttribute('data-mce-bogus') === 'all') {
- parentNode.parentNode.insertBefore(editor.dom.createFragment(value), parentNode);
- } else {
- var node = parentNode.firstChild;
- var node2 = parentNode.lastChild;
- if (!node || node === node2 && node.nodeName === 'BR') {
- editor.dom.setHTML(parentNode, value);
- } else {
- editor.selection.setContent(value);
- }
- }
- };
- var trimBrsFromTableCell = function (dom, elm) {
- Optional.from(dom.getParent(elm, 'td,th')).map(SugarElement.fromDom).each(trimBlockTrailingBr);
- };
- var reduceInlineTextElements = function (editor, merge) {
- var textInlineElements = editor.schema.getTextInlineElements();
- var dom = editor.dom;
- if (merge) {
- var root_1 = editor.getBody();
- var elementUtils_1 = ElementUtils(dom);
- Tools.each(dom.select('*[data-mce-fragment]'), function (node) {
- var isInline = isNonNullable(textInlineElements[node.nodeName.toLowerCase()]);
- if (isInline && hasInheritableStyles(dom, node)) {
- for (var parentNode = node.parentNode; isNonNullable(parentNode) && parentNode !== root_1; parentNode = parentNode.parentNode) {
- var styleConflict = hasStyleConflict(dom, node, parentNode);
- if (styleConflict) {
- break;
- }
- if (elementUtils_1.compare(parentNode, node)) {
- dom.remove(node, true);
- break;
- }
- }
- }
- });
- }
- };
- var markFragmentElements = function (fragment) {
- var node = fragment;
- while (node = node.walk()) {
- if (node.type === 1) {
- node.attr('data-mce-fragment', '1');
- }
- }
- };
- var unmarkFragmentElements = function (elm) {
- Tools.each(elm.getElementsByTagName('*'), function (elm) {
- elm.removeAttribute('data-mce-fragment');
- });
- };
- var isPartOfFragment = function (node) {
- return !!node.getAttribute('data-mce-fragment');
- };
- var canHaveChildren = function (editor, node) {
- return node && !editor.schema.getShortEndedElements()[node.nodeName];
- };
- var moveSelectionToMarker = function (editor, marker) {
- var nextRng;
- var dom = editor.dom;
- var selection = editor.selection;
- if (!marker) {
- return;
- }
- selection.scrollIntoView(marker);
- var parentEditableElm = getContentEditableRoot$1(editor.getBody(), marker);
- if (dom.getContentEditable(parentEditableElm) === 'false') {
- dom.remove(marker);
- selection.select(parentEditableElm);
- return;
- }
- var rng = dom.createRng();
- var node = marker.previousSibling;
- if (isText$7(node)) {
- rng.setStart(node, node.nodeValue.length);
- if (!Env.ie) {
- var node2 = marker.nextSibling;
- if (isText$7(node2)) {
- node.appendData(node2.data);
- node2.parentNode.removeChild(node2);
- }
- }
- } else {
- rng.setStartBefore(marker);
- rng.setEndBefore(marker);
- }
- var findNextCaretRng = function (rng) {
- var caretPos = CaretPosition.fromRangeStart(rng);
- var caretWalker = CaretWalker(editor.getBody());
- caretPos = caretWalker.next(caretPos);
- if (caretPos) {
- return caretPos.toRange();
- }
- };
- var parentBlock = dom.getParent(marker, dom.isBlock);
- dom.remove(marker);
- if (parentBlock && dom.isEmpty(parentBlock)) {
- editor.$(parentBlock).empty();
- rng.setStart(parentBlock, 0);
- rng.setEnd(parentBlock, 0);
- if (!isTableCell$1(parentBlock) && !isPartOfFragment(parentBlock) && (nextRng = findNextCaretRng(rng))) {
- rng = nextRng;
- dom.remove(parentBlock);
- } else {
- dom.add(parentBlock, dom.create('br', { 'data-mce-bogus': '1' }));
- }
- }
- selection.setRng(rng);
- };
- var deleteSelectedContent = function (editor) {
- var dom = editor.dom;
- var rng = normalize(editor.selection.getRng());
- editor.selection.setRng(rng);
- var startCell = dom.getParent(rng.startContainer, isTableCell$1);
- if (isTableCellContentSelected(dom, rng, startCell)) {
- deleteCellContents(editor, rng, SugarElement.fromDom(startCell));
- } else {
- editor.getDoc().execCommand('Delete', false, null);
- }
- };
- var insertHtmlAtCaret = function (editor, value, details) {
- var parentNode;
- var rng, node;
- var selection = editor.selection;
- var dom = editor.dom;
- if (/^ | $/.test(value)) {
- value = trimOrPadLeftRight(dom, selection.getRng(), value);
- }
- var parser = editor.parser;
- var merge = details.merge;
- var serializer = HtmlSerializer({ validate: shouldValidate(editor) }, editor.schema);
- var bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark"></span>';
- var args = editor.fire('BeforeSetContent', {
- content: value,
- format: 'html',
- selection: true,
- paste: details.paste
- });
- if (args.isDefaultPrevented()) {
- editor.fire('SetContent', {
- content: args.content,
- format: 'html',
- selection: true,
- paste: details.paste
- });
- return;
- }
- value = args.content;
- if (value.indexOf('{$caret}') === -1) {
- value += '{$caret}';
- }
- value = value.replace(/\{\$caret\}/, bookmarkHtml);
- rng = selection.getRng();
- var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
- var body = editor.getBody();
- if (caretElement === body && selection.isCollapsed()) {
- if (dom.isBlock(body.firstChild) && canHaveChildren(editor, body.firstChild) && dom.isEmpty(body.firstChild)) {
- rng = dom.createRng();
- rng.setStart(body.firstChild, 0);
- rng.setEnd(body.firstChild, 0);
- selection.setRng(rng);
- }
- }
- if (!selection.isCollapsed()) {
- deleteSelectedContent(editor);
- }
- parentNode = selection.getNode();
- var parserArgs = {
- context: parentNode.nodeName.toLowerCase(),
- data: details.data,
- insert: true
- };
- var fragment = parser.parse(value, parserArgs);
- if (details.paste === true && isListFragment(editor.schema, fragment) && isParentBlockLi(dom, parentNode)) {
- rng = insertAtCaret$1(serializer, dom, selection.getRng(), fragment);
- selection.setRng(rng);
- editor.fire('SetContent', args);
- return;
- }
- markFragmentElements(fragment);
- node = fragment.lastChild;
- if (node.attr('id') === 'mce_marker') {
- var marker = node;
- for (node = node.prev; node; node = node.walk(true)) {
- if (node.type === 3 || !dom.isBlock(node.name)) {
- if (editor.schema.isValidChild(node.parent.name, 'span')) {
- node.parent.insert(marker, node, node.name === 'br');
- }
- break;
- }
- }
- }
- editor._selectionOverrides.showBlockCaretContainer(parentNode);
- if (!parserArgs.invalid) {
- value = serializer.serialize(fragment);
- validInsertion(editor, value, parentNode);
- } else {
- editor.selection.setContent(bookmarkHtml);
- parentNode = selection.getNode();
- var rootNode = editor.getBody();
- if (parentNode.nodeType === 9) {
- parentNode = node = rootNode;
- } else {
- node = parentNode;
- }
- while (node !== rootNode) {
- parentNode = node;
- node = node.parentNode;
- }
- value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
- value = serializer.serialize(parser.parse(value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function () {
- return serializer.serialize(fragment);
- })));
- if (parentNode === rootNode) {
- dom.setHTML(rootNode, value);
- } else {
- dom.setOuterHTML(parentNode, value);
- }
- }
- reduceInlineTextElements(editor, merge);
- moveSelectionToMarker(editor, dom.get('mce_marker'));
- unmarkFragmentElements(editor.getBody());
- trimBrsFromTableCell(dom, selection.getStart());
- editor.fire('SetContent', args);
- editor.addVisual();
- };
- var traverse = function (node, fn) {
- fn(node);
- if (node.firstChild) {
- traverse(node.firstChild, fn);
- }
- if (node.next) {
- traverse(node.next, fn);
- }
- };
- var findMatchingNodes = function (nodeFilters, attributeFilters, node) {
- var nodeMatches = {};
- var attrMatches = {};
- var matches = [];
- if (node.firstChild) {
- traverse(node.firstChild, function (node) {
- each$k(nodeFilters, function (filter) {
- if (filter.name === node.name) {
- if (nodeMatches[filter.name]) {
- nodeMatches[filter.name].nodes.push(node);
- } else {
- nodeMatches[filter.name] = {
- filter: filter,
- nodes: [node]
- };
- }
- }
- });
- each$k(attributeFilters, function (filter) {
- if (typeof node.attr(filter.name) === 'string') {
- if (attrMatches[filter.name]) {
- attrMatches[filter.name].nodes.push(node);
- } else {
- attrMatches[filter.name] = {
- filter: filter,
- nodes: [node]
- };
- }
- }
- });
- });
- }
- for (var name_1 in nodeMatches) {
- if (has$2(nodeMatches, name_1)) {
- matches.push(nodeMatches[name_1]);
- }
- }
- for (var name_2 in attrMatches) {
- if (has$2(attrMatches, name_2)) {
- matches.push(attrMatches[name_2]);
- }
- }
- return matches;
- };
- var filter$1 = function (nodeFilters, attributeFilters, node) {
- var matches = findMatchingNodes(nodeFilters, attributeFilters, node);
- each$k(matches, function (match) {
- each$k(match.filter.callbacks, function (callback) {
- callback(match.nodes, match.filter.name, {});
- });
- });
- };
- var defaultFormat$1 = 'html';
- var isTreeNode = function (content) {
- return content instanceof AstNode;
- };
- var moveSelection = function (editor) {
- if (hasFocus(editor)) {
- firstPositionIn(editor.getBody()).each(function (pos) {
- var node = pos.getNode();
- var caretPos = isTable$3(node) ? firstPositionIn(node).getOr(pos) : pos;
- editor.selection.setRng(caretPos.toRange());
- });
- }
- };
- var setEditorHtml = function (editor, html, noSelection) {
- editor.dom.setHTML(editor.getBody(), html);
- if (noSelection !== true) {
- moveSelection(editor);
- }
- };
- var setContentString = function (editor, body, content, args) {
- if (content.length === 0 || /^\s+$/.test(content)) {
- var padd = '<br data-mce-bogus="1">';
- if (body.nodeName === 'TABLE') {
- content = '<tr><td>' + padd + '</td></tr>';
- } else if (/^(UL|OL)$/.test(body.nodeName)) {
- content = '<li>' + padd + '</li>';
- }
- var forcedRootBlockName = getForcedRootBlock(editor);
- if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
- content = padd;
- content = editor.dom.createHTML(forcedRootBlockName, getForcedRootBlockAttrs(editor), content);
- } else if (!content) {
- content = '<br data-mce-bogus="1">';
- }
- setEditorHtml(editor, content, args.no_selection);
- editor.fire('SetContent', args);
- } else {
- if (args.format !== 'raw') {
- content = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, {
- isRootContent: true,
- insert: true
- }));
- }
- args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? content : Tools.trim(content);
- setEditorHtml(editor, args.content, args.no_selection);
- if (!args.no_events) {
- editor.fire('SetContent', args);
- }
- }
- return args.content;
- };
- var setContentTree = function (editor, body, content, args) {
- filter$1(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content);
- var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content);
- args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html);
- setEditorHtml(editor, args.content, args.no_selection);
- if (!args.no_events) {
- editor.fire('SetContent', args);
- }
- return content;
- };
- var setupArgs$2 = function (args, content) {
- return __assign(__assign({ format: defaultFormat$1 }, args), {
- set: true,
- content: isTreeNode(content) ? '' : content
- });
- };
- var setContentInternal = function (editor, content, args) {
- var defaultedArgs = setupArgs$2(args, content);
- var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeSetContent', defaultedArgs);
- if (!isTreeNode(content)) {
- content = updatedArgs.content;
- }
- return Optional.from(editor.getBody()).fold(constant(content), function (body) {
- return isTreeNode(content) ? setContentTree(editor, body, content, updatedArgs) : setContentString(editor, body, content, updatedArgs);
- });
- };
- var sibling = function (scope, predicate) {
- return sibling$2(scope, predicate).isSome();
- };
- var ensureIsRoot = function (isRoot) {
- return isFunction(isRoot) ? isRoot : never;
- };
- var ancestor = function (scope, transform, isRoot) {
- var element = scope.dom;
- var stop = ensureIsRoot(isRoot);
- while (element.parentNode) {
- element = element.parentNode;
- var el = SugarElement.fromDom(element);
- var transformed = transform(el);
- if (transformed.isSome()) {
- return transformed;
- } else if (stop(el)) {
- break;
- }
- }
- return Optional.none();
- };
- var closest$1 = function (scope, transform, isRoot) {
- var current = transform(scope);
- var stop = ensureIsRoot(isRoot);
- return current.orThunk(function () {
- return stop(scope) ? Optional.none() : ancestor(scope, transform, stop);
- });
- };
- var isEq$3 = isEq$5;
- var matchesUnInheritedFormatSelector = function (ed, node, name) {
- var formatList = ed.formatter.get(name);
- if (formatList) {
- for (var i = 0; i < formatList.length; i++) {
- var format = formatList[i];
- if (isSelectorFormat(format) && format.inherit === false && ed.dom.is(node, format.selector)) {
- return true;
- }
- }
- }
- return false;
- };
- var matchParents = function (editor, node, name, vars, similar) {
- var root = editor.dom.getRoot();
- if (node === root) {
- return false;
- }
- node = editor.dom.getParent(node, function (node) {
- if (matchesUnInheritedFormatSelector(editor, node, name)) {
- return true;
- }
- return node.parentNode === root || !!matchNode(editor, node, name, vars, true);
- });
- return !!matchNode(editor, node, name, vars, similar);
- };
- var matchName$1 = function (dom, node, format) {
- if (isEq$3(node, format.inline)) {
- return true;
- }
- if (isEq$3(node, format.block)) {
- return true;
- }
- if (format.selector) {
- return node.nodeType === 1 && dom.is(node, format.selector);
- }
- };
- var matchItems = function (dom, node, format, itemName, similar, vars) {
- var items = format[itemName];
- if (isFunction(format.onmatch)) {
- return format.onmatch(node, format, itemName);
- }
- if (items) {
- if (isUndefined(items.length)) {
- for (var key in items) {
- if (has$2(items, key)) {
- var value = itemName === 'attributes' ? dom.getAttrib(node, key) : getStyle(dom, node, key);
- var expectedValue = replaceVars(items[key], vars);
- var isEmptyValue = isNullable(value) || isEmpty$3(value);
- if (isEmptyValue && isNullable(expectedValue)) {
- continue;
- }
- if (similar && isEmptyValue && !format.exact) {
- return false;
- }
- if ((!similar || format.exact) && !isEq$3(value, normalizeStyleValue(dom, expectedValue, key))) {
- return false;
- }
- }
- }
- } else {
- for (var i = 0; i < items.length; i++) {
- if (itemName === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(dom, node, items[i])) {
- return true;
- }
- }
- }
- }
- return true;
- };
- var matchNode = function (ed, node, name, vars, similar) {
- var formatList = ed.formatter.get(name);
- var dom = ed.dom;
- if (formatList && node) {
- for (var i = 0; i < formatList.length; i++) {
- var format = formatList[i];
- if (matchName$1(ed.dom, node, format) && matchItems(dom, node, format, 'attributes', similar, vars) && matchItems(dom, node, format, 'styles', similar, vars)) {
- var classes = format.classes;
- if (classes) {
- for (var x = 0; x < classes.length; x++) {
- if (!ed.dom.hasClass(node, replaceVars(classes[x], vars))) {
- return;
- }
- }
- }
- return format;
- }
- }
- }
- };
- var match$2 = function (editor, name, vars, node, similar) {
- if (node) {
- return matchParents(editor, node, name, vars, similar);
- }
- node = editor.selection.getNode();
- if (matchParents(editor, node, name, vars, similar)) {
- return true;
- }
- var startNode = editor.selection.getStart();
- if (startNode !== node) {
- if (matchParents(editor, startNode, name, vars, similar)) {
- return true;
- }
- }
- return false;
- };
- var matchAll = function (editor, names, vars) {
- var matchedFormatNames = [];
- var checkedMap = {};
- var startElement = editor.selection.getStart();
- editor.dom.getParent(startElement, function (node) {
- for (var i = 0; i < names.length; i++) {
- var name_1 = names[i];
- if (!checkedMap[name_1] && matchNode(editor, node, name_1, vars)) {
- checkedMap[name_1] = true;
- matchedFormatNames.push(name_1);
- }
- }
- }, editor.dom.getRoot());
- return matchedFormatNames;
- };
- var closest = function (editor, names) {
- var isRoot = function (elm) {
- return eq(elm, SugarElement.fromDom(editor.getBody()));
- };
- var match = function (elm, name) {
- return matchNode(editor, elm.dom, name) ? Optional.some(name) : Optional.none();
- };
- return Optional.from(editor.selection.getStart(true)).bind(function (rawElm) {
- return closest$1(SugarElement.fromDom(rawElm), function (elm) {
- return findMap(names, function (name) {
- return match(elm, name);
- });
- }, isRoot);
- }).getOrNull();
- };
- var canApply = function (editor, name) {
- var formatList = editor.formatter.get(name);
- var dom = editor.dom;
- if (formatList) {
- var startNode = editor.selection.getStart();
- var parents = getParents$2(dom, startNode);
- for (var x = formatList.length - 1; x >= 0; x--) {
- var format = formatList[x];
- if (!isSelectorFormat(format) || isNonNullable(format.defaultBlock)) {
- return true;
- }
- for (var i = parents.length - 1; i >= 0; i--) {
- if (dom.is(parents[i], format.selector)) {
- return true;
- }
- }
- }
- }
- return false;
- };
- var matchAllOnNode = function (editor, node, formatNames) {
- return foldl(formatNames, function (acc, name) {
- var matchSimilar = isVariableFormatName(editor, name);
- if (editor.formatter.matchNode(node, name, {}, matchSimilar)) {
- return acc.concat([name]);
- } else {
- return acc;
- }
- }, []);
- };
- var ZWSP = ZWSP$1, CARET_ID = '_mce_caret';
- var importNode = function (ownerDocument, node) {
- return ownerDocument.importNode(node, true);
- };
- var getEmptyCaretContainers = function (node) {
- var nodes = [];
- while (node) {
- if (node.nodeType === 3 && node.nodeValue !== ZWSP || node.childNodes.length > 1) {
- return [];
- }
- if (node.nodeType === 1) {
- nodes.push(node);
- }
- node = node.firstChild;
- }
- return nodes;
- };
- var isCaretContainerEmpty = function (node) {
- return getEmptyCaretContainers(node).length > 0;
- };
- var findFirstTextNode = function (node) {
- if (node) {
- var walker = new DomTreeWalker(node, node);
- for (node = walker.current(); node; node = walker.next()) {
- if (isText$7(node)) {
- return node;
- }
- }
- }
- return null;
- };
- var createCaretContainer = function (fill) {
- var caretContainer = SugarElement.fromTag('span');
- setAll$1(caretContainer, {
- 'id': CARET_ID,
- 'data-mce-bogus': '1',
- 'data-mce-type': 'format-caret'
- });
- if (fill) {
- append$1(caretContainer, SugarElement.fromText(ZWSP));
- }
- return caretContainer;
- };
- var trimZwspFromCaretContainer = function (caretContainerNode) {
- var textNode = findFirstTextNode(caretContainerNode);
- if (textNode && textNode.nodeValue.charAt(0) === ZWSP) {
- textNode.deleteData(0, 1);
- }
- return textNode;
- };
- var removeCaretContainerNode = function (editor, node, moveCaret) {
- if (moveCaret === void 0) {
- moveCaret = true;
- }
- var dom = editor.dom, selection = editor.selection;
- if (isCaretContainerEmpty(node)) {
- deleteElement$2(editor, false, SugarElement.fromDom(node), moveCaret);
- } else {
- var rng = selection.getRng();
- var block = dom.getParent(node, dom.isBlock);
- var startContainer = rng.startContainer;
- var startOffset = rng.startOffset;
- var endContainer = rng.endContainer;
- var endOffset = rng.endOffset;
- var textNode = trimZwspFromCaretContainer(node);
- dom.remove(node, true);
- if (startContainer === textNode && startOffset > 0) {
- rng.setStart(textNode, startOffset - 1);
- }
- if (endContainer === textNode && endOffset > 0) {
- rng.setEnd(textNode, endOffset - 1);
- }
- if (block && dom.isEmpty(block)) {
- fillWithPaddingBr(SugarElement.fromDom(block));
- }
- selection.setRng(rng);
- }
- };
- var removeCaretContainer = function (editor, node, moveCaret) {
- if (moveCaret === void 0) {
- moveCaret = true;
- }
- var dom = editor.dom, selection = editor.selection;
- if (!node) {
- node = getParentCaretContainer(editor.getBody(), selection.getStart());
- if (!node) {
- while (node = dom.get(CARET_ID)) {
- removeCaretContainerNode(editor, node, false);
- }
- }
- } else {
- removeCaretContainerNode(editor, node, moveCaret);
- }
- };
- var insertCaretContainerNode = function (editor, caretContainer, formatNode) {
- var dom = editor.dom, block = dom.getParent(formatNode, curry(isTextBlock$1, editor));
- if (block && dom.isEmpty(block)) {
- formatNode.parentNode.replaceChild(caretContainer, formatNode);
- } else {
- removeTrailingBr(SugarElement.fromDom(formatNode));
- if (dom.isEmpty(formatNode)) {
- formatNode.parentNode.replaceChild(caretContainer, formatNode);
- } else {
- dom.insertAfter(caretContainer, formatNode);
- }
- }
- };
- var appendNode = function (parentNode, node) {
- parentNode.appendChild(node);
- return node;
- };
- var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) {
- var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) {
- return appendNode(parentNode, formatNode.cloneNode(false));
- }, caretContainer);
- return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP));
- };
- var cleanFormatNode = function (editor, caretContainer, formatNode, name, vars, similar) {
- var formatter = editor.formatter;
- var dom = editor.dom;
- var validFormats = filter$4(keys(formatter.get()), function (formatName) {
- return formatName !== name && !contains$2(formatName, 'removeformat');
- });
- var matchedFormats = matchAllOnNode(editor, formatNode, validFormats);
- var uniqueFormats = filter$4(matchedFormats, function (fmtName) {
- return !areSimilarFormats(editor, fmtName, name);
- });
- if (uniqueFormats.length > 0) {
- var clonedFormatNode = formatNode.cloneNode(false);
- dom.add(caretContainer, clonedFormatNode);
- formatter.remove(name, vars, clonedFormatNode, similar);
- dom.remove(clonedFormatNode);
- return Optional.some(clonedFormatNode);
- } else {
- return Optional.none();
- }
- };
- var applyCaretFormat = function (editor, name, vars) {
- var caretContainer, textNode;
- var selection = editor.selection;
- var selectionRng = selection.getRng();
- var offset = selectionRng.startOffset;
- var container = selectionRng.startContainer;
- var text = container.nodeValue;
- caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart());
- if (caretContainer) {
- textNode = findFirstTextNode(caretContainer);
- }
- var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/;
- if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) {
- var bookmark = selection.getBookmark();
- selectionRng.collapse(true);
- var rng = expandRng(editor, selectionRng, editor.formatter.get(name));
- rng = split(rng);
- editor.formatter.apply(name, vars, rng);
- selection.moveToBookmark(bookmark);
- } else {
- if (!caretContainer || textNode.nodeValue !== ZWSP) {
- caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom);
- textNode = caretContainer.firstChild;
- selectionRng.insertNode(caretContainer);
- offset = 1;
- editor.formatter.apply(name, vars, caretContainer);
- } else {
- editor.formatter.apply(name, vars, caretContainer);
- }
- selection.setCursorLocation(textNode, offset);
- }
- };
- var removeCaretFormat = function (editor, name, vars, similar) {
- var dom = editor.dom;
- var selection = editor.selection;
- var hasContentAfter, node, formatNode;
- var parents = [];
- var rng = selection.getRng();
- var container = rng.startContainer;
- var offset = rng.startOffset;
- node = container;
- if (container.nodeType === 3) {
- if (offset !== container.nodeValue.length) {
- hasContentAfter = true;
- }
- node = node.parentNode;
- }
- while (node) {
- if (matchNode(editor, node, name, vars, similar)) {
- formatNode = node;
- break;
- }
- if (node.nextSibling) {
- hasContentAfter = true;
- }
- parents.push(node);
- node = node.parentNode;
- }
- if (!formatNode) {
- return;
- }
- if (hasContentAfter) {
- var bookmark = selection.getBookmark();
- rng.collapse(true);
- var expandedRng = expandRng(editor, rng, editor.formatter.get(name), true);
- expandedRng = split(expandedRng);
- editor.formatter.remove(name, vars, expandedRng, similar);
- selection.moveToBookmark(bookmark);
- } else {
- var caretContainer = getParentCaretContainer(editor.getBody(), formatNode);
- var newCaretContainer = createCaretContainer(false).dom;
- insertCaretContainerNode(editor, newCaretContainer, caretContainer !== null ? caretContainer : formatNode);
- var cleanedFormatNode = cleanFormatNode(editor, newCaretContainer, formatNode, name, vars, similar);
- var caretTextNode = insertFormatNodesIntoCaretContainer(parents.concat(cleanedFormatNode.toArray()), newCaretContainer);
- removeCaretContainerNode(editor, caretContainer, false);
- selection.setCursorLocation(caretTextNode, 1);
- if (dom.isEmpty(formatNode)) {
- dom.remove(formatNode);
- }
- }
- };
- var disableCaretContainer = function (editor, keyCode) {
- var selection = editor.selection, body = editor.getBody();
- removeCaretContainer(editor, null, false);
- if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP) {
- removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
- }
- if (keyCode === 37 || keyCode === 39) {
- removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
- }
- };
- var setup$k = function (editor) {
- editor.on('mouseup keydown', function (e) {
- disableCaretContainer(editor, e.keyCode);
- });
- };
- var replaceWithCaretFormat = function (targetNode, formatNodes) {
- var caretContainer = createCaretContainer(false);
- var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom);
- before$4(SugarElement.fromDom(targetNode), caretContainer);
- remove$7(SugarElement.fromDom(targetNode));
- return CaretPosition(innerMost, 0);
- };
- var isFormatElement = function (editor, element) {
- var inlineElements = editor.schema.getTextInlineElements();
- return has$2(inlineElements, name(element)) && !isCaretNode(element.dom) && !isBogus$2(element.dom);
- };
- var isEmptyCaretFormatElement = function (element) {
- return isCaretNode(element.dom) && isCaretContainerEmpty(element.dom);
- };
- var postProcessHooks = {};
- var filter = filter$2;
- var each$b = each$i;
- var addPostProcessHook = function (name, hook) {
- var hooks = postProcessHooks[name];
- if (!hooks) {
- postProcessHooks[name] = [];
- }
- postProcessHooks[name].push(hook);
- };
- var postProcess$1 = function (name, editor) {
- each$b(postProcessHooks[name], function (hook) {
- hook(editor);
- });
- };
- addPostProcessHook('pre', function (editor) {
- var rng = editor.selection.getRng();
- var blocks;
- var hasPreSibling = function (pre) {
- return isPre(pre.previousSibling) && indexOf$1(blocks, pre.previousSibling) !== -1;
- };
- var joinPre = function (pre1, pre2) {
- DomQuery(pre2).remove();
- DomQuery(pre1).append('<br><br>').append(pre2.childNodes);
- };
- var isPre = matchNodeNames(['pre']);
- if (!rng.collapsed) {
- blocks = editor.selection.getSelectedBlocks();
- each$b(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
- joinPre(pre.previousSibling, pre);
- });
- }
- });
- var each$a = Tools.each;
- var isElementNode$1 = function (node) {
- return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
- };
- var findElementSibling = function (node, siblingName) {
- for (var sibling = node; sibling; sibling = sibling[siblingName]) {
- if (isText$7(sibling) && isNotEmpty(sibling.data)) {
- return node;
- }
- if (isElement$5(sibling) && !isBookmarkNode$1(sibling)) {
- return sibling;
- }
- }
- return node;
- };
- var mergeSiblingsNodes = function (dom, prev, next) {
- var elementUtils = ElementUtils(dom);
- if (prev && next) {
- prev = findElementSibling(prev, 'previousSibling');
- next = findElementSibling(next, 'nextSibling');
- if (elementUtils.compare(prev, next)) {
- for (var sibling = prev.nextSibling; sibling && sibling !== next;) {
- var tmpSibling = sibling;
- sibling = sibling.nextSibling;
- prev.appendChild(tmpSibling);
- }
- dom.remove(next);
- Tools.each(Tools.grep(next.childNodes), function (node) {
- prev.appendChild(node);
- });
- return prev;
- }
- }
- return next;
- };
- var mergeSiblings = function (dom, format, vars, node) {
- if (node && format.merge_siblings !== false) {
- var newNode = mergeSiblingsNodes(dom, getNonWhiteSpaceSibling(node), node);
- mergeSiblingsNodes(dom, newNode, getNonWhiteSpaceSibling(newNode, true));
- }
- };
- var clearChildStyles = function (dom, format, node) {
- if (format.clear_child_styles) {
- var selector = format.links ? '*:not(a)' : '*';
- each$a(dom.select(selector, node), function (node) {
- if (isElementNode$1(node)) {
- each$a(format.styles, function (value, name) {
- dom.setStyle(node, name, '');
- });
- }
- });
- }
- };
- var processChildElements = function (node, filter, process) {
- each$a(node.childNodes, function (node) {
- if (isElementNode$1(node)) {
- if (filter(node)) {
- process(node);
- }
- if (node.hasChildNodes()) {
- processChildElements(node, filter, process);
- }
- }
- });
- };
- var unwrapEmptySpan = function (dom, node) {
- if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) {
- dom.remove(node, true);
- }
- };
- var hasStyle = function (dom, name) {
- return function (node) {
- return !!(node && getStyle(dom, node, name));
- };
- };
- var applyStyle = function (dom, name, value) {
- return function (node) {
- dom.setStyle(node, name, value);
- if (node.getAttribute('style') === '') {
- node.removeAttribute('style');
- }
- unwrapEmptySpan(dom, node);
- };
- };
- var removeResult = Adt.generate([
- { keep: [] },
- { rename: ['name'] },
- { removed: [] }
- ]);
- var MCE_ATTR_RE = /^(src|href|style)$/;
- var each$9 = Tools.each;
- var isEq$2 = isEq$5;
- var isTableCellOrRow = function (node) {
- return /^(TR|TH|TD)$/.test(node.nodeName);
- };
- var isChildOfInlineParent = function (dom, node, parent) {
- return dom.isChildOf(node, parent) && node !== parent && !dom.isBlock(parent);
- };
- var getContainer = function (ed, rng, start) {
- var container = rng[start ? 'startContainer' : 'endContainer'];
- var offset = rng[start ? 'startOffset' : 'endOffset'];
- if (isElement$5(container)) {
- var lastIdx = container.childNodes.length - 1;
- if (!start && offset) {
- offset--;
- }
- container = container.childNodes[offset > lastIdx ? lastIdx : offset];
- }
- if (isText$7(container) && start && offset >= container.nodeValue.length) {
- container = new DomTreeWalker(container, ed.getBody()).next() || container;
- }
- if (isText$7(container) && !start && offset === 0) {
- container = new DomTreeWalker(container, ed.getBody()).prev() || container;
- }
- return container;
- };
- var normalizeTableSelection = function (node, start) {
- var prop = start ? 'firstChild' : 'lastChild';
- if (isTableCellOrRow(node) && node[prop]) {
- var childNode = node[prop];
- if (node.nodeName === 'TR') {
- return childNode[prop] || childNode;
- } else {
- return childNode;
- }
- }
- return node;
- };
- var wrap$1 = function (dom, node, name, attrs) {
- var wrapper = dom.create(name, attrs);
- node.parentNode.insertBefore(wrapper, node);
- wrapper.appendChild(node);
- return wrapper;
- };
- var wrapWithSiblings = function (dom, node, next, name, attrs) {
- var start = SugarElement.fromDom(node);
- var wrapper = SugarElement.fromDom(dom.create(name, attrs));
- var siblings = next ? nextSiblings(start) : prevSiblings(start);
- append(wrapper, siblings);
- if (next) {
- before$4(start, wrapper);
- prepend(wrapper, start);
- } else {
- after$3(start, wrapper);
- append$1(wrapper, start);
- }
- return wrapper.dom;
- };
- var matchName = function (dom, node, format) {
- if (isInlineFormat(format) && isEq$2(node, format.inline)) {
- return true;
- }
- if (isBlockFormat(format) && isEq$2(node, format.block)) {
- return true;
- }
- if (isSelectorFormat(format)) {
- return isElement$5(node) && dom.is(node, format.selector);
- }
- };
- var isColorFormatAndAnchor = function (node, format) {
- return format.links && node.nodeName === 'A';
- };
- var find = function (dom, node, next, inc) {
- var sibling = getNonWhiteSpaceSibling(node, next, inc);
- return isNullable(sibling) || sibling.nodeName === 'BR' || dom.isBlock(sibling);
- };
- var removeNode = function (ed, node, format) {
- var parentNode = node.parentNode;
- var rootBlockElm;
- var dom = ed.dom, forcedRootBlock = getForcedRootBlock(ed);
- if (isBlockFormat(format)) {
- if (!forcedRootBlock) {
- if (dom.isBlock(node) && !dom.isBlock(parentNode)) {
- if (!find(dom, node, false) && !find(dom, node.firstChild, true, true)) {
- node.insertBefore(dom.create('br'), node.firstChild);
- }
- if (!find(dom, node, true) && !find(dom, node.lastChild, false, true)) {
- node.appendChild(dom.create('br'));
- }
- }
- } else {
- if (parentNode === dom.getRoot()) {
- if (!format.list_block || !isEq$2(node, format.list_block)) {
- each$k(from(node.childNodes), function (node) {
- if (isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) {
- if (!rootBlockElm) {
- rootBlockElm = wrap$1(dom, node, forcedRootBlock);
- dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
- } else {
- rootBlockElm.appendChild(node);
- }
- } else {
- rootBlockElm = null;
- }
- });
- }
- }
- }
- }
- if (isMixedFormat(format) && !isEq$2(format.inline, node)) {
- return;
- }
- dom.remove(node, true);
- };
- var removeFormatInternal = function (ed, format, vars, node, compareNode) {
- var stylesModified;
- var dom = ed.dom;
- if (!matchName(dom, node, format) && !isColorFormatAndAnchor(node, format)) {
- return removeResult.keep();
- }
- var elm = node;
- if (isInlineFormat(format) && format.remove === 'all' && isArray$1(format.preserve_attributes)) {
- var attrsToPreserve = filter$4(dom.getAttribs(elm), function (attr) {
- return contains$3(format.preserve_attributes, attr.name.toLowerCase());
- });
- dom.removeAllAttribs(elm);
- each$k(attrsToPreserve, function (attr) {
- return dom.setAttrib(elm, attr.name, attr.value);
- });
- if (attrsToPreserve.length > 0) {
- return removeResult.rename('span');
- }
- }
- if (format.remove !== 'all') {
- each$9(format.styles, function (value, name) {
- value = normalizeStyleValue(dom, replaceVars(value, vars), name + '');
- if (isNumber(name)) {
- name = value;
- compareNode = null;
- }
- if (format.remove_similar || (!compareNode || isEq$2(getStyle(dom, compareNode, name), value))) {
- dom.setStyle(elm, name, '');
- }
- stylesModified = true;
- });
- if (stylesModified && dom.getAttrib(elm, 'style') === '') {
- elm.removeAttribute('style');
- elm.removeAttribute('data-mce-style');
- }
- each$9(format.attributes, function (value, name) {
- var valueOut;
- value = replaceVars(value, vars);
- if (isNumber(name)) {
- name = value;
- compareNode = null;
- }
- if (format.remove_similar || (!compareNode || isEq$2(dom.getAttrib(compareNode, name), value))) {
- if (name === 'class') {
- value = dom.getAttrib(elm, name);
- if (value) {
- valueOut = '';
- each$k(value.split(/\s+/), function (cls) {
- if (/mce\-\w+/.test(cls)) {
- valueOut += (valueOut ? ' ' : '') + cls;
- }
- });
- if (valueOut) {
- dom.setAttrib(elm, name, valueOut);
- return;
- }
- }
- }
- if (MCE_ATTR_RE.test(name)) {
- elm.removeAttribute('data-mce-' + name);
- }
- if (name === 'style' && matchNodeNames(['li'])(elm) && dom.getStyle(elm, 'list-style-type') === 'none') {
- elm.removeAttribute(name);
- dom.setStyle(elm, 'list-style-type', 'none');
- return;
- }
- if (name === 'class') {
- elm.removeAttribute('className');
- }
- elm.removeAttribute(name);
- }
- });
- each$9(format.classes, function (value) {
- value = replaceVars(value, vars);
- if (!compareNode || dom.hasClass(compareNode, value)) {
- dom.removeClass(elm, value);
- }
- });
- var attrs = dom.getAttribs(elm);
- for (var i = 0; i < attrs.length; i++) {
- var attrName = attrs[i].nodeName;
- if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) {
- return removeResult.keep();
- }
- }
- }
- if (format.remove !== 'none') {
- removeNode(ed, elm, format);
- return removeResult.removed();
- }
- return removeResult.keep();
- };
- var removeFormat$1 = function (ed, format, vars, node, compareNode) {
- return removeFormatInternal(ed, format, vars, node, compareNode).fold(never, function (newName) {
- ed.dom.rename(node, newName);
- return true;
- }, always);
- };
- var findFormatRoot = function (editor, container, name, vars, similar) {
- var formatRoot;
- each$k(getParents$2(editor.dom, container.parentNode).reverse(), function (parent) {
- if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') {
- var format = matchNode(editor, parent, name, vars, similar);
- if (format && format.split !== false) {
- formatRoot = parent;
- }
- }
- });
- return formatRoot;
- };
- var removeFormatFromClone = function (editor, format, vars, clone) {
- return removeFormatInternal(editor, format, vars, clone, clone).fold(constant(clone), function (newName) {
- var fragment = editor.dom.createFragment();
- fragment.appendChild(clone);
- return editor.dom.rename(clone, newName);
- }, constant(null));
- };
- var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) {
- var clone, lastClone, firstClone;
- var dom = editor.dom;
- if (formatRoot) {
- var formatRootParent = formatRoot.parentNode;
- for (var parent_1 = container.parentNode; parent_1 && parent_1 !== formatRootParent; parent_1 = parent_1.parentNode) {
- clone = dom.clone(parent_1, false);
- for (var i = 0; i < formatList.length; i++) {
- clone = removeFormatFromClone(editor, formatList[i], vars, clone);
- if (clone === null) {
- break;
- }
- }
- if (clone) {
- if (lastClone) {
- clone.appendChild(lastClone);
- }
- if (!firstClone) {
- firstClone = clone;
- }
- lastClone = clone;
- }
- }
- if (split && (!format.mixed || !dom.isBlock(formatRoot))) {
- container = dom.split(formatRoot, container);
- }
- if (lastClone) {
- target.parentNode.insertBefore(lastClone, target);
- firstClone.appendChild(target);
- if (isInlineFormat(format)) {
- mergeSiblings(dom, format, vars, lastClone);
- }
- }
- }
- return container;
- };
- var remove$1 = function (ed, name, vars, node, similar) {
- var formatList = ed.formatter.get(name);
- var format = formatList[0];
- var contentEditable = true;
- var dom = ed.dom;
- var selection = ed.selection;
- var splitToFormatRoot = function (container) {
- var formatRoot = findFormatRoot(ed, container, name, vars, similar);
- return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars);
- };
- var isRemoveBookmarkNode = function (node) {
- return isBookmarkNode$1(node) && isElement$5(node) && (node.id === '_start' || node.id === '_end');
- };
- var removeNodeFormat = function (node) {
- return exists(formatList, function (fmt) {
- return removeFormat$1(ed, fmt, vars, node, node);
- });
- };
- var process = function (node) {
- var lastContentEditable = true;
- var hasContentEditableState = false;
- if (isElement$5(node) && dom.getContentEditable(node)) {
- lastContentEditable = contentEditable;
- contentEditable = dom.getContentEditable(node) === 'true';
- hasContentEditableState = true;
- }
- var children = from(node.childNodes);
- if (contentEditable && !hasContentEditableState) {
- var removed = removeNodeFormat(node);
- var currentNodeMatches = removed || exists(formatList, function (f) {
- return matchName$1(dom, node, f);
- });
- var parentNode = node.parentNode;
- if (!currentNodeMatches && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
- removeNodeFormat(parentNode);
- }
- }
- if (format.deep) {
- if (children.length) {
- for (var i = 0; i < children.length; i++) {
- process(children[i]);
- }
- if (hasContentEditableState) {
- contentEditable = lastContentEditable;
- }
- }
- }
- var textDecorations = [
- 'underline',
- 'line-through',
- 'overline'
- ];
- each$k(textDecorations, function (decoration) {
- if (isElement$5(node) && ed.dom.getStyle(node, 'text-decoration') === decoration && node.parentNode && getTextDecoration(dom, node.parentNode) === decoration) {
- removeFormat$1(ed, {
- deep: false,
- exact: true,
- inline: 'span',
- styles: { textDecoration: decoration }
- }, null, node);
- }
- });
- };
- var unwrap = function (start) {
- var node = dom.get(start ? '_start' : '_end');
- var out = node[start ? 'firstChild' : 'lastChild'];
- if (isRemoveBookmarkNode(out)) {
- out = out[start ? 'firstChild' : 'lastChild'];
- }
- if (isText$7(out) && out.data.length === 0) {
- out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
- }
- dom.remove(node, true);
- return out;
- };
- var removeRngStyle = function (rng) {
- var startContainer, endContainer;
- var expandedRng = expandRng(ed, rng, formatList, rng.collapsed);
- if (format.split) {
- expandedRng = split(expandedRng);
- startContainer = getContainer(ed, expandedRng, true);
- endContainer = getContainer(ed, expandedRng);
- if (startContainer !== endContainer) {
- startContainer = normalizeTableSelection(startContainer, true);
- endContainer = normalizeTableSelection(endContainer, false);
- if (isChildOfInlineParent(dom, startContainer, endContainer)) {
- var marker = Optional.from(startContainer.firstChild).getOr(startContainer);
- splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', {
- 'id': '_start',
- 'data-mce-type': 'bookmark'
- }));
- unwrap(true);
- return;
- }
- if (isChildOfInlineParent(dom, endContainer, startContainer)) {
- var marker = Optional.from(endContainer.lastChild).getOr(endContainer);
- splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', {
- 'id': '_end',
- 'data-mce-type': 'bookmark'
- }));
- unwrap(false);
- return;
- }
- startContainer = wrap$1(dom, startContainer, 'span', {
- 'id': '_start',
- 'data-mce-type': 'bookmark'
- });
- endContainer = wrap$1(dom, endContainer, 'span', {
- 'id': '_end',
- 'data-mce-type': 'bookmark'
- });
- var newRng = dom.createRng();
- newRng.setStartAfter(startContainer);
- newRng.setEndBefore(endContainer);
- walk$2(dom, newRng, function (nodes) {
- each$k(nodes, function (n) {
- if (!isBookmarkNode$1(n) && !isBookmarkNode$1(n.parentNode)) {
- splitToFormatRoot(n);
- }
- });
- });
- splitToFormatRoot(startContainer);
- splitToFormatRoot(endContainer);
- startContainer = unwrap(true);
- endContainer = unwrap();
- } else {
- startContainer = endContainer = splitToFormatRoot(startContainer);
- }
- expandedRng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
- expandedRng.startOffset = dom.nodeIndex(startContainer);
- expandedRng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
- expandedRng.endOffset = dom.nodeIndex(endContainer) + 1;
- }
- walk$2(dom, expandedRng, function (nodes) {
- each$k(nodes, process);
- });
- };
- if (node) {
- if (isNode(node)) {
- var rng = dom.createRng();
- rng.setStartBefore(node);
- rng.setEndAfter(node);
- removeRngStyle(rng);
- } else {
- removeRngStyle(node);
- }
- fireFormatRemove(ed, name, node, vars);
- return;
- }
- if (dom.getContentEditable(selection.getNode()) === 'false') {
- node = selection.getNode();
- for (var i = 0; i < formatList.length; i++) {
- if (formatList[i].ceFalseOverride) {
- if (removeFormat$1(ed, formatList[i], vars, node, node)) {
- break;
- }
- }
- }
- fireFormatRemove(ed, name, node, vars);
- return;
- }
- if (!selection.isCollapsed() || !isInlineFormat(format) || getCellsFromEditor(ed).length) {
- preserve(selection, true, function () {
- runOnRanges(ed, removeRngStyle);
- });
- if (isInlineFormat(format) && match$2(ed, name, vars, selection.getStart())) {
- moveStart(dom, selection, selection.getRng());
- }
- ed.nodeChanged();
- } else {
- removeCaretFormat(ed, name, vars, similar);
- }
- fireFormatRemove(ed, name, node, vars);
- };
- var each$8 = Tools.each;
- var mergeTextDecorationsAndColor = function (dom, format, vars, node) {
- var processTextDecorationsAndColor = function (n) {
- if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) {
- var textDecoration = getTextDecoration(dom, n.parentNode);
- if (dom.getStyle(n, 'color') && textDecoration) {
- dom.setStyle(n, 'text-decoration', textDecoration);
- } else if (dom.getStyle(n, 'text-decoration') === textDecoration) {
- dom.setStyle(n, 'text-decoration', null);
- }
- }
- };
- if (format.styles && (format.styles.color || format.styles.textDecoration)) {
- Tools.walk(node, processTextDecorationsAndColor, 'childNodes');
- processTextDecorationsAndColor(node);
- }
- };
- var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) {
- if (format.styles && format.styles.backgroundColor) {
- processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', replaceVars(format.styles.backgroundColor, vars)));
- }
- };
- var mergeSubSup = function (dom, format, vars, node) {
- if (isInlineFormat(format) && (format.inline === 'sub' || format.inline === 'sup')) {
- processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', ''));
- dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true);
- }
- };
- var mergeWithChildren = function (editor, formatList, vars, node) {
- each$8(formatList, function (format) {
- if (isInlineFormat(format)) {
- each$8(editor.dom.select(format.inline, node), function (child) {
- if (!isElementNode$1(child)) {
- return;
- }
- removeFormat$1(editor, format, vars, child, format.exact ? child : null);
- });
- }
- clearChildStyles(editor.dom, format, node);
- });
- };
- var mergeWithParents = function (editor, format, name, vars, node) {
- if (matchNode(editor, node.parentNode, name, vars)) {
- if (removeFormat$1(editor, format, vars, node)) {
- return;
- }
- }
- if (format.merge_with_parents) {
- editor.dom.getParent(node.parentNode, function (parent) {
- if (matchNode(editor, parent, name, vars)) {
- removeFormat$1(editor, format, vars, node);
- return true;
- }
- });
- }
- };
- var each$7 = Tools.each;
- var isElementNode = function (node) {
- return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
- };
- var canFormatBR = function (editor, format, node, parentName) {
- if (canFormatEmptyLines(editor) && isInlineFormat(format)) {
- var validBRParentElements = __assign(__assign({}, editor.schema.getTextBlockElements()), {
- td: {},
- th: {},
- li: {},
- dt: {},
- dd: {},
- figcaption: {},
- caption: {},
- details: {},
- summary: {}
- });
- var hasCaretNodeSibling = sibling(SugarElement.fromDom(node), function (sibling) {
- return isCaretNode(sibling.dom);
- });
- return hasNonNullableKey(validBRParentElements, parentName) && isEmpty$2(SugarElement.fromDom(node.parentNode), false) && !hasCaretNodeSibling;
- } else {
- return false;
- }
- };
- var applyFormat$1 = function (ed, name, vars, node) {
- var formatList = ed.formatter.get(name);
- var format = formatList[0];
- var isCollapsed = !node && ed.selection.isCollapsed();
- var dom = ed.dom;
- var selection = ed.selection;
- var setElementFormat = function (elm, fmt) {
- if (fmt === void 0) {
- fmt = format;
- }
- if (isFunction(fmt.onformat)) {
- fmt.onformat(elm, fmt, vars, node);
- }
- each$7(fmt.styles, function (value, name) {
- dom.setStyle(elm, name, replaceVars(value, vars));
- });
- if (fmt.styles) {
- var styleVal = dom.getAttrib(elm, 'style');
- if (styleVal) {
- dom.setAttrib(elm, 'data-mce-style', styleVal);
- }
- }
- each$7(fmt.attributes, function (value, name) {
- dom.setAttrib(elm, name, replaceVars(value, vars));
- });
- each$7(fmt.classes, function (value) {
- value = replaceVars(value, vars);
- if (!dom.hasClass(elm, value)) {
- dom.addClass(elm, value);
- }
- });
- };
- var applyNodeStyle = function (formatList, node) {
- var found = false;
- each$7(formatList, function (format) {
- if (!isSelectorFormat(format)) {
- return false;
- }
- if (isNonNullable(format.collapsed) && format.collapsed !== isCollapsed) {
- return;
- }
- if (dom.is(node, format.selector) && !isCaretNode(node)) {
- setElementFormat(node, format);
- found = true;
- return false;
- }
- });
- return found;
- };
- var createWrapElement = function (wrapName) {
- if (isString$1(wrapName)) {
- var wrapElm = dom.create(wrapName);
- setElementFormat(wrapElm);
- return wrapElm;
- } else {
- return null;
- }
- };
- var applyRngStyle = function (dom, rng, nodeSpecific) {
- var newWrappers = [];
- var contentEditable = true;
- var wrapName = format.inline || format.block;
- var wrapElm = createWrapElement(wrapName);
- walk$2(dom, rng, function (nodes) {
- var currentWrapElm;
- var process = function (node) {
- var hasContentEditableState = false;
- var lastContentEditable = contentEditable;
- var nodeName = node.nodeName.toLowerCase();
- var parentNode = node.parentNode;
- var parentName = parentNode.nodeName.toLowerCase();
- if (isElement$5(node) && dom.getContentEditable(node)) {
- lastContentEditable = contentEditable;
- contentEditable = dom.getContentEditable(node) === 'true';
- hasContentEditableState = true;
- }
- if (isBr$5(node) && !canFormatBR(ed, format, node, parentName)) {
- currentWrapElm = null;
- if (isBlockFormat(format)) {
- dom.remove(node);
- }
- return;
- }
- if (isBlockFormat(format) && format.wrapper && matchNode(ed, node, name, vars)) {
- currentWrapElm = null;
- return;
- }
- if (contentEditable && !hasContentEditableState && isBlockFormat(format) && !format.wrapper && isTextBlock$1(ed, nodeName) && isValid(ed, parentName, wrapName)) {
- var elm = dom.rename(node, wrapName);
- setElementFormat(elm);
- newWrappers.push(elm);
- currentWrapElm = null;
- return;
- }
- if (isSelectorFormat(format)) {
- var found = applyNodeStyle(formatList, node);
- if (!found && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
- found = applyNodeStyle(formatList, parentNode);
- }
- if (!isInlineFormat(format) || found) {
- currentWrapElm = null;
- return;
- }
- }
- if (contentEditable && !hasContentEditableState && isValid(ed, wrapName, nodeName) && isValid(ed, parentName, wrapName) && !(!nodeSpecific && isText$7(node) && isZwsp(node.data)) && !isCaretNode(node) && (!isInlineFormat(format) || !dom.isBlock(node))) {
- if (!currentWrapElm) {
- currentWrapElm = dom.clone(wrapElm, false);
- node.parentNode.insertBefore(currentWrapElm, node);
- newWrappers.push(currentWrapElm);
- }
- currentWrapElm.appendChild(node);
- } else {
- currentWrapElm = null;
- each$k(from(node.childNodes), process);
- if (hasContentEditableState) {
- contentEditable = lastContentEditable;
- }
- currentWrapElm = null;
- }
- };
- each$k(nodes, process);
- });
- if (format.links === true) {
- each$k(newWrappers, function (node) {
- var process = function (node) {
- if (node.nodeName === 'A') {
- setElementFormat(node, format);
- }
- each$k(from(node.childNodes), process);
- };
- process(node);
- });
- }
- each$k(newWrappers, function (node) {
- var getChildCount = function (node) {
- var count = 0;
- each$k(node.childNodes, function (node) {
- if (!isEmptyTextNode$1(node) && !isBookmarkNode$1(node)) {
- count++;
- }
- });
- return count;
- };
- var mergeStyles = function (node) {
- var childElement = find$3(node.childNodes, isElementNode).filter(function (child) {
- return matchName$1(dom, child, format);
- });
- return childElement.map(function (child) {
- var clone = dom.clone(child, false);
- setElementFormat(clone);
- dom.replace(clone, node, true);
- dom.remove(child, true);
- return clone;
- }).getOr(node);
- };
- var childCount = getChildCount(node);
- if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) {
- dom.remove(node, true);
- return;
- }
- if (isInlineFormat(format) || isBlockFormat(format) && format.wrapper) {
- if (!format.exact && childCount === 1) {
- node = mergeStyles(node);
- }
- mergeWithChildren(ed, formatList, vars, node);
- mergeWithParents(ed, format, name, vars, node);
- mergeBackgroundColorAndFontSize(dom, format, vars, node);
- mergeTextDecorationsAndColor(dom, format, vars, node);
- mergeSubSup(dom, format, vars, node);
- mergeSiblings(dom, format, vars, node);
- }
- });
- };
- if (dom.getContentEditable(selection.getNode()) === 'false') {
- node = selection.getNode();
- for (var i = 0, l = formatList.length; i < l; i++) {
- var formatItem = formatList[i];
- if (formatItem.ceFalseOverride && isSelectorFormat(formatItem) && dom.is(node, formatItem.selector)) {
- setElementFormat(node, formatItem);
- break;
- }
- }
- fireFormatApply(ed, name, node, vars);
- return;
- }
- if (format) {
- if (node) {
- if (isNode(node)) {
- if (!applyNodeStyle(formatList, node)) {
- var rng = dom.createRng();
- rng.setStartBefore(node);
- rng.setEndAfter(node);
- applyRngStyle(dom, expandRng(ed, rng, formatList), true);
- }
- } else {
- applyRngStyle(dom, node, true);
- }
- } else {
- if (!isCollapsed || !isInlineFormat(format) || getCellsFromEditor(ed).length) {
- var curSelNode = selection.getNode();
- var firstFormat = formatList[0];
- if (!ed.settings.forced_root_block && firstFormat.defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
- applyFormat$1(ed, firstFormat.defaultBlock);
- }
- selection.setRng(normalize(selection.getRng()));
- preserve(selection, true, function () {
- runOnRanges(ed, function (selectionRng, fake) {
- var expandedRng = fake ? selectionRng : expandRng(ed, selectionRng, formatList);
- applyRngStyle(dom, expandedRng, false);
- });
- });
- moveStart(dom, selection, selection.getRng());
- ed.nodeChanged();
- } else {
- applyCaretFormat(ed, name, vars);
- }
- }
- postProcess$1(name, ed);
- }
- fireFormatApply(ed, name, node, vars);
- };
- var hasVars = function (value) {
- return has$2(value, 'vars');
- };
- var setup$j = function (registeredFormatListeners, editor) {
- registeredFormatListeners.set({});
- editor.on('NodeChange', function (e) {
- updateAndFireChangeCallbacks(editor, e.element, registeredFormatListeners.get());
- });
- editor.on('FormatApply FormatRemove', function (e) {
- var element = Optional.from(e.node).map(function (nodeOrRange) {
- return isNode(nodeOrRange) ? nodeOrRange : nodeOrRange.startContainer;
- }).bind(function (node) {
- return isElement$5(node) ? Optional.some(node) : Optional.from(node.parentElement);
- }).getOrThunk(function () {
- return fallbackElement(editor);
- });
- updateAndFireChangeCallbacks(editor, element, registeredFormatListeners.get());
- });
- };
- var fallbackElement = function (editor) {
- return editor.selection.getStart();
- };
- var matchingNode = function (editor, parents, format, similar, vars) {
- var isMatchingNode = function (node) {
- var matchingFormat = editor.formatter.matchNode(node, format, vars !== null && vars !== void 0 ? vars : {}, similar);
- return !isUndefined(matchingFormat);
- };
- var isUnableToMatch = function (node) {
- if (matchesUnInheritedFormatSelector(editor, node, format)) {
- return true;
- } else {
- if (!similar) {
- return isNonNullable(editor.formatter.matchNode(node, format, vars, true));
- } else {
- return false;
- }
- }
- };
- return findUntil$1(parents, isMatchingNode, isUnableToMatch);
- };
- var getParents = function (editor, elm) {
- var element = elm !== null && elm !== void 0 ? elm : fallbackElement(editor);
- return filter$4(getParents$2(editor.dom, element), function (node) {
- return isElement$5(node) && !isBogus$2(node);
- });
- };
- var updateAndFireChangeCallbacks = function (editor, elm, registeredCallbacks) {
- var parents = getParents(editor, elm);
- each$j(registeredCallbacks, function (data, format) {
- var runIfChanged = function (spec) {
- var match = matchingNode(editor, parents, format, spec.similar, hasVars(spec) ? spec.vars : undefined);
- var isSet = match.isSome();
- if (spec.state.get() !== isSet) {
- spec.state.set(isSet);
- var node_1 = match.getOr(elm);
- if (hasVars(spec)) {
- spec.callback(isSet, {
- node: node_1,
- format: format,
- parents: parents
- });
- } else {
- each$k(spec.callbacks, function (callback) {
- return callback(isSet, {
- node: node_1,
- format: format,
- parents: parents
- });
- });
- }
- }
- };
- each$k([
- data.withSimilar,
- data.withoutSimilar
- ], runIfChanged);
- each$k(data.withVars, runIfChanged);
- });
- };
- var addListeners = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
- var formatChangeItems = registeredFormatListeners.get();
- each$k(formats.split(','), function (format) {
- var group = get$9(formatChangeItems, format).getOrThunk(function () {
- var base = {
- withSimilar: {
- state: Cell(false),
- similar: true,
- callbacks: []
- },
- withoutSimilar: {
- state: Cell(false),
- similar: false,
- callbacks: []
- },
- withVars: []
- };
- formatChangeItems[format] = base;
- return base;
- });
- var getCurrent = function () {
- var parents = getParents(editor);
- return matchingNode(editor, parents, format, similar, vars).isSome();
- };
- if (isUndefined(vars)) {
- var toAppendTo = similar ? group.withSimilar : group.withoutSimilar;
- toAppendTo.callbacks.push(callback);
- if (toAppendTo.callbacks.length === 1) {
- toAppendTo.state.set(getCurrent());
- }
- } else {
- group.withVars.push({
- state: Cell(getCurrent()),
- similar: similar,
- vars: vars,
- callback: callback
- });
- }
- });
- registeredFormatListeners.set(formatChangeItems);
- };
- var removeListeners = function (registeredFormatListeners, formats, callback) {
- var formatChangeItems = registeredFormatListeners.get();
- each$k(formats.split(','), function (format) {
- return get$9(formatChangeItems, format).each(function (group) {
- formatChangeItems[format] = {
- withSimilar: __assign(__assign({}, group.withSimilar), {
- callbacks: filter$4(group.withSimilar.callbacks, function (cb) {
- return cb !== callback;
- })
- }),
- withoutSimilar: __assign(__assign({}, group.withoutSimilar), {
- callbacks: filter$4(group.withoutSimilar.callbacks, function (cb) {
- return cb !== callback;
- })
- }),
- withVars: filter$4(group.withVars, function (item) {
- return item.callback !== callback;
- })
- };
- });
- });
- registeredFormatListeners.set(formatChangeItems);
- };
- var formatChangedInternal = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
- if (registeredFormatListeners.get() === null) {
- setup$j(registeredFormatListeners, editor);
- }
- addListeners(editor, registeredFormatListeners, formats, callback, similar, vars);
- return {
- unbind: function () {
- return removeListeners(registeredFormatListeners, formats, callback);
- }
- };
- };
- var toggle = function (editor, name, vars, node) {
- var fmt = editor.formatter.get(name);
- if (match$2(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
- remove$1(editor, name, vars, node);
- } else {
- applyFormat$1(editor, name, vars, node);
- }
- };
- var fromElements = function (elements, scope) {
- var doc = scope || document;
- var fragment = doc.createDocumentFragment();
- each$k(elements, function (element) {
- fragment.appendChild(element.dom);
- });
- return SugarElement.fromDom(fragment);
- };
- var tableModel = function (element, width, rows) {
- return {
- element: element,
- width: width,
- rows: rows
- };
- };
- var tableRow = function (element, cells) {
- return {
- element: element,
- cells: cells
- };
- };
- var cellPosition = function (x, y) {
- return {
- x: x,
- y: y
- };
- };
- var getSpan = function (td, key) {
- var value = parseInt(get$6(td, key), 10);
- return isNaN(value) ? 1 : value;
- };
- var fillout = function (table, x, y, tr, td) {
- var rowspan = getSpan(td, 'rowspan');
- var colspan = getSpan(td, 'colspan');
- var rows = table.rows;
- for (var y2 = y; y2 < y + rowspan; y2++) {
- if (!rows[y2]) {
- rows[y2] = tableRow(deep$1(tr), []);
- }
- for (var x2 = x; x2 < x + colspan; x2++) {
- var cells = rows[y2].cells;
- cells[x2] = y2 === y && x2 === x ? td : shallow(td);
- }
- }
- };
- var cellExists = function (table, x, y) {
- var rows = table.rows;
- var cells = rows[y] ? rows[y].cells : [];
- return !!cells[x];
- };
- var skipCellsX = function (table, x, y) {
- while (cellExists(table, x, y)) {
- x++;
- }
- return x;
- };
- var getWidth = function (rows) {
- return foldl(rows, function (acc, row) {
- return row.cells.length > acc ? row.cells.length : acc;
- }, 0);
- };
- var findElementPos = function (table, element) {
- var rows = table.rows;
- for (var y = 0; y < rows.length; y++) {
- var cells = rows[y].cells;
- for (var x = 0; x < cells.length; x++) {
- if (eq(cells[x], element)) {
- return Optional.some(cellPosition(x, y));
- }
- }
- }
- return Optional.none();
- };
- var extractRows = function (table, sx, sy, ex, ey) {
- var newRows = [];
- var rows = table.rows;
- for (var y = sy; y <= ey; y++) {
- var cells = rows[y].cells;
- var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1);
- newRows.push(tableRow(rows[y].element, slice));
- }
- return newRows;
- };
- var subTable = function (table, startPos, endPos) {
- var sx = startPos.x, sy = startPos.y;
- var ex = endPos.x, ey = endPos.y;
- var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy);
- return tableModel(table.element, getWidth(newRows), newRows);
- };
- var createDomTable = function (table, rows) {
- var tableElement = shallow(table.element);
- var tableBody = SugarElement.fromTag('tbody');
- append(tableBody, rows);
- append$1(tableElement, tableBody);
- return tableElement;
- };
- var modelRowsToDomRows = function (table) {
- return map$3(table.rows, function (row) {
- var cells = map$3(row.cells, function (cell) {
- var td = deep$1(cell);
- remove$6(td, 'colspan');
- remove$6(td, 'rowspan');
- return td;
- });
- var tr = shallow(row.element);
- append(tr, cells);
- return tr;
- });
- };
- var fromDom = function (tableElm) {
- var table = tableModel(shallow(tableElm), 0, []);
- each$k(descendants(tableElm, 'tr'), function (tr, y) {
- each$k(descendants(tr, 'td,th'), function (td, x) {
- fillout(table, skipCellsX(table, x, y), y, tr, td);
- });
- });
- return tableModel(table.element, getWidth(table.rows), table.rows);
- };
- var toDom = function (table) {
- return createDomTable(table, modelRowsToDomRows(table));
- };
- var subsection = function (table, startElement, endElement) {
- return findElementPos(table, startElement).bind(function (startPos) {
- return findElementPos(table, endElement).map(function (endPos) {
- return subTable(table, startPos, endPos);
- });
- });
- };
- var findParentListContainer = function (parents) {
- return find$3(parents, function (elm) {
- return name(elm) === 'ul' || name(elm) === 'ol';
- });
- };
- var getFullySelectedListWrappers = function (parents, rng) {
- return find$3(parents, function (elm) {
- return name(elm) === 'li' && hasAllContentsSelected(elm, rng);
- }).fold(constant([]), function (_li) {
- return findParentListContainer(parents).map(function (listCont) {
- var listElm = SugarElement.fromTag(name(listCont));
- var listStyles = filter$3(getAllRaw(listCont), function (_style, name) {
- return startsWith(name, 'list-style');
- });
- setAll(listElm, listStyles);
- return [
- SugarElement.fromTag('li'),
- listElm
- ];
- }).getOr([]);
- });
- };
- var wrap = function (innerElm, elms) {
- var wrapped = foldl(elms, function (acc, elm) {
- append$1(elm, acc);
- return elm;
- }, innerElm);
- return elms.length > 0 ? fromElements([wrapped]) : wrapped;
- };
- var directListWrappers = function (commonAnchorContainer) {
- if (isListItem(commonAnchorContainer)) {
- return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) {
- return [
- commonAnchorContainer,
- listElm
- ];
- });
- } else {
- return isList(commonAnchorContainer) ? [commonAnchorContainer] : [];
- }
- };
- var getWrapElements = function (rootNode, rng) {
- var commonAnchorContainer = SugarElement.fromDom(rng.commonAncestorContainer);
- var parents = parentsAndSelf(commonAnchorContainer, rootNode);
- var wrapElements = filter$4(parents, function (elm) {
- return isInline$1(elm) || isHeading(elm);
- });
- var listWrappers = getFullySelectedListWrappers(parents, rng);
- var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer));
- return map$3(allWrappers, shallow);
- };
- var emptyFragment = function () {
- return fromElements([]);
- };
- var getFragmentFromRange = function (rootNode, rng) {
- return wrap(SugarElement.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng));
- };
- var getParentTable = function (rootElm, cell) {
- return ancestor$2(cell, 'table', curry(eq, rootElm));
- };
- var getTableFragment = function (rootNode, selectedTableCells) {
- return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) {
- var firstCell = selectedTableCells[0];
- var lastCell = selectedTableCells[selectedTableCells.length - 1];
- var fullTableModel = fromDom(tableElm);
- return subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) {
- return fromElements([toDom(sectionedTableModel)]);
- });
- }).getOrThunk(emptyFragment);
- };
- var getSelectionFragment = function (rootNode, ranges) {
- return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]);
- };
- var read$3 = function (rootNode, ranges) {
- var selectedCells = getCellsFromElementOrRanges(ranges, rootNode);
- return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges);
- };
- var trimLeadingCollapsibleText = function (text) {
- return text.replace(/^[ \f\n\r\t\v]+/, '');
- };
- var isCollapsibleWhitespace = function (text, index) {
- return index >= 0 && index < text.length && isWhiteSpace(text.charAt(index));
- };
- var getInnerText = function (bin, shouldTrim) {
- var text = trim$2(bin.innerText);
- return shouldTrim ? trimLeadingCollapsibleText(text) : text;
- };
- var getContextNodeName = function (parentBlockOpt) {
- return parentBlockOpt.map(function (block) {
- return block.nodeName;
- }).getOr('div').toLowerCase();
- };
- var getTextContent = function (editor) {
- return Optional.from(editor.selection.getRng()).map(function (rng) {
- var parentBlockOpt = Optional.from(editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock));
- var body = editor.getBody();
- var contextNodeName = getContextNodeName(parentBlockOpt);
- var shouldTrimSpaces = Env.browser.isIE() && contextNodeName !== 'pre';
- var bin = editor.dom.add(body, contextNodeName, {
- 'data-mce-bogus': 'all',
- 'style': 'overflow: hidden; opacity: 0;'
- }, rng.cloneContents());
- var text = getInnerText(bin, shouldTrimSpaces);
- var nonRenderedText = trim$2(bin.textContent);
- editor.dom.remove(bin);
- if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) {
- var parentBlock = parentBlockOpt.getOr(body);
- var parentBlockText = getInnerText(parentBlock, shouldTrimSpaces);
- var textIndex = parentBlockText.indexOf(text);
- if (textIndex === -1) {
- return text;
- } else {
- var hasProceedingSpace = isCollapsibleWhitespace(parentBlockText, textIndex - 1);
- var hasTrailingSpace = isCollapsibleWhitespace(parentBlockText, textIndex + text.length);
- return (hasProceedingSpace ? ' ' : '') + text + (hasTrailingSpace ? ' ' : '');
- }
- } else {
- return text;
- }
- }).getOr('');
- };
- var getSerializedContent = function (editor, args) {
- var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body');
- var sel = editor.selection.getSel();
- var ranges = processRanges(editor, getRanges(sel));
- var fragment = args.contextual ? read$3(SugarElement.fromDom(editor.getBody()), ranges).dom : rng.cloneContents();
- if (fragment) {
- tmpElm.appendChild(fragment);
- }
- return editor.selection.serializer.serialize(tmpElm, args);
- };
- var setupArgs$1 = function (args, format) {
- return __assign(__assign({}, args), {
- format: format,
- get: true,
- selection: true
- });
- };
- var getSelectedContentInternal = function (editor, format, args) {
- if (args === void 0) {
- args = {};
- }
- var defaultedArgs = setupArgs$1(args, format);
- var updatedArgs = editor.fire('BeforeGetContent', defaultedArgs);
- if (updatedArgs.isDefaultPrevented()) {
- editor.fire('GetContent', updatedArgs);
- return updatedArgs.content;
- }
- if (updatedArgs.format === 'text') {
- return getTextContent(editor);
- } else {
- updatedArgs.getInner = true;
- var content = getSerializedContent(editor, updatedArgs);
- if (updatedArgs.format === 'tree') {
- return content;
- } else {
- updatedArgs.content = editor.selection.isCollapsed() ? '' : content;
- editor.fire('GetContent', updatedArgs);
- return updatedArgs.content;
- }
- }
- };
- var KEEP = 0, INSERT = 1, DELETE = 2;
- var diff = function (left, right) {
- var size = left.length + right.length + 2;
- var vDown = new Array(size);
- var vUp = new Array(size);
- var snake = function (start, end, diag) {
- return {
- start: start,
- end: end,
- diag: diag
- };
- };
- var buildScript = function (start1, end1, start2, end2, script) {
- var middle = getMiddleSnake(start1, end1, start2, end2);
- if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) {
- var i = start1;
- var j = start2;
- while (i < end1 || j < end2) {
- if (i < end1 && j < end2 && left[i] === right[j]) {
- script.push([
- KEEP,
- left[i]
- ]);
- ++i;
- ++j;
- } else {
- if (end1 - start1 > end2 - start2) {
- script.push([
- DELETE,
- left[i]
- ]);
- ++i;
- } else {
- script.push([
- INSERT,
- right[j]
- ]);
- ++j;
- }
- }
- }
- } else {
- buildScript(start1, middle.start, start2, middle.start - middle.diag, script);
- for (var i2 = middle.start; i2 < middle.end; ++i2) {
- script.push([
- KEEP,
- left[i2]
- ]);
- }
- buildScript(middle.end, end1, middle.end - middle.diag, end2, script);
- }
- };
- var buildSnake = function (start, diag, end1, end2) {
- var end = start;
- while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) {
- ++end;
- }
- return snake(start, end, diag);
- };
- var getMiddleSnake = function (start1, end1, start2, end2) {
- var m = end1 - start1;
- var n = end2 - start2;
- if (m === 0 || n === 0) {
- return null;
- }
- var delta = m - n;
- var sum = n + m;
- var offset = (sum % 2 === 0 ? sum : sum + 1) / 2;
- vDown[1 + offset] = start1;
- vUp[1 + offset] = end1 + 1;
- var d, k, i, x, y;
- for (d = 0; d <= offset; ++d) {
- for (k = -d; k <= d; k += 2) {
- i = k + offset;
- if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) {
- vDown[i] = vDown[i + 1];
- } else {
- vDown[i] = vDown[i - 1] + 1;
- }
- x = vDown[i];
- y = x - start1 + start2 - k;
- while (x < end1 && y < end2 && left[x] === right[y]) {
- vDown[i] = ++x;
- ++y;
- }
- if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) {
- if (vUp[i - delta] <= vDown[i]) {
- return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2);
- }
- }
- }
- for (k = delta - d; k <= delta + d; k += 2) {
- i = k + offset - delta;
- if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) {
- vUp[i] = vUp[i + 1] - 1;
- } else {
- vUp[i] = vUp[i - 1];
- }
- x = vUp[i] - 1;
- y = x - start1 + start2 - k;
- while (x >= start1 && y >= start2 && left[x] === right[y]) {
- vUp[i] = x--;
- y--;
- }
- if (delta % 2 === 0 && -d <= k && k <= d) {
- if (vUp[i] <= vDown[i + delta]) {
- return buildSnake(vUp[i], k + start1 - start2, end1, end2);
- }
- }
- }
- }
- };
- var script = [];
- buildScript(0, left.length, 0, right.length, script);
- return script;
- };
- var getOuterHtml = function (elm) {
- if (isElement$5(elm)) {
- return elm.outerHTML;
- } else if (isText$7(elm)) {
- return Entities.encodeRaw(elm.data, false);
- } else if (isComment(elm)) {
- return '<!--' + elm.data + '-->';
- }
- return '';
- };
- var createFragment = function (html) {
- var node;
- var container = document.createElement('div');
- var frag = document.createDocumentFragment();
- if (html) {
- container.innerHTML = html;
- }
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- return frag;
- };
- var insertAt = function (elm, html, index) {
- var fragment = createFragment(html);
- if (elm.hasChildNodes() && index < elm.childNodes.length) {
- var target = elm.childNodes[index];
- target.parentNode.insertBefore(fragment, target);
- } else {
- elm.appendChild(fragment);
- }
- };
- var removeAt = function (elm, index) {
- if (elm.hasChildNodes() && index < elm.childNodes.length) {
- var target = elm.childNodes[index];
- target.parentNode.removeChild(target);
- }
- };
- var applyDiff = function (diff, elm) {
- var index = 0;
- each$k(diff, function (action) {
- if (action[0] === KEEP) {
- index++;
- } else if (action[0] === INSERT) {
- insertAt(elm, action[1], index);
- index++;
- } else if (action[0] === DELETE) {
- removeAt(elm, index);
- }
- });
- };
- var read$2 = function (elm) {
- return filter$4(map$3(from(elm.childNodes), getOuterHtml), function (item) {
- return item.length > 0;
- });
- };
- var write = function (fragments, elm) {
- var currentFragments = map$3(from(elm.childNodes), getOuterHtml);
- applyDiff(diff(currentFragments, fragments), elm);
- return elm;
- };
- var lazyTempDocument = cached(function () {
- return document.implementation.createHTMLDocument('undo');
- });
- var hasIframes = function (html) {
- return html.indexOf('</iframe>') !== -1;
- };
- var createFragmentedLevel = function (fragments) {
- return {
- type: 'fragmented',
- fragments: fragments,
- content: '',
- bookmark: null,
- beforeBookmark: null
- };
- };
- var createCompleteLevel = function (content) {
- return {
- type: 'complete',
- fragments: null,
- content: content,
- bookmark: null,
- beforeBookmark: null
- };
- };
- var createFromEditor = function (editor) {
- var fragments = read$2(editor.getBody());
- var trimmedFragments = bind(fragments, function (html) {
- var trimmed = trimInternal(editor.serializer, html);
- return trimmed.length > 0 ? [trimmed] : [];
- });
- var content = trimmedFragments.join('');
- return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
- };
- var applyToEditor = function (editor, level, before) {
- var bookmark = before ? level.beforeBookmark : level.bookmark;
- if (level.type === 'fragmented') {
- write(level.fragments, editor.getBody());
- } else {
- editor.setContent(level.content, {
- format: 'raw',
- no_selection: isNonNullable(bookmark) && isPathBookmark(bookmark) ? !bookmark.isFakeCaret : true
- });
- }
- editor.selection.moveToBookmark(bookmark);
- };
- var getLevelContent = function (level) {
- return level.type === 'fragmented' ? level.fragments.join('') : level.content;
- };
- var getCleanLevelContent = function (level) {
- var elm = SugarElement.fromTag('body', lazyTempDocument());
- set(elm, getLevelContent(level));
- each$k(descendants(elm, '*[data-mce-bogus]'), unwrap);
- return get$3(elm);
- };
- var hasEqualContent = function (level1, level2) {
- return getLevelContent(level1) === getLevelContent(level2);
- };
- var hasEqualCleanedContent = function (level1, level2) {
- return getCleanLevelContent(level1) === getCleanLevelContent(level2);
- };
- var isEq$1 = function (level1, level2) {
- if (!level1 || !level2) {
- return false;
- } else if (hasEqualContent(level1, level2)) {
- return true;
- } else {
- return hasEqualCleanedContent(level1, level2);
- }
- };
- var isUnlocked = function (locks) {
- return locks.get() === 0;
- };
- var setTyping = function (undoManager, typing, locks) {
- if (isUnlocked(locks)) {
- undoManager.typing = typing;
- }
- };
- var endTyping = function (undoManager, locks) {
- if (undoManager.typing) {
- setTyping(undoManager, false, locks);
- undoManager.add();
- }
- };
- var endTypingLevelIgnoreLocks = function (undoManager) {
- if (undoManager.typing) {
- undoManager.typing = false;
- undoManager.add();
- }
- };
- var beforeChange$1 = function (editor, locks, beforeBookmark) {
- if (isUnlocked(locks)) {
- beforeBookmark.set(getUndoBookmark(editor.selection));
- }
- };
- var addUndoLevel$1 = function (editor, undoManager, index, locks, beforeBookmark, level, event) {
- var currentLevel = createFromEditor(editor);
- level = level || {};
- level = Tools.extend(level, currentLevel);
- if (isUnlocked(locks) === false || editor.removed) {
- return null;
- }
- var lastLevel = undoManager.data[index.get()];
- if (editor.fire('BeforeAddUndo', {
- level: level,
- lastLevel: lastLevel,
- originalEvent: event
- }).isDefaultPrevented()) {
- return null;
- }
- if (lastLevel && isEq$1(lastLevel, level)) {
- return null;
- }
- if (undoManager.data[index.get()]) {
- beforeBookmark.get().each(function (bm) {
- undoManager.data[index.get()].beforeBookmark = bm;
- });
- }
- var customUndoRedoLevels = getCustomUndoRedoLevels(editor);
- if (customUndoRedoLevels) {
- if (undoManager.data.length > customUndoRedoLevels) {
- for (var i = 0; i < undoManager.data.length - 1; i++) {
- undoManager.data[i] = undoManager.data[i + 1];
- }
- undoManager.data.length--;
- index.set(undoManager.data.length);
- }
- }
- level.bookmark = getUndoBookmark(editor.selection);
- if (index.get() < undoManager.data.length - 1) {
- undoManager.data.length = index.get() + 1;
- }
- undoManager.data.push(level);
- index.set(undoManager.data.length - 1);
- var args = {
- level: level,
- lastLevel: lastLevel,
- originalEvent: event
- };
- if (index.get() > 0) {
- editor.setDirty(true);
- editor.fire('AddUndo', args);
- editor.fire('change', args);
- } else {
- editor.fire('AddUndo', args);
- }
- return level;
- };
- var clear$1 = function (editor, undoManager, index) {
- undoManager.data = [];
- index.set(0);
- undoManager.typing = false;
- editor.fire('ClearUndos');
- };
- var extra$1 = function (editor, undoManager, index, callback1, callback2) {
- if (undoManager.transact(callback1)) {
- var bookmark = undoManager.data[index.get()].bookmark;
- var lastLevel = undoManager.data[index.get() - 1];
- applyToEditor(editor, lastLevel, true);
- if (undoManager.transact(callback2)) {
- undoManager.data[index.get() - 1].beforeBookmark = bookmark;
- }
- }
- };
- var redo$1 = function (editor, index, data) {
- var level;
- if (index.get() < data.length - 1) {
- index.set(index.get() + 1);
- level = data[index.get()];
- applyToEditor(editor, level, false);
- editor.setDirty(true);
- editor.fire('Redo', { level: level });
- }
- return level;
- };
- var undo$1 = function (editor, undoManager, locks, index) {
- var level;
- if (undoManager.typing) {
- undoManager.add();
- undoManager.typing = false;
- setTyping(undoManager, false, locks);
- }
- if (index.get() > 0) {
- index.set(index.get() - 1);
- level = undoManager.data[index.get()];
- applyToEditor(editor, level, true);
- editor.setDirty(true);
- editor.fire('Undo', { level: level });
- }
- return level;
- };
- var reset$1 = function (undoManager) {
- undoManager.clear();
- undoManager.add();
- };
- var hasUndo$1 = function (editor, undoManager, index) {
- return index.get() > 0 || undoManager.typing && undoManager.data[0] && !isEq$1(createFromEditor(editor), undoManager.data[0]);
- };
- var hasRedo$1 = function (undoManager, index) {
- return index.get() < undoManager.data.length - 1 && !undoManager.typing;
- };
- var transact$1 = function (undoManager, locks, callback) {
- endTyping(undoManager, locks);
- undoManager.beforeChange();
- undoManager.ignore(callback);
- return undoManager.add();
- };
- var ignore$1 = function (locks, callback) {
- try {
- locks.set(locks.get() + 1);
- callback();
- } finally {
- locks.set(locks.get() - 1);
- }
- };
- var addVisualInternal = function (editor, elm) {
- var dom = editor.dom;
- var scope = isNonNullable(elm) ? elm : editor.getBody();
- if (isUndefined(editor.hasVisual)) {
- editor.hasVisual = isVisualAidsEnabled(editor);
- }
- each$k(dom.select('table,a', scope), function (matchedElm) {
- switch (matchedElm.nodeName) {
- case 'TABLE':
- var cls = getVisualAidsTableClass(editor);
- var value = dom.getAttrib(matchedElm, 'border');
- if ((!value || value === '0') && editor.hasVisual) {
- dom.addClass(matchedElm, cls);
- } else {
- dom.removeClass(matchedElm, cls);
- }
- break;
- case 'A':
- if (!dom.getAttrib(matchedElm, 'href')) {
- var value_1 = dom.getAttrib(matchedElm, 'name') || matchedElm.id;
- var cls_1 = getVisualAidsAnchorClass(editor);
- if (value_1 && editor.hasVisual) {
- dom.addClass(matchedElm, cls_1);
- } else {
- dom.removeClass(matchedElm, cls_1);
- }
- }
- break;
- }
- });
- editor.fire('VisualAid', {
- element: elm,
- hasVisual: editor.hasVisual
- });
- };
- var makePlainAdaptor = function (editor) {
- return {
- undoManager: {
- beforeChange: function (locks, beforeBookmark) {
- return beforeChange$1(editor, locks, beforeBookmark);
- },
- add: function (undoManager, index, locks, beforeBookmark, level, event) {
- return addUndoLevel$1(editor, undoManager, index, locks, beforeBookmark, level, event);
- },
- undo: function (undoManager, locks, index) {
- return undo$1(editor, undoManager, locks, index);
- },
- redo: function (index, data) {
- return redo$1(editor, index, data);
- },
- clear: function (undoManager, index) {
- return clear$1(editor, undoManager, index);
- },
- reset: function (undoManager) {
- return reset$1(undoManager);
- },
- hasUndo: function (undoManager, index) {
- return hasUndo$1(editor, undoManager, index);
- },
- hasRedo: function (undoManager, index) {
- return hasRedo$1(undoManager, index);
- },
- transact: function (undoManager, locks, callback) {
- return transact$1(undoManager, locks, callback);
- },
- ignore: function (locks, callback) {
- return ignore$1(locks, callback);
- },
- extra: function (undoManager, index, callback1, callback2) {
- return extra$1(editor, undoManager, index, callback1, callback2);
- }
- },
- formatter: {
- match: function (name, vars, node, similar) {
- return match$2(editor, name, vars, node, similar);
- },
- matchAll: function (names, vars) {
- return matchAll(editor, names, vars);
- },
- matchNode: function (node, name, vars, similar) {
- return matchNode(editor, node, name, vars, similar);
- },
- canApply: function (name) {
- return canApply(editor, name);
- },
- closest: function (names) {
- return closest(editor, names);
- },
- apply: function (name, vars, node) {
- return applyFormat$1(editor, name, vars, node);
- },
- remove: function (name, vars, node, similar) {
- return remove$1(editor, name, vars, node, similar);
- },
- toggle: function (name, vars, node) {
- return toggle(editor, name, vars, node);
- },
- formatChanged: function (registeredFormatListeners, formats, callback, similar, vars) {
- return formatChangedInternal(editor, registeredFormatListeners, formats, callback, similar, vars);
- }
- },
- editor: {
- getContent: function (args, format) {
- return getContentInternal(editor, args, format);
- },
- setContent: function (content, args) {
- return setContentInternal(editor, content, args);
- },
- insertContent: function (value, details) {
- return insertHtmlAtCaret(editor, value, details);
- },
- addVisual: function (elm) {
- return addVisualInternal(editor, elm);
- }
- },
- selection: {
- getContent: function (format, args) {
- return getSelectedContentInternal(editor, format, args);
- }
- },
- raw: {
- getModel: function () {
- return Optional.none();
- }
- }
- };
- };
- var makeRtcAdaptor = function (rtcEditor) {
- var defaultVars = function (vars) {
- return isObject(vars) ? vars : {};
- };
- var undoManager = rtcEditor.undoManager, formatter = rtcEditor.formatter, editor = rtcEditor.editor, selection = rtcEditor.selection, raw = rtcEditor.raw;
- return {
- undoManager: {
- beforeChange: undoManager.beforeChange,
- add: undoManager.add,
- undo: undoManager.undo,
- redo: undoManager.redo,
- clear: undoManager.clear,
- reset: undoManager.reset,
- hasUndo: undoManager.hasUndo,
- hasRedo: undoManager.hasRedo,
- transact: function (_undoManager, _locks, fn) {
- return undoManager.transact(fn);
- },
- ignore: function (_locks, callback) {
- return undoManager.ignore(callback);
- },
- extra: function (_undoManager, _index, callback1, callback2) {
- return undoManager.extra(callback1, callback2);
- }
- },
- formatter: {
- match: function (name, vars, _node, similar) {
- return formatter.match(name, defaultVars(vars), similar);
- },
- matchAll: formatter.matchAll,
- matchNode: formatter.matchNode,
- canApply: function (name) {
- return formatter.canApply(name);
- },
- closest: function (names) {
- return formatter.closest(names);
- },
- apply: function (name, vars, _node) {
- return formatter.apply(name, defaultVars(vars));
- },
- remove: function (name, vars, _node, _similar) {
- return formatter.remove(name, defaultVars(vars));
- },
- toggle: function (name, vars, _node) {
- return formatter.toggle(name, defaultVars(vars));
- },
- formatChanged: function (_rfl, formats, callback, similar, vars) {
- return formatter.formatChanged(formats, callback, similar, vars);
- }
- },
- editor: {
- getContent: function (args, _format) {
- return editor.getContent(args);
- },
- setContent: function (content, args) {
- return editor.setContent(content, args);
- },
- insertContent: function (content, _details) {
- return editor.insertContent(content);
- },
- addVisual: editor.addVisual
- },
- selection: {
- getContent: function (_format, args) {
- return selection.getContent(args);
- }
- },
- raw: {
- getModel: function () {
- return Optional.some(raw.getRawModel());
- }
- }
- };
- };
- var makeNoopAdaptor = function () {
- var nul = constant(null);
- var empty = constant('');
- return {
- undoManager: {
- beforeChange: noop,
- add: nul,
- undo: nul,
- redo: nul,
- clear: noop,
- reset: noop,
- hasUndo: never,
- hasRedo: never,
- transact: nul,
- ignore: noop,
- extra: noop
- },
- formatter: {
- match: never,
- matchAll: constant([]),
- matchNode: constant(undefined),
- canApply: never,
- closest: empty,
- apply: noop,
- remove: noop,
- toggle: noop,
- formatChanged: constant({ unbind: noop })
- },
- editor: {
- getContent: empty,
- setContent: empty,
- insertContent: noop,
- addVisual: noop
- },
- selection: { getContent: empty },
- raw: { getModel: constant(Optional.none()) }
- };
- };
- var isRtc = function (editor) {
- return has$2(editor.plugins, 'rtc');
- };
- var getRtcSetup = function (editor) {
- return get$9(editor.plugins, 'rtc').bind(function (rtcPlugin) {
- return Optional.from(rtcPlugin.setup);
- });
- };
- var setup$i = function (editor) {
- var editorCast = editor;
- return getRtcSetup(editor).fold(function () {
- editorCast.rtcInstance = makePlainAdaptor(editor);
- return Optional.none();
- }, function (setup) {
- editorCast.rtcInstance = makeNoopAdaptor();
- return Optional.some(function () {
- return setup().then(function (rtcEditor) {
- editorCast.rtcInstance = makeRtcAdaptor(rtcEditor);
- return rtcEditor.rtc.isRemote;
- });
- });
- });
- };
- var getRtcInstanceWithFallback = function (editor) {
- return editor.rtcInstance ? editor.rtcInstance : makePlainAdaptor(editor);
- };
- var getRtcInstanceWithError = function (editor) {
- var rtcInstance = editor.rtcInstance;
- if (!rtcInstance) {
- throw new Error('Failed to get RTC instance not yet initialized.');
- } else {
- return rtcInstance;
- }
- };
- var beforeChange = function (editor, locks, beforeBookmark) {
- getRtcInstanceWithError(editor).undoManager.beforeChange(locks, beforeBookmark);
- };
- var addUndoLevel = function (editor, undoManager, index, locks, beforeBookmark, level, event) {
- return getRtcInstanceWithError(editor).undoManager.add(undoManager, index, locks, beforeBookmark, level, event);
- };
- var undo = function (editor, undoManager, locks, index) {
- return getRtcInstanceWithError(editor).undoManager.undo(undoManager, locks, index);
- };
- var redo = function (editor, index, data) {
- return getRtcInstanceWithError(editor).undoManager.redo(index, data);
- };
- var clear = function (editor, undoManager, index) {
- getRtcInstanceWithError(editor).undoManager.clear(undoManager, index);
- };
- var reset = function (editor, undoManager) {
- getRtcInstanceWithError(editor).undoManager.reset(undoManager);
- };
- var hasUndo = function (editor, undoManager, index) {
- return getRtcInstanceWithError(editor).undoManager.hasUndo(undoManager, index);
- };
- var hasRedo = function (editor, undoManager, index) {
- return getRtcInstanceWithError(editor).undoManager.hasRedo(undoManager, index);
- };
- var transact = function (editor, undoManager, locks, callback) {
- return getRtcInstanceWithError(editor).undoManager.transact(undoManager, locks, callback);
- };
- var ignore = function (editor, locks, callback) {
- getRtcInstanceWithError(editor).undoManager.ignore(locks, callback);
- };
- var extra = function (editor, undoManager, index, callback1, callback2) {
- getRtcInstanceWithError(editor).undoManager.extra(undoManager, index, callback1, callback2);
- };
- var matchFormat = function (editor, name, vars, node, similar) {
- return getRtcInstanceWithError(editor).formatter.match(name, vars, node, similar);
- };
- var matchAllFormats = function (editor, names, vars) {
- return getRtcInstanceWithError(editor).formatter.matchAll(names, vars);
- };
- var matchNodeFormat = function (editor, node, name, vars, similar) {
- return getRtcInstanceWithError(editor).formatter.matchNode(node, name, vars, similar);
- };
- var canApplyFormat = function (editor, name) {
- return getRtcInstanceWithError(editor).formatter.canApply(name);
- };
- var closestFormat = function (editor, names) {
- return getRtcInstanceWithError(editor).formatter.closest(names);
- };
- var applyFormat = function (editor, name, vars, node) {
- getRtcInstanceWithError(editor).formatter.apply(name, vars, node);
- };
- var removeFormat = function (editor, name, vars, node, similar) {
- getRtcInstanceWithError(editor).formatter.remove(name, vars, node, similar);
- };
- var toggleFormat = function (editor, name, vars, node) {
- getRtcInstanceWithError(editor).formatter.toggle(name, vars, node);
- };
- var formatChanged = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
- return getRtcInstanceWithError(editor).formatter.formatChanged(registeredFormatListeners, formats, callback, similar, vars);
- };
- var getContent$2 = function (editor, args, format) {
- return getRtcInstanceWithFallback(editor).editor.getContent(args, format);
- };
- var setContent$2 = function (editor, content, args) {
- return getRtcInstanceWithFallback(editor).editor.setContent(content, args);
- };
- var insertContent = function (editor, value, details) {
- return getRtcInstanceWithFallback(editor).editor.insertContent(value, details);
- };
- var getSelectedContent = function (editor, format, args) {
- return getRtcInstanceWithError(editor).selection.getContent(format, args);
- };
- var addVisual$1 = function (editor, elm) {
- return getRtcInstanceWithError(editor).editor.addVisual(elm);
- };
- var getContent$1 = function (editor, args) {
- if (args === void 0) {
- args = {};
- }
- var format = args.format ? args.format : 'html';
- return getSelectedContent(editor, format, args);
- };
- var removeEmpty = function (text) {
- if (text.dom.length === 0) {
- remove$7(text);
- return Optional.none();
- } else {
- return Optional.some(text);
- }
- };
- var walkPastBookmark = function (node, start) {
- return node.filter(function (elm) {
- return BookmarkManager.isBookmarkNode(elm.dom);
- }).bind(start ? nextSibling : prevSibling);
- };
- var merge = function (outer, inner, rng, start) {
- var outerElm = outer.dom;
- var innerElm = inner.dom;
- var oldLength = start ? outerElm.length : innerElm.length;
- if (start) {
- mergeTextNodes(outerElm, innerElm, false, !start);
- rng.setStart(innerElm, oldLength);
- } else {
- mergeTextNodes(innerElm, outerElm, false, !start);
- rng.setEnd(innerElm, oldLength);
- }
- };
- var normalizeTextIfRequired = function (inner, start) {
- parent(inner).each(function (root) {
- var text = inner.dom;
- if (start && needsToBeNbspLeft(root, CaretPosition(text, 0))) {
- normalizeWhitespaceAfter(text, 0);
- } else if (!start && needsToBeNbspRight(root, CaretPosition(text, text.length))) {
- normalizeWhitespaceBefore(text, text.length);
- }
- });
- };
- var mergeAndNormalizeText = function (outerNode, innerNode, rng, start) {
- outerNode.bind(function (outer) {
- var normalizer = start ? normalizeWhitespaceBefore : normalizeWhitespaceAfter;
- normalizer(outer.dom, start ? outer.dom.length : 0);
- return innerNode.filter(isText$8).map(function (inner) {
- return merge(outer, inner, rng, start);
- });
- }).orThunk(function () {
- var innerTextNode = walkPastBookmark(innerNode, start).or(innerNode).filter(isText$8);
- return innerTextNode.map(function (inner) {
- return normalizeTextIfRequired(inner, start);
- });
- });
- };
- var rngSetContent = function (rng, fragment) {
- var firstChild = Optional.from(fragment.firstChild).map(SugarElement.fromDom);
- var lastChild = Optional.from(fragment.lastChild).map(SugarElement.fromDom);
- rng.deleteContents();
- rng.insertNode(fragment);
- var prevText = firstChild.bind(prevSibling).filter(isText$8).bind(removeEmpty);
- var nextText = lastChild.bind(nextSibling).filter(isText$8).bind(removeEmpty);
- mergeAndNormalizeText(prevText, firstChild, rng, true);
- mergeAndNormalizeText(nextText, lastChild, rng, false);
- rng.collapse(false);
- };
- var setupArgs = function (args, content) {
- return __assign(__assign({ format: 'html' }, args), {
- set: true,
- selection: true,
- content: content
- });
- };
- var cleanContent = function (editor, args) {
- if (args.format !== 'raw') {
- var rng = editor.selection.getRng();
- var contextBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock);
- var contextArgs = contextBlock ? { context: contextBlock.nodeName.toLowerCase() } : {};
- var node = editor.parser.parse(args.content, __assign(__assign({
- isRootContent: true,
- forced_root_block: false
- }, contextArgs), args));
- return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node);
- } else {
- return args.content;
- }
- };
- var setContent$1 = function (editor, content, args) {
- if (args === void 0) {
- args = {};
- }
- var defaultedArgs = setupArgs(args, content);
- var updatedArgs = defaultedArgs;
- if (!defaultedArgs.no_events) {
- var eventArgs = editor.fire('BeforeSetContent', defaultedArgs);
- if (eventArgs.isDefaultPrevented()) {
- editor.fire('SetContent', eventArgs);
- return;
- } else {
- updatedArgs = eventArgs;
- }
- }
- updatedArgs.content = cleanContent(editor, updatedArgs);
- var rng = editor.selection.getRng();
- rngSetContent(rng, rng.createContextualFragment(updatedArgs.content));
- editor.selection.setRng(rng);
- scrollRangeIntoView(editor, rng);
- if (!updatedArgs.no_events) {
- editor.fire('SetContent', updatedArgs);
- }
- };
- var deleteFromCallbackMap = function (callbackMap, selector, callback) {
- if (callbackMap && has$2(callbackMap, selector)) {
- var newCallbacks = filter$4(callbackMap[selector], function (cb) {
- return cb !== callback;
- });
- if (newCallbacks.length === 0) {
- delete callbackMap[selector];
- } else {
- callbackMap[selector] = newCallbacks;
- }
- }
- };
- function SelectorChanged (dom, editor) {
- var selectorChangedData;
- var currentSelectors;
- var findMatchingNode = function (selector, nodes) {
- return find$3(nodes, function (node) {
- return dom.is(node, selector);
- });
- };
- var getParents = function (elem) {
- return dom.getParents(elem, null, dom.getRoot());
- };
- return {
- selectorChangedWithUnbind: function (selector, callback) {
- if (!selectorChangedData) {
- selectorChangedData = {};
- currentSelectors = {};
- editor.on('NodeChange', function (e) {
- var node = e.element;
- var parents = getParents(node);
- var matchedSelectors = {};
- Tools.each(selectorChangedData, function (callbacks, selector) {
- findMatchingNode(selector, parents).each(function (node) {
- if (!currentSelectors[selector]) {
- each$k(callbacks, function (callback) {
- callback(true, {
- node: node,
- selector: selector,
- parents: parents
- });
- });
- currentSelectors[selector] = callbacks;
- }
- matchedSelectors[selector] = callbacks;
- });
- });
- Tools.each(currentSelectors, function (callbacks, selector) {
- if (!matchedSelectors[selector]) {
- delete currentSelectors[selector];
- Tools.each(callbacks, function (callback) {
- callback(false, {
- node: node,
- selector: selector,
- parents: parents
- });
- });
- }
- });
- });
- }
- if (!selectorChangedData[selector]) {
- selectorChangedData[selector] = [];
- }
- selectorChangedData[selector].push(callback);
- findMatchingNode(selector, getParents(editor.selection.getStart())).each(function () {
- currentSelectors[selector] = selectorChangedData[selector];
- });
- return {
- unbind: function () {
- deleteFromCallbackMap(selectorChangedData, selector, callback);
- deleteFromCallbackMap(currentSelectors, selector, callback);
- }
- };
- }
- };
- }
- var isNativeIeSelection = function (rng) {
- return !!rng.select;
- };
- var isAttachedToDom = function (node) {
- return !!(node && node.ownerDocument) && contains$1(SugarElement.fromDom(node.ownerDocument), SugarElement.fromDom(node));
- };
- var isValidRange = function (rng) {
- if (!rng) {
- return false;
- } else if (isNativeIeSelection(rng)) {
- return true;
- } else {
- return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer);
- }
- };
- var EditorSelection = function (dom, win, serializer, editor) {
- var selectedRange;
- var explicitRange;
- var selectorChangedWithUnbind = SelectorChanged(dom, editor).selectorChangedWithUnbind;
- var setCursorLocation = function (node, offset) {
- var rng = dom.createRng();
- if (isNonNullable(node) && isNonNullable(offset)) {
- rng.setStart(node, offset);
- rng.setEnd(node, offset);
- setRng(rng);
- collapse(false);
- } else {
- moveEndPoint(dom, rng, editor.getBody(), true);
- setRng(rng);
- }
- };
- var getContent = function (args) {
- return getContent$1(editor, args);
- };
- var setContent = function (content, args) {
- return setContent$1(editor, content, args);
- };
- var getStart$1 = function (real) {
- return getStart(editor.getBody(), getRng$1(), real);
- };
- var getEnd$1 = function (real) {
- return getEnd(editor.getBody(), getRng$1(), real);
- };
- var getBookmark = function (type, normalized) {
- return bookmarkManager.getBookmark(type, normalized);
- };
- var moveToBookmark = function (bookmark) {
- return bookmarkManager.moveToBookmark(bookmark);
- };
- var select$1 = function (node, content) {
- select(dom, node, content).each(setRng);
- return node;
- };
- var isCollapsed = function () {
- var rng = getRng$1(), sel = getSel();
- if (!rng || rng.item) {
- return false;
- }
- if (rng.compareEndPoints) {
- return rng.compareEndPoints('StartToEnd', rng) === 0;
- }
- return !sel || rng.collapsed;
- };
- var collapse = function (toStart) {
- var rng = getRng$1();
- rng.collapse(!!toStart);
- setRng(rng);
- };
- var getSel = function () {
- return win.getSelection ? win.getSelection() : win.document.selection;
- };
- var getRng$1 = function () {
- var selection, rng, elm;
- var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) {
- try {
- return sourceRange.compareBoundaryPoints(how, destinationRange);
- } catch (ex) {
- return -1;
- }
- };
- var doc = win.document;
- if (editor.bookmark !== undefined && hasFocus(editor) === false) {
- var bookmark = getRng(editor);
- if (bookmark.isSome()) {
- return bookmark.map(function (r) {
- return processRanges(editor, [r])[0];
- }).getOr(doc.createRange());
- }
- }
- try {
- if ((selection = getSel()) && !isRestrictedNode(selection.anchorNode)) {
- if (selection.rangeCount > 0) {
- rng = selection.getRangeAt(0);
- } else {
- rng = selection.createRange ? selection.createRange() : doc.createRange();
- }
- rng = processRanges(editor, [rng])[0];
- }
- } catch (ex) {
- }
- if (!rng) {
- rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
- }
- if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
- elm = dom.getRoot();
- rng.setStart(elm, 0);
- rng.setEnd(elm, 0);
- }
- if (selectedRange && explicitRange) {
- if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) {
- rng = explicitRange;
- } else {
- selectedRange = null;
- explicitRange = null;
- }
- }
- return rng;
- };
- var setRng = function (rng, forward) {
- var node;
- if (!isValidRange(rng)) {
- return;
- }
- var ieRange = isNativeIeSelection(rng) ? rng : null;
- if (ieRange) {
- explicitRange = null;
- try {
- ieRange.select();
- } catch (ex) {
- }
- return;
- }
- var sel = getSel();
- var evt = editor.fire('SetSelectionRange', {
- range: rng,
- forward: forward
- });
- rng = evt.range;
- if (sel) {
- explicitRange = rng;
- try {
- sel.removeAllRanges();
- sel.addRange(rng);
- } catch (ex) {
- }
- if (forward === false && sel.extend) {
- sel.collapse(rng.endContainer, rng.endOffset);
- sel.extend(rng.startContainer, rng.startOffset);
- }
- selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
- }
- if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) {
- if (rng.endOffset - rng.startOffset < 2) {
- if (rng.startContainer.hasChildNodes()) {
- node = rng.startContainer.childNodes[rng.startOffset];
- if (node && node.tagName === 'IMG') {
- sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset);
- if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) {
- sel.setBaseAndExtent(node, 0, node, 1);
- }
- }
- }
- }
- }
- editor.fire('AfterSetSelectionRange', {
- range: rng,
- forward: forward
- });
- };
- var setNode = function (elm) {
- setContent(dom.getOuterHTML(elm));
- return elm;
- };
- var getNode$1 = function () {
- return getNode(editor.getBody(), getRng$1());
- };
- var getSelectedBlocks$1 = function (startElm, endElm) {
- return getSelectedBlocks(dom, getRng$1(), startElm, endElm);
- };
- var isForward = function () {
- var sel = getSel();
- var anchorNode = sel === null || sel === void 0 ? void 0 : sel.anchorNode;
- var focusNode = sel === null || sel === void 0 ? void 0 : sel.focusNode;
- if (!sel || !anchorNode || !focusNode || isRestrictedNode(anchorNode) || isRestrictedNode(focusNode)) {
- return true;
- }
- var anchorRange = dom.createRng();
- anchorRange.setStart(anchorNode, sel.anchorOffset);
- anchorRange.collapse(true);
- var focusRange = dom.createRng();
- focusRange.setStart(focusNode, sel.focusOffset);
- focusRange.collapse(true);
- return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
- };
- var normalize = function () {
- var rng = getRng$1();
- var sel = getSel();
- if (!hasMultipleRanges(sel) && hasAnyRanges(editor)) {
- var normRng = normalize$2(dom, rng);
- normRng.each(function (normRng) {
- setRng(normRng, isForward());
- });
- return normRng.getOr(rng);
- }
- return rng;
- };
- var selectorChanged = function (selector, callback) {
- selectorChangedWithUnbind(selector, callback);
- return exports;
- };
- var getScrollContainer = function () {
- var scrollContainer;
- var node = dom.getRoot();
- while (node && node.nodeName !== 'BODY') {
- if (node.scrollHeight > node.clientHeight) {
- scrollContainer = node;
- break;
- }
- node = node.parentNode;
- }
- return scrollContainer;
- };
- var scrollIntoView = function (elm, alignToTop) {
- if (isNonNullable(elm)) {
- scrollElementIntoView(editor, elm, alignToTop);
- } else {
- scrollRangeIntoView(editor, getRng$1(), alignToTop);
- }
- };
- var placeCaretAt = function (clientX, clientY) {
- return setRng(fromPoint(clientX, clientY, editor.getDoc()));
- };
- var getBoundingClientRect = function () {
- var rng = getRng$1();
- return rng.collapsed ? CaretPosition.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect();
- };
- var destroy = function () {
- win = selectedRange = explicitRange = null;
- controlSelection.destroy();
- };
- var exports = {
- bookmarkManager: null,
- controlSelection: null,
- dom: dom,
- win: win,
- serializer: serializer,
- editor: editor,
- collapse: collapse,
- setCursorLocation: setCursorLocation,
- getContent: getContent,
- setContent: setContent,
- getBookmark: getBookmark,
- moveToBookmark: moveToBookmark,
- select: select$1,
- isCollapsed: isCollapsed,
- isForward: isForward,
- setNode: setNode,
- getNode: getNode$1,
- getSel: getSel,
- setRng: setRng,
- getRng: getRng$1,
- getStart: getStart$1,
- getEnd: getEnd$1,
- getSelectedBlocks: getSelectedBlocks$1,
- normalize: normalize,
- selectorChanged: selectorChanged,
- selectorChangedWithUnbind: selectorChangedWithUnbind,
- getScrollContainer: getScrollContainer,
- scrollIntoView: scrollIntoView,
- placeCaretAt: placeCaretAt,
- getBoundingClientRect: getBoundingClientRect,
- destroy: destroy
- };
- var bookmarkManager = BookmarkManager(exports);
- var controlSelection = ControlSelection(exports, editor);
- exports.bookmarkManager = bookmarkManager;
- exports.controlSelection = controlSelection;
- return exports;
- };
- var removeAttrs = function (node, names) {
- each$k(names, function (name) {
- node.attr(name, null);
- });
- };
- var addFontToSpansFilter = function (domParser, styles, fontSizes) {
- domParser.addNodeFilter('font', function (nodes) {
- each$k(nodes, function (node) {
- var props = styles.parse(node.attr('style'));
- var color = node.attr('color');
- var face = node.attr('face');
- var size = node.attr('size');
- if (color) {
- props.color = color;
- }
- if (face) {
- props['font-family'] = face;
- }
- if (size) {
- props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1];
- }
- node.name = 'span';
- node.attr('style', styles.serialize(props));
- removeAttrs(node, [
- 'color',
- 'face',
- 'size'
- ]);
- });
- });
- };
- var addStrikeToSpanFilter = function (domParser, styles) {
- domParser.addNodeFilter('strike', function (nodes) {
- each$k(nodes, function (node) {
- var props = styles.parse(node.attr('style'));
- props['text-decoration'] = 'line-through';
- node.name = 'span';
- node.attr('style', styles.serialize(props));
- });
- });
- };
- var addFilters = function (domParser, settings) {
- var styles = Styles();
- if (settings.convert_fonts_to_spans) {
- addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values));
- }
- addStrikeToSpanFilter(domParser, styles);
- };
- var register$2 = function (domParser, settings) {
- if (settings.inline_styles) {
- addFilters(domParser, settings);
- }
- };
- var blobUriToBlob = function (url) {
- return new promiseObj(function (resolve, reject) {
- var rejectWithError = function () {
- reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.');
- };
- try {
- var xhr_1 = new XMLHttpRequest();
- xhr_1.open('GET', url, true);
- xhr_1.responseType = 'blob';
- xhr_1.onload = function () {
- if (xhr_1.status === 200) {
- resolve(xhr_1.response);
- } else {
- rejectWithError();
- }
- };
- xhr_1.onerror = rejectWithError;
- xhr_1.send();
- } catch (ex) {
- rejectWithError();
- }
- });
- };
- var parseDataUri = function (uri) {
- var type;
- var uriParts = decodeURIComponent(uri).split(',');
- var matches = /data:([^;]+)/.exec(uriParts[0]);
- if (matches) {
- type = matches[1];
- }
- return {
- type: type,
- data: uriParts[1]
- };
- };
- var buildBlob = function (type, data) {
- var str;
- try {
- str = atob(data);
- } catch (e) {
- return Optional.none();
- }
- var arr = new Uint8Array(str.length);
- for (var i = 0; i < arr.length; i++) {
- arr[i] = str.charCodeAt(i);
- }
- return Optional.some(new Blob([arr], { type: type }));
- };
- var dataUriToBlob = function (uri) {
- return new promiseObj(function (resolve) {
- var _a = parseDataUri(uri), type = _a.type, data = _a.data;
- buildBlob(type, data).fold(function () {
- return resolve(new Blob([]));
- }, resolve);
- });
- };
- var uriToBlob = function (url) {
- if (url.indexOf('blob:') === 0) {
- return blobUriToBlob(url);
- }
- if (url.indexOf('data:') === 0) {
- return dataUriToBlob(url);
- }
- return null;
- };
- var blobToDataUri = function (blob) {
- return new promiseObj(function (resolve) {
- var reader = new FileReader();
- reader.onloadend = function () {
- resolve(reader.result);
- };
- reader.readAsDataURL(blob);
- });
- };
- var count$1 = 0;
- var uniqueId = function (prefix) {
- return (prefix || 'blobid') + count$1++;
- };
- var imageToBlobInfo = function (blobCache, img, resolve, reject) {
- var base64, blobInfo;
- if (img.src.indexOf('blob:') === 0) {
- blobInfo = blobCache.getByUri(img.src);
- if (blobInfo) {
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- } else {
- uriToBlob(img.src).then(function (blob) {
- blobToDataUri(blob).then(function (dataUri) {
- base64 = parseDataUri(dataUri).data;
- blobInfo = blobCache.create(uniqueId(), blob, base64);
- blobCache.add(blobInfo);
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- });
- }, function (err) {
- reject(err);
- });
- }
- return;
- }
- var _a = parseDataUri(img.src), data = _a.data, type = _a.type;
- base64 = data;
- blobInfo = blobCache.getByData(base64, type);
- if (blobInfo) {
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- } else {
- uriToBlob(img.src).then(function (blob) {
- blobInfo = blobCache.create(uniqueId(), blob, base64);
- blobCache.add(blobInfo);
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- }, function (err) {
- reject(err);
- });
- }
- };
- var getAllImages = function (elm) {
- return elm ? from(elm.getElementsByTagName('img')) : [];
- };
- var ImageScanner = function (uploadStatus, blobCache) {
- var cachedPromises = {};
- var findAll = function (elm, predicate) {
- if (!predicate) {
- predicate = always;
- }
- var images = filter$4(getAllImages(elm), function (img) {
- var src = img.src;
- if (!Env.fileApi) {
- return false;
- }
- if (img.hasAttribute('data-mce-bogus')) {
- return false;
- }
- if (img.hasAttribute('data-mce-placeholder')) {
- return false;
- }
- if (!src || src === Env.transparentSrc) {
- return false;
- }
- if (src.indexOf('blob:') === 0) {
- return !uploadStatus.isUploaded(src) && predicate(img);
- }
- if (src.indexOf('data:') === 0) {
- return predicate(img);
- }
- return false;
- });
- var promises = map$3(images, function (img) {
- if (cachedPromises[img.src] !== undefined) {
- return new promiseObj(function (resolve) {
- cachedPromises[img.src].then(function (imageInfo) {
- if (typeof imageInfo === 'string') {
- return imageInfo;
- }
- resolve({
- image: img,
- blobInfo: imageInfo.blobInfo
- });
- });
- });
- }
- var newPromise = new promiseObj(function (resolve, reject) {
- imageToBlobInfo(blobCache, img, resolve, reject);
- }).then(function (result) {
- delete cachedPromises[result.image.src];
- return result;
- }).catch(function (error) {
- delete cachedPromises[img.src];
- return error;
- });
- cachedPromises[img.src] = newPromise;
- return newPromise;
- });
- return promiseObj.all(promises);
- };
- return { findAll: findAll };
- };
- var paddEmptyNode = function (settings, args, blockElements, node) {
- var brPreferred = settings.padd_empty_with_br || args.insert;
- if (brPreferred && blockElements[node.name]) {
- node.empty().append(new AstNode('br', 1)).shortEnded = true;
- } else {
- node.empty().append(new AstNode('#text', 3)).value = nbsp;
- }
- };
- var isPaddedWithNbsp = function (node) {
- return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp;
- };
- var hasOnlyChild = function (node, name) {
- return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
- };
- var isPadded = function (schema, node) {
- var rule = schema.getElementRule(node.name);
- return rule && rule.paddEmpty;
- };
- var isEmpty = function (schema, nonEmptyElements, whitespaceElements, node) {
- return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) {
- return isPadded(schema, node);
- });
- };
- var isLineBreakNode = function (node, blockElements) {
- return node && (has$2(blockElements, node.name) || node.name === 'br');
- };
- var isBogusImage = function (img) {
- return isNonNullable(img.attr('data-mce-bogus'));
- };
- var isInternalImageSource = function (img) {
- return img.attr('src') === Env.transparentSrc || isNonNullable(img.attr('data-mce-placeholder'));
- };
- var isValidDataImg = function (img, settings) {
- if (settings.images_dataimg_filter) {
- var imgElem_1 = new Image();
- imgElem_1.src = img.attr('src');
- each$j(img.attributes.map, function (value, key) {
- imgElem_1.setAttribute(key, value);
- });
- return settings.images_dataimg_filter(imgElem_1);
- } else {
- return true;
- }
- };
- var registerBase64ImageFilter = function (parser, settings) {
- var blobCache = settings.blob_cache;
- var processImage = function (img) {
- var inputSrc = img.attr('src');
- if (isInternalImageSource(img) || isBogusImage(img)) {
- return;
- }
- parseDataUri$1(inputSrc).filter(function () {
- return isValidDataImg(img, settings);
- }).bind(function (_a) {
- var type = _a.type, data = _a.data;
- return Optional.from(blobCache.getByData(data, type)).orThunk(function () {
- return buildBlob(type, data).map(function (blob) {
- var blobInfo = blobCache.create(uniqueId(), blob, data);
- blobCache.add(blobInfo);
- return blobInfo;
- });
- });
- }).each(function (blobInfo) {
- img.attr('src', blobInfo.blobUri());
- });
- };
- if (blobCache) {
- parser.addAttributeFilter('src', function (nodes) {
- return each$k(nodes, processImage);
- });
- }
- };
- var register$1 = function (parser, settings) {
- var schema = parser.schema;
- if (settings.remove_trailing_brs) {
- parser.addNodeFilter('br', function (nodes, _, args) {
- var i;
- var l = nodes.length;
- var node;
- var blockElements = Tools.extend({}, schema.getBlockElements());
- var nonEmptyElements = schema.getNonEmptyElements();
- var parent, lastParent, prev, prevName;
- var whiteSpaceElements = schema.getWhiteSpaceElements();
- var elementRule, textNode;
- blockElements.body = 1;
- for (i = 0; i < l; i++) {
- node = nodes[i];
- parent = node.parent;
- if (blockElements[node.parent.name] && node === parent.lastChild) {
- prev = node.prev;
- while (prev) {
- prevName = prev.name;
- if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') {
- if (prevName === 'br') {
- node = null;
- }
- break;
- }
- prev = prev.prev;
- }
- if (node) {
- node.remove();
- if (isEmpty(schema, nonEmptyElements, whiteSpaceElements, parent)) {
- elementRule = schema.getElementRule(parent.name);
- if (elementRule) {
- if (elementRule.removeEmpty) {
- parent.remove();
- } else if (elementRule.paddEmpty) {
- paddEmptyNode(settings, args, blockElements, parent);
- }
- }
- }
- }
- } else {
- lastParent = node;
- while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
- lastParent = parent;
- if (blockElements[parent.name]) {
- break;
- }
- parent = parent.parent;
- }
- if (lastParent === parent && settings.padd_empty_with_br !== true) {
- textNode = new AstNode('#text', 3);
- textNode.value = nbsp;
- node.replace(textNode);
- }
- }
- }
- });
- }
- parser.addAttributeFilter('href', function (nodes) {
- var i = nodes.length;
- var appendRel = function (rel) {
- var parts = rel.split(' ').filter(function (p) {
- return p.length > 0;
- });
- return parts.concat(['noopener']).sort().join(' ');
- };
- var addNoOpener = function (rel) {
- var newRel = rel ? Tools.trim(rel) : '';
- if (!/\b(noopener)\b/g.test(newRel)) {
- return appendRel(newRel);
- } else {
- return newRel;
- }
- };
- if (!settings.allow_unsafe_link_target) {
- while (i--) {
- var node = nodes[i];
- if (node.name === 'a' && node.attr('target') === '_blank') {
- node.attr('rel', addNoOpener(node.attr('rel')));
- }
- }
- }
- });
- if (!settings.allow_html_in_named_anchor) {
- parser.addAttributeFilter('id,name', function (nodes) {
- var i = nodes.length, sibling, prevSibling, parent, node;
- while (i--) {
- node = nodes[i];
- if (node.name === 'a' && node.firstChild && !node.attr('href')) {
- parent = node.parent;
- sibling = node.lastChild;
- do {
- prevSibling = sibling.prev;
- parent.insert(sibling, node);
- sibling = prevSibling;
- } while (sibling);
- }
- }
- });
- }
- if (settings.fix_list_elements) {
- parser.addNodeFilter('ul,ol', function (nodes) {
- var i = nodes.length, node, parentNode;
- while (i--) {
- node = nodes[i];
- parentNode = node.parent;
- if (parentNode.name === 'ul' || parentNode.name === 'ol') {
- if (node.prev && node.prev.name === 'li') {
- node.prev.append(node);
- } else {
- var li = new AstNode('li', 1);
- li.attr('style', 'list-style-type: none');
- node.wrap(li);
- }
- }
- }
- });
- }
- if (settings.validate && schema.getValidClasses()) {
- parser.addAttributeFilter('class', function (nodes) {
- var validClasses = schema.getValidClasses();
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- var classList = node.attr('class').split(' ');
- var classValue = '';
- for (var ci = 0; ci < classList.length; ci++) {
- var className = classList[ci];
- var valid = false;
- var validClassesMap = validClasses['*'];
- if (validClassesMap && validClassesMap[className]) {
- valid = true;
- }
- validClassesMap = validClasses[node.name];
- if (!valid && validClassesMap && validClassesMap[className]) {
- valid = true;
- }
- if (valid) {
- if (classValue) {
- classValue += ' ';
- }
- classValue += className;
- }
- }
- if (!classValue.length) {
- classValue = null;
- }
- node.attr('class', classValue);
- }
- });
- }
- registerBase64ImageFilter(parser, settings);
- };
- var makeMap = Tools.makeMap, each$6 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
- var DomParser = function (settings, schema) {
- if (schema === void 0) {
- schema = Schema();
- }
- var nodeFilters = {};
- var attributeFilters = [];
- var matchedNodes = {};
- var matchedAttributes = {};
- settings = settings || {};
- settings.validate = 'validate' in settings ? settings.validate : true;
- settings.root_name = settings.root_name || 'body';
- var fixInvalidChildren = function (nodes) {
- var nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
- var nonEmptyElements = schema.getNonEmptyElements();
- var whitespaceElements = schema.getWhiteSpaceElements();
- var textBlockElements = schema.getTextBlockElements();
- var specialElements = schema.getSpecialElements();
- var removeOrUnwrapInvalidNode = function (node, originalNodeParent) {
- if (originalNodeParent === void 0) {
- originalNodeParent = node.parent;
- }
- if (specialElements[node.name]) {
- node.empty().remove();
- } else {
- var children = node.children();
- for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
- var childNode = children_1[_i];
- if (!schema.isValidChild(originalNodeParent.name, childNode.name)) {
- removeOrUnwrapInvalidNode(childNode, originalNodeParent);
- }
- }
- node.unwrap();
- }
- };
- for (var ni = 0; ni < nodes.length; ni++) {
- var node = nodes[ni];
- var parent_1 = void 0, newParent = void 0, tempNode = void 0;
- if (!node.parent || node.fixed) {
- continue;
- }
- if (textBlockElements[node.name] && node.parent.name === 'li') {
- var sibling = node.next;
- while (sibling) {
- if (textBlockElements[sibling.name]) {
- sibling.name = 'li';
- sibling.fixed = true;
- node.parent.insert(sibling, node.parent);
- } else {
- break;
- }
- sibling = sibling.next;
- }
- node.unwrap();
- continue;
- }
- var parents = [node];
- for (parent_1 = node.parent; parent_1 && !schema.isValidChild(parent_1.name, node.name) && !nonSplitableElements[parent_1.name]; parent_1 = parent_1.parent) {
- parents.push(parent_1);
- }
- if (parent_1 && parents.length > 1) {
- if (schema.isValidChild(parent_1.name, node.name)) {
- parents.reverse();
- newParent = filterNode(parents[0].clone());
- var currentNode = newParent;
- for (var i = 0; i < parents.length - 1; i++) {
- if (schema.isValidChild(currentNode.name, parents[i].name)) {
- tempNode = filterNode(parents[i].clone());
- currentNode.append(tempNode);
- } else {
- tempNode = currentNode;
- }
- for (var childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) {
- var nextNode = childNode.next;
- tempNode.append(childNode);
- childNode = nextNode;
- }
- currentNode = tempNode;
- }
- if (!isEmpty(schema, nonEmptyElements, whitespaceElements, newParent)) {
- parent_1.insert(newParent, parents[0], true);
- parent_1.insert(node, newParent);
- } else {
- parent_1.insert(node, parents[0], true);
- }
- parent_1 = parents[0];
- if (isEmpty(schema, nonEmptyElements, whitespaceElements, parent_1) || hasOnlyChild(parent_1, 'br')) {
- parent_1.empty().remove();
- }
- } else {
- removeOrUnwrapInvalidNode(node);
- }
- } else if (node.parent) {
- if (node.name === 'li') {
- var sibling = node.prev;
- if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) {
- sibling.append(node);
- continue;
- }
- sibling = node.next;
- if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) {
- sibling.insert(node, sibling.firstChild, true);
- continue;
- }
- node.wrap(filterNode(new AstNode('ul', 1)));
- continue;
- }
- if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
- node.wrap(filterNode(new AstNode('div', 1)));
- } else {
- removeOrUnwrapInvalidNode(node);
- }
- }
- }
- };
- var filterNode = function (node) {
- var name = node.name;
- if (name in nodeFilters) {
- var list = matchedNodes[name];
- if (list) {
- list.push(node);
- } else {
- matchedNodes[name] = [node];
- }
- }
- var i = attributeFilters.length;
- while (i--) {
- var attrName = attributeFilters[i].name;
- if (attrName in node.attributes.map) {
- var list = matchedAttributes[attrName];
- if (list) {
- list.push(node);
- } else {
- matchedAttributes[attrName] = [node];
- }
- }
- }
- return node;
- };
- var addNodeFilter = function (name, callback) {
- each$6(explode$2(name), function (name) {
- var list = nodeFilters[name];
- if (!list) {
- nodeFilters[name] = list = [];
- }
- list.push(callback);
- });
- };
- var getNodeFilters = function () {
- var out = [];
- for (var name_1 in nodeFilters) {
- if (has$2(nodeFilters, name_1)) {
- out.push({
- name: name_1,
- callbacks: nodeFilters[name_1]
- });
- }
- }
- return out;
- };
- var addAttributeFilter = function (name, callback) {
- each$6(explode$2(name), function (name) {
- var i;
- for (i = 0; i < attributeFilters.length; i++) {
- if (attributeFilters[i].name === name) {
- attributeFilters[i].callbacks.push(callback);
- return;
- }
- }
- attributeFilters.push({
- name: name,
- callbacks: [callback]
- });
- });
- };
- var getAttributeFilters = function () {
- return [].concat(attributeFilters);
- };
- var parse = function (html, args) {
- var nodes, i, l, fi, fl, list, name;
- var invalidChildren = [];
- var node;
- var getRootBlockName = function (name) {
- if (name === false) {
- return '';
- } else if (name === true) {
- return 'p';
- } else {
- return name;
- }
- };
- args = args || {};
- matchedNodes = {};
- matchedAttributes = {};
- var blockElements = extend$4(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
- var nonEmptyElements = schema.getNonEmptyElements();
- var children = schema.children;
- var validate = settings.validate;
- var forcedRootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block;
- var rootBlockName = getRootBlockName(forcedRootBlockName);
- var whiteSpaceElements = schema.getWhiteSpaceElements();
- var startWhiteSpaceRegExp = /^[ \t\r\n]+/;
- var endWhiteSpaceRegExp = /[ \t\r\n]+$/;
- var allWhiteSpaceRegExp = /[ \t\r\n]+/g;
- var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
- var isInWhiteSpacePreservedElement = has$2(whiteSpaceElements, args.context) || has$2(whiteSpaceElements, settings.root_name);
- var addRootBlocks = function () {
- var node = rootNode.firstChild, rootBlockNode = null;
- var trim = function (rootBlock) {
- if (rootBlock) {
- node = rootBlock.firstChild;
- if (node && node.type === 3) {
- node.value = node.value.replace(startWhiteSpaceRegExp, '');
- }
- node = rootBlock.lastChild;
- if (node && node.type === 3) {
- node.value = node.value.replace(endWhiteSpaceRegExp, '');
- }
- }
- };
- if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
- return;
- }
- while (node) {
- var next = node.next;
- if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) {
- if (!rootBlockNode) {
- rootBlockNode = createNode(rootBlockName, 1);
- rootBlockNode.attr(settings.forced_root_block_attrs);
- rootNode.insert(rootBlockNode, node);
- rootBlockNode.append(node);
- } else {
- rootBlockNode.append(node);
- }
- } else {
- trim(rootBlockNode);
- rootBlockNode = null;
- }
- node = next;
- }
- trim(rootBlockNode);
- };
- var createNode = function (name, type) {
- var node = new AstNode(name, type);
- var list;
- if (name in nodeFilters) {
- list = matchedNodes[name];
- if (list) {
- list.push(node);
- } else {
- matchedNodes[name] = [node];
- }
- }
- return node;
- };
- var removeWhitespaceBefore = function (node) {
- var blockElements = schema.getBlockElements();
- for (var textNode = node.prev; textNode && textNode.type === 3;) {
- var textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
- if (textVal.length > 0) {
- textNode.value = textVal;
- return;
- }
- var textNodeNext = textNode.next;
- if (textNodeNext) {
- if (textNodeNext.type === 3 && textNodeNext.value.length) {
- textNode = textNode.prev;
- continue;
- }
- if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') {
- textNode = textNode.prev;
- continue;
- }
- }
- var sibling = textNode.prev;
- textNode.remove();
- textNode = sibling;
- }
- };
- var cloneAndExcludeBlocks = function (input) {
- var output = {};
- for (var name_2 in input) {
- if (name_2 !== 'li' && name_2 !== 'p') {
- output[name_2] = input[name_2];
- }
- }
- return output;
- };
- var parser = SaxParser({
- validate: validate,
- document: settings.document,
- allow_html_data_urls: settings.allow_html_data_urls,
- allow_svg_data_urls: settings.allow_svg_data_urls,
- allow_script_urls: settings.allow_script_urls,
- allow_conditional_comments: settings.allow_conditional_comments,
- preserve_cdata: settings.preserve_cdata,
- self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
- cdata: function (text) {
- node.append(createNode('#cdata', 4)).value = text;
- },
- text: function (text, raw) {
- var textNode;
- if (!isInWhiteSpacePreservedElement) {
- text = text.replace(allWhiteSpaceRegExp, ' ');
- if (isLineBreakNode(node.lastChild, blockElements)) {
- text = text.replace(startWhiteSpaceRegExp, '');
- }
- }
- if (text.length !== 0) {
- textNode = createNode('#text', 3);
- textNode.raw = !!raw;
- node.append(textNode).value = text;
- }
- },
- comment: function (text) {
- node.append(createNode('#comment', 8)).value = text;
- },
- pi: function (name, text) {
- node.append(createNode(name, 7)).value = text;
- removeWhitespaceBefore(node);
- },
- doctype: function (text) {
- var newNode = node.append(createNode('#doctype', 10));
- newNode.value = text;
- removeWhitespaceBefore(node);
- },
- start: function (name, attrs, empty) {
- var elementRule = validate ? schema.getElementRule(name) : {};
- if (elementRule) {
- var newNode = createNode(elementRule.outputName || name, 1);
- newNode.attributes = attrs;
- newNode.shortEnded = empty;
- node.append(newNode);
- var parent_2 = children[node.name];
- if (parent_2 && children[newNode.name] && !parent_2[newNode.name]) {
- invalidChildren.push(newNode);
- }
- var attrFiltersLen = attributeFilters.length;
- while (attrFiltersLen--) {
- var attrName = attributeFilters[attrFiltersLen].name;
- if (attrName in attrs.map) {
- list = matchedAttributes[attrName];
- if (list) {
- list.push(newNode);
- } else {
- matchedAttributes[attrName] = [newNode];
- }
- }
- }
- if (blockElements[name]) {
- removeWhitespaceBefore(newNode);
- }
- if (!empty) {
- node = newNode;
- }
- if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
- isInWhiteSpacePreservedElement = true;
- }
- }
- },
- end: function (name) {
- var textNode, text, sibling, tempNode;
- var elementRule = validate ? schema.getElementRule(name) : {};
- if (elementRule) {
- if (blockElements[name]) {
- if (!isInWhiteSpacePreservedElement) {
- textNode = node.firstChild;
- if (textNode && textNode.type === 3) {
- text = textNode.value.replace(startWhiteSpaceRegExp, '');
- if (text.length > 0) {
- textNode.value = text;
- textNode = textNode.next;
- } else {
- sibling = textNode.next;
- textNode.remove();
- textNode = sibling;
- while (textNode && textNode.type === 3) {
- text = textNode.value;
- sibling = textNode.next;
- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
- textNode.remove();
- textNode = sibling;
- }
- textNode = sibling;
- }
- }
- }
- textNode = node.lastChild;
- if (textNode && textNode.type === 3) {
- text = textNode.value.replace(endWhiteSpaceRegExp, '');
- if (text.length > 0) {
- textNode.value = text;
- textNode = textNode.prev;
- } else {
- sibling = textNode.prev;
- textNode.remove();
- textNode = sibling;
- while (textNode && textNode.type === 3) {
- text = textNode.value;
- sibling = textNode.prev;
- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
- textNode.remove();
- textNode = sibling;
- }
- textNode = sibling;
- }
- }
- }
- }
- }
- if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
- isInWhiteSpacePreservedElement = false;
- }
- if (elementRule.removeEmpty && isEmpty(schema, nonEmptyElements, whiteSpaceElements, node)) {
- tempNode = node.parent;
- if (blockElements[node.name]) {
- node.empty().remove();
- } else {
- node.unwrap();
- }
- node = tempNode;
- return;
- }
- if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty(schema, nonEmptyElements, whiteSpaceElements, node))) {
- paddEmptyNode(settings, args, blockElements, node);
- }
- node = node.parent;
- }
- }
- }, schema);
- var rootNode = node = new AstNode(args.context || settings.root_name, 11);
- parser.parse(html, args.format);
- if (validate && invalidChildren.length) {
- if (!args.context) {
- fixInvalidChildren(invalidChildren);
- } else {
- args.invalid = true;
- }
- }
- if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) {
- addRootBlocks();
- }
- if (!args.invalid) {
- for (name in matchedNodes) {
- if (!has$2(matchedNodes, name)) {
- continue;
- }
- list = nodeFilters[name];
- nodes = matchedNodes[name];
- fi = nodes.length;
- while (fi--) {
- if (!nodes[fi].parent) {
- nodes.splice(fi, 1);
- }
- }
- for (i = 0, l = list.length; i < l; i++) {
- list[i](nodes, name, args);
- }
- }
- for (i = 0, l = attributeFilters.length; i < l; i++) {
- list = attributeFilters[i];
- if (list.name in matchedAttributes) {
- nodes = matchedAttributes[list.name];
- fi = nodes.length;
- while (fi--) {
- if (!nodes[fi].parent) {
- nodes.splice(fi, 1);
- }
- }
- for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
- list.callbacks[fi](nodes, list.name, args);
- }
- }
- }
- }
- return rootNode;
- };
- var exports = {
- schema: schema,
- addAttributeFilter: addAttributeFilter,
- getAttributeFilters: getAttributeFilters,
- addNodeFilter: addNodeFilter,
- getNodeFilters: getNodeFilters,
- filterNode: filterNode,
- parse: parse
- };
- register$1(exports, settings);
- register$2(exports, settings);
- return exports;
- };
- var register = function (htmlParser, settings, dom) {
- htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- node.attr('tabindex', node.attr('data-mce-tabindex'));
- node.attr(name, null);
- }
- });
- htmlParser.addAttributeFilter('src,href,style', function (nodes, name) {
- var internalName = 'data-mce-' + name;
- var urlConverter = settings.url_converter;
- var urlConverterScope = settings.url_converter_scope;
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- var value = node.attr(internalName);
- if (value !== undefined) {
- node.attr(name, value.length > 0 ? value : null);
- node.attr(internalName, null);
- } else {
- value = node.attr(name);
- if (name === 'style') {
- value = dom.serializeStyle(dom.parseStyle(value), node.name);
- } else if (urlConverter) {
- value = urlConverter.call(urlConverterScope, value, name, node.name);
- }
- node.attr(name, value.length > 0 ? value : null);
- }
- }
- });
- htmlParser.addAttributeFilter('class', function (nodes) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- var value = node.attr('class');
- if (value) {
- value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
- node.attr('class', value.length > 0 ? value : null);
- }
- }
- });
- htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- if (node.attr('data-mce-type') === 'bookmark' && !args.cleanup) {
- var hasChildren = Optional.from(node.firstChild).exists(function (firstChild) {
- return !isZwsp(firstChild.value);
- });
- if (hasChildren) {
- node.unwrap();
- } else {
- node.remove();
- }
- }
- }
- });
- htmlParser.addNodeFilter('noscript', function (nodes) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i].firstChild;
- if (node) {
- node.value = Entities.decode(node.value);
- }
- }
- });
- htmlParser.addNodeFilter('script,style', function (nodes, name) {
- var trim = function (value) {
- return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '').replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');
- };
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- var value = node.firstChild ? node.firstChild.value : '';
- if (name === 'script') {
- var type = node.attr('type');
- if (type) {
- node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
- }
- if (settings.element_format === 'xhtml' && value.length > 0) {
- node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
- }
- } else {
- if (settings.element_format === 'xhtml' && value.length > 0) {
- node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
- }
- }
- }
- });
- htmlParser.addNodeFilter('#comment', function (nodes) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- if (settings.preserve_cdata && node.value.indexOf('[CDATA[') === 0) {
- node.name = '#cdata';
- node.type = 4;
- node.value = dom.decode(node.value.replace(/^\[CDATA\[|\]\]$/g, ''));
- } else if (node.value.indexOf('mce:protected ') === 0) {
- node.name = '#text';
- node.type = 3;
- node.raw = true;
- node.value = unescape(node.value).substr(14);
- }
- }
- });
- htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- if (node.type === 7) {
- node.remove();
- } else if (node.type === 1) {
- if (name === 'input' && !node.attr('type')) {
- node.attr('type', 'text');
- }
- }
- }
- });
- htmlParser.addAttributeFilter('data-mce-type', function (nodes) {
- each$k(nodes, function (node) {
- if (node.attr('data-mce-type') === 'format-caret') {
- if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) {
- node.remove();
- } else {
- node.unwrap();
- }
- }
- });
- });
- htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize,data-mce-placeholder', function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- nodes[i].attr(name, null);
- }
- });
- };
- var trimTrailingBr = function (rootNode) {
- var isBr = function (node) {
- return node && node.name === 'br';
- };
- var brNode1 = rootNode.lastChild;
- if (isBr(brNode1)) {
- var brNode2 = brNode1.prev;
- if (isBr(brNode2)) {
- brNode1.remove();
- brNode2.remove();
- }
- }
- };
- var preProcess = function (editor, node, args) {
- var oldDoc;
- var dom = editor.dom;
- var clonedNode = node.cloneNode(true);
- var impl = document.implementation;
- if (impl.createHTMLDocument) {
- var doc_1 = impl.createHTMLDocument('');
- Tools.each(clonedNode.nodeName === 'BODY' ? clonedNode.childNodes : [clonedNode], function (node) {
- doc_1.body.appendChild(doc_1.importNode(node, true));
- });
- if (clonedNode.nodeName !== 'BODY') {
- clonedNode = doc_1.body.firstChild;
- } else {
- clonedNode = doc_1.body;
- }
- oldDoc = dom.doc;
- dom.doc = doc_1;
- }
- firePreProcess(editor, __assign(__assign({}, args), { node: clonedNode }));
- if (oldDoc) {
- dom.doc = oldDoc;
- }
- return clonedNode;
- };
- var shouldFireEvent = function (editor, args) {
- return editor && editor.hasEventListeners('PreProcess') && !args.no_events;
- };
- var process = function (editor, node, args) {
- return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node;
- };
- var addTempAttr = function (htmlParser, tempAttrs, name) {
- if (Tools.inArray(tempAttrs, name) === -1) {
- htmlParser.addAttributeFilter(name, function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- nodes[i].attr(name, null);
- }
- });
- tempAttrs.push(name);
- }
- };
- var postProcess = function (editor, args, content) {
- if (!args.no_events && editor) {
- var outArgs = firePostProcess(editor, __assign(__assign({}, args), { content: content }));
- return outArgs.content;
- } else {
- return content;
- }
- };
- var getHtmlFromNode = function (dom, node, args) {
- var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
- return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html);
- };
- var parseHtml = function (htmlParser, html, args) {
- var parserArgs = args.selection ? __assign({ forced_root_block: false }, args) : args;
- var rootNode = htmlParser.parse(html, parserArgs);
- trimTrailingBr(rootNode);
- return rootNode;
- };
- var serializeNode = function (settings, schema, node) {
- var htmlSerializer = HtmlSerializer(settings, schema);
- return htmlSerializer.serialize(node);
- };
- var toHtml = function (editor, settings, schema, rootNode, args) {
- var content = serializeNode(settings, schema, rootNode);
- return postProcess(editor, args, content);
- };
- var DomSerializerImpl = function (settings, editor) {
- var tempAttrs = ['data-mce-selected'];
- var dom = editor && editor.dom ? editor.dom : DOMUtils.DOM;
- var schema = editor && editor.schema ? editor.schema : Schema(settings);
- settings.entity_encoding = settings.entity_encoding || 'named';
- settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true;
- var htmlParser = DomParser(settings, schema);
- register(htmlParser, settings, dom);
- var serialize = function (node, parserArgs) {
- if (parserArgs === void 0) {
- parserArgs = {};
- }
- var args = __assign({ format: 'html' }, parserArgs);
- var targetNode = process(editor, node, args);
- var html = getHtmlFromNode(dom, targetNode, args);
- var rootNode = parseHtml(htmlParser, html, args);
- return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args);
- };
- return {
- schema: schema,
- addNodeFilter: htmlParser.addNodeFilter,
- addAttributeFilter: htmlParser.addAttributeFilter,
- serialize: serialize,
- addRules: schema.addValidElements,
- setRules: schema.setValidElements,
- addTempAttr: curry(addTempAttr, htmlParser, tempAttrs),
- getTempAttrs: constant(tempAttrs),
- getNodeFilters: htmlParser.getNodeFilters,
- getAttributeFilters: htmlParser.getAttributeFilters
- };
- };
- var DomSerializer = function (settings, editor) {
- var domSerializer = DomSerializerImpl(settings, editor);
- return {
- schema: domSerializer.schema,
- addNodeFilter: domSerializer.addNodeFilter,
- addAttributeFilter: domSerializer.addAttributeFilter,
- serialize: domSerializer.serialize,
- addRules: domSerializer.addRules,
- setRules: domSerializer.setRules,
- addTempAttr: domSerializer.addTempAttr,
- getTempAttrs: domSerializer.getTempAttrs,
- getNodeFilters: domSerializer.getNodeFilters,
- getAttributeFilters: domSerializer.getAttributeFilters
- };
- };
- var defaultFormat = 'html';
- var getContent = function (editor, args) {
- if (args === void 0) {
- args = {};
- }
- var format = args.format ? args.format : defaultFormat;
- return getContent$2(editor, args, format);
- };
- var setContent = function (editor, content, args) {
- if (args === void 0) {
- args = {};
- }
- return setContent$2(editor, content, args);
- };
- var DOM$7 = DOMUtils.DOM;
- var restoreOriginalStyles = function (editor) {
- DOM$7.setStyle(editor.id, 'display', editor.orgDisplay);
- };
- var safeDestroy = function (x) {
- return Optional.from(x).each(function (x) {
- return x.destroy();
- });
- };
- var clearDomReferences = function (editor) {
- editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null;
- editor.bodyElement = editor.contentDocument = editor.contentWindow = null;
- editor.iframeElement = editor.targetElm = null;
- if (editor.selection) {
- editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null;
- }
- };
- var restoreForm = function (editor) {
- var form = editor.formElement;
- if (form) {
- if (form._mceOldSubmit) {
- form.submit = form._mceOldSubmit;
- form._mceOldSubmit = null;
- }
- DOM$7.unbind(form, 'submit reset', editor.formEventDelegate);
- }
- };
- var remove = function (editor) {
- if (!editor.removed) {
- var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload;
- var body = editor.getBody();
- var element = editor.getElement();
- if (body) {
- editor.save({ is_removing: true });
- }
- editor.removed = true;
- editor.unbindAllNativeEvents();
- if (editor.hasHiddenInput && element) {
- DOM$7.remove(element.nextSibling);
- }
- fireRemove(editor);
- editor.editorManager.remove(editor);
- if (!editor.inline && body) {
- restoreOriginalStyles(editor);
- }
- fireDetach(editor);
- DOM$7.remove(editor.getContainer());
- safeDestroy(_selectionOverrides);
- safeDestroy(editorUpload);
- editor.destroy();
- }
- };
- var destroy = function (editor, automatic) {
- var selection = editor.selection, dom = editor.dom;
- if (editor.destroyed) {
- return;
- }
- if (!automatic && !editor.removed) {
- editor.remove();
- return;
- }
- if (!automatic) {
- editor.editorManager.off('beforeunload', editor._beforeUnload);
- if (editor.theme && editor.theme.destroy) {
- editor.theme.destroy();
- }
- safeDestroy(selection);
- safeDestroy(dom);
- }
- restoreForm(editor);
- clearDomReferences(editor);
- editor.destroyed = true;
- };
- var deep = function (old, nu) {
- var bothObjects = isObject(old) && isObject(nu);
- return bothObjects ? deepMerge(old, nu) : nu;
- };
- var baseMerge = function (merger) {
- return function () {
- var objects = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- objects[_i] = arguments[_i];
- }
- if (objects.length === 0) {
- throw new Error('Can\'t merge zero objects');
- }
- var ret = {};
- for (var j = 0; j < objects.length; j++) {
- var curObject = objects[j];
- for (var key in curObject) {
- if (has$2(curObject, key)) {
- ret[key] = merger(ret[key], curObject[key]);
- }
- }
- }
- return ret;
- };
- };
- var deepMerge = baseMerge(deep);
- var deprecatedSettings = ('autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,' + 'boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,' + 'force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,' + 'non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,' + 'tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,' + 'paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists').split(',');
- var deprecatedPlugins = 'bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor'.split(',');
- var movedToPremiumPlugins = 'imagetools,toc'.split(',');
- var getDeprecatedSettings = function (settings) {
- var settingNames = filter$4(deprecatedSettings, function (setting) {
- return has$2(settings, setting);
- });
- var forcedRootBlock = settings.forced_root_block;
- if (forcedRootBlock === false || forcedRootBlock === '') {
- settingNames.push('forced_root_block (false only)');
- }
- return sort(settingNames);
- };
- var getDeprecatedPlugins = function (settings) {
- var plugins = Tools.makeMap(settings.plugins, ' ');
- var hasPlugin = function (plugin) {
- return has$2(plugins, plugin);
- };
- var pluginNames = __spreadArray(__spreadArray([], filter$4(deprecatedPlugins, hasPlugin), true), bind(movedToPremiumPlugins, function (plugin) {
- return hasPlugin(plugin) ? [plugin + ' (moving to premium)'] : [];
- }), true);
- return sort(pluginNames);
- };
- var logDeprecationsWarning = function (rawSettings, finalSettings) {
- var deprecatedSettings = getDeprecatedSettings(rawSettings);
- var deprecatedPlugins = getDeprecatedPlugins(finalSettings);
- var hasDeprecatedPlugins = deprecatedPlugins.length > 0;
- var hasDeprecatedSettings = deprecatedSettings.length > 0;
- var isLegacyMobileTheme = finalSettings.theme === 'mobile';
- if (hasDeprecatedPlugins || hasDeprecatedSettings || isLegacyMobileTheme) {
- var listJoiner = '\n- ';
- var themesMessage = isLegacyMobileTheme ? '\n\nThemes:' + listJoiner + 'mobile' : '';
- var pluginsMessage = hasDeprecatedPlugins ? '\n\nPlugins:' + listJoiner + deprecatedPlugins.join(listJoiner) : '';
- var settingsMessage = hasDeprecatedSettings ? '\n\nSettings:' + listJoiner + deprecatedSettings.join(listJoiner) : '';
- console.warn('The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. ' + 'See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information.' + themesMessage + pluginsMessage + settingsMessage);
- }
- };
- var sectionResult = function (sections, settings) {
- return {
- sections: constant(sections),
- settings: constant(settings)
- };
- };
- var deviceDetection = detect().deviceType;
- var isTouch = deviceDetection.isTouch();
- var isPhone = deviceDetection.isPhone();
- var isTablet = deviceDetection.isTablet();
- var legacyMobilePlugins = [
- 'lists',
- 'autolink',
- 'autosave'
- ];
- var defaultTouchSettings = {
- table_grid: false,
- object_resizing: false,
- resize: false
- };
- var normalizePlugins = function (plugins) {
- var pluginNames = isArray$1(plugins) ? plugins.join(' ') : plugins;
- var trimmedPlugins = map$3(isString$1(pluginNames) ? pluginNames.split(' ') : [], trim$4);
- return filter$4(trimmedPlugins, function (item) {
- return item.length > 0;
- });
- };
- var filterLegacyMobilePlugins = function (plugins) {
- return filter$4(plugins, curry(contains$3, legacyMobilePlugins));
- };
- var extractSections = function (keys, settings) {
- var result = bifilter(settings, function (value, key) {
- return contains$3(keys, key);
- });
- return sectionResult(result.t, result.f);
- };
- var getSection = function (sectionResult, name, defaults) {
- if (defaults === void 0) {
- defaults = {};
- }
- var sections = sectionResult.sections();
- var sectionSettings = get$9(sections, name).getOr({});
- return Tools.extend({}, defaults, sectionSettings);
- };
- var hasSection = function (sectionResult, name) {
- return has$2(sectionResult.sections(), name);
- };
- var isSectionTheme = function (sectionResult, name, theme) {
- var section = sectionResult.sections();
- return hasSection(sectionResult, name) && section[name].theme === theme;
- };
- var getSectionConfig = function (sectionResult, name) {
- return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {};
- };
- var getToolbarMode = function (settings, defaultVal) {
- return get$9(settings, 'toolbar_mode').orThunk(function () {
- return get$9(settings, 'toolbar_drawer').map(function (val) {
- return val === false ? 'wrap' : val;
- });
- }).getOr(defaultVal);
- };
- var getDefaultSettings = function (settings, id, documentBaseUrl, isTouch, editor) {
- var baseDefaults = {
- id: id,
- theme: 'silver',
- toolbar_mode: getToolbarMode(settings, 'floating'),
- plugins: '',
- document_base_url: documentBaseUrl,
- add_form_submit_trigger: true,
- submit_patch: true,
- add_unload_trigger: true,
- convert_urls: true,
- relative_urls: true,
- remove_script_host: true,
- object_resizing: true,
- doctype: '<!DOCTYPE html>',
- visual: true,
- font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
- forced_root_block: 'p',
- hidden_input: true,
- inline_styles: true,
- convert_fonts_to_spans: true,
- indent: true,
- indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
- indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
- entity_encoding: 'named',
- url_converter: editor.convertURL,
- url_converter_scope: editor
- };
- return __assign(__assign({}, baseDefaults), isTouch ? defaultTouchSettings : {});
- };
- var getDefaultMobileSettings = function (mobileSettings, isPhone) {
- var defaultMobileSettings = {
- resize: false,
- toolbar_mode: getToolbarMode(mobileSettings, 'scrolling'),
- toolbar_sticky: false
- };
- var defaultPhoneSettings = { menubar: false };
- return __assign(__assign(__assign({}, defaultTouchSettings), defaultMobileSettings), isPhone ? defaultPhoneSettings : {});
- };
- var getExternalPlugins = function (overrideSettings, settings) {
- var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {};
- if (overrideSettings && overrideSettings.external_plugins) {
- return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins);
- } else {
- return userDefinedExternalPlugins;
- }
- };
- var combinePlugins = function (forcedPlugins, plugins) {
- return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins));
- };
- var getPlatformPlugins = function (isMobileDevice, sectionResult, desktopPlugins, mobilePlugins) {
- if (isMobileDevice && isSectionTheme(sectionResult, 'mobile', 'mobile')) {
- return filterLegacyMobilePlugins(mobilePlugins);
- } else if (isMobileDevice && hasSection(sectionResult, 'mobile')) {
- return mobilePlugins;
- } else {
- return desktopPlugins;
- }
- };
- var processPlugins = function (isMobileDevice, sectionResult, defaultOverrideSettings, settings) {
- var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
- var desktopPlugins = normalizePlugins(settings.plugins);
- var mobileConfig = getSectionConfig(sectionResult, 'mobile');
- var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins;
- var platformPlugins = getPlatformPlugins(isMobileDevice, sectionResult, desktopPlugins, mobilePlugins);
- var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
- if (Env.browser.isIE() && contains$3(combinedPlugins, 'rtc')) {
- throw new Error('RTC plugin is not supported on IE 11.');
- }
- return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
- };
- var isOnMobile = function (isMobileDevice, sectionResult) {
- return isMobileDevice && hasSection(sectionResult, 'mobile');
- };
- var combineSettings = function (isMobileDevice, isPhone, defaultSettings, defaultOverrideSettings, settings) {
- var defaultDeviceSettings = isMobileDevice ? { mobile: getDefaultMobileSettings(settings.mobile || {}, isPhone) } : {};
- var sectionResult = extractSections(['mobile'], deepMerge(defaultDeviceSettings, settings));
- var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isMobileDevice, sectionResult) ? getSection(sectionResult, 'mobile') : {}, {
- validate: true,
- external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
- });
- return processPlugins(isMobileDevice, sectionResult, defaultOverrideSettings, extendedSettings);
- };
- var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
- var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor);
- var finalSettings = combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings);
- if (finalSettings.deprecation_warnings !== false) {
- logDeprecationsWarning(settings, finalSettings);
- }
- return finalSettings;
- };
- var getFiltered = function (predicate, editor, name) {
- return Optional.from(editor.settings[name]).filter(predicate);
- };
- var getParamObject = function (value) {
- var output = {};
- if (typeof value === 'string') {
- each$k(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
- var arr = val.split('=');
- if (arr.length > 1) {
- output[Tools.trim(arr[0])] = Tools.trim(arr[1]);
- } else {
- output[Tools.trim(arr[0])] = Tools.trim(arr[0]);
- }
- });
- } else {
- output = value;
- }
- return output;
- };
- var isArrayOf = function (p) {
- return function (a) {
- return isArray$1(a) && forall(a, p);
- };
- };
- var getParam = function (editor, name, defaultVal, type) {
- var value = name in editor.settings ? editor.settings[name] : defaultVal;
- if (type === 'hash') {
- return getParamObject(value);
- } else if (type === 'string') {
- return getFiltered(isString$1, editor, name).getOr(defaultVal);
- } else if (type === 'number') {
- return getFiltered(isNumber, editor, name).getOr(defaultVal);
- } else if (type === 'boolean') {
- return getFiltered(isBoolean, editor, name).getOr(defaultVal);
- } else if (type === 'object') {
- return getFiltered(isObject, editor, name).getOr(defaultVal);
- } else if (type === 'array') {
- return getFiltered(isArray$1, editor, name).getOr(defaultVal);
- } else if (type === 'string[]') {
- return getFiltered(isArrayOf(isString$1), editor, name).getOr(defaultVal);
- } else if (type === 'function') {
- return getFiltered(isFunction, editor, name).getOr(defaultVal);
- } else {
- return value;
- }
- };
- var CreateIconManager = function () {
- var lookup = {};
- var add = function (id, iconPack) {
- lookup[id] = iconPack;
- };
- var get = function (id) {
- if (lookup[id]) {
- return lookup[id];
- }
- return { icons: {} };
- };
- var has = function (id) {
- return has$2(lookup, id);
- };
- return {
- add: add,
- get: get,
- has: has
- };
- };
- var IconManager = CreateIconManager();
- var getProp = function (propName, elm) {
- var rawElm = elm.dom;
- return rawElm[propName];
- };
- var getComputedSizeProp = function (propName, elm) {
- return parseInt(get$5(elm, propName), 10);
- };
- var getClientWidth = curry(getProp, 'clientWidth');
- var getClientHeight = curry(getProp, 'clientHeight');
- var getMarginTop = curry(getComputedSizeProp, 'margin-top');
- var getMarginLeft = curry(getComputedSizeProp, 'margin-left');
- var getBoundingClientRect = function (elm) {
- return elm.dom.getBoundingClientRect();
- };
- var isInsideElementContentArea = function (bodyElm, clientX, clientY) {
- var clientWidth = getClientWidth(bodyElm);
- var clientHeight = getClientHeight(bodyElm);
- return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight;
- };
- var transpose = function (inline, elm, clientX, clientY) {
- var clientRect = getBoundingClientRect(elm);
- var deltaX = inline ? clientRect.left + elm.dom.clientLeft + getMarginLeft(elm) : 0;
- var deltaY = inline ? clientRect.top + elm.dom.clientTop + getMarginTop(elm) : 0;
- var x = clientX - deltaX;
- var y = clientY - deltaY;
- return {
- x: x,
- y: y
- };
- };
- var isXYInContentArea = function (editor, clientX, clientY) {
- var bodyElm = SugarElement.fromDom(editor.getBody());
- var targetElm = editor.inline ? bodyElm : documentElement(bodyElm);
- var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY);
- return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y);
- };
- var fromDomSafe = function (node) {
- return Optional.from(node).map(SugarElement.fromDom);
- };
- var isEditorAttachedToDom = function (editor) {
- var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer();
- return fromDomSafe(rawContainer).map(inBody).getOr(false);
- };
- var NotificationManagerImpl = function () {
- var unimplemented = function () {
- throw new Error('Theme did not provide a NotificationManager implementation.');
- };
- return {
- open: unimplemented,
- close: unimplemented,
- reposition: unimplemented,
- getArgs: unimplemented
- };
- };
- var NotificationManager = function (editor) {
- var notifications = [];
- var getImplementation = function () {
- var theme = editor.theme;
- return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl();
- };
- var getTopNotification = function () {
- return Optional.from(notifications[0]);
- };
- var isEqual = function (a, b) {
- return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout;
- };
- var reposition = function () {
- if (notifications.length > 0) {
- getImplementation().reposition(notifications);
- }
- };
- var addNotification = function (notification) {
- notifications.push(notification);
- };
- var closeNotification = function (notification) {
- findIndex$2(notifications, function (otherNotification) {
- return otherNotification === notification;
- }).each(function (index) {
- notifications.splice(index, 1);
- });
- };
- var open = function (spec, fireEvent) {
- if (fireEvent === void 0) {
- fireEvent = true;
- }
- if (editor.removed || !isEditorAttachedToDom(editor)) {
- return;
- }
- if (fireEvent) {
- editor.fire('BeforeOpenNotification', { notification: spec });
- }
- return find$3(notifications, function (notification) {
- return isEqual(getImplementation().getArgs(notification), spec);
- }).getOrThunk(function () {
- editor.editorManager.setActive(editor);
- var notification = getImplementation().open(spec, function () {
- closeNotification(notification);
- reposition();
- getTopNotification().fold(function () {
- return editor.focus();
- }, function (top) {
- return focus$1(SugarElement.fromDom(top.getEl()));
- });
- });
- addNotification(notification);
- reposition();
- editor.fire('OpenNotification', { notification: __assign({}, notification) });
- return notification;
- });
- };
- var close = function () {
- getTopNotification().each(function (notification) {
- getImplementation().close(notification);
- closeNotification(notification);
- reposition();
- });
- };
- var getNotifications = constant(notifications);
- var registerEvents = function (editor) {
- editor.on('SkinLoaded', function () {
- var serviceMessage = getServiceMessage(editor);
- if (serviceMessage) {
- open({
- text: serviceMessage,
- type: 'warning',
- timeout: 0
- }, false);
- }
- reposition();
- });
- editor.on('show ResizeEditor ResizeWindow NodeChange', function () {
- Delay.requestAnimationFrame(reposition);
- });
- editor.on('remove', function () {
- each$k(notifications.slice(), function (notification) {
- getImplementation().close(notification);
- });
- });
- };
- registerEvents(editor);
- return {
- open: open,
- close: close,
- getNotifications: getNotifications
- };
- };
- var PluginManager = AddOnManager.PluginManager;
- var ThemeManager = AddOnManager.ThemeManager;
- function WindowManagerImpl () {
- var unimplemented = function () {
- throw new Error('Theme did not provide a WindowManager implementation.');
- };
- return {
- open: unimplemented,
- openUrl: unimplemented,
- alert: unimplemented,
- confirm: unimplemented,
- close: unimplemented,
- getParams: unimplemented,
- setParams: unimplemented
- };
- }
- var WindowManager = function (editor) {
- var dialogs = [];
- var getImplementation = function () {
- var theme = editor.theme;
- return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl();
- };
- var funcBind = function (scope, f) {
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return f ? f.apply(scope, args) : undefined;
- };
- };
- var fireOpenEvent = function (dialog) {
- editor.fire('OpenWindow', { dialog: dialog });
- };
- var fireCloseEvent = function (dialog) {
- editor.fire('CloseWindow', { dialog: dialog });
- };
- var addDialog = function (dialog) {
- dialogs.push(dialog);
- fireOpenEvent(dialog);
- };
- var closeDialog = function (dialog) {
- fireCloseEvent(dialog);
- dialogs = filter$4(dialogs, function (otherDialog) {
- return otherDialog !== dialog;
- });
- if (dialogs.length === 0) {
- editor.focus();
- }
- };
- var getTopDialog = function () {
- return Optional.from(dialogs[dialogs.length - 1]);
- };
- var storeSelectionAndOpenDialog = function (openDialog) {
- editor.editorManager.setActive(editor);
- store(editor);
- var dialog = openDialog();
- addDialog(dialog);
- return dialog;
- };
- var open = function (args, params) {
- return storeSelectionAndOpenDialog(function () {
- return getImplementation().open(args, params, closeDialog);
- });
- };
- var openUrl = function (args) {
- return storeSelectionAndOpenDialog(function () {
- return getImplementation().openUrl(args, closeDialog);
- });
- };
- var alert = function (message, callback, scope) {
- var windowManagerImpl = getImplementation();
- windowManagerImpl.alert(message, funcBind(scope ? scope : windowManagerImpl, callback));
- };
- var confirm = function (message, callback, scope) {
- var windowManagerImpl = getImplementation();
- windowManagerImpl.confirm(message, funcBind(scope ? scope : windowManagerImpl, callback));
- };
- var close = function () {
- getTopDialog().each(function (dialog) {
- getImplementation().close(dialog);
- closeDialog(dialog);
- });
- };
- editor.on('remove', function () {
- each$k(dialogs, function (dialog) {
- getImplementation().close(dialog);
- });
- });
- return {
- open: open,
- openUrl: openUrl,
- alert: alert,
- confirm: confirm,
- close: close
- };
- };
- var displayNotification = function (editor, message) {
- editor.notificationManager.open({
- type: 'error',
- text: message
- });
- };
- var displayError = function (editor, message) {
- if (editor._skinLoaded) {
- displayNotification(editor, message);
- } else {
- editor.on('SkinLoaded', function () {
- displayNotification(editor, message);
- });
- }
- };
- var uploadError = function (editor, message) {
- displayError(editor, I18n.translate([
- 'Failed to upload image: {0}',
- message
- ]));
- };
- var logError = function (editor, errorType, msg) {
- fireError(editor, errorType, { message: msg });
- console.error(msg);
- };
- var createLoadError = function (type, url, name) {
- return name ? 'Failed to load ' + type + ': ' + name + ' from url ' + url : 'Failed to load ' + type + ' url: ' + url;
- };
- var pluginLoadError = function (editor, url, name) {
- logError(editor, 'PluginLoadError', createLoadError('plugin', url, name));
- };
- var iconsLoadError = function (editor, url, name) {
- logError(editor, 'IconsLoadError', createLoadError('icons', url, name));
- };
- var languageLoadError = function (editor, url, name) {
- logError(editor, 'LanguageLoadError', createLoadError('language', url, name));
- };
- var pluginInitError = function (editor, name, err) {
- var message = I18n.translate([
- 'Failed to initialize plugin: {0}',
- name
- ]);
- fireError(editor, 'PluginLoadError', { message: message });
- initError(message, err);
- displayError(editor, message);
- };
- var initError = function (message) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var console = window.console;
- if (console) {
- if (console.error) {
- console.error.apply(console, __spreadArray([message], x, false));
- } else {
- console.log.apply(console, __spreadArray([message], x, false));
- }
- }
- };
- var isContentCssSkinName = function (url) {
- return /^[a-z0-9\-]+$/i.test(url);
- };
- var getContentCssUrls = function (editor) {
- return transformToUrls(editor, getContentCss(editor));
- };
- var getFontCssUrls = function (editor) {
- return transformToUrls(editor, getFontCss(editor));
- };
- var transformToUrls = function (editor, cssLinks) {
- var skinUrl = editor.editorManager.baseURL + '/skins/content';
- var suffix = editor.editorManager.suffix;
- var contentCssFile = 'content' + suffix + '.css';
- var inline = editor.inline === true;
- return map$3(cssLinks, function (url) {
- if (isContentCssSkinName(url) && !inline) {
- return skinUrl + '/' + url + '/' + contentCssFile;
- } else {
- return editor.documentBaseURI.toAbsolute(url);
- }
- });
- };
- var appendContentCssFromSettings = function (editor) {
- editor.contentCSS = editor.contentCSS.concat(getContentCssUrls(editor), getFontCssUrls(editor));
- };
- var UploadStatus = function () {
- var PENDING = 1, UPLOADED = 2;
- var blobUriStatuses = {};
- var createStatus = function (status, resultUri) {
- return {
- status: status,
- resultUri: resultUri
- };
- };
- var hasBlobUri = function (blobUri) {
- return blobUri in blobUriStatuses;
- };
- var getResultUri = function (blobUri) {
- var result = blobUriStatuses[blobUri];
- return result ? result.resultUri : null;
- };
- var isPending = function (blobUri) {
- return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false;
- };
- var isUploaded = function (blobUri) {
- return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false;
- };
- var markPending = function (blobUri) {
- blobUriStatuses[blobUri] = createStatus(PENDING, null);
- };
- var markUploaded = function (blobUri, resultUri) {
- blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri);
- };
- var removeFailed = function (blobUri) {
- delete blobUriStatuses[blobUri];
- };
- var destroy = function () {
- blobUriStatuses = {};
- };
- return {
- hasBlobUri: hasBlobUri,
- getResultUri: getResultUri,
- isPending: isPending,
- isUploaded: isUploaded,
- markPending: markPending,
- markUploaded: markUploaded,
- removeFailed: removeFailed,
- destroy: destroy
- };
- };
- var count = 0;
- var seed = function () {
- var rnd = function () {
- return Math.round(Math.random() * 4294967295).toString(36);
- };
- var now = new Date().getTime();
- return 's' + now.toString(36) + rnd() + rnd() + rnd();
- };
- var uuid = function (prefix) {
- return prefix + count++ + seed();
- };
- var BlobCache = function () {
- var cache = [];
- var mimeToExt = function (mime) {
- var mimes = {
- 'image/jpeg': 'jpg',
- 'image/jpg': 'jpg',
- 'image/gif': 'gif',
- 'image/png': 'png',
- 'image/apng': 'apng',
- 'image/avif': 'avif',
- 'image/svg+xml': 'svg',
- 'image/webp': 'webp',
- 'image/bmp': 'bmp',
- 'image/tiff': 'tiff'
- };
- return mimes[mime.toLowerCase()] || 'dat';
- };
- var create = function (o, blob, base64, name, filename) {
- if (isString$1(o)) {
- var id = o;
- return toBlobInfo({
- id: id,
- name: name,
- filename: filename,
- blob: blob,
- base64: base64
- });
- } else if (isObject(o)) {
- return toBlobInfo(o);
- } else {
- throw new Error('Unknown input type');
- }
- };
- var toBlobInfo = function (o) {
- if (!o.blob || !o.base64) {
- throw new Error('blob and base64 representations of the image are required for BlobInfo to be created');
- }
- var id = o.id || uuid('blobid');
- var name = o.name || id;
- var blob = o.blob;
- return {
- id: constant(id),
- name: constant(name),
- filename: constant(o.filename || name + '.' + mimeToExt(blob.type)),
- blob: constant(blob),
- base64: constant(o.base64),
- blobUri: constant(o.blobUri || URL.createObjectURL(blob)),
- uri: constant(o.uri)
- };
- };
- var add = function (blobInfo) {
- if (!get(blobInfo.id())) {
- cache.push(blobInfo);
- }
- };
- var findFirst = function (predicate) {
- return find$3(cache, predicate).getOrUndefined();
- };
- var get = function (id) {
- return findFirst(function (cachedBlobInfo) {
- return cachedBlobInfo.id() === id;
- });
- };
- var getByUri = function (blobUri) {
- return findFirst(function (blobInfo) {
- return blobInfo.blobUri() === blobUri;
- });
- };
- var getByData = function (base64, type) {
- return findFirst(function (blobInfo) {
- return blobInfo.base64() === base64 && blobInfo.blob().type === type;
- });
- };
- var removeByUri = function (blobUri) {
- cache = filter$4(cache, function (blobInfo) {
- if (blobInfo.blobUri() === blobUri) {
- URL.revokeObjectURL(blobInfo.blobUri());
- return false;
- }
- return true;
- });
- };
- var destroy = function () {
- each$k(cache, function (cachedBlobInfo) {
- URL.revokeObjectURL(cachedBlobInfo.blobUri());
- });
- cache = [];
- };
- return {
- create: create,
- add: add,
- get: get,
- getByUri: getByUri,
- getByData: getByData,
- findFirst: findFirst,
- removeByUri: removeByUri,
- destroy: destroy
- };
- };
- var Uploader = function (uploadStatus, settings) {
- var pendingPromises = {};
- var pathJoin = function (path1, path2) {
- if (path1) {
- return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
- }
- return path2;
- };
- var defaultHandler = function (blobInfo, success, failure, progress) {
- var xhr = new XMLHttpRequest();
- xhr.open('POST', settings.url);
- xhr.withCredentials = settings.credentials;
- xhr.upload.onprogress = function (e) {
- progress(e.loaded / e.total * 100);
- };
- xhr.onerror = function () {
- failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
- };
- xhr.onload = function () {
- if (xhr.status < 200 || xhr.status >= 300) {
- failure('HTTP Error: ' + xhr.status);
- return;
- }
- var json = JSON.parse(xhr.responseText);
- if (!json || typeof json.location !== 'string') {
- failure('Invalid JSON: ' + xhr.responseText);
- return;
- }
- success(pathJoin(settings.basePath, json.location));
- };
- var formData = new FormData();
- formData.append('file', blobInfo.blob(), blobInfo.filename());
- xhr.send(formData);
- };
- var noUpload = function () {
- return new promiseObj(function (resolve) {
- resolve([]);
- });
- };
- var handlerSuccess = function (blobInfo, url) {
- return {
- url: url,
- blobInfo: blobInfo,
- status: true
- };
- };
- var handlerFailure = function (blobInfo, message, options) {
- return {
- url: '',
- blobInfo: blobInfo,
- status: false,
- error: {
- message: message,
- options: options
- }
- };
- };
- var resolvePending = function (blobUri, result) {
- Tools.each(pendingPromises[blobUri], function (resolve) {
- resolve(result);
- });
- delete pendingPromises[blobUri];
- };
- var uploadBlobInfo = function (blobInfo, handler, openNotification) {
- uploadStatus.markPending(blobInfo.blobUri());
- return new promiseObj(function (resolve) {
- var notification, progress;
- try {
- var closeNotification_1 = function () {
- if (notification) {
- notification.close();
- progress = noop;
- }
- };
- var success = function (url) {
- closeNotification_1();
- uploadStatus.markUploaded(blobInfo.blobUri(), url);
- resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url));
- resolve(handlerSuccess(blobInfo, url));
- };
- var failure = function (error, options) {
- var failureOptions = options ? options : {};
- closeNotification_1();
- uploadStatus.removeFailed(blobInfo.blobUri());
- resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error, failureOptions));
- resolve(handlerFailure(blobInfo, error, failureOptions));
- };
- progress = function (percent) {
- if (percent < 0 || percent > 100) {
- return;
- }
- Optional.from(notification).orThunk(function () {
- return Optional.from(openNotification).map(apply);
- }).each(function (n) {
- notification = n;
- n.progressBar.value(percent);
- });
- };
- handler(blobInfo, success, failure, progress);
- } catch (ex) {
- resolve(handlerFailure(blobInfo, ex.message, {}));
- }
- });
- };
- var isDefaultHandler = function (handler) {
- return handler === defaultHandler;
- };
- var pendingUploadBlobInfo = function (blobInfo) {
- var blobUri = blobInfo.blobUri();
- return new promiseObj(function (resolve) {
- pendingPromises[blobUri] = pendingPromises[blobUri] || [];
- pendingPromises[blobUri].push(resolve);
- });
- };
- var uploadBlobs = function (blobInfos, openNotification) {
- blobInfos = Tools.grep(blobInfos, function (blobInfo) {
- return !uploadStatus.isUploaded(blobInfo.blobUri());
- });
- return promiseObj.all(Tools.map(blobInfos, function (blobInfo) {
- return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification);
- }));
- };
- var upload = function (blobInfos, openNotification) {
- return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification);
- };
- if (isFunction(settings.handler) === false) {
- settings.handler = defaultHandler;
- }
- return { upload: upload };
- };
- var openNotification = function (editor) {
- return function () {
- return editor.notificationManager.open({
- text: editor.translate('Image uploading...'),
- type: 'info',
- timeout: -1,
- progressBar: true
- });
- };
- };
- var createUploader = function (editor, uploadStatus) {
- return Uploader(uploadStatus, {
- url: getImageUploadUrl(editor),
- basePath: getImageUploadBasePath(editor),
- credentials: getImagesUploadCredentials(editor),
- handler: getImagesUploadHandler(editor)
- });
- };
- var ImageUploader = function (editor) {
- var uploadStatus = UploadStatus();
- var uploader = createUploader(editor, uploadStatus);
- return {
- upload: function (blobInfos, showNotification) {
- if (showNotification === void 0) {
- showNotification = true;
- }
- return uploader.upload(blobInfos, showNotification ? openNotification(editor) : undefined);
- }
- };
- };
- var UploadChangeHandler = function (editor) {
- var lastChangedLevel = Cell(null);
- editor.on('change AddUndo', function (e) {
- lastChangedLevel.set(__assign({}, e.level));
- });
- var fireIfChanged = function () {
- var data = editor.undoManager.data;
- last$2(data).filter(function (level) {
- return !isEq$1(lastChangedLevel.get(), level);
- }).each(function (level) {
- editor.setDirty(true);
- editor.fire('change', {
- level: level,
- lastLevel: get$a(data, data.length - 2).getOrNull()
- });
- });
- };
- return { fireIfChanged: fireIfChanged };
- };
- var EditorUpload = function (editor) {
- var blobCache = BlobCache();
- var uploader, imageScanner;
- var uploadStatus = UploadStatus();
- var urlFilters = [];
- var changeHandler = UploadChangeHandler(editor);
- var aliveGuard = function (callback) {
- return function (result) {
- if (editor.selection) {
- return callback(result);
- }
- return [];
- };
- };
- var cacheInvalidator = function (url) {
- return url + (url.indexOf('?') === -1 ? '?' : '&') + new Date().getTime();
- };
- var replaceString = function (content, search, replace) {
- var index = 0;
- do {
- index = content.indexOf(search, index);
- if (index !== -1) {
- content = content.substring(0, index) + replace + content.substr(index + search.length);
- index += replace.length - search.length + 1;
- }
- } while (index !== -1);
- return content;
- };
- var replaceImageUrl = function (content, targetUrl, replacementUrl) {
- var replacementString = 'src="' + replacementUrl + '"' + (replacementUrl === Env.transparentSrc ? ' data-mce-placeholder="1"' : '');
- content = replaceString(content, 'src="' + targetUrl + '"', replacementString);
- content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
- return content;
- };
- var replaceUrlInUndoStack = function (targetUrl, replacementUrl) {
- each$k(editor.undoManager.data, function (level) {
- if (level.type === 'fragmented') {
- level.fragments = map$3(level.fragments, function (fragment) {
- return replaceImageUrl(fragment, targetUrl, replacementUrl);
- });
- } else {
- level.content = replaceImageUrl(level.content, targetUrl, replacementUrl);
- }
- });
- };
- var replaceImageUriInView = function (image, resultUri) {
- var src = editor.convertURL(resultUri, 'src');
- replaceUrlInUndoStack(image.src, resultUri);
- editor.$(image).attr({
- 'src': shouldReuseFileName(editor) ? cacheInvalidator(resultUri) : resultUri,
- 'data-mce-src': src
- });
- };
- var uploadImages = function (callback) {
- if (!uploader) {
- uploader = createUploader(editor, uploadStatus);
- }
- return scanForImages().then(aliveGuard(function (imageInfos) {
- var blobInfos = map$3(imageInfos, function (imageInfo) {
- return imageInfo.blobInfo;
- });
- return uploader.upload(blobInfos, openNotification(editor)).then(aliveGuard(function (result) {
- var imagesToRemove = [];
- var filteredResult = map$3(result, function (uploadInfo, index) {
- var blobInfo = imageInfos[index].blobInfo;
- var image = imageInfos[index].image;
- if (uploadInfo.status && shouldReplaceBlobUris(editor)) {
- blobCache.removeByUri(image.src);
- if (isRtc(editor)) ; else {
- replaceImageUriInView(image, uploadInfo.url);
- }
- } else if (uploadInfo.error) {
- if (uploadInfo.error.options.remove) {
- replaceUrlInUndoStack(image.getAttribute('src'), Env.transparentSrc);
- imagesToRemove.push(image);
- }
- uploadError(editor, uploadInfo.error.message);
- }
- return {
- element: image,
- status: uploadInfo.status,
- uploadUri: uploadInfo.url,
- blobInfo: blobInfo
- };
- });
- if (filteredResult.length > 0) {
- changeHandler.fireIfChanged();
- }
- if (imagesToRemove.length > 0) {
- if (isRtc(editor)) {
- console.error('Removing images on failed uploads is currently unsupported for RTC');
- } else {
- editor.undoManager.transact(function () {
- each$k(imagesToRemove, function (element) {
- editor.dom.remove(element);
- blobCache.removeByUri(element.src);
- });
- });
- }
- }
- if (callback) {
- callback(filteredResult);
- }
- return filteredResult;
- }));
- }));
- };
- var uploadImagesAuto = function (callback) {
- if (isAutomaticUploadsEnabled(editor)) {
- return uploadImages(callback);
- }
- };
- var isValidDataUriImage = function (imgElm) {
- if (forall(urlFilters, function (filter) {
- return filter(imgElm);
- }) === false) {
- return false;
- }
- if (imgElm.getAttribute('src').indexOf('data:') === 0) {
- var dataImgFilter = getImagesDataImgFilter(editor);
- return dataImgFilter(imgElm);
- }
- return true;
- };
- var addFilter = function (filter) {
- urlFilters.push(filter);
- };
- var scanForImages = function () {
- if (!imageScanner) {
- imageScanner = ImageScanner(uploadStatus, blobCache);
- }
- return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) {
- result = filter$4(result, function (resultItem) {
- if (typeof resultItem === 'string') {
- displayError(editor, resultItem);
- return false;
- }
- return true;
- });
- if (isRtc(editor)) ; else {
- each$k(result, function (resultItem) {
- replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());
- resultItem.image.src = resultItem.blobInfo.blobUri();
- resultItem.image.removeAttribute('data-mce-src');
- });
- }
- return result;
- }));
- };
- var destroy = function () {
- blobCache.destroy();
- uploadStatus.destroy();
- imageScanner = uploader = null;
- };
- var replaceBlobUris = function (content) {
- return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) {
- var resultUri = uploadStatus.getResultUri(blobUri);
- if (resultUri) {
- return 'src="' + resultUri + '"';
- }
- var blobInfo = blobCache.getByUri(blobUri);
- if (!blobInfo) {
- blobInfo = foldl(editor.editorManager.get(), function (result, editor) {
- return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri);
- }, null);
- }
- if (blobInfo) {
- var blob = blobInfo.blob();
- return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"';
- }
- return match;
- });
- };
- editor.on('SetContent', function () {
- if (isAutomaticUploadsEnabled(editor)) {
- uploadImagesAuto();
- } else {
- scanForImages();
- }
- });
- editor.on('RawSaveContent', function (e) {
- e.content = replaceBlobUris(e.content);
- });
- editor.on('GetContent', function (e) {
- if (e.source_view || e.format === 'raw' || e.format === 'tree') {
- return;
- }
- e.content = replaceBlobUris(e.content);
- });
- editor.on('PostRender', function () {
- editor.parser.addNodeFilter('img', function (images) {
- each$k(images, function (img) {
- var src = img.attr('src');
- if (blobCache.getByUri(src)) {
- return;
- }
- var resultUri = uploadStatus.getResultUri(src);
- if (resultUri) {
- img.attr('src', resultUri);
- }
- });
- });
- });
- return {
- blobCache: blobCache,
- addFilter: addFilter,
- uploadImages: uploadImages,
- uploadImagesAuto: uploadImagesAuto,
- scanForImages: scanForImages,
- destroy: destroy
- };
- };
- var get = function (dom) {
- var formats = {
- valigntop: [{
- selector: 'td,th',
- styles: { verticalAlign: 'top' }
- }],
- valignmiddle: [{
- selector: 'td,th',
- styles: { verticalAlign: 'middle' }
- }],
- valignbottom: [{
- selector: 'td,th',
- styles: { verticalAlign: 'bottom' }
- }],
- alignleft: [
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-left',
- ceFalseOverride: true,
- preview: 'font-family font-size'
- },
- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'left' },
- inherit: false,
- preview: false,
- defaultBlock: 'div'
- },
- {
- selector: 'img,table,audio,video',
- collapsed: false,
- styles: { float: 'left' },
- preview: 'font-family font-size'
- }
- ],
- aligncenter: [
- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'center' },
- inherit: false,
- preview: 'font-family font-size',
- defaultBlock: 'div'
- },
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-center',
- ceFalseOverride: true,
- preview: 'font-family font-size'
- },
- {
- selector: 'img,audio,video',
- collapsed: false,
- styles: {
- display: 'block',
- marginLeft: 'auto',
- marginRight: 'auto'
- },
- preview: false
- },
- {
- selector: 'table',
- collapsed: false,
- styles: {
- marginLeft: 'auto',
- marginRight: 'auto'
- },
- preview: 'font-family font-size'
- }
- ],
- alignright: [
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-right',
- ceFalseOverride: true,
- preview: 'font-family font-size'
- },
- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'right' },
- inherit: false,
- preview: 'font-family font-size',
- defaultBlock: 'div'
- },
- {
- selector: 'img,table,audio,video',
- collapsed: false,
- styles: { float: 'right' },
- preview: 'font-family font-size'
- }
- ],
- alignjustify: [{
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'justify' },
- inherit: false,
- defaultBlock: 'div',
- preview: 'font-family font-size'
- }],
- bold: [
- {
- inline: 'strong',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- },
- {
- inline: 'span',
- styles: { fontWeight: 'bold' }
- },
- {
- inline: 'b',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- }
- ],
- italic: [
- {
- inline: 'em',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- },
- {
- inline: 'span',
- styles: { fontStyle: 'italic' }
- },
- {
- inline: 'i',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- }
- ],
- underline: [
- {
- inline: 'span',
- styles: { textDecoration: 'underline' },
- exact: true
- },
- {
- inline: 'u',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- }
- ],
- strikethrough: [
- {
- inline: 'span',
- styles: { textDecoration: 'line-through' },
- exact: true
- },
- {
- inline: 'strike',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- },
- {
- inline: 's',
- remove: 'all',
- preserve_attributes: [
- 'class',
- 'style'
- ]
- }
- ],
- forecolor: {
- inline: 'span',
- styles: { color: '%value' },
- links: true,
- remove_similar: true,
- clear_child_styles: true
- },
- hilitecolor: {
- inline: 'span',
- styles: { backgroundColor: '%value' },
- links: true,
- remove_similar: true,
- clear_child_styles: true
- },
- fontname: {
- inline: 'span',
- toggle: false,
- styles: { fontFamily: '%value' },
- clear_child_styles: true
- },
- fontsize: {
- inline: 'span',
- toggle: false,
- styles: { fontSize: '%value' },
- clear_child_styles: true
- },
- lineheight: {
- selector: 'h1,h2,h3,h4,h5,h6,p,li,td,th,div',
- defaultBlock: 'p',
- styles: { lineHeight: '%value' }
- },
- fontsize_class: {
- inline: 'span',
- attributes: { class: '%value' }
- },
- blockquote: {
- block: 'blockquote',
- wrapper: true,
- remove: 'all'
- },
- subscript: { inline: 'sub' },
- superscript: { inline: 'sup' },
- code: { inline: 'code' },
- link: {
- inline: 'a',
- selector: 'a',
- remove: 'all',
- split: true,
- deep: true,
- onmatch: function (node, _fmt, _itemName) {
- return isElement$5(node) && node.hasAttribute('href');
- },
- onformat: function (elm, _fmt, vars) {
- Tools.each(vars, function (value, key) {
- dom.setAttrib(elm, key, value);
- });
- }
- },
- lang: {
- inline: 'span',
- clear_child_styles: true,
- remove_similar: true,
- attributes: {
- 'lang': '%value',
- 'data-mce-lang': function (vars) {
- var _a;
- return (_a = vars === null || vars === void 0 ? void 0 : vars.customValue) !== null && _a !== void 0 ? _a : null;
- }
- }
- },
- removeformat: [
- {
- selector: 'b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small',
- remove: 'all',
- split: true,
- expand: false,
- block_expand: true,
- deep: true
- },
- {
- selector: 'span',
- attributes: [
- 'style',
- 'class'
- ],
- remove: 'empty',
- split: true,
- expand: false,
- deep: true
- },
- {
- selector: '*',
- attributes: [
- 'style',
- 'class'
- ],
- split: false,
- expand: false,
- deep: true
- }
- ]
- };
- Tools.each('p h1 h2 h3 h4 h5 h6 div address pre dt dd samp'.split(/\s/), function (name) {
- formats[name] = {
- block: name,
- remove: 'all'
- };
- });
- return formats;
- };
- var FormatRegistry = function (editor) {
- var formats = {};
- var get$1 = function (name) {
- return isNonNullable(name) ? formats[name] : formats;
- };
- var has = function (name) {
- return has$2(formats, name);
- };
- var register = function (name, format) {
- if (name) {
- if (!isString$1(name)) {
- each$j(name, function (format, name) {
- register(name, format);
- });
- } else {
- if (!isArray$1(format)) {
- format = [format];
- }
- each$k(format, function (format) {
- if (isUndefined(format.deep)) {
- format.deep = !isSelectorFormat(format);
- }
- if (isUndefined(format.split)) {
- format.split = !isSelectorFormat(format) || isInlineFormat(format);
- }
- if (isUndefined(format.remove) && isSelectorFormat(format) && !isInlineFormat(format)) {
- format.remove = 'none';
- }
- if (isSelectorFormat(format) && isInlineFormat(format)) {
- format.mixed = true;
- format.block_expand = true;
- }
- if (isString$1(format.classes)) {
- format.classes = format.classes.split(/\s+/);
- }
- });
- formats[name] = format;
- }
- }
- };
- var unregister = function (name) {
- if (name && formats[name]) {
- delete formats[name];
- }
- return formats;
- };
- register(get(editor.dom));
- register(getFormats(editor));
- return {
- get: get$1,
- has: has,
- register: register,
- unregister: unregister
- };
- };
- var each$5 = Tools.each;
- var dom = DOMUtils.DOM;
- var parsedSelectorToHtml = function (ancestry, editor) {
- var elm, item, fragment;
- var schema = editor && editor.schema || Schema({});
- var decorate = function (elm, item) {
- if (item.classes.length) {
- dom.addClass(elm, item.classes.join(' '));
- }
- dom.setAttribs(elm, item.attrs);
- };
- var createElement = function (sItem) {
- item = typeof sItem === 'string' ? {
- name: sItem,
- classes: [],
- attrs: {}
- } : sItem;
- var elm = dom.create(item.name);
- decorate(elm, item);
- return elm;
- };
- var getRequiredParent = function (elm, candidate) {
- var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm;
- var elmRule = schema.getElementRule(name);
- var parentsRequired = elmRule && elmRule.parentsRequired;
- if (parentsRequired && parentsRequired.length) {
- return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0];
- } else {
- return false;
- }
- };
- var wrapInHtml = function (elm, ancestry, siblings) {
- var parent, parentCandidate;
- var ancestor = ancestry.length > 0 && ancestry[0];
- var ancestorName = ancestor && ancestor.name;
- var parentRequired = getRequiredParent(elm, ancestorName);
- if (parentRequired) {
- if (ancestorName === parentRequired) {
- parentCandidate = ancestry[0];
- ancestry = ancestry.slice(1);
- } else {
- parentCandidate = parentRequired;
- }
- } else if (ancestor) {
- parentCandidate = ancestry[0];
- ancestry = ancestry.slice(1);
- } else if (!siblings) {
- return elm;
- }
- if (parentCandidate) {
- parent = createElement(parentCandidate);
- parent.appendChild(elm);
- }
- if (siblings) {
- if (!parent) {
- parent = dom.create('div');
- parent.appendChild(elm);
- }
- Tools.each(siblings, function (sibling) {
- var siblingElm = createElement(sibling);
- parent.insertBefore(siblingElm, elm);
- });
- }
- return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings);
- };
- if (ancestry && ancestry.length) {
- item = ancestry[0];
- elm = createElement(item);
- fragment = dom.create('div');
- fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings));
- return fragment;
- } else {
- return '';
- }
- };
- var parseSelectorItem = function (item) {
- var tagName;
- var obj = {
- classes: [],
- attrs: {}
- };
- item = obj.selector = Tools.trim(item);
- if (item !== '*') {
- tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) {
- switch ($1) {
- case '#':
- obj.attrs.id = $2;
- break;
- case '.':
- obj.classes.push($2);
- break;
- case ':':
- if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) {
- obj.attrs[$2] = $2;
- }
- break;
- }
- if ($3 === '[') {
- var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/);
- if (m) {
- obj.attrs[m[1]] = m[2];
- }
- }
- return '';
- });
- }
- obj.name = tagName || 'div';
- return obj;
- };
- var parseSelector = function (selector) {
- if (!selector || typeof selector !== 'string') {
- return [];
- }
- selector = selector.split(/\s*,\s*/)[0];
- selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1');
- return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) {
- var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem);
- var obj = siblings.pop();
- if (siblings.length) {
- obj.siblings = siblings;
- }
- return obj;
- }).reverse();
- };
- var getCssText = function (editor, format) {
- var name, previewFrag;
- var previewCss = '', parentFontSize;
- var previewStyles = getPreviewStyles(editor);
- if (previewStyles === '') {
- return '';
- }
- var removeVars = function (val) {
- return val.replace(/%(\w+)/g, '');
- };
- if (typeof format === 'string') {
- format = editor.formatter.get(format);
- if (!format) {
- return;
- }
- format = format[0];
- }
- if ('preview' in format) {
- var previewOpt = get$9(format, 'preview');
- if (is$1(previewOpt, false)) {
- return '';
- } else {
- previewStyles = previewOpt.getOr(previewStyles);
- }
- }
- name = format.block || format.inline || 'span';
- var items = parseSelector(format.selector);
- if (items.length) {
- if (!items[0].name) {
- items[0].name = name;
- }
- name = format.selector;
- previewFrag = parsedSelectorToHtml(items, editor);
- } else {
- previewFrag = parsedSelectorToHtml([name], editor);
- }
- var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
- each$5(format.styles, function (value, name) {
- var newValue = removeVars(value);
- if (newValue) {
- dom.setStyle(previewElm, name, newValue);
- }
- });
- each$5(format.attributes, function (value, name) {
- var newValue = removeVars(value);
- if (newValue) {
- dom.setAttrib(previewElm, name, newValue);
- }
- });
- each$5(format.classes, function (value) {
- var newValue = removeVars(value);
- if (!dom.hasClass(previewElm, newValue)) {
- dom.addClass(previewElm, newValue);
- }
- });
- editor.fire('PreviewFormats');
- dom.setStyles(previewFrag, {
- position: 'absolute',
- left: -65535
- });
- editor.getBody().appendChild(previewFrag);
- parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
- parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
- each$5(previewStyles.split(' '), function (name) {
- var value = dom.getStyle(previewElm, name, true);
- if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
- value = dom.getStyle(editor.getBody(), name, true);
- if (dom.toHex(value).toLowerCase() === '#ffffff') {
- return;
- }
- }
- if (name === 'color') {
- if (dom.toHex(value).toLowerCase() === '#000000') {
- return;
- }
- }
- if (name === 'font-size') {
- if (/em|%$/.test(value)) {
- if (parentFontSize === 0) {
- return;
- }
- var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1);
- value = numValue * parentFontSize + 'px';
- }
- }
- if (name === 'border' && value) {
- previewCss += 'padding:0 2px;';
- }
- previewCss += name + ':' + value + ';';
- });
- editor.fire('AfterPreviewFormats');
- dom.remove(previewFrag);
- return previewCss;
- };
- var setup$h = function (editor) {
- editor.addShortcut('meta+b', '', 'Bold');
- editor.addShortcut('meta+i', '', 'Italic');
- editor.addShortcut('meta+u', '', 'Underline');
- for (var i = 1; i <= 6; i++) {
- editor.addShortcut('access+' + i, '', [
- 'FormatBlock',
- false,
- 'h' + i
- ]);
- }
- editor.addShortcut('access+7', '', [
- 'FormatBlock',
- false,
- 'p'
- ]);
- editor.addShortcut('access+8', '', [
- 'FormatBlock',
- false,
- 'div'
- ]);
- editor.addShortcut('access+9', '', [
- 'FormatBlock',
- false,
- 'address'
- ]);
- };
- var Formatter = function (editor) {
- var formats = FormatRegistry(editor);
- var formatChangeState = Cell(null);
- setup$h(editor);
- setup$k(editor);
- return {
- get: formats.get,
- has: formats.has,
- register: formats.register,
- unregister: formats.unregister,
- apply: function (name, vars, node) {
- applyFormat(editor, name, vars, node);
- },
- remove: function (name, vars, node, similar) {
- removeFormat(editor, name, vars, node, similar);
- },
- toggle: function (name, vars, node) {
- toggleFormat(editor, name, vars, node);
- },
- match: function (name, vars, node, similar) {
- return matchFormat(editor, name, vars, node, similar);
- },
- closest: function (names) {
- return closestFormat(editor, names);
- },
- matchAll: function (names, vars) {
- return matchAllFormats(editor, names, vars);
- },
- matchNode: function (node, name, vars, similar) {
- return matchNodeFormat(editor, node, name, vars, similar);
- },
- canApply: function (name) {
- return canApplyFormat(editor, name);
- },
- formatChanged: function (formats, callback, similar, vars) {
- return formatChanged(editor, formatChangeState, formats, callback, similar, vars);
- },
- getCssText: curry(getCssText, editor)
- };
- };
- var shouldIgnoreCommand = function (cmd) {
- switch (cmd.toLowerCase()) {
- case 'undo':
- case 'redo':
- case 'mcerepaint':
- case 'mcefocus':
- return true;
- default:
- return false;
- }
- };
- var registerEvents = function (editor, undoManager, locks) {
- var isFirstTypedCharacter = Cell(false);
- var addNonTypingUndoLevel = function (e) {
- setTyping(undoManager, false, locks);
- undoManager.add({}, e);
- };
- editor.on('init', function () {
- undoManager.add();
- });
- editor.on('BeforeExecCommand', function (e) {
- var cmd = e.command;
- if (!shouldIgnoreCommand(cmd)) {
- endTyping(undoManager, locks);
- undoManager.beforeChange();
- }
- });
- editor.on('ExecCommand', function (e) {
- var cmd = e.command;
- if (!shouldIgnoreCommand(cmd)) {
- addNonTypingUndoLevel(e);
- }
- });
- editor.on('ObjectResizeStart cut', function () {
- undoManager.beforeChange();
- });
- editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
- editor.on('dragend', addNonTypingUndoLevel);
- editor.on('keyup', function (e) {
- var keyCode = e.keyCode;
- if (e.isDefaultPrevented()) {
- return;
- }
- if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) {
- addNonTypingUndoLevel();
- editor.nodeChanged();
- }
- if (keyCode === 46 || keyCode === 8) {
- editor.nodeChanged();
- }
- if (isFirstTypedCharacter.get() && undoManager.typing && isEq$1(createFromEditor(editor), undoManager.data[0]) === false) {
- if (editor.isDirty() === false) {
- editor.setDirty(true);
- editor.fire('change', {
- level: undoManager.data[0],
- lastLevel: null
- });
- }
- editor.fire('TypingUndo');
- isFirstTypedCharacter.set(false);
- editor.nodeChanged();
- }
- });
- editor.on('keydown', function (e) {
- var keyCode = e.keyCode;
- if (e.isDefaultPrevented()) {
- return;
- }
- if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) {
- if (undoManager.typing) {
- addNonTypingUndoLevel(e);
- }
- return;
- }
- var modKey = e.ctrlKey && !e.altKey || e.metaKey;
- if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !undoManager.typing && !modKey) {
- undoManager.beforeChange();
- setTyping(undoManager, true, locks);
- undoManager.add({}, e);
- isFirstTypedCharacter.set(true);
- }
- });
- editor.on('mousedown', function (e) {
- if (undoManager.typing) {
- addNonTypingUndoLevel(e);
- }
- });
- var isInsertReplacementText = function (event) {
- return event.inputType === 'insertReplacementText';
- };
- var isInsertTextDataNull = function (event) {
- return event.inputType === 'insertText' && event.data === null;
- };
- var isInsertFromPasteOrDrop = function (event) {
- return event.inputType === 'insertFromPaste' || event.inputType === 'insertFromDrop';
- };
- editor.on('input', function (e) {
- if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e) || isInsertFromPasteOrDrop(e))) {
- addNonTypingUndoLevel(e);
- }
- });
- editor.on('AddUndo Undo Redo ClearUndos', function (e) {
- if (!e.isDefaultPrevented()) {
- editor.nodeChanged();
- }
- });
- };
- var addKeyboardShortcuts = function (editor) {
- editor.addShortcut('meta+z', '', 'Undo');
- editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
- };
- var UndoManager = function (editor) {
- var beforeBookmark = value();
- var locks = Cell(0);
- var index = Cell(0);
- var undoManager = {
- data: [],
- typing: false,
- beforeChange: function () {
- beforeChange(editor, locks, beforeBookmark);
- },
- add: function (level, event) {
- return addUndoLevel(editor, undoManager, index, locks, beforeBookmark, level, event);
- },
- undo: function () {
- return undo(editor, undoManager, locks, index);
- },
- redo: function () {
- return redo(editor, index, undoManager.data);
- },
- clear: function () {
- clear(editor, undoManager, index);
- },
- reset: function () {
- reset(editor, undoManager);
- },
- hasUndo: function () {
- return hasUndo(editor, undoManager, index);
- },
- hasRedo: function () {
- return hasRedo(editor, undoManager, index);
- },
- transact: function (callback) {
- return transact(editor, undoManager, locks, callback);
- },
- ignore: function (callback) {
- ignore(editor, locks, callback);
- },
- extra: function (callback1, callback2) {
- extra(editor, undoManager, index, callback1, callback2);
- }
- };
- if (!isRtc(editor)) {
- registerEvents(editor, undoManager, locks);
- }
- addKeyboardShortcuts(editor);
- return undoManager;
- };
- var nonTypingKeycodes = [
- 9,
- 27,
- VK.HOME,
- VK.END,
- 19,
- 20,
- 44,
- 144,
- 145,
- 33,
- 34,
- 45,
- 16,
- 17,
- 18,
- 91,
- 92,
- 93,
- VK.DOWN,
- VK.UP,
- VK.LEFT,
- VK.RIGHT
- ].concat(Env.browser.isFirefox() ? [224] : []);
- var placeholderAttr = 'data-mce-placeholder';
- var isKeyboardEvent = function (e) {
- return e.type === 'keydown' || e.type === 'keyup';
- };
- var isDeleteEvent = function (e) {
- var keyCode = e.keyCode;
- return keyCode === VK.BACKSPACE || keyCode === VK.DELETE;
- };
- var isNonTypingKeyboardEvent = function (e) {
- if (isKeyboardEvent(e)) {
- var keyCode = e.keyCode;
- return !isDeleteEvent(e) && (VK.metaKeyPressed(e) || e.altKey || keyCode >= 112 && keyCode <= 123 || contains$3(nonTypingKeycodes, keyCode));
- } else {
- return false;
- }
- };
- var isTypingKeyboardEvent = function (e) {
- return isKeyboardEvent(e) && !(isDeleteEvent(e) || e.type === 'keyup' && e.keyCode === 229);
- };
- var isVisuallyEmpty = function (dom, rootElm, forcedRootBlock) {
- if (isEmpty$2(SugarElement.fromDom(rootElm), false)) {
- var isForcedRootBlockFalse = forcedRootBlock === '';
- var firstElement = rootElm.firstElementChild;
- if (!firstElement) {
- return true;
- } else if (dom.getStyle(rootElm.firstElementChild, 'padding-left') || dom.getStyle(rootElm.firstElementChild, 'padding-right')) {
- return false;
- } else {
- return isForcedRootBlockFalse ? !dom.isBlock(firstElement) : forcedRootBlock === firstElement.nodeName.toLowerCase();
- }
- } else {
- return false;
- }
- };
- var setup$g = function (editor) {
- var dom = editor.dom;
- var rootBlock = getForcedRootBlock(editor);
- var placeholder = getPlaceholder(editor);
- var updatePlaceholder = function (e, initial) {
- if (isNonTypingKeyboardEvent(e)) {
- return;
- }
- var body = editor.getBody();
- var showPlaceholder = isTypingKeyboardEvent(e) ? false : isVisuallyEmpty(dom, body, rootBlock);
- var isPlaceholderShown = dom.getAttrib(body, placeholderAttr) !== '';
- if (isPlaceholderShown !== showPlaceholder || initial) {
- dom.setAttrib(body, placeholderAttr, showPlaceholder ? placeholder : null);
- dom.setAttrib(body, 'aria-placeholder', showPlaceholder ? placeholder : null);
- firePlaceholderToggle(editor, showPlaceholder);
- editor.on(showPlaceholder ? 'keydown' : 'keyup', updatePlaceholder);
- editor.off(showPlaceholder ? 'keyup' : 'keydown', updatePlaceholder);
- }
- };
- if (placeholder) {
- editor.on('init', function (e) {
- updatePlaceholder(e, true);
- editor.on('change SetContent ExecCommand', updatePlaceholder);
- editor.on('paste', function (e) {
- return Delay.setEditorTimeout(editor, function () {
- return updatePlaceholder(e);
- });
- });
- });
- }
- };
- var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;
- var hasStrongRtl = function (text) {
- return strongRtl.test(text);
- };
- var isInlineTarget = function (editor, elm) {
- return is$2(SugarElement.fromDom(elm), getInlineBoundarySelector(editor));
- };
- var isRtl = function (element) {
- return DOMUtils.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent);
- };
- var findInlineParents = function (isInlineTarget, rootNode, pos) {
- return filter$4(DOMUtils.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget);
- };
- var findRootInline = function (isInlineTarget, rootNode, pos) {
- var parents = findInlineParents(isInlineTarget, rootNode, pos);
- return Optional.from(parents[parents.length - 1]);
- };
- var hasSameParentBlock = function (rootNode, node1, node2) {
- var block1 = getParentBlock$2(node1, rootNode);
- var block2 = getParentBlock$2(node2, rootNode);
- return block1 && block1 === block2;
- };
- var isAtZwsp = function (pos) {
- return isBeforeInline(pos) || isAfterInline(pos);
- };
- var normalizePosition = function (forward, pos) {
- if (!pos) {
- return pos;
- }
- var container = pos.container(), offset = pos.offset();
- if (forward) {
- if (isCaretContainerInline(container)) {
- if (isText$7(container.nextSibling)) {
- return CaretPosition(container.nextSibling, 0);
- } else {
- return CaretPosition.after(container);
- }
- } else {
- return isBeforeInline(pos) ? CaretPosition(container, offset + 1) : pos;
- }
- } else {
- if (isCaretContainerInline(container)) {
- if (isText$7(container.previousSibling)) {
- return CaretPosition(container.previousSibling, container.previousSibling.data.length);
- } else {
- return CaretPosition.before(container);
- }
- } else {
- return isAfterInline(pos) ? CaretPosition(container, offset - 1) : pos;
- }
- }
- };
- var normalizeForwards = curry(normalizePosition, true);
- var normalizeBackwards = curry(normalizePosition, false);
- var isBeforeRoot = function (rootNode) {
- return function (elm) {
- return eq(rootNode, SugarElement.fromDom(elm.dom.parentNode));
- };
- };
- var isTextBlockOrListItem = function (element) {
- return isTextBlock$2(element) || isListItem(element);
- };
- var getParentBlock$1 = function (rootNode, elm) {
- if (contains$1(rootNode, elm)) {
- return closest$3(elm, isTextBlockOrListItem, isBeforeRoot(rootNode));
- } else {
- return Optional.none();
- }
- };
- var placeCaretInEmptyBody = function (editor) {
- var body = editor.getBody();
- var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body;
- editor.selection.setCursorLocation(node, 0);
- };
- var paddEmptyBody = function (editor) {
- if (editor.dom.isEmpty(editor.getBody())) {
- editor.setContent('');
- placeCaretInEmptyBody(editor);
- }
- };
- var willDeleteLastPositionInElement = function (forward, fromPos, elm) {
- return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) {
- var normalizedFirstPos = normalizePosition(true, firstPos);
- var normalizedLastPos = normalizePosition(false, lastPos);
- var normalizedFromPos = normalizePosition(false, fromPos);
- if (forward) {
- return nextPosition(elm, normalizedFromPos).exists(function (nextPos) {
- return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos);
- });
- } else {
- return prevPosition(elm, normalizedFromPos).exists(function (prevPos) {
- return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos);
- });
- }
- }).getOr(true);
- };
- var blockPosition = function (block, position) {
- return {
- block: block,
- position: position
- };
- };
- var blockBoundary = function (from, to) {
- return {
- from: from,
- to: to
- };
- };
- var getBlockPosition = function (rootNode, pos) {
- var rootElm = SugarElement.fromDom(rootNode);
- var containerElm = SugarElement.fromDom(pos.container());
- return getParentBlock$1(rootElm, containerElm).map(function (block) {
- return blockPosition(block, pos);
- });
- };
- var isDifferentBlocks = function (blockBoundary) {
- return eq(blockBoundary.from.block, blockBoundary.to.block) === false;
- };
- var hasSameParent = function (blockBoundary) {
- return parent(blockBoundary.from.block).bind(function (parent1) {
- return parent(blockBoundary.to.block).filter(function (parent2) {
- return eq(parent1, parent2);
- });
- }).isSome();
- };
- var isEditable$1 = function (blockBoundary) {
- return isContentEditableFalse$b(blockBoundary.from.block.dom) === false && isContentEditableFalse$b(blockBoundary.to.block.dom) === false;
- };
- var skipLastBr = function (rootNode, forward, blockPosition) {
- if (isBr$5(blockPosition.position.getNode()) && isEmpty$2(blockPosition.block) === false) {
- return positionIn(false, blockPosition.block.dom).bind(function (lastPositionInBlock) {
- if (lastPositionInBlock.isEqual(blockPosition.position)) {
- return fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) {
- return getBlockPosition(rootNode, to);
- });
- } else {
- return Optional.some(blockPosition);
- }
- }).getOr(blockPosition);
- } else {
- return blockPosition;
- }
- };
- var readFromRange = function (rootNode, forward, rng) {
- var fromBlockPos = getBlockPosition(rootNode, CaretPosition.fromRangeStart(rng));
- var toBlockPos = fromBlockPos.bind(function (blockPos) {
- return fromPosition(forward, rootNode, blockPos.position).bind(function (to) {
- return getBlockPosition(rootNode, to).map(function (blockPos) {
- return skipLastBr(rootNode, forward, blockPos);
- });
- });
- });
- return lift2(fromBlockPos, toBlockPos, blockBoundary).filter(function (blockBoundary) {
- return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable$1(blockBoundary);
- });
- };
- var read$1 = function (rootNode, forward, rng) {
- return rng.collapsed ? readFromRange(rootNode, forward, rng) : Optional.none();
- };
- var getChildrenUntilBlockBoundary = function (block) {
- var children$1 = children(block);
- return findIndex$2(children$1, isBlock$2).fold(constant(children$1), function (index) {
- return children$1.slice(0, index);
- });
- };
- var extractChildren = function (block) {
- var children = getChildrenUntilBlockBoundary(block);
- each$k(children, remove$7);
- return children;
- };
- var removeEmptyRoot = function (rootNode, block) {
- var parents = parentsAndSelf(block, rootNode);
- return find$3(parents.reverse(), function (element) {
- return isEmpty$2(element);
- }).each(remove$7);
- };
- var isEmptyBefore = function (el) {
- return filter$4(prevSiblings(el), function (el) {
- return !isEmpty$2(el);
- }).length === 0;
- };
- var nestedBlockMerge = function (rootNode, fromBlock, toBlock, insertionPoint) {
- if (isEmpty$2(toBlock)) {
- fillWithPaddingBr(toBlock);
- return firstPositionIn(toBlock.dom);
- }
- if (isEmptyBefore(insertionPoint) && isEmpty$2(fromBlock)) {
- before$4(insertionPoint, SugarElement.fromTag('br'));
- }
- var position = prevPosition(toBlock.dom, CaretPosition.before(insertionPoint.dom));
- each$k(extractChildren(fromBlock), function (child) {
- before$4(insertionPoint, child);
- });
- removeEmptyRoot(rootNode, fromBlock);
- return position;
- };
- var sidelongBlockMerge = function (rootNode, fromBlock, toBlock) {
- if (isEmpty$2(toBlock)) {
- remove$7(toBlock);
- if (isEmpty$2(fromBlock)) {
- fillWithPaddingBr(fromBlock);
- }
- return firstPositionIn(fromBlock.dom);
- }
- var position = lastPositionIn(toBlock.dom);
- each$k(extractChildren(fromBlock), function (child) {
- append$1(toBlock, child);
- });
- removeEmptyRoot(rootNode, fromBlock);
- return position;
- };
- var findInsertionPoint = function (toBlock, block) {
- var parentsAndSelf$1 = parentsAndSelf(block, toBlock);
- return Optional.from(parentsAndSelf$1[parentsAndSelf$1.length - 1]);
- };
- var getInsertionPoint = function (fromBlock, toBlock) {
- return contains$1(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Optional.none();
- };
- var trimBr = function (first, block) {
- positionIn(first, block.dom).map(function (position) {
- return position.getNode();
- }).map(SugarElement.fromDom).filter(isBr$4).each(remove$7);
- };
- var mergeBlockInto = function (rootNode, fromBlock, toBlock) {
- trimBr(true, fromBlock);
- trimBr(false, toBlock);
- return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock));
- };
- var mergeBlocks = function (rootNode, forward, block1, block2) {
- return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2);
- };
- var backspaceDelete$8 = function (editor, forward) {
- var rootNode = SugarElement.fromDom(editor.getBody());
- var position = read$1(rootNode.dom, forward, editor.selection.getRng()).bind(function (blockBoundary) {
- return mergeBlocks(rootNode, forward, blockBoundary.from.block, blockBoundary.to.block);
- });
- position.each(function (pos) {
- editor.selection.setRng(pos.toRange());
- });
- return position.isSome();
- };
- var deleteRangeMergeBlocks = function (rootNode, selection) {
- var rng = selection.getRng();
- return lift2(getParentBlock$1(rootNode, SugarElement.fromDom(rng.startContainer)), getParentBlock$1(rootNode, SugarElement.fromDom(rng.endContainer)), function (block1, block2) {
- if (eq(block1, block2) === false) {
- rng.deleteContents();
- mergeBlocks(rootNode, true, block1, block2).each(function (pos) {
- selection.setRng(pos.toRange());
- });
- return true;
- } else {
- return false;
- }
- }).getOr(false);
- };
- var isRawNodeInTable = function (root, rawNode) {
- var node = SugarElement.fromDom(rawNode);
- var isRoot = curry(eq, root);
- return ancestor$3(node, isTableCell$4, isRoot).isSome();
- };
- var isSelectionInTable = function (root, rng) {
- return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer);
- };
- var isEverythingSelected = function (root, rng) {
- var noPrevious = prevPosition(root.dom, CaretPosition.fromRangeStart(rng)).isNone();
- var noNext = nextPosition(root.dom, CaretPosition.fromRangeEnd(rng)).isNone();
- return !isSelectionInTable(root, rng) && noPrevious && noNext;
- };
- var emptyEditor = function (editor) {
- editor.setContent('');
- editor.selection.setCursorLocation();
- return true;
- };
- var deleteRange$1 = function (editor) {
- var rootNode = SugarElement.fromDom(editor.getBody());
- var rng = editor.selection.getRng();
- return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection);
- };
- var backspaceDelete$7 = function (editor, _forward) {
- return editor.selection.isCollapsed() ? false : deleteRange$1(editor);
- };
- var isContentEditableTrue$2 = isContentEditableTrue$4;
- var isContentEditableFalse$4 = isContentEditableFalse$b;
- var showCaret = function (direction, editor, node, before, scrollIntoView) {
- return Optional.from(editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView));
- };
- var getNodeRange = function (node) {
- var rng = node.ownerDocument.createRange();
- rng.selectNode(node);
- return rng;
- };
- var selectNode = function (editor, node) {
- var e = editor.fire('BeforeObjectSelected', { target: node });
- if (e.isDefaultPrevented()) {
- return Optional.none();
- }
- return Optional.some(getNodeRange(node));
- };
- var renderCaretAtRange = function (editor, range, scrollIntoView) {
- var normalizedRange = normalizeRange(1, editor.getBody(), range);
- var caretPosition = CaretPosition.fromRangeStart(normalizedRange);
- var caretPositionNode = caretPosition.getNode();
- if (isInlineFakeCaretTarget(caretPositionNode)) {
- return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false);
- }
- var caretPositionBeforeNode = caretPosition.getNode(true);
- if (isInlineFakeCaretTarget(caretPositionBeforeNode)) {
- return showCaret(1, editor, caretPositionBeforeNode, false, false);
- }
- var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) {
- return isContentEditableFalse$4(node) || isContentEditableTrue$2(node);
- });
- if (isInlineFakeCaretTarget(ceRoot)) {
- return showCaret(1, editor, ceRoot, false, scrollIntoView);
- }
- return Optional.none();
- };
- var renderRangeCaret = function (editor, range, scrollIntoView) {
- return range.collapsed ? renderCaretAtRange(editor, range, scrollIntoView).getOr(range) : range;
- };
- var isBeforeBoundary = function (pos) {
- return isBeforeContentEditableFalse(pos) || isBeforeMedia(pos);
- };
- var isAfterBoundary = function (pos) {
- return isAfterContentEditableFalse(pos) || isAfterMedia(pos);
- };
- var trimEmptyTextNode = function (dom, node) {
- if (isText$7(node) && node.data.length === 0) {
- dom.remove(node);
- }
- };
- var deleteContentAndShowCaret = function (editor, range, node, direction, forward, peekCaretPosition) {
- showCaret(direction, editor, peekCaretPosition.getNode(!forward), forward, true).each(function (caretRange) {
- if (range.collapsed) {
- var deleteRange = range.cloneRange();
- if (forward) {
- deleteRange.setEnd(caretRange.startContainer, caretRange.startOffset);
- } else {
- deleteRange.setStart(caretRange.endContainer, caretRange.endOffset);
- }
- deleteRange.deleteContents();
- } else {
- range.deleteContents();
- }
- editor.selection.setRng(caretRange);
- });
- trimEmptyTextNode(editor.dom, node);
- return true;
- };
- var deleteBoundaryText = function (editor, forward) {
- var range = editor.selection.getRng();
- if (!isText$7(range.commonAncestorContainer)) {
- return false;
- }
- var direction = forward ? HDirection.Forwards : HDirection.Backwards;
- var caretWalker = CaretWalker(editor.getBody());
- var getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev);
- var isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary;
- var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
- var nextCaretPosition = normalizePosition(forward, getNextPosFn(caretPosition));
- if (!nextCaretPosition || !isMoveInsideSameBlock(caretPosition, nextCaretPosition)) {
- return false;
- } else if (isBeforeFn(nextCaretPosition)) {
- return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, nextCaretPosition);
- }
- var peekCaretPosition = getNextPosFn(nextCaretPosition);
- if (peekCaretPosition && isBeforeFn(peekCaretPosition)) {
- if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) {
- return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, peekCaretPosition);
- }
- }
- return false;
- };
- var backspaceDelete$6 = function (editor, forward) {
- return deleteBoundaryText(editor, forward);
- };
- var isCompoundElement = function (node) {
- return isTableCell$4(SugarElement.fromDom(node)) || isListItem(SugarElement.fromDom(node));
- };
- var DeleteAction = Adt.generate([
- { remove: ['element'] },
- { moveToElement: ['element'] },
- { moveToPosition: ['position'] }
- ]);
- var isAtContentEditableBlockCaret = function (forward, from) {
- var elm = from.getNode(forward === false);
- var caretLocation = forward ? 'after' : 'before';
- return isElement$5(elm) && elm.getAttribute('data-mce-caret') === caretLocation;
- };
- var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) {
- var inSameBlock = function (elm) {
- return isInline$1(SugarElement.fromDom(elm)) && !isInSameBlock(from, to, root);
- };
- return getRelativeCefElm(!forward, from).fold(function () {
- return getRelativeCefElm(forward, to).fold(never, inSameBlock);
- }, inSameBlock);
- };
- var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) {
- var toCefElm = to.getNode(forward === false);
- return getParentBlock$1(SugarElement.fromDom(root), SugarElement.fromDom(from.getNode())).map(function (blockElm) {
- return isEmpty$2(blockElm) ? DeleteAction.remove(blockElm.dom) : DeleteAction.moveToElement(toCefElm);
- }).orThunk(function () {
- return Optional.some(DeleteAction.moveToElement(toCefElm));
- });
- };
- var findCefPosition = function (root, forward, from) {
- return fromPosition(forward, root, from).bind(function (to) {
- if (isCompoundElement(to.getNode())) {
- return Optional.none();
- } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) {
- return Optional.none();
- } else if (forward && isContentEditableFalse$b(to.getNode())) {
- return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
- } else if (forward === false && isContentEditableFalse$b(to.getNode(true))) {
- return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
- } else if (forward && isAfterContentEditableFalse(from)) {
- return Optional.some(DeleteAction.moveToPosition(to));
- } else if (forward === false && isBeforeContentEditableFalse(from)) {
- return Optional.some(DeleteAction.moveToPosition(to));
- } else {
- return Optional.none();
- }
- });
- };
- var getContentEditableBlockAction = function (forward, elm) {
- if (forward && isContentEditableFalse$b(elm.nextSibling)) {
- return Optional.some(DeleteAction.moveToElement(elm.nextSibling));
- } else if (forward === false && isContentEditableFalse$b(elm.previousSibling)) {
- return Optional.some(DeleteAction.moveToElement(elm.previousSibling));
- } else {
- return Optional.none();
- }
- };
- var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) {
- return deleteAction.fold(function (elm) {
- return Optional.some(DeleteAction.remove(elm));
- }, function (elm) {
- return Optional.some(DeleteAction.moveToElement(elm));
- }, function (to) {
- if (isInSameBlock(from, to, root)) {
- return Optional.none();
- } else {
- return Optional.some(DeleteAction.moveToPosition(to));
- }
- });
- };
- var getContentEditableAction = function (root, forward, from) {
- if (isAtContentEditableBlockCaret(forward, from)) {
- return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () {
- return findCefPosition(root, forward, from);
- }, Optional.some);
- } else {
- return findCefPosition(root, forward, from).bind(function (deleteAction) {
- return skipMoveToActionFromInlineCefToContent(root, from, deleteAction);
- });
- }
- };
- var read = function (root, forward, rng) {
- var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng);
- var from = CaretPosition.fromRangeStart(normalizedRange);
- var rootElement = SugarElement.fromDom(root);
- if (forward === false && isAfterContentEditableFalse(from)) {
- return Optional.some(DeleteAction.remove(from.getNode(true)));
- } else if (forward && isBeforeContentEditableFalse(from)) {
- return Optional.some(DeleteAction.remove(from.getNode()));
- } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) {
- return findPreviousBr(rootElement, from).map(function (br) {
- return DeleteAction.remove(br.getNode());
- });
- } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr$1(rootElement, from)) {
- return findNextBr(rootElement, from).map(function (br) {
- return DeleteAction.remove(br.getNode());
- });
- } else {
- return getContentEditableAction(root, forward, from);
- }
- };
- var deleteElement$1 = function (editor, forward) {
- return function (element) {
- editor._selectionOverrides.hideFakeCaret();
- deleteElement$2(editor, forward, SugarElement.fromDom(element));
- return true;
- };
- };
- var moveToElement = function (editor, forward) {
- return function (element) {
- var pos = forward ? CaretPosition.before(element) : CaretPosition.after(element);
- editor.selection.setRng(pos.toRange());
- return true;
- };
- };
- var moveToPosition = function (editor) {
- return function (pos) {
- editor.selection.setRng(pos.toRange());
- return true;
- };
- };
- var getAncestorCe = function (editor, node) {
- return Optional.from(getContentEditableRoot$1(editor.getBody(), node));
- };
- var backspaceDeleteCaret = function (editor, forward) {
- var selectedNode = editor.selection.getNode();
- return getAncestorCe(editor, selectedNode).filter(isContentEditableFalse$b).fold(function () {
- return read(editor.getBody(), forward, editor.selection.getRng()).exists(function (deleteAction) {
- return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
- });
- }, always);
- };
- var deleteOffscreenSelection = function (rootElement) {
- each$k(descendants(rootElement, '.mce-offscreen-selection'), remove$7);
- };
- var backspaceDeleteRange = function (editor, forward) {
- var selectedNode = editor.selection.getNode();
- if (isContentEditableFalse$b(selectedNode) && !isTableCell$5(selectedNode)) {
- var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(isContentEditableFalse$b);
- return hasCefAncestor.fold(function () {
- deleteOffscreenSelection(SugarElement.fromDom(editor.getBody()));
- deleteElement$2(editor, forward, SugarElement.fromDom(editor.selection.getNode()));
- paddEmptyBody(editor);
- return true;
- }, always);
- }
- return false;
- };
- var paddEmptyElement = function (editor) {
- var dom = editor.dom, selection = editor.selection;
- var ceRoot = getContentEditableRoot$1(editor.getBody(), selection.getNode());
- if (isContentEditableTrue$4(ceRoot) && dom.isBlock(ceRoot) && dom.isEmpty(ceRoot)) {
- var br = dom.create('br', { 'data-mce-bogus': '1' });
- dom.setHTML(ceRoot, '');
- ceRoot.appendChild(br);
- selection.setRng(CaretPosition.before(br).toRange());
- }
- return true;
- };
- var backspaceDelete$5 = function (editor, forward) {
- if (editor.selection.isCollapsed()) {
- return backspaceDeleteCaret(editor, forward);
- } else {
- return backspaceDeleteRange(editor, forward);
- }
- };
- var deleteCaret$2 = function (editor, forward) {
- var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
- return fromPosition(forward, editor.getBody(), fromPos).filter(function (pos) {
- return forward ? isBeforeImageBlock(pos) : isAfterImageBlock(pos);
- }).bind(function (pos) {
- return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, pos));
- }).exists(function (elm) {
- editor.selection.select(elm);
- return true;
- });
- };
- var backspaceDelete$4 = function (editor, forward) {
- return editor.selection.isCollapsed() ? deleteCaret$2(editor, forward) : false;
- };
- var isText = isText$7;
- var startsWithCaretContainer = function (node) {
- return isText(node) && node.data[0] === ZWSP$1;
- };
- var endsWithCaretContainer = function (node) {
- return isText(node) && node.data[node.data.length - 1] === ZWSP$1;
- };
- var createZwsp = function (node) {
- return node.ownerDocument.createTextNode(ZWSP$1);
- };
- var insertBefore = function (node) {
- if (isText(node.previousSibling)) {
- if (endsWithCaretContainer(node.previousSibling)) {
- return node.previousSibling;
- } else {
- node.previousSibling.appendData(ZWSP$1);
- return node.previousSibling;
- }
- } else if (isText(node)) {
- if (startsWithCaretContainer(node)) {
- return node;
- } else {
- node.insertData(0, ZWSP$1);
- return node;
- }
- } else {
- var newNode = createZwsp(node);
- node.parentNode.insertBefore(newNode, node);
- return newNode;
- }
- };
- var insertAfter = function (node) {
- if (isText(node.nextSibling)) {
- if (startsWithCaretContainer(node.nextSibling)) {
- return node.nextSibling;
- } else {
- node.nextSibling.insertData(0, ZWSP$1);
- return node.nextSibling;
- }
- } else if (isText(node)) {
- if (endsWithCaretContainer(node)) {
- return node;
- } else {
- node.appendData(ZWSP$1);
- return node;
- }
- } else {
- var newNode = createZwsp(node);
- if (node.nextSibling) {
- node.parentNode.insertBefore(newNode, node.nextSibling);
- } else {
- node.parentNode.appendChild(newNode);
- }
- return newNode;
- }
- };
- var insertInline = function (before, node) {
- return before ? insertBefore(node) : insertAfter(node);
- };
- var insertInlineBefore = curry(insertInline, true);
- var insertInlineAfter = curry(insertInline, false);
- var insertInlinePos = function (pos, before) {
- if (isText$7(pos.container())) {
- return insertInline(before, pos.container());
- } else {
- return insertInline(before, pos.getNode());
- }
- };
- var isPosCaretContainer = function (pos, caret) {
- var caretNode = caret.get();
- return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode);
- };
- var renderCaret = function (caret, location) {
- return location.fold(function (element) {
- remove$2(caret.get());
- var text = insertInlineBefore(element);
- caret.set(text);
- return Optional.some(CaretPosition(text, text.length - 1));
- }, function (element) {
- return firstPositionIn(element).map(function (pos) {
- if (!isPosCaretContainer(pos, caret)) {
- remove$2(caret.get());
- var text = insertInlinePos(pos, true);
- caret.set(text);
- return CaretPosition(text, 1);
- } else {
- return CaretPosition(caret.get(), 1);
- }
- });
- }, function (element) {
- return lastPositionIn(element).map(function (pos) {
- if (!isPosCaretContainer(pos, caret)) {
- remove$2(caret.get());
- var text = insertInlinePos(pos, false);
- caret.set(text);
- return CaretPosition(text, text.length - 1);
- } else {
- return CaretPosition(caret.get(), caret.get().length - 1);
- }
- });
- }, function (element) {
- remove$2(caret.get());
- var text = insertInlineAfter(element);
- caret.set(text);
- return Optional.some(CaretPosition(text, 1));
- });
- };
- var evaluateUntil = function (fns, args) {
- for (var i = 0; i < fns.length; i++) {
- var result = fns[i].apply(null, args);
- if (result.isSome()) {
- return result;
- }
- }
- return Optional.none();
- };
- var Location = Adt.generate([
- { before: ['element'] },
- { start: ['element'] },
- { end: ['element'] },
- { after: ['element'] }
- ]);
- var rescope$1 = function (rootNode, node) {
- var parentBlock = getParentBlock$2(node, rootNode);
- return parentBlock ? parentBlock : rootNode;
- };
- var before = function (isInlineTarget, rootNode, pos) {
- var nPos = normalizeForwards(pos);
- var scope = rescope$1(rootNode, nPos.container());
- return findRootInline(isInlineTarget, scope, nPos).fold(function () {
- return nextPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) {
- return Location.before(inline);
- });
- }, Optional.none);
- };
- var isNotInsideFormatCaretContainer = function (rootNode, elm) {
- return getParentCaretContainer(rootNode, elm) === null;
- };
- var findInsideRootInline = function (isInlineTarget, rootNode, pos) {
- return findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode));
- };
- var start$1 = function (isInlineTarget, rootNode, pos) {
- var nPos = normalizeBackwards(pos);
- return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
- var prevPos = prevPosition(inline, nPos);
- return prevPos.isNone() ? Optional.some(Location.start(inline)) : Optional.none();
- });
- };
- var end = function (isInlineTarget, rootNode, pos) {
- var nPos = normalizeForwards(pos);
- return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
- var nextPos = nextPosition(inline, nPos);
- return nextPos.isNone() ? Optional.some(Location.end(inline)) : Optional.none();
- });
- };
- var after = function (isInlineTarget, rootNode, pos) {
- var nPos = normalizeBackwards(pos);
- var scope = rescope$1(rootNode, nPos.container());
- return findRootInline(isInlineTarget, scope, nPos).fold(function () {
- return prevPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) {
- return Location.after(inline);
- });
- }, Optional.none);
- };
- var isValidLocation = function (location) {
- return isRtl(getElement(location)) === false;
- };
- var readLocation = function (isInlineTarget, rootNode, pos) {
- var location = evaluateUntil([
- before,
- start$1,
- end,
- after
- ], [
- isInlineTarget,
- rootNode,
- pos
- ]);
- return location.filter(isValidLocation);
- };
- var getElement = function (location) {
- return location.fold(identity, identity, identity, identity);
- };
- var getName = function (location) {
- return location.fold(constant('before'), constant('start'), constant('end'), constant('after'));
- };
- var outside = function (location) {
- return location.fold(Location.before, Location.before, Location.after, Location.after);
- };
- var inside = function (location) {
- return location.fold(Location.start, Location.start, Location.end, Location.end);
- };
- var isEq = function (location1, location2) {
- return getName(location1) === getName(location2) && getElement(location1) === getElement(location2);
- };
- var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) {
- return lift2(findRootInline(isInlineTarget, rootNode, from), findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) {
- if (fromInline !== toInline && hasSameParentBlock(rootNode, fromInline, toInline)) {
- return Location.after(forward ? fromInline : toInline);
- } else {
- return location;
- }
- }).getOr(location);
- };
- var skipNoMovement = function (fromLocation, toLocation) {
- return fromLocation.fold(always, function (fromLocation) {
- return !isEq(fromLocation, toLocation);
- });
- };
- var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) {
- var from = normalizePosition(forward, pos);
- var to = fromPosition(forward, rootNode, from).map(curry(normalizePosition, forward));
- var location = to.fold(function () {
- return fromLocation.map(outside);
- }, function (to) {
- return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation));
- });
- return location.filter(isValidLocation);
- };
- var findLocationSimple = function (forward, location) {
- if (forward) {
- return location.fold(compose(Optional.some, Location.start), Optional.none, compose(Optional.some, Location.after), Optional.none);
- } else {
- return location.fold(Optional.none, compose(Optional.some, Location.before), Optional.none, compose(Optional.some, Location.end));
- }
- };
- var findLocation$1 = function (forward, isInlineTarget, rootNode, pos) {
- var from = normalizePosition(forward, pos);
- var fromLocation = readLocation(isInlineTarget, rootNode, from);
- return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () {
- return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos);
- });
- };
- curry(findLocation$1, false);
- curry(findLocation$1, true);
- var hasSelectionModifyApi = function (editor) {
- return isFunction(editor.selection.getSel().modify);
- };
- var moveRel = function (forward, selection, pos) {
- var delta = forward ? 1 : -1;
- selection.setRng(CaretPosition(pos.container(), pos.offset() + delta).toRange());
- selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word');
- return true;
- };
- var moveByWord = function (forward, editor) {
- var rng = editor.selection.getRng();
- var pos = forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng);
- if (!hasSelectionModifyApi(editor)) {
- return false;
- } else if (forward && isBeforeInline(pos)) {
- return moveRel(true, editor.selection, pos);
- } else if (!forward && isAfterInline(pos)) {
- return moveRel(false, editor.selection, pos);
- } else {
- return false;
- }
- };
- var BreakType;
- (function (BreakType) {
- BreakType[BreakType['Br'] = 0] = 'Br';
- BreakType[BreakType['Block'] = 1] = 'Block';
- BreakType[BreakType['Wrap'] = 2] = 'Wrap';
- BreakType[BreakType['Eol'] = 3] = 'Eol';
- }(BreakType || (BreakType = {})));
- var flip = function (direction, positions) {
- return direction === HDirection.Backwards ? reverse(positions) : positions;
- };
- var walk = function (direction, caretWalker, pos) {
- return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos);
- };
- var getBreakType = function (scope, direction, currentPos, nextPos) {
- if (isBr$5(nextPos.getNode(direction === HDirection.Forwards))) {
- return BreakType.Br;
- } else if (isInSameBlock(currentPos, nextPos) === false) {
- return BreakType.Block;
- } else {
- return BreakType.Wrap;
- }
- };
- var getPositionsUntil = function (predicate, direction, scope, start) {
- var caretWalker = CaretWalker(scope);
- var currentPos = start;
- var positions = [];
- while (currentPos) {
- var nextPos = walk(direction, caretWalker, currentPos);
- if (!nextPos) {
- break;
- }
- if (isBr$5(nextPos.getNode(false))) {
- if (direction === HDirection.Forwards) {
- return {
- positions: flip(direction, positions).concat([nextPos]),
- breakType: BreakType.Br,
- breakAt: Optional.some(nextPos)
- };
- } else {
- return {
- positions: flip(direction, positions),
- breakType: BreakType.Br,
- breakAt: Optional.some(nextPos)
- };
- }
- }
- if (!nextPos.isVisible()) {
- currentPos = nextPos;
- continue;
- }
- if (predicate(currentPos, nextPos)) {
- var breakType = getBreakType(scope, direction, currentPos, nextPos);
- return {
- positions: flip(direction, positions),
- breakType: breakType,
- breakAt: Optional.some(nextPos)
- };
- }
- positions.push(nextPos);
- currentPos = nextPos;
- }
- return {
- positions: flip(direction, positions),
- breakType: BreakType.Eol,
- breakAt: Optional.none()
- };
- };
- var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) {
- return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) {
- var positions = getPositionsUntilBreak(scope, pos).positions;
- return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions);
- }).getOr([]);
- };
- var findClosestHorizontalPositionFromPoint = function (positions, x) {
- return foldl(positions, function (acc, newPos) {
- return acc.fold(function () {
- return Optional.some(newPos);
- }, function (lastPos) {
- return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) {
- var lastDist = Math.abs(x - lastRect.left);
- var newDist = Math.abs(x - newRect.left);
- return newDist <= lastDist ? newPos : lastPos;
- }).or(acc);
- });
- }, Optional.none());
- };
- var findClosestHorizontalPosition = function (positions, pos) {
- return head(pos.getClientRects()).bind(function (targetRect) {
- return findClosestHorizontalPositionFromPoint(positions, targetRect.left);
- });
- };
- var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1);
- var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1);
- var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine);
- var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine);
- var isAtFirstLine = function (scope, pos) {
- return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone();
- };
- var isAtLastLine = function (scope, pos) {
- return getPositionsUntilNextLine(scope, pos).breakAt.isNone();
- };
- var getFirstLinePositions = function (scope) {
- return firstPositionIn(scope).map(function (pos) {
- return [pos].concat(getPositionsUntilNextLine(scope, pos).positions);
- }).getOr([]);
- };
- var getLastLinePositions = function (scope) {
- return lastPositionIn(scope).map(function (pos) {
- return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos);
- }).getOr([]);
- };
- var getNodeClientRects = function (node) {
- var toArrayWithNode = function (clientRects) {
- return map$3(clientRects, function (rect) {
- var clientRect = clone(rect);
- clientRect.node = node;
- return clientRect;
- });
- };
- if (isElement$5(node)) {
- return toArrayWithNode(node.getClientRects());
- }
- if (isText$7(node)) {
- var rng = node.ownerDocument.createRange();
- rng.setStart(node, 0);
- rng.setEnd(node, node.data.length);
- return toArrayWithNode(rng.getClientRects());
- }
- };
- var getClientRects = function (nodes) {
- return bind(nodes, getNodeClientRects);
- };
- var VDirection;
- (function (VDirection) {
- VDirection[VDirection['Up'] = -1] = 'Up';
- VDirection[VDirection['Down'] = 1] = 'Down';
- }(VDirection || (VDirection = {})));
- var findUntil = function (direction, root, predicateFn, node) {
- while (node = findNode$1(node, direction, isEditableCaretCandidate$1, root)) {
- if (predicateFn(node)) {
- return;
- }
- }
- };
- var walkUntil$1 = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) {
- var line = 0;
- var result = [];
- var add = function (node) {
- var clientRects = getClientRects([node]);
- if (direction === -1) {
- clientRects = clientRects.reverse();
- }
- for (var i = 0; i < clientRects.length; i++) {
- var clientRect = clientRects[i];
- if (isBeflowFn(clientRect, targetClientRect)) {
- continue;
- }
- if (result.length > 0 && isAboveFn(clientRect, last$1(result))) {
- line++;
- }
- clientRect.line = line;
- if (predicateFn(clientRect)) {
- return true;
- }
- result.push(clientRect);
- }
- };
- var targetClientRect = last$1(caretPosition.getClientRects());
- if (!targetClientRect) {
- return result;
- }
- var node = caretPosition.getNode();
- add(node);
- findUntil(direction, root, add, node);
- return result;
- };
- var aboveLineNumber = function (lineNumber, clientRect) {
- return clientRect.line > lineNumber;
- };
- var isLineNumber = function (lineNumber, clientRect) {
- return clientRect.line === lineNumber;
- };
- var upUntil = curry(walkUntil$1, VDirection.Up, isAbove$1, isBelow$1);
- var downUntil = curry(walkUntil$1, VDirection.Down, isBelow$1, isAbove$1);
- var positionsUntil = function (direction, root, predicateFn, node) {
- var caretWalker = CaretWalker(root);
- var walkFn;
- var isBelowFn;
- var isAboveFn;
- var caretPosition;
- var result = [];
- var line = 0;
- var getClientRect = function (caretPosition) {
- if (direction === 1) {
- return last$1(caretPosition.getClientRects());
- }
- return last$1(caretPosition.getClientRects());
- };
- if (direction === 1) {
- walkFn = caretWalker.next;
- isBelowFn = isBelow$1;
- isAboveFn = isAbove$1;
- caretPosition = CaretPosition.after(node);
- } else {
- walkFn = caretWalker.prev;
- isBelowFn = isAbove$1;
- isAboveFn = isBelow$1;
- caretPosition = CaretPosition.before(node);
- }
- var targetClientRect = getClientRect(caretPosition);
- do {
- if (!caretPosition.isVisible()) {
- continue;
- }
- var rect = getClientRect(caretPosition);
- if (isAboveFn(rect, targetClientRect)) {
- continue;
- }
- if (result.length > 0 && isBelowFn(rect, last$1(result))) {
- line++;
- }
- var clientRect = clone(rect);
- clientRect.position = caretPosition;
- clientRect.line = line;
- if (predicateFn(clientRect)) {
- return result;
- }
- result.push(clientRect);
- } while (caretPosition = walkFn(caretPosition));
- return result;
- };
- var isAboveLine = function (lineNumber) {
- return function (clientRect) {
- return aboveLineNumber(lineNumber, clientRect);
- };
- };
- var isLine = function (lineNumber) {
- return function (clientRect) {
- return isLineNumber(lineNumber, clientRect);
- };
- };
- var isContentEditableFalse$3 = isContentEditableFalse$b;
- var findNode = findNode$1;
- var distanceToRectLeft = function (clientRect, clientX) {
- return Math.abs(clientRect.left - clientX);
- };
- var distanceToRectRight = function (clientRect, clientX) {
- return Math.abs(clientRect.right - clientX);
- };
- var isInsideX = function (clientX, clientRect) {
- return clientX >= clientRect.left && clientX <= clientRect.right;
- };
- var isInsideY = function (clientY, clientRect) {
- return clientY >= clientRect.top && clientY <= clientRect.bottom;
- };
- var isNodeClientRect = function (rect) {
- return hasNonNullableKey(rect, 'node');
- };
- var findClosestClientRect = function (clientRects, clientX, allowInside) {
- if (allowInside === void 0) {
- allowInside = always;
- }
- return reduce(clientRects, function (oldClientRect, clientRect) {
- if (isInsideX(clientX, clientRect)) {
- return allowInside(clientRect) ? clientRect : oldClientRect;
- }
- if (isInsideX(clientX, oldClientRect)) {
- return allowInside(oldClientRect) ? oldClientRect : clientRect;
- }
- var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
- var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
- if (newDistance === oldDistance && isNodeClientRect(clientRect) && isContentEditableFalse$3(clientRect.node)) {
- return clientRect;
- }
- if (newDistance < oldDistance) {
- return clientRect;
- }
- return oldClientRect;
- });
- };
- var walkUntil = function (direction, root, predicateFn, startNode, includeChildren) {
- var node = findNode(startNode, direction, isEditableCaretCandidate$1, root, !includeChildren);
- do {
- if (!node || predicateFn(node)) {
- return;
- }
- } while (node = findNode(node, direction, isEditableCaretCandidate$1, root));
- };
- var findLineNodeRects = function (root, targetNodeRect, includeChildren) {
- if (includeChildren === void 0) {
- includeChildren = true;
- }
- var clientRects = [];
- var collect = function (checkPosFn, node) {
- var lineRects = filter$4(getClientRects([node]), function (clientRect) {
- return !checkPosFn(clientRect, targetNodeRect);
- });
- clientRects = clientRects.concat(lineRects);
- return lineRects.length === 0;
- };
- clientRects.push(targetNodeRect);
- walkUntil(VDirection.Up, root, curry(collect, isAbove$1), targetNodeRect.node, includeChildren);
- walkUntil(VDirection.Down, root, curry(collect, isBelow$1), targetNodeRect.node, includeChildren);
- return clientRects;
- };
- var getFakeCaretTargets = function (root) {
- return filter$4(from(root.getElementsByTagName('*')), isFakeCaretTarget);
- };
- var caretInfo = function (clientRect, clientX) {
- return {
- node: clientRect.node,
- before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
- };
- };
- var closestFakeCaret = function (root, clientX, clientY) {
- var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root));
- var targetNodeRects = filter$4(fakeTargetNodeRects, curry(isInsideY, clientY));
- var checkInside = function (clientRect) {
- return !isTable$3(clientRect.node) && !isMedia$2(clientRect.node);
- };
- var closestNodeRect = findClosestClientRect(targetNodeRects, clientX, checkInside);
- if (closestNodeRect) {
- var includeChildren = checkInside(closestNodeRect);
- closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX, checkInside);
- if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
- return caretInfo(closestNodeRect, clientX);
- }
- }
- return null;
- };
- var moveToRange = function (editor, rng) {
- editor.selection.setRng(rng);
- scrollRangeIntoView(editor, editor.selection.getRng());
- };
- var renderRangeCaretOpt = function (editor, range, scrollIntoView) {
- return Optional.some(renderRangeCaret(editor, range, scrollIntoView));
- };
- var moveHorizontally = function (editor, direction, range, isBefore, isAfter, isElement) {
- var forwards = direction === HDirection.Forwards;
- var caretWalker = CaretWalker(editor.getBody());
- var getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev);
- var isBeforeFn = forwards ? isBefore : isAfter;
- if (!range.collapsed) {
- var node = getSelectedNode(range);
- if (isElement(node)) {
- return showCaret(direction, editor, node, direction === HDirection.Backwards, false);
- }
- }
- var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
- if (isBeforeFn(caretPosition)) {
- return selectNode(editor, caretPosition.getNode(!forwards));
- }
- var nextCaretPosition = normalizePosition(forwards, getNextPosFn(caretPosition));
- var rangeIsInContainerBlock = isRangeInCaretContainerBlock(range);
- if (!nextCaretPosition) {
- return rangeIsInContainerBlock ? Optional.some(range) : Optional.none();
- }
- if (isBeforeFn(nextCaretPosition)) {
- return showCaret(direction, editor, nextCaretPosition.getNode(!forwards), forwards, false);
- }
- var peekCaretPosition = getNextPosFn(nextCaretPosition);
- if (peekCaretPosition && isBeforeFn(peekCaretPosition)) {
- if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) {
- return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, false);
- }
- }
- if (rangeIsInContainerBlock) {
- return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false);
- }
- return Optional.none();
- };
- var moveVertically = function (editor, direction, range, isBefore, isAfter, isElement) {
- var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
- var caretClientRect = last$1(caretPosition.getClientRects());
- var forwards = direction === VDirection.Down;
- if (!caretClientRect) {
- return Optional.none();
- }
- var walkerFn = forwards ? downUntil : upUntil;
- var linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition);
- var nextLinePositions = filter$4(linePositions, isLine(1));
- var clientX = caretClientRect.left;
- var nextLineRect = findClosestClientRect(nextLinePositions, clientX);
- if (nextLineRect && isElement(nextLineRect.node)) {
- var dist1 = Math.abs(clientX - nextLineRect.left);
- var dist2 = Math.abs(clientX - nextLineRect.right);
- return showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false);
- }
- var currentNode;
- if (isBefore(caretPosition)) {
- currentNode = caretPosition.getNode();
- } else if (isAfter(caretPosition)) {
- currentNode = caretPosition.getNode(true);
- } else {
- currentNode = getSelectedNode(range);
- }
- if (currentNode) {
- var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), currentNode);
- var closestNextLineRect = findClosestClientRect(filter$4(caretPositions, isLine(1)), clientX);
- if (closestNextLineRect) {
- return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
- }
- closestNextLineRect = last$1(filter$4(caretPositions, isLine(0)));
- if (closestNextLineRect) {
- return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
- }
- }
- if (nextLinePositions.length === 0) {
- return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore).map(function (pos) {
- return renderRangeCaret(editor, pos.toRange(), false);
- });
- }
- return Optional.none();
- };
- var getLineEndPoint = function (editor, forward) {
- var rng = editor.selection.getRng();
- var body = editor.getBody();
- if (forward) {
- var from = CaretPosition.fromRangeEnd(rng);
- var result = getPositionsUntilNextLine(body, from);
- return last$2(result.positions);
- } else {
- var from = CaretPosition.fromRangeStart(rng);
- var result = getPositionsUntilPreviousLine(body, from);
- return head(result.positions);
- }
- };
- var moveToLineEndPoint$3 = function (editor, forward, isElementPosition) {
- return getLineEndPoint(editor, forward).filter(isElementPosition).exists(function (pos) {
- editor.selection.setRng(pos.toRange());
- return true;
- });
- };
- var setCaretPosition = function (editor, pos) {
- var rng = editor.dom.createRng();
- rng.setStart(pos.container(), pos.offset());
- rng.setEnd(pos.container(), pos.offset());
- editor.selection.setRng(rng);
- };
- var setSelected = function (state, elm) {
- if (state) {
- elm.setAttribute('data-mce-selected', 'inline-boundary');
- } else {
- elm.removeAttribute('data-mce-selected');
- }
- };
- var renderCaretLocation = function (editor, caret, location) {
- return renderCaret(caret, location).map(function (pos) {
- setCaretPosition(editor, pos);
- return location;
- });
- };
- var findLocation = function (editor, caret, forward) {
- var rootNode = editor.getBody();
- var from = CaretPosition.fromRangeStart(editor.selection.getRng());
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- var location = findLocation$1(forward, isInlineTarget$1, rootNode, from);
- return location.bind(function (location) {
- return renderCaretLocation(editor, caret, location);
- });
- };
- var toggleInlines = function (isInlineTarget, dom, elms) {
- var inlineBoundaries = map$3(descendants(SugarElement.fromDom(dom.getRoot()), '*[data-mce-selected="inline-boundary"]'), function (e) {
- return e.dom;
- });
- var selectedInlines = filter$4(inlineBoundaries, isInlineTarget);
- var targetInlines = filter$4(elms, isInlineTarget);
- each$k(difference(selectedInlines, targetInlines), curry(setSelected, false));
- each$k(difference(targetInlines, selectedInlines), curry(setSelected, true));
- };
- var safeRemoveCaretContainer = function (editor, caret) {
- if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) {
- var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
- if (CaretPosition.isTextPosition(pos) && isAtZwsp(pos) === false) {
- setCaretPosition(editor, removeAndReposition(caret.get(), pos));
- caret.set(null);
- }
- }
- };
- var renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) {
- if (editor.selection.isCollapsed()) {
- var inlines = filter$4(elms, isInlineTarget);
- each$k(inlines, function (_inline) {
- var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
- readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) {
- return renderCaretLocation(editor, caret, location);
- });
- });
- }
- };
- var move$2 = function (editor, caret, forward) {
- return isInlineBoundariesEnabled(editor) ? findLocation(editor, caret, forward).isSome() : false;
- };
- var moveWord = function (forward, editor, _caret) {
- return isInlineBoundariesEnabled(editor) ? moveByWord(forward, editor) : false;
- };
- var setupSelectedState = function (editor) {
- var caret = Cell(null);
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- editor.on('NodeChange', function (e) {
- if (isInlineBoundariesEnabled(editor) && !(Env.browser.isIE() && e.initial)) {
- toggleInlines(isInlineTarget$1, editor.dom, e.parents);
- safeRemoveCaretContainer(editor, caret);
- renderInsideInlineCaret(isInlineTarget$1, editor, caret, e.parents);
- }
- });
- return caret;
- };
- var moveNextWord = curry(moveWord, true);
- var movePrevWord = curry(moveWord, false);
- var moveToLineEndPoint$2 = function (editor, forward, caret) {
- if (isInlineBoundariesEnabled(editor)) {
- var linePoint = getLineEndPoint(editor, forward).getOrThunk(function () {
- var rng = editor.selection.getRng();
- return forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng);
- });
- return readLocation(curry(isInlineTarget, editor), editor.getBody(), linePoint).exists(function (loc) {
- var outsideLoc = outside(loc);
- return renderCaret(caret, outsideLoc).exists(function (pos) {
- setCaretPosition(editor, pos);
- return true;
- });
- });
- } else {
- return false;
- }
- };
- var rangeFromPositions = function (from, to) {
- var range = document.createRange();
- range.setStart(from.container(), from.offset());
- range.setEnd(to.container(), to.offset());
- return range;
- };
- var hasOnlyTwoOrLessPositionsLeft = function (elm) {
- return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) {
- var normalizedFirstPos = normalizePosition(true, firstPos);
- var normalizedLastPos = normalizePosition(false, lastPos);
- return nextPosition(elm, normalizedFirstPos).forall(function (pos) {
- return pos.isEqual(normalizedLastPos);
- });
- }).getOr(true);
- };
- var setCaretLocation = function (editor, caret) {
- return function (location) {
- return renderCaret(caret, location).exists(function (pos) {
- setCaretPosition(editor, pos);
- return true;
- });
- };
- };
- var deleteFromTo = function (editor, caret, from, to) {
- var rootNode = editor.getBody();
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- editor.undoManager.ignore(function () {
- editor.selection.setRng(rangeFromPositions(from, to));
- editor.execCommand('Delete');
- readLocation(isInlineTarget$1, rootNode, CaretPosition.fromRangeStart(editor.selection.getRng())).map(inside).map(setCaretLocation(editor, caret));
- });
- editor.nodeChanged();
- };
- var rescope = function (rootNode, node) {
- var parentBlock = getParentBlock$2(node, rootNode);
- return parentBlock ? parentBlock : rootNode;
- };
- var backspaceDeleteCollapsed = function (editor, caret, forward, from) {
- var rootNode = rescope(editor.getBody(), from.container());
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- var fromLocation = readLocation(isInlineTarget$1, rootNode, from);
- return fromLocation.bind(function (location) {
- if (forward) {
- return location.fold(constant(Optional.some(inside(location))), Optional.none, constant(Optional.some(outside(location))), Optional.none);
- } else {
- return location.fold(Optional.none, constant(Optional.some(outside(location))), Optional.none, constant(Optional.some(inside(location))));
- }
- }).map(setCaretLocation(editor, caret)).getOrThunk(function () {
- var toPosition = navigate(forward, rootNode, from);
- var toLocation = toPosition.bind(function (pos) {
- return readLocation(isInlineTarget$1, rootNode, pos);
- });
- return lift2(fromLocation, toLocation, function () {
- return findRootInline(isInlineTarget$1, rootNode, from).exists(function (elm) {
- if (hasOnlyTwoOrLessPositionsLeft(elm)) {
- deleteElement$2(editor, forward, SugarElement.fromDom(elm));
- return true;
- } else {
- return false;
- }
- });
- }).orThunk(function () {
- return toLocation.bind(function (_) {
- return toPosition.map(function (to) {
- if (forward) {
- deleteFromTo(editor, caret, from, to);
- } else {
- deleteFromTo(editor, caret, to, from);
- }
- return true;
- });
- });
- }).getOr(false);
- });
- };
- var backspaceDelete$3 = function (editor, caret, forward) {
- if (editor.selection.isCollapsed() && isInlineBoundariesEnabled(editor)) {
- var from = CaretPosition.fromRangeStart(editor.selection.getRng());
- return backspaceDeleteCollapsed(editor, caret, forward, from);
- }
- return false;
- };
- var getParentInlines = function (rootElm, startElm) {
- var parents = parentsAndSelf(startElm, rootElm);
- return findIndex$2(parents, isBlock$2).fold(constant(parents), function (index) {
- return parents.slice(0, index);
- });
- };
- var hasOnlyOneChild = function (elm) {
- return childNodesCount(elm) === 1;
- };
- var deleteLastPosition = function (forward, editor, target, parentInlines) {
- var isFormatElement$1 = curry(isFormatElement, editor);
- var formatNodes = map$3(filter$4(parentInlines, isFormatElement$1), function (elm) {
- return elm.dom;
- });
- if (formatNodes.length === 0) {
- deleteElement$2(editor, forward, target);
- } else {
- var pos = replaceWithCaretFormat(target.dom, formatNodes);
- editor.selection.setRng(pos.toRange());
- }
- };
- var deleteCaret$1 = function (editor, forward) {
- var rootElm = SugarElement.fromDom(editor.getBody());
- var startElm = SugarElement.fromDom(editor.selection.getStart());
- var parentInlines = filter$4(getParentInlines(rootElm, startElm), hasOnlyOneChild);
- return last$2(parentInlines).exists(function (target) {
- var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
- if (willDeleteLastPositionInElement(forward, fromPos, target.dom) && !isEmptyCaretFormatElement(target)) {
- deleteLastPosition(forward, editor, target, parentInlines);
- return true;
- } else {
- return false;
- }
- });
- };
- var backspaceDelete$2 = function (editor, forward) {
- return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false;
- };
- var deleteElement = function (editor, forward, element) {
- editor._selectionOverrides.hideFakeCaret();
- deleteElement$2(editor, forward, SugarElement.fromDom(element));
- return true;
- };
- var deleteCaret = function (editor, forward) {
- var isNearMedia = forward ? isBeforeMedia : isAfterMedia;
- var direction = forward ? HDirection.Forwards : HDirection.Backwards;
- var fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng());
- if (isNearMedia(fromPos)) {
- return deleteElement(editor, forward, fromPos.getNode(!forward));
- } else {
- return Optional.from(normalizePosition(forward, fromPos)).filter(function (pos) {
- return isNearMedia(pos) && isMoveInsideSameBlock(fromPos, pos);
- }).exists(function (pos) {
- return deleteElement(editor, forward, pos.getNode(!forward));
- });
- }
- };
- var deleteRange = function (editor, forward) {
- var selectedNode = editor.selection.getNode();
- return isMedia$2(selectedNode) ? deleteElement(editor, forward, selectedNode) : false;
- };
- var backspaceDelete$1 = function (editor, forward) {
- return editor.selection.isCollapsed() ? deleteCaret(editor, forward) : deleteRange(editor, forward);
- };
- var isEditable = function (target) {
- return closest$3(target, function (elm) {
- return isContentEditableTrue$4(elm.dom) || isContentEditableFalse$b(elm.dom);
- }).exists(function (elm) {
- return isContentEditableTrue$4(elm.dom);
- });
- };
- var parseIndentValue = function (value) {
- var number = parseInt(value, 10);
- return isNaN(number) ? 0 : number;
- };
- var getIndentStyleName = function (useMargin, element) {
- var indentStyleName = useMargin || isTable$2(element) ? 'margin' : 'padding';
- var suffix = get$5(element, 'direction') === 'rtl' ? '-right' : '-left';
- return indentStyleName + suffix;
- };
- var indentElement = function (dom, command, useMargin, value, unit, element) {
- var indentStyleName = getIndentStyleName(useMargin, SugarElement.fromDom(element));
- if (command === 'outdent') {
- var styleValue = Math.max(0, parseIndentValue(element.style[indentStyleName]) - value);
- dom.setStyle(element, indentStyleName, styleValue ? styleValue + unit : '');
- } else {
- var styleValue = parseIndentValue(element.style[indentStyleName]) + value + unit;
- dom.setStyle(element, indentStyleName, styleValue);
- }
- };
- var validateBlocks = function (editor, blocks) {
- return forall(blocks, function (block) {
- var indentStyleName = getIndentStyleName(shouldIndentUseMargin(editor), block);
- var intentValue = getRaw(block, indentStyleName).map(parseIndentValue).getOr(0);
- var contentEditable = editor.dom.getContentEditable(block.dom);
- return contentEditable !== 'false' && intentValue > 0;
- });
- };
- var canOutdent = function (editor) {
- var blocks = getBlocksToIndent(editor);
- return !editor.mode.isReadOnly() && (blocks.length > 1 || validateBlocks(editor, blocks));
- };
- var isListComponent = function (el) {
- return isList(el) || isListItem(el);
- };
- var parentIsListComponent = function (el) {
- return parent(el).exists(isListComponent);
- };
- var getBlocksToIndent = function (editor) {
- return filter$4(fromDom$1(editor.selection.getSelectedBlocks()), function (el) {
- return !isListComponent(el) && !parentIsListComponent(el) && isEditable(el);
- });
- };
- var handle = function (editor, command) {
- var dom = editor.dom, selection = editor.selection, formatter = editor.formatter;
- var indentation = getIndentation(editor);
- var indentUnit = /[a-z%]+$/i.exec(indentation)[0];
- var indentValue = parseInt(indentation, 10);
- var useMargin = shouldIndentUseMargin(editor);
- var forcedRootBlock = getForcedRootBlock(editor);
- if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) {
- if (forcedRootBlock === '' && !dom.getParent(selection.getNode(), dom.isBlock)) {
- formatter.apply('div');
- }
- }
- each$k(getBlocksToIndent(editor), function (block) {
- indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom);
- });
- };
- var backspaceDelete = function (editor, _forward) {
- if (editor.selection.isCollapsed() && canOutdent(editor)) {
- var dom = editor.dom;
- var rng = editor.selection.getRng();
- var pos = CaretPosition.fromRangeStart(rng);
- var block = dom.getParent(rng.startContainer, dom.isBlock);
- if (block !== null && isAtStartOfBlock(SugarElement.fromDom(block), pos)) {
- handle(editor, 'outdent');
- return true;
- }
- }
- return false;
- };
- var nativeCommand = function (editor, command) {
- editor.getDoc().execCommand(command, false, null);
- };
- var deleteCommand = function (editor, caret) {
- if (backspaceDelete(editor)) {
- return;
- } else if (backspaceDelete$5(editor, false)) {
- return;
- } else if (backspaceDelete$6(editor, false)) {
- return;
- } else if (backspaceDelete$3(editor, caret, false)) {
- return;
- } else if (backspaceDelete$8(editor, false)) {
- return;
- } else if (backspaceDelete$9(editor)) {
- return;
- } else if (backspaceDelete$4(editor, false)) {
- return;
- } else if (backspaceDelete$1(editor, false)) {
- return;
- } else if (backspaceDelete$7(editor)) {
- return;
- } else if (backspaceDelete$2(editor, false)) {
- return;
- } else {
- nativeCommand(editor, 'Delete');
- paddEmptyBody(editor);
- }
- };
- var forwardDeleteCommand = function (editor, caret) {
- if (backspaceDelete$5(editor, true)) {
- return;
- } else if (backspaceDelete$6(editor, true)) {
- return;
- } else if (backspaceDelete$3(editor, caret, true)) {
- return;
- } else if (backspaceDelete$8(editor, true)) {
- return;
- } else if (backspaceDelete$9(editor)) {
- return;
- } else if (backspaceDelete$4(editor, true)) {
- return;
- } else if (backspaceDelete$1(editor, true)) {
- return;
- } else if (backspaceDelete$7(editor)) {
- return;
- } else if (backspaceDelete$2(editor, true)) {
- return;
- } else {
- nativeCommand(editor, 'ForwardDelete');
- }
- };
- var setup$f = function (editor, caret) {
- editor.addCommand('delete', function () {
- deleteCommand(editor, caret);
- });
- editor.addCommand('forwardDelete', function () {
- forwardDeleteCommand(editor, caret);
- });
- };
- var SIGNIFICANT_MOVE = 5;
- var LONGPRESS_DELAY = 400;
- var getTouch = function (event) {
- if (event.touches === undefined || event.touches.length !== 1) {
- return Optional.none();
- }
- return Optional.some(event.touches[0]);
- };
- var isFarEnough = function (touch, data) {
- var distX = Math.abs(touch.clientX - data.x);
- var distY = Math.abs(touch.clientY - data.y);
- return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE;
- };
- var setup$e = function (editor) {
- var startData = value();
- var longpressFired = Cell(false);
- var debounceLongpress = last(function (e) {
- editor.fire('longpress', __assign(__assign({}, e), { type: 'longpress' }));
- longpressFired.set(true);
- }, LONGPRESS_DELAY);
- editor.on('touchstart', function (e) {
- getTouch(e).each(function (touch) {
- debounceLongpress.cancel();
- var data = {
- x: touch.clientX,
- y: touch.clientY,
- target: e.target
- };
- debounceLongpress.throttle(e);
- longpressFired.set(false);
- startData.set(data);
- });
- }, true);
- editor.on('touchmove', function (e) {
- debounceLongpress.cancel();
- getTouch(e).each(function (touch) {
- startData.on(function (data) {
- if (isFarEnough(touch, data)) {
- startData.clear();
- longpressFired.set(false);
- editor.fire('longpresscancel');
- }
- });
- });
- }, true);
- editor.on('touchend touchcancel', function (e) {
- debounceLongpress.cancel();
- if (e.type === 'touchcancel') {
- return;
- }
- startData.get().filter(function (data) {
- return data.target.isEqualNode(e.target);
- }).each(function () {
- if (longpressFired.get()) {
- e.preventDefault();
- } else {
- editor.fire('tap', __assign(__assign({}, e), { type: 'tap' }));
- }
- });
- }, true);
- };
- var isBlockElement = function (blockElements, node) {
- return has$2(blockElements, node.nodeName);
- };
- var isValidTarget = function (blockElements, node) {
- if (isText$7(node)) {
- return true;
- } else if (isElement$5(node)) {
- return !isBlockElement(blockElements, node) && !isBookmarkNode$1(node);
- } else {
- return false;
- }
- };
- var hasBlockParent = function (blockElements, root, node) {
- return exists(parents(SugarElement.fromDom(node), SugarElement.fromDom(root)), function (elm) {
- return isBlockElement(blockElements, elm.dom);
- });
- };
- var shouldRemoveTextNode = function (blockElements, node) {
- if (isText$7(node)) {
- if (node.nodeValue.length === 0) {
- return true;
- } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) {
- return true;
- }
- }
- return false;
- };
- var addRootBlocks = function (editor) {
- var dom = editor.dom, selection = editor.selection;
- var schema = editor.schema, blockElements = schema.getBlockElements();
- var node = selection.getStart();
- var rootNode = editor.getBody();
- var rootBlockNode, tempNode, wrapped;
- var forcedRootBlock = getForcedRootBlock(editor);
- if (!node || !isElement$5(node) || !forcedRootBlock) {
- return;
- }
- var rootNodeName = rootNode.nodeName.toLowerCase();
- if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) {
- return;
- }
- var rng = selection.getRng();
- var startContainer = rng.startContainer;
- var startOffset = rng.startOffset;
- var endContainer = rng.endContainer;
- var endOffset = rng.endOffset;
- var restoreSelection = hasFocus(editor);
- node = rootNode.firstChild;
- while (node) {
- if (isValidTarget(blockElements, node)) {
- if (shouldRemoveTextNode(blockElements, node)) {
- tempNode = node;
- node = node.nextSibling;
- dom.remove(tempNode);
- continue;
- }
- if (!rootBlockNode) {
- rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor));
- node.parentNode.insertBefore(rootBlockNode, node);
- wrapped = true;
- }
- tempNode = node;
- node = node.nextSibling;
- rootBlockNode.appendChild(tempNode);
- } else {
- rootBlockNode = null;
- node = node.nextSibling;
- }
- }
- if (wrapped && restoreSelection) {
- rng.setStart(startContainer, startOffset);
- rng.setEnd(endContainer, endOffset);
- selection.setRng(rng);
- editor.nodeChanged();
- }
- };
- var setup$d = function (editor) {
- if (getForcedRootBlock(editor)) {
- editor.on('NodeChange', curry(addRootBlocks, editor));
- }
- };
- var findBlockCaretContainer = function (editor) {
- return descendant(SugarElement.fromDom(editor.getBody()), '*[data-mce-caret]').map(function (elm) {
- return elm.dom;
- }).getOrNull();
- };
- var removeIeControlRect = function (editor) {
- editor.selection.setRng(editor.selection.getRng());
- };
- var showBlockCaretContainer = function (editor, blockCaretContainer) {
- if (blockCaretContainer.hasAttribute('data-mce-caret')) {
- showCaretContainerBlock(blockCaretContainer);
- removeIeControlRect(editor);
- editor.selection.scrollIntoView(blockCaretContainer);
- }
- };
- var handleBlockContainer = function (editor, e) {
- var blockCaretContainer = findBlockCaretContainer(editor);
- if (!blockCaretContainer) {
- return;
- }
- if (e.type === 'compositionstart') {
- e.preventDefault();
- e.stopPropagation();
- showBlockCaretContainer(editor, blockCaretContainer);
- return;
- }
- if (hasContent(blockCaretContainer)) {
- showBlockCaretContainer(editor, blockCaretContainer);
- editor.undoManager.add();
- }
- };
- var setup$c = function (editor) {
- editor.on('keyup compositionstart', curry(handleBlockContainer, editor));
- };
- var isContentEditableFalse$2 = isContentEditableFalse$b;
- var moveToCeFalseHorizontally = function (direction, editor, range) {
- return moveHorizontally(editor, direction, range, isBeforeContentEditableFalse, isAfterContentEditableFalse, isContentEditableFalse$2);
- };
- var moveToCeFalseVertically = function (direction, editor, range) {
- var isBefore = function (caretPosition) {
- return isBeforeContentEditableFalse(caretPosition) || isBeforeTable(caretPosition);
- };
- var isAfter = function (caretPosition) {
- return isAfterContentEditableFalse(caretPosition) || isAfterTable(caretPosition);
- };
- return moveVertically(editor, direction, range, isBefore, isAfter, isContentEditableFalse$2);
- };
- var createTextBlock = function (editor) {
- var textBlock = editor.dom.create(getForcedRootBlock(editor));
- if (!Env.ie || Env.ie >= 11) {
- textBlock.innerHTML = '<br data-mce-bogus="1">';
- }
- return textBlock;
- };
- var exitPreBlock = function (editor, direction, range) {
- var caretWalker = CaretWalker(editor.getBody());
- var getVisualCaretPosition$1 = curry(getVisualCaretPosition, direction === 1 ? caretWalker.next : caretWalker.prev);
- if (range.collapsed && hasForcedRootBlock(editor)) {
- var pre = editor.dom.getParent(range.startContainer, 'PRE');
- if (!pre) {
- return;
- }
- var caretPos = getVisualCaretPosition$1(CaretPosition.fromRangeStart(range));
- if (!caretPos) {
- var newBlock = createTextBlock(editor);
- if (direction === 1) {
- editor.$(pre).after(newBlock);
- } else {
- editor.$(pre).before(newBlock);
- }
- editor.selection.select(newBlock, true);
- editor.selection.collapse();
- }
- }
- };
- var getHorizontalRange = function (editor, forward) {
- var direction = forward ? HDirection.Forwards : HDirection.Backwards;
- var range = editor.selection.getRng();
- return moveToCeFalseHorizontally(direction, editor, range).orThunk(function () {
- exitPreBlock(editor, direction, range);
- return Optional.none();
- });
- };
- var getVerticalRange = function (editor, down) {
- var direction = down ? 1 : -1;
- var range = editor.selection.getRng();
- return moveToCeFalseVertically(direction, editor, range).orThunk(function () {
- exitPreBlock(editor, direction, range);
- return Optional.none();
- });
- };
- var moveH$2 = function (editor, forward) {
- return getHorizontalRange(editor, forward).exists(function (newRange) {
- moveToRange(editor, newRange);
- return true;
- });
- };
- var moveV$3 = function (editor, down) {
- return getVerticalRange(editor, down).exists(function (newRange) {
- moveToRange(editor, newRange);
- return true;
- });
- };
- var moveToLineEndPoint$1 = function (editor, forward) {
- var isCefPosition = forward ? isAfterContentEditableFalse : isBeforeContentEditableFalse;
- return moveToLineEndPoint$3(editor, forward, isCefPosition);
- };
- var isTarget = function (node) {
- return contains$3(['figcaption'], name(node));
- };
- var rangeBefore = function (target) {
- var rng = document.createRange();
- rng.setStartBefore(target.dom);
- rng.setEndBefore(target.dom);
- return rng;
- };
- var insertElement = function (root, elm, forward) {
- if (forward) {
- append$1(root, elm);
- } else {
- prepend(root, elm);
- }
- };
- var insertBr = function (root, forward) {
- var br = SugarElement.fromTag('br');
- insertElement(root, br, forward);
- return rangeBefore(br);
- };
- var insertBlock = function (root, forward, blockName, attrs) {
- var block = SugarElement.fromTag(blockName);
- var br = SugarElement.fromTag('br');
- setAll$1(block, attrs);
- append$1(block, br);
- insertElement(root, block, forward);
- return rangeBefore(br);
- };
- var insertEmptyLine = function (root, rootBlockName, attrs, forward) {
- if (rootBlockName === '') {
- return insertBr(root, forward);
- } else {
- return insertBlock(root, forward, rootBlockName, attrs);
- }
- };
- var getClosestTargetBlock = function (pos, root) {
- var isRoot = curry(eq, root);
- return closest$3(SugarElement.fromDom(pos.container()), isBlock$2, isRoot).filter(isTarget);
- };
- var isAtFirstOrLastLine = function (root, forward, pos) {
- return forward ? isAtLastLine(root.dom, pos) : isAtFirstLine(root.dom, pos);
- };
- var moveCaretToNewEmptyLine = function (editor, forward) {
- var root = SugarElement.fromDom(editor.getBody());
- var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
- var rootBlock = getForcedRootBlock(editor);
- var rootBlockAttrs = getForcedRootBlockAttrs(editor);
- return getClosestTargetBlock(pos, root).exists(function () {
- if (isAtFirstOrLastLine(root, forward, pos)) {
- var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward);
- editor.selection.setRng(rng);
- return true;
- } else {
- return false;
- }
- });
- };
- var moveV$2 = function (editor, forward) {
- if (editor.selection.isCollapsed()) {
- return moveCaretToNewEmptyLine(editor, forward);
- } else {
- return false;
- }
- };
- var defaultPatterns = function (patterns) {
- return map$3(patterns, function (pattern) {
- return __assign({
- shiftKey: false,
- altKey: false,
- ctrlKey: false,
- metaKey: false,
- keyCode: 0,
- action: noop
- }, pattern);
- });
- };
- var matchesEvent = function (pattern, evt) {
- return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey;
- };
- var match$1 = function (patterns, evt) {
- return bind(defaultPatterns(patterns), function (pattern) {
- return matchesEvent(pattern, evt) ? [pattern] : [];
- });
- };
- var action = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- return function () {
- return f.apply(null, x);
- };
- };
- var execute = function (patterns, evt) {
- return find$3(match$1(patterns, evt), function (pattern) {
- return pattern.action();
- });
- };
- var moveH$1 = function (editor, forward) {
- var direction = forward ? HDirection.Forwards : HDirection.Backwards;
- var range = editor.selection.getRng();
- return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia$2).exists(function (newRange) {
- moveToRange(editor, newRange);
- return true;
- });
- };
- var moveV$1 = function (editor, down) {
- var direction = down ? 1 : -1;
- var range = editor.selection.getRng();
- return moveVertically(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia$2).exists(function (newRange) {
- moveToRange(editor, newRange);
- return true;
- });
- };
- var moveToLineEndPoint = function (editor, forward) {
- var isNearMedia = forward ? isAfterMedia : isBeforeMedia;
- return moveToLineEndPoint$3(editor, forward, isNearMedia);
- };
- var deflate = function (rect, delta) {
- return {
- left: rect.left - delta,
- top: rect.top - delta,
- right: rect.right + delta * 2,
- bottom: rect.bottom + delta * 2,
- width: rect.width + delta,
- height: rect.height + delta
- };
- };
- var getCorners = function (getYAxisValue, tds) {
- return bind(tds, function (td) {
- var rect = deflate(clone(td.getBoundingClientRect()), -1);
- return [
- {
- x: rect.left,
- y: getYAxisValue(rect),
- cell: td
- },
- {
- x: rect.right,
- y: getYAxisValue(rect),
- cell: td
- }
- ];
- });
- };
- var findClosestCorner = function (corners, x, y) {
- return foldl(corners, function (acc, newCorner) {
- return acc.fold(function () {
- return Optional.some(newCorner);
- }, function (oldCorner) {
- var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y));
- var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y));
- return Optional.some(newDist < oldDist ? newCorner : oldCorner);
- });
- }, Optional.none());
- };
- var getClosestCell = function (getYAxisValue, isTargetCorner, table, x, y) {
- var cells = descendants(SugarElement.fromDom(table), 'td,th,caption').map(function (e) {
- return e.dom;
- });
- var corners = filter$4(getCorners(getYAxisValue, cells), function (corner) {
- return isTargetCorner(corner, y);
- });
- return findClosestCorner(corners, x, y).map(function (corner) {
- return corner.cell;
- });
- };
- var getBottomValue = function (rect) {
- return rect.bottom;
- };
- var getTopValue = function (rect) {
- return rect.top;
- };
- var isAbove = function (corner, y) {
- return corner.y < y;
- };
- var isBelow = function (corner, y) {
- return corner.y > y;
- };
- var getClosestCellAbove = curry(getClosestCell, getBottomValue, isAbove);
- var getClosestCellBelow = curry(getClosestCell, getTopValue, isBelow);
- var findClosestPositionInAboveCell = function (table, pos) {
- return head(pos.getClientRects()).bind(function (rect) {
- return getClosestCellAbove(table, rect.left, rect.top);
- }).bind(function (cell) {
- return findClosestHorizontalPosition(getLastLinePositions(cell), pos);
- });
- };
- var findClosestPositionInBelowCell = function (table, pos) {
- return last$2(pos.getClientRects()).bind(function (rect) {
- return getClosestCellBelow(table, rect.left, rect.top);
- }).bind(function (cell) {
- return findClosestHorizontalPosition(getFirstLinePositions(cell), pos);
- });
- };
- var hasNextBreak = function (getPositionsUntil, scope, lineInfo) {
- return lineInfo.breakAt.exists(function (breakPos) {
- return getPositionsUntil(scope, breakPos).breakAt.isSome();
- });
- };
- var startsWithWrapBreak = function (lineInfo) {
- return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0;
- };
- var startsWithBrBreak = function (lineInfo) {
- return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1;
- };
- var isAtTableCellLine = function (getPositionsUntil, scope, pos) {
- var lineInfo = getPositionsUntil(scope, pos);
- if (startsWithWrapBreak(lineInfo) || !isBr$5(pos.getNode()) && startsWithBrBreak(lineInfo)) {
- return !hasNextBreak(getPositionsUntil, scope, lineInfo);
- } else {
- return lineInfo.breakAt.isNone();
- }
- };
- var isAtFirstTableCellLine = curry(isAtTableCellLine, getPositionsUntilPreviousLine);
- var isAtLastTableCellLine = curry(isAtTableCellLine, getPositionsUntilNextLine);
- var isCaretAtStartOrEndOfTable = function (forward, rng, table) {
- var caretPos = CaretPosition.fromRangeStart(rng);
- return positionIn(!forward, table).exists(function (pos) {
- return pos.isEqual(caretPos);
- });
- };
- var navigateHorizontally = function (editor, forward, table, _td) {
- var rng = editor.selection.getRng();
- var direction = forward ? 1 : -1;
- if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) {
- showCaret(direction, editor, table, !forward, false).each(function (newRng) {
- moveToRange(editor, newRng);
- });
- return true;
- }
- return false;
- };
- var getClosestAbovePosition = function (root, table, start) {
- return findClosestPositionInAboveCell(table, start).orThunk(function () {
- return head(start.getClientRects()).bind(function (rect) {
- return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition.before(table)), rect.left);
- });
- }).getOr(CaretPosition.before(table));
- };
- var getClosestBelowPosition = function (root, table, start) {
- return findClosestPositionInBelowCell(table, start).orThunk(function () {
- return head(start.getClientRects()).bind(function (rect) {
- return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition.after(table)), rect.left);
- });
- }).getOr(CaretPosition.after(table));
- };
- var getTable = function (previous, pos) {
- var node = pos.getNode(previous);
- return isElement$5(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none();
- };
- var renderBlock = function (down, editor, table, pos) {
- var forcedRootBlock = getForcedRootBlock(editor);
- if (forcedRootBlock) {
- editor.undoManager.transact(function () {
- var element = SugarElement.fromTag(forcedRootBlock);
- setAll$1(element, getForcedRootBlockAttrs(editor));
- append$1(element, SugarElement.fromTag('br'));
- if (down) {
- after$3(SugarElement.fromDom(table), element);
- } else {
- before$4(SugarElement.fromDom(table), element);
- }
- var rng = editor.dom.createRng();
- rng.setStart(element.dom, 0);
- rng.setEnd(element.dom, 0);
- moveToRange(editor, rng);
- });
- } else {
- moveToRange(editor, pos.toRange());
- }
- };
- var moveCaret = function (editor, down, pos) {
- var table = down ? getTable(true, pos) : getTable(false, pos);
- var last = down === false;
- table.fold(function () {
- return moveToRange(editor, pos.toRange());
- }, function (table) {
- return positionIn(last, editor.getBody()).filter(function (lastPos) {
- return lastPos.isEqual(pos);
- }).fold(function () {
- return moveToRange(editor, pos.toRange());
- }, function (_) {
- return renderBlock(down, editor, table, pos);
- });
- });
- };
- var navigateVertically = function (editor, down, table, td) {
- var rng = editor.selection.getRng();
- var pos = CaretPosition.fromRangeStart(rng);
- var root = editor.getBody();
- if (!down && isAtFirstTableCellLine(td, pos)) {
- var newPos = getClosestAbovePosition(root, table, pos);
- moveCaret(editor, down, newPos);
- return true;
- } else if (down && isAtLastTableCellLine(td, pos)) {
- var newPos = getClosestBelowPosition(root, table, pos);
- moveCaret(editor, down, newPos);
- return true;
- } else {
- return false;
- }
- };
- var move$1 = function (editor, forward, mover) {
- return Optional.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
- return Optional.from(editor.dom.getParent(td, 'table')).map(function (table) {
- return mover(editor, forward, table, td);
- });
- }).getOr(false);
- };
- var moveH = function (editor, forward) {
- return move$1(editor, forward, navigateHorizontally);
- };
- var moveV = function (editor, forward) {
- return move$1(editor, forward, navigateVertically);
- };
- var executeKeydownOverride$3 = function (editor, caret, evt) {
- var os = detect().os;
- execute([
- {
- keyCode: VK.RIGHT,
- action: action(moveH$2, editor, true)
- },
- {
- keyCode: VK.LEFT,
- action: action(moveH$2, editor, false)
- },
- {
- keyCode: VK.UP,
- action: action(moveV$3, editor, false)
- },
- {
- keyCode: VK.DOWN,
- action: action(moveV$3, editor, true)
- },
- {
- keyCode: VK.RIGHT,
- action: action(moveH, editor, true)
- },
- {
- keyCode: VK.LEFT,
- action: action(moveH, editor, false)
- },
- {
- keyCode: VK.UP,
- action: action(moveV, editor, false)
- },
- {
- keyCode: VK.DOWN,
- action: action(moveV, editor, true)
- },
- {
- keyCode: VK.RIGHT,
- action: action(moveH$1, editor, true)
- },
- {
- keyCode: VK.LEFT,
- action: action(moveH$1, editor, false)
- },
- {
- keyCode: VK.UP,
- action: action(moveV$1, editor, false)
- },
- {
- keyCode: VK.DOWN,
- action: action(moveV$1, editor, true)
- },
- {
- keyCode: VK.RIGHT,
- action: action(move$2, editor, caret, true)
- },
- {
- keyCode: VK.LEFT,
- action: action(move$2, editor, caret, false)
- },
- {
- keyCode: VK.RIGHT,
- ctrlKey: !os.isOSX(),
- altKey: os.isOSX(),
- action: action(moveNextWord, editor, caret)
- },
- {
- keyCode: VK.LEFT,
- ctrlKey: !os.isOSX(),
- altKey: os.isOSX(),
- action: action(movePrevWord, editor, caret)
- },
- {
- keyCode: VK.UP,
- action: action(moveV$2, editor, false)
- },
- {
- keyCode: VK.DOWN,
- action: action(moveV$2, editor, true)
- }
- ], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var setup$b = function (editor, caret) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride$3(editor, caret, evt);
- }
- });
- };
- var executeKeydownOverride$2 = function (editor, caret, evt) {
- execute([
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete, editor, false)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$5, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$5, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$6, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$6, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$3, editor, caret, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$3, editor, caret, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$9, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$9, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$4, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$4, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$1, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$1, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$7, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$7, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$8, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$8, editor, true)
- },
- {
- keyCode: VK.BACKSPACE,
- action: action(backspaceDelete$2, editor, false)
- },
- {
- keyCode: VK.DELETE,
- action: action(backspaceDelete$2, editor, true)
- }
- ], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var executeKeyupOverride = function (editor, evt) {
- execute([
- {
- keyCode: VK.BACKSPACE,
- action: action(paddEmptyElement, editor)
- },
- {
- keyCode: VK.DELETE,
- action: action(paddEmptyElement, editor)
- }
- ], evt);
- };
- var setup$a = function (editor, caret) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride$2(editor, caret, evt);
- }
- });
- editor.on('keyup', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeyupOverride(editor, evt);
- }
- });
- };
- var firstNonWhiteSpaceNodeSibling = function (node) {
- while (node) {
- if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) {
- return node;
- }
- node = node.nextSibling;
- }
- };
- var moveToCaretPosition = function (editor, root) {
- var node, lastNode = root;
- var dom = editor.dom;
- var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements();
- if (!root) {
- return;
- }
- if (/^(LI|DT|DD)$/.test(root.nodeName)) {
- var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
- if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
- root.insertBefore(dom.doc.createTextNode(nbsp), root.firstChild);
- }
- }
- var rng = dom.createRng();
- root.normalize();
- if (root.hasChildNodes()) {
- var walker = new DomTreeWalker(root, root);
- while (node = walker.current()) {
- if (isText$7(node)) {
- rng.setStart(node, 0);
- rng.setEnd(node, 0);
- break;
- }
- if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
- rng.setStartBefore(node);
- rng.setEndBefore(node);
- break;
- }
- lastNode = node;
- node = walker.next();
- }
- if (!node) {
- rng.setStart(lastNode, 0);
- rng.setEnd(lastNode, 0);
- }
- } else {
- if (isBr$5(root)) {
- if (root.nextSibling && dom.isBlock(root.nextSibling)) {
- rng.setStartBefore(root);
- rng.setEndBefore(root);
- } else {
- rng.setStartAfter(root);
- rng.setEndAfter(root);
- }
- } else {
- rng.setStart(root, 0);
- rng.setEnd(root, 0);
- }
- }
- editor.selection.setRng(rng);
- scrollRangeIntoView(editor, rng);
- };
- var getEditableRoot$1 = function (dom, node) {
- var root = dom.getRoot();
- var parent, editableRoot;
- parent = node;
- while (parent !== root && dom.getContentEditable(parent) !== 'false') {
- if (dom.getContentEditable(parent) === 'true') {
- editableRoot = parent;
- }
- parent = parent.parentNode;
- }
- return parent !== root ? editableRoot : root;
- };
- var getParentBlock = function (editor) {
- return Optional.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock));
- };
- var getParentBlockName = function (editor) {
- return getParentBlock(editor).fold(constant(''), function (parentBlock) {
- return parentBlock.nodeName.toUpperCase();
- });
- };
- var isListItemParentBlock = function (editor) {
- return getParentBlock(editor).filter(function (elm) {
- return isListItem(SugarElement.fromDom(elm));
- }).isSome();
- };
- var hasFirstChild = function (elm, name) {
- return elm.firstChild && elm.firstChild.nodeName === name;
- };
- var isFirstChild = function (elm) {
- var _a;
- return ((_a = elm.parentNode) === null || _a === void 0 ? void 0 : _a.firstChild) === elm;
- };
- var hasParent = function (elm, parentName) {
- return elm && elm.parentNode && elm.parentNode.nodeName === parentName;
- };
- var isListBlock = function (elm) {
- return elm && /^(OL|UL|LI)$/.test(elm.nodeName);
- };
- var isNestedList = function (elm) {
- return isListBlock(elm) && isListBlock(elm.parentNode);
- };
- var getContainerBlock = function (containerBlock) {
- var containerBlockParent = containerBlock.parentNode;
- if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
- return containerBlockParent;
- }
- return containerBlock;
- };
- var isFirstOrLastLi = function (containerBlock, parentBlock, first) {
- var node = containerBlock[first ? 'firstChild' : 'lastChild'];
- while (node) {
- if (isElement$5(node)) {
- break;
- }
- node = node[first ? 'nextSibling' : 'previousSibling'];
- }
- return node === parentBlock;
- };
- var insert$3 = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) {
- var dom = editor.dom;
- var rng = editor.selection.getRng();
- if (containerBlock === editor.getBody()) {
- return;
- }
- if (isNestedList(containerBlock)) {
- newBlockName = 'LI';
- }
- var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
- if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) {
- if (hasParent(containerBlock, 'LI')) {
- var containerBlockParent = getContainerBlock(containerBlock);
- dom.insertAfter(newBlock, containerBlockParent);
- if (isFirstChild(containerBlock)) {
- dom.remove(containerBlockParent);
- } else {
- dom.remove(containerBlock);
- }
- } else {
- dom.replace(newBlock, containerBlock);
- }
- } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) {
- if (hasParent(containerBlock, 'LI')) {
- dom.insertAfter(newBlock, getContainerBlock(containerBlock));
- newBlock.appendChild(dom.doc.createTextNode(' '));
- newBlock.appendChild(containerBlock);
- } else {
- containerBlock.parentNode.insertBefore(newBlock, containerBlock);
- }
- dom.remove(parentBlock);
- } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) {
- dom.insertAfter(newBlock, getContainerBlock(containerBlock));
- dom.remove(parentBlock);
- } else {
- containerBlock = getContainerBlock(containerBlock);
- var tmpRng = rng.cloneRange();
- tmpRng.setStartAfter(parentBlock);
- tmpRng.setEndAfter(containerBlock);
- var fragment = tmpRng.extractContents();
- if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) {
- newBlock = fragment.firstChild;
- dom.insertAfter(fragment, containerBlock);
- } else {
- dom.insertAfter(fragment, containerBlock);
- dom.insertAfter(newBlock, containerBlock);
- }
- dom.remove(parentBlock);
- }
- moveToCaretPosition(editor, newBlock);
- };
- var trimZwsp = function (fragment) {
- each$k(descendants$1(SugarElement.fromDom(fragment), isText$8), function (text) {
- var rawNode = text.dom;
- rawNode.nodeValue = trim$2(rawNode.nodeValue);
- });
- };
- var isEmptyAnchor = function (dom, elm) {
- return elm && elm.nodeName === 'A' && dom.isEmpty(elm);
- };
- var isTableCell = function (node) {
- return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
- };
- var emptyBlock = function (elm) {
- elm.innerHTML = '<br data-mce-bogus="1">';
- };
- var containerAndSiblingName = function (container, nodeName) {
- return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName;
- };
- var canSplitBlock = function (dom, node) {
- return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true';
- };
- var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) {
- var node = block;
- var firstChilds = [];
- var i;
- if (!node) {
- return;
- }
- while (node = node.firstChild) {
- if (dom.isBlock(node)) {
- return;
- }
- if (isElement$5(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
- firstChilds.push(node);
- }
- }
- i = firstChilds.length;
- while (i--) {
- node = firstChilds[i];
- if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') {
- dom.remove(node);
- } else {
- if (isEmptyAnchor(dom, node)) {
- dom.remove(node);
- }
- }
- }
- };
- var normalizeZwspOffset = function (start, container, offset) {
- if (isText$7(container) === false) {
- return offset;
- } else if (start) {
- return offset === 1 && container.data.charAt(offset - 1) === ZWSP$1 ? 0 : offset;
- } else {
- return offset === container.data.length - 1 && container.data.charAt(offset) === ZWSP$1 ? container.data.length : offset;
- }
- };
- var includeZwspInRange = function (rng) {
- var newRng = rng.cloneRange();
- newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset));
- newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset));
- return newRng;
- };
- var trimLeadingLineBreaks = function (node) {
- do {
- if (isText$7(node)) {
- node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
- }
- node = node.firstChild;
- } while (node);
- };
- var getEditableRoot = function (dom, node) {
- var root = dom.getRoot();
- var parent, editableRoot;
- parent = node;
- while (parent !== root && dom.getContentEditable(parent) !== 'false') {
- if (dom.getContentEditable(parent) === 'true') {
- editableRoot = parent;
- }
- parent = parent.parentNode;
- }
- return parent !== root ? editableRoot : root;
- };
- var applyAttributes = function (editor, node, forcedRootBlockAttrs) {
- var dom = editor.dom;
- Optional.from(forcedRootBlockAttrs.style).map(dom.parseStyle).each(function (attrStyles) {
- var currentStyles = getAllRaw(SugarElement.fromDom(node));
- var newStyles = __assign(__assign({}, currentStyles), attrStyles);
- dom.setStyles(node, newStyles);
- });
- var attrClassesOpt = Optional.from(forcedRootBlockAttrs.class).map(function (attrClasses) {
- return attrClasses.split(/\s+/);
- });
- var currentClassesOpt = Optional.from(node.className).map(function (currentClasses) {
- return filter$4(currentClasses.split(/\s+/), function (clazz) {
- return clazz !== '';
- });
- });
- lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) {
- var filteredClasses = filter$4(currentClasses, function (clazz) {
- return !contains$3(attrClasses, clazz);
- });
- var newClasses = __spreadArray(__spreadArray([], attrClasses, true), filteredClasses, true);
- dom.setAttrib(node, 'class', newClasses.join(' '));
- });
- var appliedAttrs = [
- 'style',
- 'class'
- ];
- var remainingAttrs = filter$3(forcedRootBlockAttrs, function (_, attrs) {
- return !contains$3(appliedAttrs, attrs);
- });
- dom.setAttribs(node, remainingAttrs);
- };
- var setForcedBlockAttrs = function (editor, node) {
- var forcedRootBlockName = getForcedRootBlock(editor);
- if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
- var forcedRootBlockAttrs = getForcedRootBlockAttrs(editor);
- applyAttributes(editor, node, forcedRootBlockAttrs);
- }
- };
- var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) {
- var newBlock, parentBlock, startNode, node, next, rootBlockName;
- var blockName = newBlockName || 'P';
- var dom = editor.dom, editableRoot = getEditableRoot(dom, container);
- parentBlock = dom.getParent(container, dom.isBlock);
- if (!parentBlock || !canSplitBlock(dom, parentBlock)) {
- parentBlock = parentBlock || editableRoot;
- if (parentBlock === editor.getBody() || isTableCell(parentBlock)) {
- rootBlockName = parentBlock.nodeName.toLowerCase();
- } else {
- rootBlockName = parentBlock.parentNode.nodeName.toLowerCase();
- }
- if (!parentBlock.hasChildNodes()) {
- newBlock = dom.create(blockName);
- setForcedBlockAttrs(editor, newBlock);
- parentBlock.appendChild(newBlock);
- rng.setStart(newBlock, 0);
- rng.setEnd(newBlock, 0);
- return newBlock;
- }
- node = container;
- while (node.parentNode !== parentBlock) {
- node = node.parentNode;
- }
- while (node && !dom.isBlock(node)) {
- startNode = node;
- node = node.previousSibling;
- }
- if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
- newBlock = dom.create(blockName);
- setForcedBlockAttrs(editor, newBlock);
- startNode.parentNode.insertBefore(newBlock, startNode);
- node = startNode;
- while (node && !dom.isBlock(node)) {
- next = node.nextSibling;
- newBlock.appendChild(node);
- node = next;
- }
- rng.setStart(container, offset);
- rng.setEnd(container, offset);
- }
- }
- return container;
- };
- var addBrToBlockIfNeeded = function (dom, block) {
- block.normalize();
- var lastChild = block.lastChild;
- if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) {
- dom.add(block, 'br');
- }
- };
- var insert$2 = function (editor, evt) {
- var tmpRng, container, offset, parentBlock;
- var newBlock, fragment, containerBlock, parentBlockName, newBlockName, isAfterLastNodeInContainer;
- var dom = editor.dom;
- var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements();
- var rng = editor.selection.getRng();
- var createNewBlock = function (name) {
- var node = container, block, clonedNode, caretNode;
- var textInlineElements = schema.getTextInlineElements();
- if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
- block = dom.create(name || newBlockName);
- } else {
- block = parentBlock.cloneNode(false);
- }
- caretNode = block;
- if (shouldKeepStyles(editor) === false) {
- dom.setAttrib(block, 'style', null);
- dom.setAttrib(block, 'class', null);
- } else {
- do {
- if (textInlineElements[node.nodeName]) {
- if (isCaretNode(node) || isBookmarkNode$1(node)) {
- continue;
- }
- clonedNode = node.cloneNode(false);
- dom.setAttrib(clonedNode, 'id', '');
- if (block.hasChildNodes()) {
- clonedNode.appendChild(block.firstChild);
- block.appendChild(clonedNode);
- } else {
- caretNode = clonedNode;
- block.appendChild(clonedNode);
- }
- }
- } while ((node = node.parentNode) && node !== editableRoot);
- }
- setForcedBlockAttrs(editor, block);
- emptyBlock(caretNode);
- return block;
- };
- var isCaretAtStartOrEndOfBlock = function (start) {
- var node, name;
- var normalizedOffset = normalizeZwspOffset(start, container, offset);
- if (isText$7(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) {
- return false;
- }
- if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) {
- return true;
- }
- if (start && isElement$5(container) && container === parentBlock.firstChild) {
- return true;
- }
- if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) {
- return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start;
- }
- var walker = new DomTreeWalker(container, parentBlock);
- if (isText$7(container)) {
- if (start && normalizedOffset === 0) {
- walker.prev();
- } else if (!start && normalizedOffset === container.nodeValue.length) {
- walker.next();
- }
- }
- while (node = walker.current()) {
- if (isElement$5(node)) {
- if (!node.getAttribute('data-mce-bogus')) {
- name = node.nodeName.toLowerCase();
- if (nonEmptyElementsMap[name] && name !== 'br') {
- return false;
- }
- }
- } else if (isText$7(node) && !isWhitespaceText(node.nodeValue)) {
- return false;
- }
- if (start) {
- walker.prev();
- } else {
- walker.next();
- }
- }
- return true;
- };
- var insertNewBlockAfter = function () {
- if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') {
- newBlock = createNewBlock(newBlockName);
- } else {
- newBlock = createNewBlock();
- }
- if (shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) {
- newBlock = dom.split(containerBlock, parentBlock);
- } else {
- dom.insertAfter(newBlock, parentBlock);
- }
- moveToCaretPosition(editor, newBlock);
- };
- normalize$2(dom, rng).each(function (normRng) {
- rng.setStart(normRng.startContainer, normRng.startOffset);
- rng.setEnd(normRng.endContainer, normRng.endOffset);
- });
- container = rng.startContainer;
- offset = rng.startOffset;
- newBlockName = getForcedRootBlock(editor);
- var shiftKey = !!(evt && evt.shiftKey);
- var ctrlKey = !!(evt && evt.ctrlKey);
- if (isElement$5(container) && container.hasChildNodes()) {
- isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
- if (isAfterLastNodeInContainer && isText$7(container)) {
- offset = container.nodeValue.length;
- } else {
- offset = 0;
- }
- }
- var editableRoot = getEditableRoot(dom, container);
- if (!editableRoot) {
- return;
- }
- if (newBlockName && !shiftKey || !newBlockName && shiftKey) {
- container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset);
- }
- parentBlock = dom.getParent(container, dom.isBlock);
- containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
- parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : '';
- var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
- if (containerBlockName === 'LI' && !ctrlKey) {
- parentBlock = containerBlock;
- containerBlock = containerBlock.parentNode;
- parentBlockName = containerBlockName;
- }
- if (/^(LI|DT|DD)$/.test(parentBlockName)) {
- if (dom.isEmpty(parentBlock)) {
- insert$3(editor, createNewBlock, containerBlock, parentBlock, newBlockName);
- return;
- }
- }
- if (newBlockName && parentBlock === editor.getBody()) {
- return;
- }
- newBlockName = newBlockName || 'P';
- if (isCaretContainerBlock$1(parentBlock)) {
- newBlock = showCaretContainerBlock(parentBlock);
- if (dom.isEmpty(parentBlock)) {
- emptyBlock(parentBlock);
- }
- setForcedBlockAttrs(editor, newBlock);
- moveToCaretPosition(editor, newBlock);
- } else if (isCaretAtStartOrEndOfBlock()) {
- insertNewBlockAfter();
- } else if (isCaretAtStartOrEndOfBlock(true)) {
- newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
- moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock);
- } else {
- tmpRng = includeZwspInRange(rng).cloneRange();
- tmpRng.setEndAfter(parentBlock);
- fragment = tmpRng.extractContents();
- trimZwsp(fragment);
- trimLeadingLineBreaks(fragment);
- newBlock = fragment.firstChild;
- dom.insertAfter(fragment, parentBlock);
- trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock);
- addBrToBlockIfNeeded(dom, parentBlock);
- if (dom.isEmpty(parentBlock)) {
- emptyBlock(parentBlock);
- }
- newBlock.normalize();
- if (dom.isEmpty(newBlock)) {
- dom.remove(newBlock);
- insertNewBlockAfter();
- } else {
- setForcedBlockAttrs(editor, newBlock);
- moveToCaretPosition(editor, newBlock);
- }
- }
- dom.setAttrib(newBlock, 'id', '');
- editor.fire('NewBlock', { newBlock: newBlock });
- };
- var hasRightSideContent = function (schema, container, parentBlock) {
- var walker = new DomTreeWalker(container, parentBlock);
- var node;
- var nonEmptyElementsMap = schema.getNonEmptyElements();
- while (node = walker.next()) {
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
- return true;
- }
- }
- };
- var moveSelectionToBr = function (editor, brElm, extraBr) {
- var rng = editor.dom.createRng();
- if (!extraBr) {
- rng.setStartAfter(brElm);
- rng.setEndAfter(brElm);
- } else {
- rng.setStartBefore(brElm);
- rng.setEndBefore(brElm);
- }
- editor.selection.setRng(rng);
- scrollRangeIntoView(editor, rng);
- };
- var insertBrAtCaret = function (editor, evt) {
- var selection = editor.selection;
- var dom = editor.dom;
- var rng = selection.getRng();
- var brElm;
- var extraBr;
- normalize$2(dom, rng).each(function (normRng) {
- rng.setStart(normRng.startContainer, normRng.startOffset);
- rng.setEnd(normRng.endContainer, normRng.endOffset);
- });
- var offset = rng.startOffset;
- var container = rng.startContainer;
- if (container.nodeType === 1 && container.hasChildNodes()) {
- var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
- if (isAfterLastNodeInContainer && container.nodeType === 3) {
- offset = container.nodeValue.length;
- } else {
- offset = 0;
- }
- }
- var parentBlock = dom.getParent(container, dom.isBlock);
- var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
- var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
- var isControlKey = !!(evt && evt.ctrlKey);
- if (containerBlockName === 'LI' && !isControlKey) {
- parentBlock = containerBlock;
- }
- if (container && container.nodeType === 3 && offset >= container.nodeValue.length) {
- if (!hasRightSideContent(editor.schema, container, parentBlock)) {
- brElm = dom.create('br');
- rng.insertNode(brElm);
- rng.setStartAfter(brElm);
- rng.setEndAfter(brElm);
- extraBr = true;
- }
- }
- brElm = dom.create('br');
- rangeInsertNode(dom, rng, brElm);
- moveSelectionToBr(editor, brElm, extraBr);
- editor.undoManager.add();
- };
- var insertBrBefore = function (editor, inline) {
- var br = SugarElement.fromTag('br');
- before$4(SugarElement.fromDom(inline), br);
- editor.undoManager.add();
- };
- var insertBrAfter = function (editor, inline) {
- if (!hasBrAfter(editor.getBody(), inline)) {
- after$3(SugarElement.fromDom(inline), SugarElement.fromTag('br'));
- }
- var br = SugarElement.fromTag('br');
- after$3(SugarElement.fromDom(inline), br);
- moveSelectionToBr(editor, br.dom, false);
- editor.undoManager.add();
- };
- var isBeforeBr = function (pos) {
- return isBr$5(pos.getNode());
- };
- var hasBrAfter = function (rootNode, startNode) {
- if (isBeforeBr(CaretPosition.after(startNode))) {
- return true;
- } else {
- return nextPosition(rootNode, CaretPosition.after(startNode)).map(function (pos) {
- return isBr$5(pos.getNode());
- }).getOr(false);
- }
- };
- var isAnchorLink = function (elm) {
- return elm && elm.nodeName === 'A' && 'href' in elm;
- };
- var isInsideAnchor = function (location) {
- return location.fold(never, isAnchorLink, isAnchorLink, never);
- };
- var readInlineAnchorLocation = function (editor) {
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- var position = CaretPosition.fromRangeStart(editor.selection.getRng());
- return readLocation(isInlineTarget$1, editor.getBody(), position).filter(isInsideAnchor);
- };
- var insertBrOutsideAnchor = function (editor, location) {
- location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop);
- };
- var insert$1 = function (editor, evt) {
- var anchorLocation = readInlineAnchorLocation(editor);
- if (anchorLocation.isSome()) {
- anchorLocation.each(curry(insertBrOutsideAnchor, editor));
- } else {
- insertBrAtCaret(editor, evt);
- }
- };
- var matchesSelector = function (editor, selector) {
- return getParentBlock(editor).filter(function (parentBlock) {
- return selector.length > 0 && is$2(SugarElement.fromDom(parentBlock), selector);
- }).isSome();
- };
- var shouldInsertBr = function (editor) {
- return matchesSelector(editor, getBrNewLineSelector(editor));
- };
- var shouldBlockNewLine$1 = function (editor) {
- return matchesSelector(editor, getNoNewLineSelector(editor));
- };
- var newLineAction = Adt.generate([
- { br: [] },
- { block: [] },
- { none: [] }
- ]);
- var shouldBlockNewLine = function (editor, _shiftKey) {
- return shouldBlockNewLine$1(editor);
- };
- var isBrMode = function (requiredState) {
- return function (editor, _shiftKey) {
- var brMode = getForcedRootBlock(editor) === '';
- return brMode === requiredState;
- };
- };
- var inListBlock = function (requiredState) {
- return function (editor, _shiftKey) {
- return isListItemParentBlock(editor) === requiredState;
- };
- };
- var inBlock = function (blockName, requiredState) {
- return function (editor, _shiftKey) {
- var state = getParentBlockName(editor) === blockName.toUpperCase();
- return state === requiredState;
- };
- };
- var inPreBlock = function (requiredState) {
- return inBlock('pre', requiredState);
- };
- var inSummaryBlock = function () {
- return inBlock('summary', true);
- };
- var shouldPutBrInPre = function (requiredState) {
- return function (editor, _shiftKey) {
- return shouldPutBrInPre$1(editor) === requiredState;
- };
- };
- var inBrContext = function (editor, _shiftKey) {
- return shouldInsertBr(editor);
- };
- var hasShiftKey = function (_editor, shiftKey) {
- return shiftKey;
- };
- var canInsertIntoEditableRoot = function (editor) {
- var forcedRootBlock = getForcedRootBlock(editor);
- var rootEditable = getEditableRoot$1(editor.dom, editor.selection.getStart());
- return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P');
- };
- var match = function (predicates, action) {
- return function (editor, shiftKey) {
- var isMatch = foldl(predicates, function (res, p) {
- return res && p(editor, shiftKey);
- }, true);
- return isMatch ? Optional.some(action) : Optional.none();
- };
- };
- var getAction = function (editor, evt) {
- return evaluateUntil([
- match([shouldBlockNewLine], newLineAction.none()),
- match([inSummaryBlock()], newLineAction.br()),
- match([
- inPreBlock(true),
- shouldPutBrInPre(false),
- hasShiftKey
- ], newLineAction.br()),
- match([
- inPreBlock(true),
- shouldPutBrInPre(false)
- ], newLineAction.block()),
- match([
- inPreBlock(true),
- shouldPutBrInPre(true),
- hasShiftKey
- ], newLineAction.block()),
- match([
- inPreBlock(true),
- shouldPutBrInPre(true)
- ], newLineAction.br()),
- match([
- inListBlock(true),
- hasShiftKey
- ], newLineAction.br()),
- match([inListBlock(true)], newLineAction.block()),
- match([
- isBrMode(true),
- hasShiftKey,
- canInsertIntoEditableRoot
- ], newLineAction.block()),
- match([isBrMode(true)], newLineAction.br()),
- match([inBrContext], newLineAction.br()),
- match([
- isBrMode(false),
- hasShiftKey
- ], newLineAction.br()),
- match([canInsertIntoEditableRoot], newLineAction.block())
- ], [
- editor,
- !!(evt && evt.shiftKey)
- ]).getOr(newLineAction.none());
- };
- var insert = function (editor, evt) {
- getAction(editor, evt).fold(function () {
- insert$1(editor, evt);
- }, function () {
- insert$2(editor, evt);
- }, noop);
- };
- var handleEnterKeyEvent = function (editor, event) {
- if (event.isDefaultPrevented()) {
- return;
- }
- event.preventDefault();
- endTypingLevelIgnoreLocks(editor.undoManager);
- editor.undoManager.transact(function () {
- if (editor.selection.isCollapsed() === false) {
- editor.execCommand('Delete');
- }
- insert(editor, event);
- });
- };
- var setup$9 = function (editor) {
- editor.on('keydown', function (event) {
- if (event.keyCode === VK.ENTER) {
- handleEnterKeyEvent(editor, event);
- }
- });
- };
- var executeKeydownOverride$1 = function (editor, caret, evt) {
- execute([
- {
- keyCode: VK.END,
- action: action(moveToLineEndPoint$1, editor, true)
- },
- {
- keyCode: VK.HOME,
- action: action(moveToLineEndPoint$1, editor, false)
- },
- {
- keyCode: VK.END,
- action: action(moveToLineEndPoint, editor, true)
- },
- {
- keyCode: VK.HOME,
- action: action(moveToLineEndPoint, editor, false)
- },
- {
- keyCode: VK.END,
- action: action(moveToLineEndPoint$2, editor, true, caret)
- },
- {
- keyCode: VK.HOME,
- action: action(moveToLineEndPoint$2, editor, false, caret)
- }
- ], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var setup$8 = function (editor, caret) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride$1(editor, caret, evt);
- }
- });
- };
- var browser = detect().browser;
- var setupIeInput = function (editor) {
- var keypressThrotter = first(function () {
- if (!editor.composing) {
- normalizeNbspsInEditor(editor);
- }
- }, 0);
- if (browser.isIE()) {
- editor.on('keypress', function (_e) {
- keypressThrotter.throttle();
- });
- editor.on('remove', function (_e) {
- keypressThrotter.cancel();
- });
- }
- };
- var setup$7 = function (editor) {
- setupIeInput(editor);
- editor.on('input', function (e) {
- if (e.isComposing === false) {
- normalizeNbspsInEditor(editor);
- }
- });
- };
- var platform = detect();
- var executeKeyupAction = function (editor, caret, evt) {
- execute([
- {
- keyCode: VK.PAGE_UP,
- action: action(moveToLineEndPoint$2, editor, false, caret)
- },
- {
- keyCode: VK.PAGE_DOWN,
- action: action(moveToLineEndPoint$2, editor, true, caret)
- }
- ], evt);
- };
- var stopImmediatePropagation = function (e) {
- return e.stopImmediatePropagation();
- };
- var isPageUpDown = function (evt) {
- return evt.keyCode === VK.PAGE_UP || evt.keyCode === VK.PAGE_DOWN;
- };
- var setNodeChangeBlocker = function (blocked, editor, block) {
- if (block && !blocked.get()) {
- editor.on('NodeChange', stopImmediatePropagation, true);
- } else if (!block && blocked.get()) {
- editor.off('NodeChange', stopImmediatePropagation);
- }
- blocked.set(block);
- };
- var setup$6 = function (editor, caret) {
- if (platform.os.isOSX()) {
- return;
- }
- var blocked = Cell(false);
- editor.on('keydown', function (evt) {
- if (isPageUpDown(evt)) {
- setNodeChangeBlocker(blocked, editor, true);
- }
- });
- editor.on('keyup', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeyupAction(editor, caret, evt);
- }
- if (isPageUpDown(evt) && blocked.get()) {
- setNodeChangeBlocker(blocked, editor, false);
- editor.nodeChanged();
- }
- });
- };
- var insertTextAtPosition = function (text, pos) {
- var container = pos.container();
- var offset = pos.offset();
- if (isText$7(container)) {
- container.insertData(offset, text);
- return Optional.some(CaretPosition(container, offset + text.length));
- } else {
- return getElementFromPosition(pos).map(function (elm) {
- var textNode = SugarElement.fromText(text);
- if (pos.isAtEnd()) {
- after$3(elm, textNode);
- } else {
- before$4(elm, textNode);
- }
- return CaretPosition(textNode.dom, text.length);
- });
- }
- };
- var insertNbspAtPosition = curry(insertTextAtPosition, nbsp);
- var insertSpaceAtPosition = curry(insertTextAtPosition, ' ');
- var locationToCaretPosition = function (root) {
- return function (location) {
- return location.fold(function (element) {
- return prevPosition(root.dom, CaretPosition.before(element));
- }, function (element) {
- return firstPositionIn(element);
- }, function (element) {
- return lastPositionIn(element);
- }, function (element) {
- return nextPosition(root.dom, CaretPosition.after(element));
- });
- };
- };
- var insertInlineBoundarySpaceOrNbsp = function (root, pos) {
- return function (checkPos) {
- return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos);
- };
- };
- var setSelection = function (editor) {
- return function (pos) {
- editor.selection.setRng(pos.toRange());
- editor.nodeChanged();
- return true;
- };
- };
- var insertSpaceOrNbspAtSelection = function (editor) {
- var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
- var root = SugarElement.fromDom(editor.getBody());
- if (editor.selection.isCollapsed()) {
- var isInlineTarget$1 = curry(isInlineTarget, editor);
- var caretPosition = CaretPosition.fromRangeStart(editor.selection.getRng());
- return readLocation(isInlineTarget$1, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection(editor));
- } else {
- return false;
- }
- };
- var executeKeydownOverride = function (editor, evt) {
- execute([{
- keyCode: VK.SPACEBAR,
- action: action(insertSpaceOrNbspAtSelection, editor)
- }], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var setup$5 = function (editor) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride(editor, evt);
- }
- });
- };
- var registerKeyboardOverrides = function (editor) {
- var caret = setupSelectedState(editor);
- setup$c(editor);
- setup$b(editor, caret);
- setup$a(editor, caret);
- setup$9(editor);
- setup$5(editor);
- setup$7(editor);
- setup$8(editor, caret);
- setup$6(editor, caret);
- return caret;
- };
- var setup$4 = function (editor) {
- if (!isRtc(editor)) {
- return registerKeyboardOverrides(editor);
- } else {
- return Cell(null);
- }
- };
- var NodeChange = function () {
- function NodeChange(editor) {
- this.lastPath = [];
- this.editor = editor;
- var lastRng;
- var self = this;
- if (!('onselectionchange' in editor.getDoc())) {
- editor.on('NodeChange click mouseup keyup focus', function (e) {
- var nativeRng = editor.selection.getRng();
- var fakeRng = {
- startContainer: nativeRng.startContainer,
- startOffset: nativeRng.startOffset,
- endContainer: nativeRng.endContainer,
- endOffset: nativeRng.endOffset
- };
- if (e.type === 'nodechange' || !isEq$4(fakeRng, lastRng)) {
- editor.fire('SelectionChange');
- }
- lastRng = fakeRng;
- });
- }
- editor.on('contextmenu', function () {
- editor.fire('SelectionChange');
- });
- editor.on('SelectionChange', function () {
- var startElm = editor.selection.getStart(true);
- if (!startElm || !Env.range && editor.selection.isCollapsed()) {
- return;
- }
- if (hasAnyRanges(editor) && !self.isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
- editor.nodeChanged({ selectionChange: true });
- }
- });
- editor.on('mouseup', function (e) {
- if (!e.isDefaultPrevented() && hasAnyRanges(editor)) {
- if (editor.selection.getNode().nodeName === 'IMG') {
- Delay.setEditorTimeout(editor, function () {
- editor.nodeChanged();
- });
- } else {
- editor.nodeChanged();
- }
- }
- });
- }
- NodeChange.prototype.nodeChanged = function (args) {
- var selection = this.editor.selection;
- var node, parents, root;
- if (this.editor.initialized && selection && !shouldDisableNodeChange(this.editor) && !this.editor.mode.isReadOnly()) {
- root = this.editor.getBody();
- node = selection.getStart(true) || root;
- if (node.ownerDocument !== this.editor.getDoc() || !this.editor.dom.isChildOf(node, root)) {
- node = root;
- }
- parents = [];
- this.editor.dom.getParent(node, function (node) {
- if (node === root) {
- return true;
- }
- parents.push(node);
- });
- args = args || {};
- args.element = node;
- args.parents = parents;
- this.editor.fire('NodeChange', args);
- }
- };
- NodeChange.prototype.isSameElementPath = function (startElm) {
- var i;
- var currentPath = this.editor.$(startElm).parentsUntil(this.editor.getBody()).add(startElm);
- if (currentPath.length === this.lastPath.length) {
- for (i = currentPath.length; i >= 0; i--) {
- if (currentPath[i] !== this.lastPath[i]) {
- break;
- }
- }
- if (i === -1) {
- this.lastPath = currentPath;
- return true;
- }
- }
- this.lastPath = currentPath;
- return false;
- };
- return NodeChange;
- }();
- var preventSummaryToggle = function (editor) {
- editor.on('click', function (e) {
- if (editor.dom.getParent(e.target, 'details')) {
- e.preventDefault();
- }
- });
- };
- var filterDetails = function (editor) {
- editor.parser.addNodeFilter('details', function (elms) {
- each$k(elms, function (details) {
- details.attr('data-mce-open', details.attr('open'));
- details.attr('open', 'open');
- });
- });
- editor.serializer.addNodeFilter('details', function (elms) {
- each$k(elms, function (details) {
- var open = details.attr('data-mce-open');
- details.attr('open', isString$1(open) ? open : null);
- details.attr('data-mce-open', null);
- });
- });
- };
- var setup$3 = function (editor) {
- preventSummaryToggle(editor);
- filterDetails(editor);
- };
- var isTextBlockNode = function (node) {
- return isElement$5(node) && isTextBlock$2(SugarElement.fromDom(node));
- };
- var normalizeSelection = function (editor) {
- var rng = editor.selection.getRng();
- var startPos = CaretPosition.fromRangeStart(rng);
- var endPos = CaretPosition.fromRangeEnd(rng);
- if (CaretPosition.isElementPosition(startPos)) {
- var container = startPos.container();
- if (isTextBlockNode(container)) {
- firstPositionIn(container).each(function (pos) {
- return rng.setStart(pos.container(), pos.offset());
- });
- }
- }
- if (CaretPosition.isElementPosition(endPos)) {
- var container = startPos.container();
- if (isTextBlockNode(container)) {
- lastPositionIn(container).each(function (pos) {
- return rng.setEnd(pos.container(), pos.offset());
- });
- }
- }
- editor.selection.setRng(normalize(rng));
- };
- var setup$2 = function (editor) {
- editor.on('click', function (e) {
- if (e.detail >= 3) {
- normalizeSelection(editor);
- }
- });
- };
- var getAbsolutePosition = function (elm) {
- var clientRect = elm.getBoundingClientRect();
- var doc = elm.ownerDocument;
- var docElem = doc.documentElement;
- var win = doc.defaultView;
- return {
- top: clientRect.top + win.pageYOffset - docElem.clientTop,
- left: clientRect.left + win.pageXOffset - docElem.clientLeft
- };
- };
- var getBodyPosition = function (editor) {
- return editor.inline ? getAbsolutePosition(editor.getBody()) : {
- left: 0,
- top: 0
- };
- };
- var getScrollPosition = function (editor) {
- var body = editor.getBody();
- return editor.inline ? {
- left: body.scrollLeft,
- top: body.scrollTop
- } : {
- left: 0,
- top: 0
- };
- };
- var getBodyScroll = function (editor) {
- var body = editor.getBody(), docElm = editor.getDoc().documentElement;
- var inlineScroll = {
- left: body.scrollLeft,
- top: body.scrollTop
- };
- var iframeScroll = {
- left: body.scrollLeft || docElm.scrollLeft,
- top: body.scrollTop || docElm.scrollTop
- };
- return editor.inline ? inlineScroll : iframeScroll;
- };
- var getMousePosition = function (editor, event) {
- if (event.target.ownerDocument !== editor.getDoc()) {
- var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
- var scrollPosition = getBodyScroll(editor);
- return {
- left: event.pageX - iframePosition.left + scrollPosition.left,
- top: event.pageY - iframePosition.top + scrollPosition.top
- };
- }
- return {
- left: event.pageX,
- top: event.pageY
- };
- };
- var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
- return {
- pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
- pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
- };
- };
- var calc = function (editor, event) {
- return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
- };
- var isContentEditableFalse$1 = isContentEditableFalse$b, isContentEditableTrue$1 = isContentEditableTrue$4;
- var isDraggable = function (rootElm, elm) {
- return isContentEditableFalse$1(elm) && elm !== rootElm;
- };
- var isValidDropTarget = function (editor, targetElement, dragElement) {
- if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) {
- return false;
- }
- return !isContentEditableFalse$1(targetElement);
- };
- var cloneElement = function (elm) {
- var cloneElm = elm.cloneNode(true);
- cloneElm.removeAttribute('data-mce-selected');
- return cloneElm;
- };
- var createGhost = function (editor, elm, width, height) {
- var dom = editor.dom;
- var clonedElm = elm.cloneNode(true);
- dom.setStyles(clonedElm, {
- width: width,
- height: height
- });
- dom.setAttrib(clonedElm, 'data-mce-selected', null);
- var ghostElm = dom.create('div', {
- 'class': 'mce-drag-container',
- 'data-mce-bogus': 'all',
- 'unselectable': 'on',
- 'contenteditable': 'false'
- });
- dom.setStyles(ghostElm, {
- position: 'absolute',
- opacity: 0.5,
- overflow: 'hidden',
- border: 0,
- padding: 0,
- margin: 0,
- width: width,
- height: height
- });
- dom.setStyles(clonedElm, {
- margin: 0,
- boxSizing: 'border-box'
- });
- ghostElm.appendChild(clonedElm);
- return ghostElm;
- };
- var appendGhostToBody = function (ghostElm, bodyElm) {
- if (ghostElm.parentNode !== bodyElm) {
- bodyElm.appendChild(ghostElm);
- }
- };
- var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
- var overflowX = 0, overflowY = 0;
- ghostElm.style.left = position.pageX + 'px';
- ghostElm.style.top = position.pageY + 'px';
- if (position.pageX + width > maxX) {
- overflowX = position.pageX + width - maxX;
- }
- if (position.pageY + height > maxY) {
- overflowY = position.pageY + height - maxY;
- }
- ghostElm.style.width = width - overflowX + 'px';
- ghostElm.style.height = height - overflowY + 'px';
- };
- var removeElement = function (elm) {
- if (elm && elm.parentNode) {
- elm.parentNode.removeChild(elm);
- }
- };
- var isLeftMouseButtonPressed = function (e) {
- return e.button === 0;
- };
- var applyRelPos = function (state, position) {
- return {
- pageX: position.pageX - state.relX,
- pageY: position.pageY + 5
- };
- };
- var start = function (state, editor) {
- return function (e) {
- if (isLeftMouseButtonPressed(e)) {
- var ceElm = find$3(editor.dom.getParents(e.target), or(isContentEditableFalse$1, isContentEditableTrue$1)).getOr(null);
- if (isDraggable(editor.getBody(), ceElm)) {
- var elmPos = editor.dom.getPos(ceElm);
- var bodyElm = editor.getBody();
- var docElm = editor.getDoc().documentElement;
- state.set({
- element: ceElm,
- dragging: false,
- screenX: e.screenX,
- screenY: e.screenY,
- maxX: (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2,
- maxY: (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2,
- relX: e.pageX - elmPos.x,
- relY: e.pageY - elmPos.y,
- width: ceElm.offsetWidth,
- height: ceElm.offsetHeight,
- ghost: createGhost(editor, ceElm, ceElm.offsetWidth, ceElm.offsetHeight)
- });
- }
- }
- };
- };
- var move = function (state, editor) {
- var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) {
- editor._selectionOverrides.hideFakeCaret();
- editor.selection.placeCaretAt(clientX, clientY);
- }, 0);
- editor.on('remove', throttledPlaceCaretAt.stop);
- return function (e) {
- return state.on(function (state) {
- var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
- if (!state.dragging && movement > 10) {
- var args = editor.fire('dragstart', { target: state.element });
- if (args.isDefaultPrevented()) {
- return;
- }
- state.dragging = true;
- editor.focus();
- }
- if (state.dragging) {
- var targetPos = applyRelPos(state, calc(editor, e));
- appendGhostToBody(state.ghost, editor.getBody());
- moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
- throttledPlaceCaretAt(e.clientX, e.clientY);
- }
- });
- };
- };
- var getRawTarget = function (selection) {
- var rng = selection.getSel().getRangeAt(0);
- var startContainer = rng.startContainer;
- return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
- };
- var drop = function (state, editor) {
- return function (e) {
- state.on(function (state) {
- if (state.dragging) {
- if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
- var targetClone_1 = cloneElement(state.element);
- var args = editor.fire('drop', {
- clientX: e.clientX,
- clientY: e.clientY
- });
- if (!args.isDefaultPrevented()) {
- editor.undoManager.transact(function () {
- removeElement(state.element);
- editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
- editor._selectionOverrides.hideFakeCaret();
- });
- }
- }
- editor.fire('dragend');
- }
- });
- removeDragState(state);
- };
- };
- var stop = function (state, editor) {
- return function () {
- state.on(function (state) {
- if (state.dragging) {
- editor.fire('dragend');
- }
- });
- removeDragState(state);
- };
- };
- var removeDragState = function (state) {
- state.on(function (state) {
- removeElement(state.ghost);
- });
- state.clear();
- };
- var bindFakeDragEvents = function (editor) {
- var state = value();
- var pageDom = DOMUtils.DOM;
- var rootDocument = document;
- var dragStartHandler = start(state, editor);
- var dragHandler = move(state, editor);
- var dropHandler = drop(state, editor);
- var dragEndHandler = stop(state, editor);
- editor.on('mousedown', dragStartHandler);
- editor.on('mousemove', dragHandler);
- editor.on('mouseup', dropHandler);
- pageDom.bind(rootDocument, 'mousemove', dragHandler);
- pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
- editor.on('remove', function () {
- pageDom.unbind(rootDocument, 'mousemove', dragHandler);
- pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
- });
- editor.on('keydown', function (e) {
- if (e.keyCode === VK.ESC) {
- dragEndHandler();
- }
- });
- };
- var blockIeDrop = function (editor) {
- editor.on('drop', function (e) {
- var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
- if (isContentEditableFalse$1(realTarget) || editor.dom.getContentEditableParent(realTarget) === 'false') {
- e.preventDefault();
- }
- });
- };
- var blockUnsupportedFileDrop = function (editor) {
- var preventFileDrop = function (e) {
- if (!e.isDefaultPrevented()) {
- var dataTransfer = e.dataTransfer;
- if (dataTransfer && (contains$3(dataTransfer.types, 'Files') || dataTransfer.files.length > 0)) {
- e.preventDefault();
- if (e.type === 'drop') {
- displayError(editor, 'Dropped file type is not supported');
- }
- }
- }
- };
- var preventFileDropIfUIElement = function (e) {
- if (isUIElement(editor, e.target)) {
- preventFileDrop(e);
- }
- };
- var setup = function () {
- var pageDom = DOMUtils.DOM;
- var dom = editor.dom;
- var doc = document;
- var editorRoot = editor.inline ? editor.getBody() : editor.getDoc();
- var eventNames = [
- 'drop',
- 'dragover'
- ];
- each$k(eventNames, function (name) {
- pageDom.bind(doc, name, preventFileDropIfUIElement);
- dom.bind(editorRoot, name, preventFileDrop);
- });
- editor.on('remove', function () {
- each$k(eventNames, function (name) {
- pageDom.unbind(doc, name, preventFileDropIfUIElement);
- dom.unbind(editorRoot, name, preventFileDrop);
- });
- });
- };
- editor.on('init', function () {
- Delay.setEditorTimeout(editor, setup, 0);
- });
- };
- var init$2 = function (editor) {
- bindFakeDragEvents(editor);
- blockIeDrop(editor);
- if (shouldBlockUnsupportedDrop(editor)) {
- blockUnsupportedFileDrop(editor);
- }
- };
- var setup$1 = function (editor) {
- var renderFocusCaret = first(function () {
- if (!editor.removed && editor.getBody().contains(document.activeElement)) {
- var rng = editor.selection.getRng();
- if (rng.collapsed) {
- var caretRange = renderRangeCaret(editor, rng, false);
- editor.selection.setRng(caretRange);
- }
- }
- }, 0);
- editor.on('focus', function () {
- renderFocusCaret.throttle();
- });
- editor.on('blur', function () {
- renderFocusCaret.cancel();
- });
- };
- var setup = function (editor) {
- editor.on('init', function () {
- editor.on('focusin', function (e) {
- var target = e.target;
- if (isMedia$2(target)) {
- var ceRoot = getContentEditableRoot$1(editor.getBody(), target);
- var node = isContentEditableFalse$b(ceRoot) ? ceRoot : target;
- if (editor.selection.getNode() !== node) {
- selectNode(editor, node).each(function (rng) {
- return editor.selection.setRng(rng);
- });
- }
- }
- });
- });
- };
- var isContentEditableTrue = isContentEditableTrue$4;
- var isContentEditableFalse = isContentEditableFalse$b;
- var getContentEditableRoot = function (editor, node) {
- return getContentEditableRoot$1(editor.getBody(), node);
- };
- var SelectionOverrides = function (editor) {
- var selection = editor.selection, dom = editor.dom;
- var isBlock = dom.isBlock;
- var rootNode = editor.getBody();
- var fakeCaret = FakeCaret(editor, rootNode, isBlock, function () {
- return hasFocus(editor);
- });
- var realSelectionId = 'sel-' + dom.uniqueId();
- var elementSelectionAttr = 'data-mce-selected';
- var selectedElement;
- var isFakeSelectionElement = function (node) {
- return dom.hasClass(node, 'mce-offscreen-selection');
- };
- var isFakeSelectionTargetElement = function (node) {
- return node !== rootNode && (isContentEditableFalse(node) || isMedia$2(node)) && dom.isChildOf(node, rootNode);
- };
- var isNearFakeSelectionElement = function (pos) {
- return isBeforeContentEditableFalse(pos) || isAfterContentEditableFalse(pos) || isBeforeMedia(pos) || isAfterMedia(pos);
- };
- var getRealSelectionElement = function () {
- var container = dom.get(realSelectionId);
- return container ? container.getElementsByTagName('*')[0] : container;
- };
- var setRange = function (range) {
- if (range) {
- selection.setRng(range);
- }
- };
- var getRange = selection.getRng;
- var showCaret = function (direction, node, before, scrollIntoView) {
- if (scrollIntoView === void 0) {
- scrollIntoView = true;
- }
- var e = editor.fire('ShowCaret', {
- target: node,
- direction: direction,
- before: before
- });
- if (e.isDefaultPrevented()) {
- return null;
- }
- if (scrollIntoView) {
- selection.scrollIntoView(node, direction === -1);
- }
- return fakeCaret.show(before, node);
- };
- var showBlockCaretContainer = function (blockCaretContainer) {
- if (blockCaretContainer.hasAttribute('data-mce-caret')) {
- showCaretContainerBlock(blockCaretContainer);
- setRange(getRange());
- selection.scrollIntoView(blockCaretContainer);
- }
- };
- var registerEvents = function () {
- editor.on('mouseup', function (e) {
- var range = getRange();
- if (range.collapsed && isXYInContentArea(editor, e.clientX, e.clientY)) {
- renderCaretAtRange(editor, range, false).each(setRange);
- }
- });
- editor.on('click', function (e) {
- var contentEditableRoot = getContentEditableRoot(editor, e.target);
- if (contentEditableRoot) {
- if (isContentEditableFalse(contentEditableRoot)) {
- e.preventDefault();
- editor.focus();
- }
- if (isContentEditableTrue(contentEditableRoot)) {
- if (dom.isChildOf(contentEditableRoot, selection.getNode())) {
- removeElementSelection();
- }
- }
- }
- });
- editor.on('blur NewBlock', removeElementSelection);
- editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition);
- var hasNormalCaretPosition = function (elm) {
- var start = elm.firstChild;
- if (isNullable(start)) {
- return false;
- }
- var startPos = CaretPosition.before(start);
- if (isBr$5(startPos.getNode()) && elm.childNodes.length === 1) {
- return !isNearFakeSelectionElement(startPos);
- } else {
- var caretWalker = CaretWalker(elm);
- var newPos = caretWalker.next(startPos);
- return newPos && !isNearFakeSelectionElement(newPos);
- }
- };
- var isInSameBlock = function (node1, node2) {
- var block1 = dom.getParent(node1, isBlock);
- var block2 = dom.getParent(node2, isBlock);
- return block1 === block2;
- };
- var hasBetterMouseTarget = function (targetNode, caretNode) {
- var targetBlock = dom.getParent(targetNode, isBlock);
- var caretBlock = dom.getParent(caretNode, isBlock);
- if (isNullable(targetBlock)) {
- return false;
- }
- if (targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse(getContentEditableRoot(editor, targetBlock)) === false) {
- return true;
- }
- return !dom.isChildOf(caretBlock, targetBlock) && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
- };
- editor.on('tap', function (e) {
- var targetElm = e.target;
- var contentEditableRoot = getContentEditableRoot(editor, targetElm);
- if (isContentEditableFalse(contentEditableRoot)) {
- e.preventDefault();
- selectNode(editor, contentEditableRoot).each(setElementSelection);
- } else if (isFakeSelectionTargetElement(targetElm)) {
- selectNode(editor, targetElm).each(setElementSelection);
- }
- }, true);
- editor.on('mousedown', function (e) {
- var targetElm = e.target;
- if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !dom.isChildOf(targetElm, rootNode)) {
- return;
- }
- if (isXYInContentArea(editor, e.clientX, e.clientY) === false) {
- return;
- }
- var contentEditableRoot = getContentEditableRoot(editor, targetElm);
- if (contentEditableRoot) {
- if (isContentEditableFalse(contentEditableRoot)) {
- e.preventDefault();
- selectNode(editor, contentEditableRoot).each(setElementSelection);
- } else {
- removeElementSelection();
- if (!(isContentEditableTrue(contentEditableRoot) && e.shiftKey) && !isXYWithinRange(e.clientX, e.clientY, selection.getRng())) {
- hideFakeCaret();
- selection.placeCaretAt(e.clientX, e.clientY);
- }
- }
- } else if (isFakeSelectionTargetElement(targetElm)) {
- selectNode(editor, targetElm).each(setElementSelection);
- } else if (isFakeCaretTarget(targetElm) === false) {
- removeElementSelection();
- hideFakeCaret();
- var fakeCaretInfo = closestFakeCaret(rootNode, e.clientX, e.clientY);
- if (fakeCaretInfo) {
- if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) {
- e.preventDefault();
- var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false);
- setRange(range);
- editor.getBody().focus();
- }
- }
- }
- });
- editor.on('keypress', function (e) {
- if (VK.modifierPressed(e)) {
- return;
- }
- if (isContentEditableFalse(selection.getNode())) {
- e.preventDefault();
- }
- });
- editor.on('GetSelectionRange', function (e) {
- var rng = e.range;
- if (selectedElement) {
- if (!selectedElement.parentNode) {
- selectedElement = null;
- return;
- }
- rng = rng.cloneRange();
- rng.selectNode(selectedElement);
- e.range = rng;
- }
- });
- editor.on('SetSelectionRange', function (e) {
- e.range = normalizeShortEndedElementSelection(e.range);
- var rng = setElementSelection(e.range, e.forward);
- if (rng) {
- e.range = rng;
- }
- });
- var isPasteBin = function (node) {
- return node.id === 'mcepastebin';
- };
- editor.on('AfterSetSelectionRange', function (e) {
- var rng = e.range;
- var parentNode = rng.startContainer.parentNode;
- if (!isRangeInCaretContainer(rng) && !isPasteBin(parentNode)) {
- hideFakeCaret();
- }
- if (!isFakeSelectionElement(parentNode)) {
- removeElementSelection();
- }
- });
- editor.on('copy', function (e) {
- var clipboardData = e.clipboardData;
- if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) {
- var realSelectionElement = getRealSelectionElement();
- if (realSelectionElement) {
- e.preventDefault();
- clipboardData.clearData();
- clipboardData.setData('text/html', realSelectionElement.outerHTML);
- clipboardData.setData('text/plain', realSelectionElement.outerText || realSelectionElement.innerText);
- }
- }
- });
- init$2(editor);
- setup$1(editor);
- setup(editor);
- };
- var isWithinCaretContainer = function (node) {
- return isCaretContainer$2(node) || startsWithCaretContainer$1(node) || endsWithCaretContainer$1(node);
- };
- var isRangeInCaretContainer = function (rng) {
- return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer);
- };
- var normalizeShortEndedElementSelection = function (rng) {
- var shortEndedElements = editor.schema.getShortEndedElements();
- var newRng = dom.createRng();
- var startContainer = rng.startContainer;
- var startOffset = rng.startOffset;
- var endContainer = rng.endContainer;
- var endOffset = rng.endOffset;
- if (has$2(shortEndedElements, startContainer.nodeName.toLowerCase())) {
- if (startOffset === 0) {
- newRng.setStartBefore(startContainer);
- } else {
- newRng.setStartAfter(startContainer);
- }
- } else {
- newRng.setStart(startContainer, startOffset);
- }
- if (has$2(shortEndedElements, endContainer.nodeName.toLowerCase())) {
- if (endOffset === 0) {
- newRng.setEndBefore(endContainer);
- } else {
- newRng.setEndAfter(endContainer);
- }
- } else {
- newRng.setEnd(endContainer, endOffset);
- }
- return newRng;
- };
- var setupOffscreenSelection = function (node, targetClone, origTargetClone) {
- var $ = editor.$;
- var $realSelectionContainer = descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () {
- return $([]);
- }, function (elm) {
- return $([elm.dom]);
- });
- if ($realSelectionContainer.length === 0) {
- $realSelectionContainer = $('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr('id', realSelectionId);
- $realSelectionContainer.appendTo(editor.getBody());
- }
- var newRange = dom.createRng();
- if (targetClone === origTargetClone && Env.ie) {
- $realSelectionContainer.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xA0</p>').append(targetClone);
- newRange.setStartAfter($realSelectionContainer[0].firstChild.firstChild);
- newRange.setEndAfter(targetClone);
- } else {
- $realSelectionContainer.empty().append(nbsp).append(targetClone).append(nbsp);
- newRange.setStart($realSelectionContainer[0].firstChild, 1);
- newRange.setEnd($realSelectionContainer[0].lastChild, 0);
- }
- $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y });
- $realSelectionContainer[0].focus();
- var sel = selection.getSel();
- sel.removeAllRanges();
- sel.addRange(newRange);
- return newRange;
- };
- var selectElement = function (elm) {
- var targetClone = elm.cloneNode(true);
- var e = editor.fire('ObjectSelected', {
- target: elm,
- targetClone: targetClone
- });
- if (e.isDefaultPrevented()) {
- return null;
- }
- var range = setupOffscreenSelection(elm, e.targetClone, targetClone);
- var nodeElm = SugarElement.fromDom(elm);
- each$k(descendants(SugarElement.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) {
- if (!eq(nodeElm, elm)) {
- remove$6(elm, elementSelectionAttr);
- }
- });
- if (!dom.getAttrib(elm, elementSelectionAttr)) {
- elm.setAttribute(elementSelectionAttr, '1');
- }
- selectedElement = elm;
- hideFakeCaret();
- return range;
- };
- var setElementSelection = function (range, forward) {
- if (!range) {
- return null;
- }
- if (range.collapsed) {
- if (!isRangeInCaretContainer(range)) {
- var dir = forward ? 1 : -1;
- var caretPosition = getNormalizedRangeEndPoint(dir, rootNode, range);
- var beforeNode = caretPosition.getNode(!forward);
- if (isFakeCaretTarget(beforeNode)) {
- return showCaret(dir, beforeNode, forward ? !caretPosition.isAtEnd() : false, false);
- }
- var afterNode = caretPosition.getNode(forward);
- if (isFakeCaretTarget(afterNode)) {
- return showCaret(dir, afterNode, forward ? false : !caretPosition.isAtEnd(), false);
- }
- }
- return null;
- }
- var startContainer = range.startContainer;
- var startOffset = range.startOffset;
- var endOffset = range.endOffset;
- if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse(startContainer.parentNode)) {
- startContainer = startContainer.parentNode;
- startOffset = dom.nodeIndex(startContainer);
- startContainer = startContainer.parentNode;
- }
- if (startContainer.nodeType !== 1) {
- return null;
- }
- if (endOffset === startOffset + 1 && startContainer === range.endContainer) {
- var node = startContainer.childNodes[startOffset];
- if (isFakeSelectionTargetElement(node)) {
- return selectElement(node);
- }
- }
- return null;
- };
- var removeElementSelection = function () {
- if (selectedElement) {
- selectedElement.removeAttribute(elementSelectionAttr);
- }
- descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(remove$7);
- selectedElement = null;
- };
- var destroy = function () {
- fakeCaret.destroy();
- selectedElement = null;
- };
- var hideFakeCaret = function () {
- fakeCaret.hide();
- };
- if (Env.ceFalse && !isRtc(editor)) {
- registerEvents();
- }
- return {
- showCaret: showCaret,
- showBlockCaretContainer: showBlockCaretContainer,
- hideFakeCaret: hideFakeCaret,
- destroy: destroy
- };
- };
- var Quirks = function (editor) {
- var each = Tools.each;
- var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, parser = editor.parser;
- var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
- var mceInternalUrlPrefix = 'data:text/mce-internal,';
- var mceInternalDataType = isIE ? 'Text' : 'URL';
- var setEditorCommandState = function (cmd, state) {
- try {
- editor.getDoc().execCommand(cmd, false, state);
- } catch (ex) {
- }
- };
- var isDefaultPrevented = function (e) {
- return e.isDefaultPrevented();
- };
- var setMceInternalContent = function (e) {
- var selectionHtml, internalContent;
- if (e.dataTransfer) {
- if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') {
- selection.select(e.target);
- }
- selectionHtml = editor.selection.getContent();
- if (selectionHtml.length > 0) {
- internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml);
- e.dataTransfer.setData(mceInternalDataType, internalContent);
- }
- }
- };
- var getMceInternalContent = function (e) {
- var internalContent;
- if (e.dataTransfer) {
- internalContent = e.dataTransfer.getData(mceInternalDataType);
- if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
- internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(',');
- return {
- id: unescape(internalContent[0]),
- html: unescape(internalContent[1])
- };
- }
- }
- return null;
- };
- var insertClipboardContents = function (content, internal) {
- if (editor.queryCommandSupported('mceInsertClipboardContent')) {
- editor.execCommand('mceInsertClipboardContent', false, {
- content: content,
- internal: internal
- });
- } else {
- editor.execCommand('mceInsertContent', false, content);
- }
- };
- var emptyEditorWhenDeleting = function () {
- var serializeRng = function (rng) {
- var body = dom.create('body');
- var contents = rng.cloneContents();
- body.appendChild(contents);
- return selection.serializer.serialize(body, { format: 'html' });
- };
- var allContentsSelected = function (rng) {
- var selection = serializeRng(rng);
- var allRng = dom.createRng();
- allRng.selectNode(editor.getBody());
- var allSelection = serializeRng(allRng);
- return selection === allSelection;
- };
- editor.on('keydown', function (e) {
- var keyCode = e.keyCode;
- var isCollapsed, body;
- if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) {
- isCollapsed = editor.selection.isCollapsed();
- body = editor.getBody();
- if (isCollapsed && !dom.isEmpty(body)) {
- return;
- }
- if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
- return;
- }
- e.preventDefault();
- editor.setContent('');
- if (body.firstChild && dom.isBlock(body.firstChild)) {
- editor.selection.setCursorLocation(body.firstChild, 0);
- } else {
- editor.selection.setCursorLocation(body, 0);
- }
- editor.nodeChanged();
- }
- });
- };
- var selectAll = function () {
- editor.shortcuts.add('meta+a', null, 'SelectAll');
- };
- var documentElementEditingFocus = function () {
- if (!editor.inline) {
- dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) {
- var rng;
- if (e.target === editor.getDoc().documentElement) {
- rng = selection.getRng();
- editor.getBody().focus();
- if (e.type === 'mousedown') {
- if (isCaretContainer$2(rng.startContainer)) {
- return;
- }
- selection.placeCaretAt(e.clientX, e.clientY);
- } else {
- selection.setRng(rng);
- }
- }
- });
- }
- };
- var removeHrOnBackspace = function () {
- editor.on('keydown', function (e) {
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
- if (!editor.getBody().getElementsByTagName('hr').length) {
- return;
- }
- if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
- var node = selection.getNode();
- var previousSibling = node.previousSibling;
- if (node.nodeName === 'HR') {
- dom.remove(node);
- e.preventDefault();
- return;
- }
- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') {
- dom.remove(previousSibling);
- e.preventDefault();
- }
- }
- }
- });
- };
- var focusBody = function () {
- if (!Range.prototype.getClientRects) {
- editor.on('mousedown', function (e) {
- if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') {
- var body_1 = editor.getBody();
- body_1.blur();
- Delay.setEditorTimeout(editor, function () {
- body_1.focus();
- });
- }
- });
- }
- };
- var selectControlElements = function () {
- editor.on('click', function (e) {
- var target = e.target;
- if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') {
- e.preventDefault();
- editor.selection.select(target);
- editor.nodeChanged();
- }
- if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) {
- e.preventDefault();
- selection.select(target);
- }
- });
- };
- var removeStylesWhenDeletingAcrossBlockElements = function () {
- var getAttributeApplyFunction = function () {
- var template = dom.getAttribs(selection.getStart().cloneNode(false));
- return function () {
- var target = selection.getStart();
- if (target !== editor.getBody()) {
- dom.setAttrib(target, 'style', null);
- each(template, function (attr) {
- target.setAttributeNode(attr.cloneNode(true));
- });
- }
- };
- };
- var isSelectionAcrossElements = function () {
- return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock);
- };
- editor.on('keypress', function (e) {
- var applyAttributes;
- if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) {
- applyAttributes = getAttributeApplyFunction();
- editor.getDoc().execCommand('delete', false, null);
- applyAttributes();
- e.preventDefault();
- return false;
- }
- });
- dom.bind(editor.getDoc(), 'cut', function (e) {
- var applyAttributes;
- if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
- applyAttributes = getAttributeApplyFunction();
- Delay.setEditorTimeout(editor, function () {
- applyAttributes();
- });
- }
- });
- };
- var disableBackspaceIntoATable = function () {
- editor.on('keydown', function (e) {
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
- if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
- var previousSibling = selection.getNode().previousSibling;
- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') {
- e.preventDefault();
- return false;
- }
- }
- }
- });
- };
- var removeBlockQuoteOnBackSpace = function () {
- editor.on('keydown', function (e) {
- var rng, parent;
- if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) {
- return;
- }
- rng = selection.getRng();
- var container = rng.startContainer;
- var offset = rng.startOffset;
- var root = dom.getRoot();
- parent = container;
- if (!rng.collapsed || offset !== 0) {
- return;
- }
- while (parent && parent.parentNode && parent.parentNode.firstChild === parent && parent.parentNode !== root) {
- parent = parent.parentNode;
- }
- if (parent.tagName === 'BLOCKQUOTE') {
- editor.formatter.toggle('blockquote', null, parent);
- rng = dom.createRng();
- rng.setStart(container, 0);
- rng.setEnd(container, 0);
- selection.setRng(rng);
- }
- });
- };
- var setGeckoEditingOptions = function () {
- var setOpts = function () {
- setEditorCommandState('StyleWithCSS', false);
- setEditorCommandState('enableInlineTableEditing', false);
- if (!getObjectResizing(editor)) {
- setEditorCommandState('enableObjectResizing', false);
- }
- };
- if (!isReadOnly$1(editor)) {
- editor.on('BeforeExecCommand mousedown', setOpts);
- }
- };
- var addBrAfterLastLinks = function () {
- var fixLinks = function () {
- each(dom.select('a'), function (node) {
- var parentNode = node.parentNode;
- var root = dom.getRoot();
- if (parentNode.lastChild === node) {
- while (parentNode && !dom.isBlock(parentNode)) {
- if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
- return;
- }
- parentNode = parentNode.parentNode;
- }
- dom.add(parentNode, 'br', { 'data-mce-bogus': 1 });
- }
- });
- };
- editor.on('SetContent ExecCommand', function (e) {
- if (e.type === 'setcontent' || e.command === 'mceInsertLink') {
- fixLinks();
- }
- });
- };
- var setDefaultBlockType = function () {
- if (getForcedRootBlock(editor)) {
- editor.on('init', function () {
- setEditorCommandState('DefaultParagraphSeparator', getForcedRootBlock(editor));
- });
- }
- };
- var normalizeSelection = function () {
- editor.on('keyup focusin mouseup', function (e) {
- if (!VK.modifierPressed(e)) {
- selection.normalize();
- }
- }, true);
- };
- var showBrokenImageIcon = function () {
- editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}');
- };
- var restoreFocusOnKeyDown = function () {
- if (!editor.inline) {
- editor.on('keydown', function () {
- if (document.activeElement === document.body) {
- editor.getWin().focus();
- }
- });
- }
- };
- var bodyHeight = function () {
- if (!editor.inline) {
- editor.contentStyles.push('body {min-height: 150px}');
- editor.on('click', function (e) {
- var rng;
- if (e.target.nodeName === 'HTML') {
- if (Env.ie > 11) {
- editor.getBody().focus();
- return;
- }
- rng = editor.selection.getRng();
- editor.getBody().focus();
- editor.selection.setRng(rng);
- editor.selection.normalize();
- editor.nodeChanged();
- }
- });
- }
- };
- var blockCmdArrowNavigation = function () {
- if (Env.mac) {
- editor.on('keydown', function (e) {
- if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) {
- e.preventDefault();
- var selection_1 = editor.selection.getSel();
- selection_1.modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary');
- }
- });
- }
- };
- var disableAutoUrlDetect = function () {
- setEditorCommandState('AutoUrlDetect', false);
- };
- var tapLinksAndImages = function () {
- editor.on('click', function (e) {
- var elm = e.target;
- do {
- if (elm.tagName === 'A') {
- e.preventDefault();
- return;
- }
- } while (elm = elm.parentNode);
- });
- editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
- };
- var blockFormSubmitInsideEditor = function () {
- editor.on('init', function () {
- editor.dom.bind(editor.getBody(), 'submit', function (e) {
- e.preventDefault();
- });
- });
- };
- var removeAppleInterchangeBrs = function () {
- parser.addNodeFilter('br', function (nodes) {
- var i = nodes.length;
- while (i--) {
- if (nodes[i].attr('class') === 'Apple-interchange-newline') {
- nodes[i].remove();
- }
- }
- });
- };
- var ieInternalDragAndDrop = function () {
- editor.on('dragstart', function (e) {
- setMceInternalContent(e);
- });
- editor.on('drop', function (e) {
- if (!isDefaultPrevented(e)) {
- var internalContent = getMceInternalContent(e);
- if (internalContent && internalContent.id !== editor.id) {
- e.preventDefault();
- var rng = fromPoint(e.x, e.y, editor.getDoc());
- selection.setRng(rng);
- insertClipboardContents(internalContent.html, true);
- }
- }
- });
- };
- var refreshContentEditable = noop;
- var isHidden = function () {
- if (!isGecko || editor.removed) {
- return false;
- }
- var sel = editor.selection.getSel();
- return !sel || !sel.rangeCount || sel.rangeCount === 0;
- };
- var setupRtc = function () {
- if (isWebKit) {
- documentElementEditingFocus();
- selectControlElements();
- blockFormSubmitInsideEditor();
- selectAll();
- if (Env.iOS) {
- restoreFocusOnKeyDown();
- bodyHeight();
- tapLinksAndImages();
- }
- }
- if (isGecko) {
- focusBody();
- setGeckoEditingOptions();
- showBrokenImageIcon();
- blockCmdArrowNavigation();
- }
- };
- var setup = function () {
- removeBlockQuoteOnBackSpace();
- emptyEditorWhenDeleting();
- if (!Env.windowsPhone) {
- normalizeSelection();
- }
- if (isWebKit) {
- documentElementEditingFocus();
- selectControlElements();
- setDefaultBlockType();
- blockFormSubmitInsideEditor();
- disableBackspaceIntoATable();
- removeAppleInterchangeBrs();
- if (Env.iOS) {
- restoreFocusOnKeyDown();
- bodyHeight();
- tapLinksAndImages();
- } else {
- selectAll();
- }
- }
- if (Env.ie >= 11) {
- bodyHeight();
- disableBackspaceIntoATable();
- }
- if (Env.ie) {
- selectAll();
- disableAutoUrlDetect();
- ieInternalDragAndDrop();
- }
- if (isGecko) {
- removeHrOnBackspace();
- focusBody();
- removeStylesWhenDeletingAcrossBlockElements();
- setGeckoEditingOptions();
- addBrAfterLastLinks();
- showBrokenImageIcon();
- blockCmdArrowNavigation();
- disableBackspaceIntoATable();
- }
- };
- if (isRtc(editor)) {
- setupRtc();
- } else {
- setup();
- }
- return {
- refreshContentEditable: refreshContentEditable,
- isHidden: isHidden
- };
- };
- var DOM$6 = DOMUtils.DOM;
- var appendStyle = function (editor, text) {
- var body = SugarElement.fromDom(editor.getBody());
- var container = getStyleContainer(getRootNode(body));
- var style = SugarElement.fromTag('style');
- set$1(style, 'type', 'text/css');
- append$1(style, SugarElement.fromText(text));
- append$1(container, style);
- editor.on('remove', function () {
- remove$7(style);
- });
- };
- var getRootName = function (editor) {
- return editor.inline ? editor.getElement().nodeName.toLowerCase() : undefined;
- };
- var removeUndefined = function (obj) {
- return filter$3(obj, function (v) {
- return isUndefined(v) === false;
- });
- };
- var mkParserSettings = function (editor) {
- var settings = editor.settings;
- var blobCache = editor.editorUpload.blobCache;
- return removeUndefined({
- allow_conditional_comments: settings.allow_conditional_comments,
- allow_html_data_urls: settings.allow_html_data_urls,
- allow_svg_data_urls: settings.allow_svg_data_urls,
- allow_html_in_named_anchor: settings.allow_html_in_named_anchor,
- allow_script_urls: settings.allow_script_urls,
- allow_unsafe_link_target: settings.allow_unsafe_link_target,
- convert_fonts_to_spans: settings.convert_fonts_to_spans,
- fix_list_elements: settings.fix_list_elements,
- font_size_legacy_values: settings.font_size_legacy_values,
- forced_root_block: settings.forced_root_block,
- forced_root_block_attrs: settings.forced_root_block_attrs,
- padd_empty_with_br: settings.padd_empty_with_br,
- preserve_cdata: settings.preserve_cdata,
- remove_trailing_brs: settings.remove_trailing_brs,
- inline_styles: settings.inline_styles,
- root_name: getRootName(editor),
- validate: true,
- blob_cache: blobCache,
- document: editor.getDoc(),
- images_dataimg_filter: settings.images_dataimg_filter
- });
- };
- var mkSerializerSettings = function (editor) {
- var settings = editor.settings;
- return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({
- url_converter: settings.url_converter,
- url_converter_scope: settings.url_converter_scope,
- element_format: settings.element_format,
- entities: settings.entities,
- entity_encoding: settings.entity_encoding,
- indent: settings.indent,
- indent_after: settings.indent_after,
- indent_before: settings.indent_before,
- block_elements: settings.block_elements,
- boolean_attributes: settings.boolean_attributes,
- custom_elements: settings.custom_elements,
- extended_valid_elements: settings.extended_valid_elements,
- invalid_elements: settings.invalid_elements,
- invalid_styles: settings.invalid_styles,
- move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements,
- non_empty_elements: settings.non_empty_elements,
- schema: settings.schema,
- self_closing_elements: settings.self_closing_elements,
- short_ended_elements: settings.short_ended_elements,
- special: settings.special,
- text_block_elements: settings.text_block_elements,
- text_inline_elements: settings.text_inline_elements,
- valid_children: settings.valid_children,
- valid_classes: settings.valid_classes,
- valid_elements: settings.valid_elements,
- valid_styles: settings.valid_styles,
- verify_html: settings.verify_html,
- whitespace_elements: settings.whitespace_elements
- }));
- };
- var createParser = function (editor) {
- var parser = DomParser(mkParserSettings(editor), editor.schema);
- parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name) {
- var i = nodes.length, node, value;
- var dom = editor.dom;
- var internalName = 'data-mce-' + name;
- while (i--) {
- node = nodes[i];
- value = node.attr(name);
- if (value && !node.attr(internalName)) {
- if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) {
- continue;
- }
- if (name === 'style') {
- value = dom.serializeStyle(dom.parseStyle(value), node.name);
- if (!value.length) {
- value = null;
- }
- node.attr(internalName, value);
- node.attr(name, value);
- } else if (name === 'tabindex') {
- node.attr(internalName, value);
- node.attr(name, null);
- } else {
- node.attr(internalName, editor.convertURL(value, name, node.name));
- }
- }
- }
- });
- parser.addNodeFilter('script', function (nodes) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- var type = node.attr('type') || 'no/type';
- if (type.indexOf('mce-') !== 0) {
- node.attr('type', 'mce-' + type);
- }
- }
- });
- if (editor.settings.preserve_cdata) {
- parser.addNodeFilter('#cdata', function (nodes) {
- var i = nodes.length;
- while (i--) {
- var node = nodes[i];
- node.type = 8;
- node.name = '#comment';
- node.value = '[CDATA[' + editor.dom.encode(node.value) + ']]';
- }
- });
- }
- parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) {
- var i = nodes.length;
- var nonEmptyElements = editor.schema.getNonEmptyElements();
- while (i--) {
- var node = nodes[i];
- if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) {
- node.append(new AstNode('br', 1)).shortEnded = true;
- }
- }
- });
- return parser;
- };
- var autoFocus = function (editor) {
- if (editor.settings.auto_focus) {
- Delay.setEditorTimeout(editor, function () {
- var focusEditor;
- if (editor.settings.auto_focus === true) {
- focusEditor = editor;
- } else {
- focusEditor = editor.editorManager.get(editor.settings.auto_focus);
- }
- if (!focusEditor.destroyed) {
- focusEditor.focus();
- }
- }, 100);
- }
- };
- var moveSelectionToFirstCaretPosition = function (editor) {
- var root = editor.dom.getRoot();
- if (!editor.inline && (!hasAnyRanges(editor) || editor.selection.getStart(true) === root)) {
- firstPositionIn(root).each(function (pos) {
- var node = pos.getNode();
- var caretPos = isTable$3(node) ? firstPositionIn(node).getOr(pos) : pos;
- if (Env.browser.isIE()) {
- storeNative(editor, caretPos.toRange());
- } else {
- editor.selection.setRng(caretPos.toRange());
- }
- });
- }
- };
- var initEditor = function (editor) {
- editor.bindPendingEventDelegates();
- editor.initialized = true;
- fireInit(editor);
- editor.focus(true);
- moveSelectionToFirstCaretPosition(editor);
- editor.nodeChanged({ initial: true });
- editor.execCallback('init_instance_callback', editor);
- autoFocus(editor);
- };
- var getStyleSheetLoader$1 = function (editor) {
- return editor.inline ? editor.ui.styleSheetLoader : editor.dom.styleSheetLoader;
- };
- var makeStylesheetLoadingPromises = function (editor, css, framedFonts) {
- var promises = [new promiseObj(function (resolve, reject) {
- return getStyleSheetLoader$1(editor).loadAll(css, resolve, reject);
- })];
- if (editor.inline) {
- return promises;
- } else {
- return promises.concat([new promiseObj(function (resolve, reject) {
- return editor.ui.styleSheetLoader.loadAll(framedFonts, resolve, reject);
- })]);
- }
- };
- var loadContentCss = function (editor) {
- var styleSheetLoader = getStyleSheetLoader$1(editor);
- var fontCss = getFontCss(editor);
- var css = editor.contentCSS;
- var removeCss = function () {
- styleSheetLoader.unloadAll(css);
- if (!editor.inline) {
- editor.ui.styleSheetLoader.unloadAll(fontCss);
- }
- };
- var loaded = function () {
- if (editor.removed) {
- removeCss();
- } else {
- editor.on('remove', removeCss);
- }
- };
- if (editor.contentStyles.length > 0) {
- var contentCssText_1 = '';
- Tools.each(editor.contentStyles, function (style) {
- contentCssText_1 += style + '\r\n';
- });
- editor.dom.addStyle(contentCssText_1);
- }
- var allStylesheets = promiseObj.all(makeStylesheetLoadingPromises(editor, css, fontCss)).then(loaded).catch(loaded);
- if (editor.settings.content_style) {
- appendStyle(editor, editor.settings.content_style);
- }
- return allStylesheets;
- };
- var preInit = function (editor) {
- var settings = editor.settings, doc = editor.getDoc(), body = editor.getBody();
- firePreInit(editor);
- if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
- doc.body.spellcheck = false;
- DOM$6.setAttrib(body, 'spellcheck', 'false');
- }
- editor.quirks = Quirks(editor);
- firePostRender(editor);
- var directionality = getDirectionality(editor);
- if (directionality !== undefined) {
- body.dir = directionality;
- }
- if (settings.protect) {
- editor.on('BeforeSetContent', function (e) {
- Tools.each(settings.protect, function (pattern) {
- e.content = e.content.replace(pattern, function (str) {
- return '<!--mce:protected ' + escape(str) + '-->';
- });
- });
- });
- }
- editor.on('SetContent', function () {
- editor.addVisual(editor.getBody());
- });
- editor.on('compositionstart compositionend', function (e) {
- editor.composing = e.type === 'compositionstart';
- });
- };
- var loadInitialContent = function (editor) {
- if (!isRtc(editor)) {
- editor.load({
- initial: true,
- format: 'html'
- });
- }
- editor.startContent = editor.getContent({ format: 'raw' });
- };
- var initEditorWithInitialContent = function (editor) {
- if (editor.removed !== true) {
- loadInitialContent(editor);
- initEditor(editor);
- }
- };
- var initContentBody = function (editor, skipWrite) {
- var settings = editor.settings;
- var targetElm = editor.getElement();
- var doc = editor.getDoc();
- if (!settings.inline) {
- editor.getElement().style.visibility = editor.orgVisibility;
- }
- if (!skipWrite && !editor.inline) {
- doc.open();
- doc.write(editor.iframeHTML);
- doc.close();
- }
- if (editor.inline) {
- DOM$6.addClass(targetElm, 'mce-content-body');
- editor.contentDocument = doc = document;
- editor.contentWindow = window;
- editor.bodyElement = targetElm;
- editor.contentAreaContainer = targetElm;
- }
- var body = editor.getBody();
- body.disabled = true;
- editor.readonly = !!settings.readonly;
- if (!editor.readonly) {
- if (editor.inline && DOM$6.getStyle(body, 'position', true) === 'static') {
- body.style.position = 'relative';
- }
- body.contentEditable = editor.getParam('content_editable_state', true);
- }
- body.disabled = false;
- editor.editorUpload = EditorUpload(editor);
- editor.schema = Schema(settings);
- editor.dom = DOMUtils(doc, {
- keep_values: true,
- url_converter: editor.convertURL,
- url_converter_scope: editor,
- hex_colors: settings.force_hex_style_colors,
- update_styles: true,
- root_element: editor.inline ? editor.getBody() : null,
- collect: function () {
- return editor.inline;
- },
- schema: editor.schema,
- contentCssCors: shouldUseContentCssCors(editor),
- referrerPolicy: getReferrerPolicy(editor),
- onSetAttrib: function (e) {
- editor.fire('SetAttrib', e);
- }
- });
- editor.parser = createParser(editor);
- editor.serializer = DomSerializer(mkSerializerSettings(editor), editor);
- editor.selection = EditorSelection(editor.dom, editor.getWin(), editor.serializer, editor);
- editor.annotator = Annotator(editor);
- editor.formatter = Formatter(editor);
- editor.undoManager = UndoManager(editor);
- editor._nodeChangeDispatcher = new NodeChange(editor);
- editor._selectionOverrides = SelectionOverrides(editor);
- setup$e(editor);
- setup$3(editor);
- if (!isRtc(editor)) {
- setup$2(editor);
- }
- var caret = setup$4(editor);
- setup$f(editor, caret);
- setup$d(editor);
- setup$g(editor);
- var setupRtcThunk = setup$i(editor);
- preInit(editor);
- setupRtcThunk.fold(function () {
- loadContentCss(editor).then(function () {
- return initEditorWithInitialContent(editor);
- });
- }, function (setupRtc) {
- editor.setProgressState(true);
- loadContentCss(editor).then(function () {
- setupRtc().then(function (_rtcMode) {
- editor.setProgressState(false);
- initEditorWithInitialContent(editor);
- }, function (err) {
- editor.notificationManager.open({
- type: 'error',
- text: String(err)
- });
- initEditorWithInitialContent(editor);
- });
- });
- });
- };
- var DOM$5 = DOMUtils.DOM;
- var relaxDomain = function (editor, ifr) {
- if (document.domain !== window.location.hostname && Env.browser.isIE()) {
- var bodyUuid = uuid('mce');
- editor[bodyUuid] = function () {
- initContentBody(editor);
- };
- var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()';
- DOM$5.setAttrib(ifr, 'src', domainRelaxUrl);
- return true;
- }
- return false;
- };
- var createIframeElement = function (id, title, height, customAttrs) {
- var iframe = SugarElement.fromTag('iframe');
- setAll$1(iframe, customAttrs);
- setAll$1(iframe, {
- id: id + '_ifr',
- frameBorder: '0',
- allowTransparency: 'true',
- title: title
- });
- add$1(iframe, 'tox-edit-area__iframe');
- return iframe;
- };
- var getIframeHtml = function (editor) {
- var iframeHTML = getDocType(editor) + '<html><head>';
- if (getDocumentBaseUrl(editor) !== editor.documentBaseUrl) {
- iframeHTML += '<base href="' + editor.documentBaseURI.getURI() + '" />';
- }
- iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
- var bodyId = getBodyId(editor);
- var bodyClass = getBodyClass(editor);
- var translatedAriaText = editor.translate(getIframeAriaText(editor));
- if (getContentSecurityPolicy(editor)) {
- iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + getContentSecurityPolicy(editor) + '" />';
- }
- iframeHTML += '</head>' + ('<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" data-id="' + editor.id + '" aria-label="' + translatedAriaText + '">') + '<br>' + '</body></html>';
- return iframeHTML;
- };
- var createIframe = function (editor, o) {
- var iframeTitle = editor.translate('Rich Text Area');
- var ifr = createIframeElement(editor.id, iframeTitle, o.height, getIframeAttrs(editor)).dom;
- ifr.onload = function () {
- ifr.onload = null;
- editor.fire('load');
- };
- var isDomainRelaxed = relaxDomain(editor, ifr);
- editor.contentAreaContainer = o.iframeContainer;
- editor.iframeElement = ifr;
- editor.iframeHTML = getIframeHtml(editor);
- DOM$5.add(o.iframeContainer, ifr);
- return isDomainRelaxed;
- };
- var init$1 = function (editor, boxInfo) {
- var isDomainRelaxed = createIframe(editor, boxInfo);
- if (boxInfo.editorContainer) {
- DOM$5.get(boxInfo.editorContainer).style.display = editor.orgDisplay;
- editor.hidden = DOM$5.isHidden(boxInfo.editorContainer);
- }
- editor.getElement().style.display = 'none';
- DOM$5.setAttrib(editor.id, 'aria-hidden', 'true');
- if (!isDomainRelaxed) {
- initContentBody(editor);
- }
- };
- var DOM$4 = DOMUtils.DOM;
- var initPlugin = function (editor, initializedPlugins, plugin) {
- var Plugin = PluginManager.get(plugin);
- var pluginUrl = PluginManager.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, '');
- plugin = Tools.trim(plugin);
- if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) {
- Tools.each(PluginManager.dependencies(plugin), function (dep) {
- initPlugin(editor, initializedPlugins, dep);
- });
- if (editor.plugins[plugin]) {
- return;
- }
- try {
- var pluginInstance = new Plugin(editor, pluginUrl, editor.$);
- editor.plugins[plugin] = pluginInstance;
- if (pluginInstance.init) {
- pluginInstance.init(editor, pluginUrl);
- initializedPlugins.push(plugin);
- }
- } catch (e) {
- pluginInitError(editor, plugin, e);
- }
- }
- };
- var trimLegacyPrefix = function (name) {
- return name.replace(/^\-/, '');
- };
- var initPlugins = function (editor) {
- var initializedPlugins = [];
- Tools.each(getPlugins(editor).split(/[ ,]/), function (name) {
- initPlugin(editor, initializedPlugins, trimLegacyPrefix(name));
- });
- };
- var initIcons = function (editor) {
- var iconPackName = Tools.trim(getIconPackName(editor));
- var currentIcons = editor.ui.registry.getAll().icons;
- var loadIcons = __assign(__assign({}, IconManager.get('default').icons), IconManager.get(iconPackName).icons);
- each$j(loadIcons, function (svgData, icon) {
- if (!has$2(currentIcons, icon)) {
- editor.ui.registry.addIcon(icon, svgData);
- }
- });
- };
- var initTheme = function (editor) {
- var theme = getTheme(editor);
- if (isString$1(theme)) {
- editor.settings.theme = trimLegacyPrefix(theme);
- var Theme = ThemeManager.get(theme);
- editor.theme = new Theme(editor, ThemeManager.urls[theme]);
- if (editor.theme.init) {
- editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$);
- }
- } else {
- editor.theme = {};
- }
- };
- var renderFromLoadedTheme = function (editor) {
- return editor.theme.renderUI();
- };
- var renderFromThemeFunc = function (editor) {
- var elm = editor.getElement();
- var theme = getTheme(editor);
- var info = theme(editor, elm);
- if (info.editorContainer.nodeType) {
- info.editorContainer.id = info.editorContainer.id || editor.id + '_parent';
- }
- if (info.iframeContainer && info.iframeContainer.nodeType) {
- info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer';
- }
- info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight;
- return info;
- };
- var createThemeFalseResult = function (element) {
- return {
- editorContainer: element,
- iframeContainer: element,
- api: {}
- };
- };
- var renderThemeFalseIframe = function (targetElement) {
- var iframeContainer = DOM$4.create('div');
- DOM$4.insertAfter(iframeContainer, targetElement);
- return createThemeFalseResult(iframeContainer);
- };
- var renderThemeFalse = function (editor) {
- var targetElement = editor.getElement();
- return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement);
- };
- var renderThemeUi = function (editor) {
- var elm = editor.getElement();
- editor.orgDisplay = elm.style.display;
- if (isString$1(getTheme(editor))) {
- return renderFromLoadedTheme(editor);
- } else if (isFunction(getTheme(editor))) {
- return renderFromThemeFunc(editor);
- } else {
- return renderThemeFalse(editor);
- }
- };
- var augmentEditorUiApi = function (editor, api) {
- var uiApiFacade = {
- show: Optional.from(api.show).getOr(noop),
- hide: Optional.from(api.hide).getOr(noop),
- disable: Optional.from(api.disable).getOr(noop),
- isDisabled: Optional.from(api.isDisabled).getOr(never),
- enable: function () {
- if (!editor.mode.isReadOnly()) {
- Optional.from(api.enable).map(call);
- }
- }
- };
- editor.ui = __assign(__assign({}, editor.ui), uiApiFacade);
- };
- var init = function (editor) {
- editor.fire('ScriptsLoaded');
- initIcons(editor);
- initTheme(editor);
- initPlugins(editor);
- var renderInfo = renderThemeUi(editor);
- augmentEditorUiApi(editor, Optional.from(renderInfo.api).getOr({}));
- var boxInfo = {
- editorContainer: renderInfo.editorContainer,
- iframeContainer: renderInfo.iframeContainer
- };
- editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null;
- appendContentCssFromSettings(editor);
- if (editor.inline) {
- return initContentBody(editor);
- } else {
- return init$1(editor, boxInfo);
- }
- };
- var DOM$3 = DOMUtils.DOM;
- var hasSkipLoadPrefix = function (name) {
- return name.charAt(0) === '-';
- };
- var loadLanguage = function (scriptLoader, editor) {
- var languageCode = getLanguageCode(editor);
- var languageUrl = getLanguageUrl(editor);
- if (I18n.hasCode(languageCode) === false && languageCode !== 'en') {
- var url_1 = languageUrl !== '' ? languageUrl : editor.editorManager.baseURL + '/langs/' + languageCode + '.js';
- scriptLoader.add(url_1, noop, undefined, function () {
- languageLoadError(editor, url_1, languageCode);
- });
- }
- };
- var loadTheme = function (scriptLoader, editor, suffix, callback) {
- var theme = getTheme(editor);
- if (isString$1(theme)) {
- if (!hasSkipLoadPrefix(theme) && !has$2(ThemeManager.urls, theme)) {
- var themeUrl = getThemeUrl(editor);
- if (themeUrl) {
- ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl));
- } else {
- ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js');
- }
- }
- scriptLoader.loadQueue(function () {
- ThemeManager.waitFor(theme, callback);
- });
- } else {
- callback();
- }
- };
- var getIconsUrlMetaFromUrl = function (editor) {
- return Optional.from(getIconsUrl(editor)).filter(function (url) {
- return url.length > 0;
- }).map(function (url) {
- return {
- url: url,
- name: Optional.none()
- };
- });
- };
- var getIconsUrlMetaFromName = function (editor, name, suffix) {
- return Optional.from(name).filter(function (name) {
- return name.length > 0 && !IconManager.has(name);
- }).map(function (name) {
- return {
- url: editor.editorManager.baseURL + '/icons/' + name + '/icons' + suffix + '.js',
- name: Optional.some(name)
- };
- });
- };
- var loadIcons = function (scriptLoader, editor, suffix) {
- var defaultIconsUrl = getIconsUrlMetaFromName(editor, 'default', suffix);
- var customIconsUrl = getIconsUrlMetaFromUrl(editor).orThunk(function () {
- return getIconsUrlMetaFromName(editor, getIconPackName(editor), '');
- });
- each$k(cat([
- defaultIconsUrl,
- customIconsUrl
- ]), function (urlMeta) {
- scriptLoader.add(urlMeta.url, noop, undefined, function () {
- iconsLoadError(editor, urlMeta.url, urlMeta.name.getOrUndefined());
- });
- });
- };
- var loadPlugins = function (editor, suffix) {
- Tools.each(getExternalPlugins$1(editor), function (url, name) {
- PluginManager.load(name, url, noop, undefined, function () {
- pluginLoadError(editor, url, name);
- });
- editor.settings.plugins += ' ' + name;
- });
- Tools.each(getPlugins(editor).split(/[ ,]/), function (plugin) {
- plugin = Tools.trim(plugin);
- if (plugin && !PluginManager.urls[plugin]) {
- if (hasSkipLoadPrefix(plugin)) {
- plugin = plugin.substr(1, plugin.length);
- var dependencies = PluginManager.dependencies(plugin);
- Tools.each(dependencies, function (depPlugin) {
- var defaultSettings = {
- prefix: 'plugins/',
- resource: depPlugin,
- suffix: '/plugin' + suffix + '.js'
- };
- var dep = PluginManager.createUrl(defaultSettings, depPlugin);
- PluginManager.load(dep.resource, dep, noop, undefined, function () {
- pluginLoadError(editor, dep.prefix + dep.resource + dep.suffix, dep.resource);
- });
- });
- } else {
- var url_2 = {
- prefix: 'plugins/',
- resource: plugin,
- suffix: '/plugin' + suffix + '.js'
- };
- PluginManager.load(plugin, url_2, noop, undefined, function () {
- pluginLoadError(editor, url_2.prefix + url_2.resource + url_2.suffix, plugin);
- });
- }
- }
- });
- };
- var loadScripts = function (editor, suffix) {
- var scriptLoader = ScriptLoader.ScriptLoader;
- loadTheme(scriptLoader, editor, suffix, function () {
- loadLanguage(scriptLoader, editor);
- loadIcons(scriptLoader, editor, suffix);
- loadPlugins(editor, suffix);
- scriptLoader.loadQueue(function () {
- if (!editor.removed) {
- init(editor);
- }
- }, editor, function () {
- if (!editor.removed) {
- init(editor);
- }
- });
- });
- };
- var getStyleSheetLoader = function (element, editor) {
- return instance.forElement(element, {
- contentCssCors: hasContentCssCors(editor),
- referrerPolicy: getReferrerPolicy(editor)
- });
- };
- var render = function (editor) {
- var id = editor.id;
- I18n.setCode(getLanguageCode(editor));
- var readyHandler = function () {
- DOM$3.unbind(window, 'ready', readyHandler);
- editor.render();
- };
- if (!EventUtils.Event.domLoaded) {
- DOM$3.bind(window, 'ready', readyHandler);
- return;
- }
- if (!editor.getElement()) {
- return;
- }
- if (!Env.contentEditable) {
- return;
- }
- var element = SugarElement.fromDom(editor.getElement());
- var snapshot = clone$3(element);
- editor.on('remove', function () {
- eachr(element.dom.attributes, function (attr) {
- return remove$6(element, attr.name);
- });
- setAll$1(element, snapshot);
- });
- editor.ui.styleSheetLoader = getStyleSheetLoader(element, editor);
- if (!isInline(editor)) {
- editor.orgVisibility = editor.getElement().style.visibility;
- editor.getElement().style.visibility = 'hidden';
- } else {
- editor.inline = true;
- }
- var form = editor.getElement().form || DOM$3.getParent(id, 'form');
- if (form) {
- editor.formElement = form;
- if (hasHiddenInput(editor) && !isTextareaOrInput(editor.getElement())) {
- DOM$3.insertAfter(DOM$3.create('input', {
- type: 'hidden',
- name: id
- }), id);
- editor.hasHiddenInput = true;
- }
- editor.formEventDelegate = function (e) {
- editor.fire(e.type, e);
- };
- DOM$3.bind(form, 'submit reset', editor.formEventDelegate);
- editor.on('reset', function () {
- editor.resetContent();
- });
- if (shouldPatchSubmit(editor) && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
- form._mceOldSubmit = form.submit;
- form.submit = function () {
- editor.editorManager.triggerSave();
- editor.setDirty(false);
- return form._mceOldSubmit(form);
- };
- }
- }
- editor.windowManager = WindowManager(editor);
- editor.notificationManager = NotificationManager(editor);
- if (isEncodingXml(editor)) {
- editor.on('GetContent', function (e) {
- if (e.save) {
- e.content = DOM$3.encode(e.content);
- }
- });
- }
- if (shouldAddFormSubmitTrigger(editor)) {
- editor.on('submit', function () {
- if (editor.initialized) {
- editor.save();
- }
- });
- }
- if (shouldAddUnloadTrigger(editor)) {
- editor._beforeUnload = function () {
- if (editor.initialized && !editor.destroyed && !editor.isHidden()) {
- editor.save({
- format: 'raw',
- no_events: true,
- set_dirty: false
- });
- }
- };
- editor.editorManager.on('BeforeUnload', editor._beforeUnload);
- }
- editor.editorManager.add(editor);
- loadScripts(editor, editor.suffix);
- };
- var addVisual = function (editor, elm) {
- return addVisual$1(editor, elm);
- };
- var legacyPropNames = {
- 'font-size': 'size',
- 'font-family': 'face'
- };
- var getSpecifiedFontProp = function (propName, rootElm, elm) {
- var getProperty = function (elm) {
- return getRaw(elm, propName).orThunk(function () {
- if (name(elm) === 'font') {
- return get$9(legacyPropNames, propName).bind(function (legacyPropName) {
- return getOpt(elm, legacyPropName);
- });
- } else {
- return Optional.none();
- }
- });
- };
- var isRoot = function (elm) {
- return eq(SugarElement.fromDom(rootElm), elm);
- };
- return closest$1(SugarElement.fromDom(elm), function (elm) {
- return getProperty(elm);
- }, isRoot);
- };
- var normalizeFontFamily = function (fontFamily) {
- return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ',');
- };
- var getComputedFontProp = function (propName, elm) {
- return Optional.from(DOMUtils.DOM.getStyle(elm, propName, true));
- };
- var getFontProp = function (propName) {
- return function (rootElm, elm) {
- return Optional.from(elm).map(SugarElement.fromDom).filter(isElement$6).bind(function (element) {
- return getSpecifiedFontProp(propName, rootElm, element.dom).or(getComputedFontProp(propName, element.dom));
- }).getOr('');
- };
- };
- var getFontSize = getFontProp('font-size');
- var getFontFamily = compose(normalizeFontFamily, getFontProp('font-family'));
- var findFirstCaretElement = function (editor) {
- return firstPositionIn(editor.getBody()).map(function (caret) {
- var container = caret.container();
- return isText$7(container) ? container.parentNode : container;
- });
- };
- var getCaretElement = function (editor) {
- return Optional.from(editor.selection.getRng()).bind(function (rng) {
- var root = editor.getBody();
- var atStartOfNode = rng.startContainer === root && rng.startOffset === 0;
- return atStartOfNode ? Optional.none() : Optional.from(editor.selection.getStart(true));
- });
- };
- var bindRange = function (editor, binder) {
- return getCaretElement(editor).orThunk(curry(findFirstCaretElement, editor)).map(SugarElement.fromDom).filter(isElement$6).bind(binder);
- };
- var mapRange = function (editor, mapper) {
- return bindRange(editor, compose1(Optional.some, mapper));
- };
- var fromFontSizeNumber = function (editor, value) {
- if (/^[0-9.]+$/.test(value)) {
- var fontSizeNumber = parseInt(value, 10);
- if (fontSizeNumber >= 1 && fontSizeNumber <= 7) {
- var fontSizes = getFontStyleValues(editor);
- var fontClasses = getFontSizeClasses(editor);
- if (fontClasses) {
- return fontClasses[fontSizeNumber - 1] || value;
- } else {
- return fontSizes[fontSizeNumber - 1] || value;
- }
- } else {
- return value;
- }
- } else {
- return value;
- }
- };
- var normalizeFontNames = function (font) {
- var fonts = font.split(/\s*,\s*/);
- return map$3(fonts, function (font) {
- if (font.indexOf(' ') !== -1 && !(startsWith(font, '"') || startsWith(font, '\''))) {
- return '\'' + font + '\'';
- } else {
- return font;
- }
- }).join(',');
- };
- var fontNameAction = function (editor, value) {
- var font = fromFontSizeNumber(editor, value);
- editor.formatter.toggle('fontname', { value: normalizeFontNames(font) });
- editor.nodeChanged();
- };
- var fontNameQuery = function (editor) {
- return mapRange(editor, function (elm) {
- return getFontFamily(editor.getBody(), elm.dom);
- }).getOr('');
- };
- var fontSizeAction = function (editor, value) {
- editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) });
- editor.nodeChanged();
- };
- var fontSizeQuery = function (editor) {
- return mapRange(editor, function (elm) {
- return getFontSize(editor.getBody(), elm.dom);
- }).getOr('');
- };
- var lineHeightQuery = function (editor) {
- return mapRange(editor, function (elm) {
- var root = SugarElement.fromDom(editor.getBody());
- var specifiedStyle = closest$1(elm, function (elm) {
- return getRaw(elm, 'line-height');
- }, curry(eq, root));
- var computedStyle = function () {
- var lineHeight = parseFloat(get$5(elm, 'line-height'));
- var fontSize = parseFloat(get$5(elm, 'font-size'));
- return String(lineHeight / fontSize);
- };
- return specifiedStyle.getOrThunk(computedStyle);
- }).getOr('');
- };
- var lineHeightAction = function (editor, lineHeight) {
- editor.formatter.toggle('lineheight', { value: String(lineHeight) });
- editor.nodeChanged();
- };
- var processValue = function (value) {
- if (typeof value !== 'string') {
- var details = Tools.extend({
- paste: value.paste,
- data: { paste: value.paste }
- }, value);
- return {
- content: value.content,
- details: details
- };
- }
- return {
- content: value,
- details: {}
- };
- };
- var insertAtCaret = function (editor, value) {
- var result = processValue(value);
- insertContent(editor, result.content, result.details);
- };
- var each$4 = Tools.each;
- var map = Tools.map, inArray = Tools.inArray;
- var EditorCommands = function () {
- function EditorCommands(editor) {
- this.commands = {
- state: {},
- exec: {},
- value: {}
- };
- this.editor = editor;
- this.setupCommands(editor);
- }
- EditorCommands.prototype.execCommand = function (command, ui, value, args) {
- var func, state = false;
- var self = this;
- if (self.editor.removed) {
- return;
- }
- if (command.toLowerCase() !== 'mcefocus') {
- if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
- self.editor.focus();
- } else {
- restore(self.editor);
- }
- }
- args = self.editor.fire('BeforeExecCommand', {
- command: command,
- ui: ui,
- value: value
- });
- if (args.isDefaultPrevented()) {
- return false;
- }
- var customCommand = command.toLowerCase();
- if (func = self.commands.exec[customCommand]) {
- func(customCommand, ui, value);
- self.editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
- });
- return true;
- }
- each$4(this.editor.plugins, function (p) {
- if (p.execCommand && p.execCommand(command, ui, value)) {
- self.editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
- });
- state = true;
- return false;
- }
- });
- if (state) {
- return state;
- }
- if (self.editor.theme && self.editor.theme.execCommand && self.editor.theme.execCommand(command, ui, value)) {
- self.editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
- });
- return true;
- }
- try {
- state = self.editor.getDoc().execCommand(command, ui, value);
- } catch (ex) {
- }
- if (state) {
- self.editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
- });
- return true;
- }
- return false;
- };
- EditorCommands.prototype.queryCommandState = function (command) {
- var func;
- if (this.editor.quirks.isHidden() || this.editor.removed) {
- return;
- }
- command = command.toLowerCase();
- if (func = this.commands.state[command]) {
- return func(command);
- }
- try {
- return this.editor.getDoc().queryCommandState(command);
- } catch (ex) {
- }
- return false;
- };
- EditorCommands.prototype.queryCommandValue = function (command) {
- var func;
- if (this.editor.quirks.isHidden() || this.editor.removed) {
- return;
- }
- command = command.toLowerCase();
- if (func = this.commands.value[command]) {
- return func(command);
- }
- try {
- return this.editor.getDoc().queryCommandValue(command);
- } catch (ex) {
- }
- };
- EditorCommands.prototype.addCommands = function (commandList, type) {
- if (type === void 0) {
- type = 'exec';
- }
- var self = this;
- each$4(commandList, function (callback, command) {
- each$4(command.toLowerCase().split(','), function (command) {
- self.commands[type][command] = callback;
- });
- });
- };
- EditorCommands.prototype.addCommand = function (command, callback, scope) {
- var _this = this;
- command = command.toLowerCase();
- this.commands.exec[command] = function (command, ui, value, args) {
- return callback.call(scope || _this.editor, ui, value, args);
- };
- };
- EditorCommands.prototype.queryCommandSupported = function (command) {
- command = command.toLowerCase();
- if (this.commands.exec[command]) {
- return true;
- }
- try {
- return this.editor.getDoc().queryCommandSupported(command);
- } catch (ex) {
- }
- return false;
- };
- EditorCommands.prototype.addQueryStateHandler = function (command, callback, scope) {
- var _this = this;
- command = command.toLowerCase();
- this.commands.state[command] = function () {
- return callback.call(scope || _this.editor);
- };
- };
- EditorCommands.prototype.addQueryValueHandler = function (command, callback, scope) {
- var _this = this;
- command = command.toLowerCase();
- this.commands.value[command] = function () {
- return callback.call(scope || _this.editor);
- };
- };
- EditorCommands.prototype.hasCustomCommand = function (command) {
- command = command.toLowerCase();
- return !!this.commands.exec[command];
- };
- EditorCommands.prototype.execNativeCommand = function (command, ui, value) {
- if (ui === undefined) {
- ui = false;
- }
- if (value === undefined) {
- value = null;
- }
- return this.editor.getDoc().execCommand(command, ui, value);
- };
- EditorCommands.prototype.isFormatMatch = function (name) {
- return this.editor.formatter.match(name);
- };
- EditorCommands.prototype.toggleFormat = function (name, value) {
- this.editor.formatter.toggle(name, value);
- this.editor.nodeChanged();
- };
- EditorCommands.prototype.storeSelection = function (type) {
- this.selectionBookmark = this.editor.selection.getBookmark(type);
- };
- EditorCommands.prototype.restoreSelection = function () {
- this.editor.selection.moveToBookmark(this.selectionBookmark);
- };
- EditorCommands.prototype.setupCommands = function (editor) {
- var self = this;
- this.addCommands({
- 'mceResetDesignMode,mceBeginUndoLevel': noop,
- 'mceEndUndoLevel,mceAddUndoLevel': function () {
- editor.undoManager.add();
- },
- 'mceFocus': function (_command, _ui, value) {
- focus(editor, value);
- },
- 'Cut,Copy,Paste': function (command) {
- var doc = editor.getDoc();
- var failed;
- try {
- self.execNativeCommand(command);
- } catch (ex) {
- failed = true;
- }
- if (command === 'paste' && !doc.queryCommandEnabled(command)) {
- failed = true;
- }
- if (failed || !doc.queryCommandSupported(command)) {
- var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.');
- if (Env.mac) {
- msg = msg.replace(/Ctrl\+/g, '\u2318+');
- }
- editor.notificationManager.open({
- text: msg,
- type: 'error'
- });
- }
- },
- 'unlink': function () {
- if (editor.selection.isCollapsed()) {
- var elm = editor.dom.getParent(editor.selection.getStart(), 'a');
- if (elm) {
- editor.dom.remove(elm, true);
- }
- return;
- }
- editor.formatter.remove('link');
- },
- 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) {
- var align = command.substring(7);
- if (align === 'full') {
- align = 'justify';
- }
- each$4('left,center,right,justify'.split(','), function (name) {
- if (align !== name) {
- editor.formatter.remove('align' + name);
- }
- });
- if (align !== 'none') {
- self.toggleFormat('align' + align);
- }
- },
- 'InsertUnorderedList,InsertOrderedList': function (command) {
- var listParent;
- self.execNativeCommand(command);
- var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
- if (listElm) {
- listParent = listElm.parentNode;
- if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
- self.storeSelection();
- editor.dom.split(listParent, listElm);
- self.restoreSelection();
- }
- }
- },
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
- self.toggleFormat(command);
- },
- 'ForeColor,HiliteColor': function (command, ui, value) {
- self.toggleFormat(command, { value: value });
- },
- 'FontName': function (command, ui, value) {
- fontNameAction(editor, value);
- },
- 'FontSize': function (command, ui, value) {
- fontSizeAction(editor, value);
- },
- 'LineHeight': function (command, ui, value) {
- lineHeightAction(editor, value);
- },
- 'Lang': function (command, ui, lang) {
- self.toggleFormat(command, {
- value: lang.code,
- customValue: lang.customCode
- });
- },
- 'RemoveFormat': function (command) {
- editor.formatter.remove(command);
- },
- 'mceBlockQuote': function () {
- self.toggleFormat('blockquote');
- },
- 'FormatBlock': function (command, ui, value) {
- return self.toggleFormat(value || 'p');
- },
- 'mceCleanup': function () {
- var bookmark = editor.selection.getBookmark();
- editor.setContent(editor.getContent());
- editor.selection.moveToBookmark(bookmark);
- },
- 'mceRemoveNode': function (command, ui, value) {
- var node = value || editor.selection.getNode();
- if (node !== editor.getBody()) {
- self.storeSelection();
- editor.dom.remove(node, true);
- self.restoreSelection();
- }
- },
- 'mceSelectNodeDepth': function (command, ui, value) {
- var counter = 0;
- editor.dom.getParent(editor.selection.getNode(), function (node) {
- if (node.nodeType === 1 && counter++ === value) {
- editor.selection.select(node);
- return false;
- }
- }, editor.getBody());
- },
- 'mceSelectNode': function (command, ui, value) {
- editor.selection.select(value);
- },
- 'mceInsertContent': function (command, ui, value) {
- insertAtCaret(editor, value);
- },
- 'mceInsertRawHTML': function (command, ui, value) {
- editor.selection.setContent('tiny_mce_marker');
- var content = editor.getContent();
- editor.setContent(content.replace(/tiny_mce_marker/g, function () {
- return value;
- }));
- },
- 'mceInsertNewLine': function (command, ui, value) {
- insert(editor, value);
- },
- 'mceToggleFormat': function (command, ui, value) {
- self.toggleFormat(value);
- },
- 'mceSetContent': function (command, ui, value) {
- editor.setContent(value);
- },
- 'Indent,Outdent': function (command) {
- handle(editor, command);
- },
- 'mceRepaint': noop,
- 'InsertHorizontalRule': function () {
- editor.execCommand('mceInsertContent', false, '<hr />');
- },
- 'mceToggleVisualAid': function () {
- editor.hasVisual = !editor.hasVisual;
- editor.addVisual();
- },
- 'mceReplaceContent': function (command, ui, value) {
- editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, editor.selection.getContent({ format: 'text' })));
- },
- 'mceInsertLink': function (command, ui, value) {
- if (typeof value === 'string') {
- value = { href: value };
- }
- var anchor = editor.dom.getParent(editor.selection.getNode(), 'a');
- value.href = value.href.replace(/ /g, '%20');
- if (!anchor || !value.href) {
- editor.formatter.remove('link');
- }
- if (value.href) {
- editor.formatter.apply('link', value, anchor);
- }
- },
- 'selectAll': function () {
- var editingHost = editor.dom.getParent(editor.selection.getStart(), isContentEditableTrue$4);
- if (editingHost) {
- var rng = editor.dom.createRng();
- rng.selectNodeContents(editingHost);
- editor.selection.setRng(rng);
- }
- },
- 'mceNewDocument': function () {
- editor.setContent('');
- },
- 'InsertLineBreak': function (command, ui, value) {
- insert$1(editor, value);
- return true;
- }
- });
- var alignStates = function (name) {
- return function () {
- var selection = editor.selection;
- var nodes = selection.isCollapsed() ? [editor.dom.getParent(selection.getNode(), editor.dom.isBlock)] : selection.getSelectedBlocks();
- var matches = map(nodes, function (node) {
- return !!editor.formatter.matchNode(node, name);
- });
- return inArray(matches, true) !== -1;
- };
- };
- self.addCommands({
- 'JustifyLeft': alignStates('alignleft'),
- 'JustifyCenter': alignStates('aligncenter'),
- 'JustifyRight': alignStates('alignright'),
- 'JustifyFull': alignStates('alignjustify'),
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
- return self.isFormatMatch(command);
- },
- 'mceBlockQuote': function () {
- return self.isFormatMatch('blockquote');
- },
- 'Outdent': function () {
- return canOutdent(editor);
- },
- 'InsertUnorderedList,InsertOrderedList': function (command) {
- var list = editor.dom.getParent(editor.selection.getNode(), 'ul,ol');
- return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL');
- }
- }, 'state');
- self.addCommands({
- Undo: function () {
- editor.undoManager.undo();
- },
- Redo: function () {
- editor.undoManager.redo();
- }
- });
- self.addQueryValueHandler('FontName', function () {
- return fontNameQuery(editor);
- }, this);
- self.addQueryValueHandler('FontSize', function () {
- return fontSizeQuery(editor);
- }, this);
- self.addQueryValueHandler('LineHeight', function () {
- return lineHeightQuery(editor);
- }, this);
- };
- return EditorCommands;
- }();
- var internalContentEditableAttr = 'data-mce-contenteditable';
- var toggleClass = function (elm, cls, state) {
- if (has(elm, cls) && state === false) {
- remove$3(elm, cls);
- } else if (state) {
- add$1(elm, cls);
- }
- };
- var setEditorCommandState = function (editor, cmd, state) {
- try {
- editor.getDoc().execCommand(cmd, false, String(state));
- } catch (ex) {
- }
- };
- var setContentEditable = function (elm, state) {
- elm.dom.contentEditable = state ? 'true' : 'false';
- };
- var switchOffContentEditableTrue = function (elm) {
- each$k(descendants(elm, '*[contenteditable="true"]'), function (elm) {
- set$1(elm, internalContentEditableAttr, 'true');
- setContentEditable(elm, false);
- });
- };
- var switchOnContentEditableTrue = function (elm) {
- each$k(descendants(elm, '*[' + internalContentEditableAttr + '="true"]'), function (elm) {
- remove$6(elm, internalContentEditableAttr);
- setContentEditable(elm, true);
- });
- };
- var removeFakeSelection = function (editor) {
- Optional.from(editor.selection.getNode()).each(function (elm) {
- elm.removeAttribute('data-mce-selected');
- });
- };
- var restoreFakeSelection = function (editor) {
- editor.selection.setRng(editor.selection.getRng());
- };
- var toggleReadOnly = function (editor, state) {
- var body = SugarElement.fromDom(editor.getBody());
- toggleClass(body, 'mce-content-readonly', state);
- if (state) {
- editor.selection.controlSelection.hideResizeRect();
- editor._selectionOverrides.hideFakeCaret();
- removeFakeSelection(editor);
- editor.readonly = true;
- setContentEditable(body, false);
- switchOffContentEditableTrue(body);
- } else {
- editor.readonly = false;
- setContentEditable(body, true);
- switchOnContentEditableTrue(body);
- setEditorCommandState(editor, 'StyleWithCSS', false);
- setEditorCommandState(editor, 'enableInlineTableEditing', false);
- setEditorCommandState(editor, 'enableObjectResizing', false);
- if (hasEditorOrUiFocus(editor)) {
- editor.focus();
- }
- restoreFakeSelection(editor);
- editor.nodeChanged();
- }
- };
- var isReadOnly = function (editor) {
- return editor.readonly;
- };
- var registerFilters = function (editor) {
- editor.parser.addAttributeFilter('contenteditable', function (nodes) {
- if (isReadOnly(editor)) {
- each$k(nodes, function (node) {
- node.attr(internalContentEditableAttr, node.attr('contenteditable'));
- node.attr('contenteditable', 'false');
- });
- }
- });
- editor.serializer.addAttributeFilter(internalContentEditableAttr, function (nodes) {
- if (isReadOnly(editor)) {
- each$k(nodes, function (node) {
- node.attr('contenteditable', node.attr(internalContentEditableAttr));
- });
- }
- });
- editor.serializer.addTempAttr(internalContentEditableAttr);
- };
- var registerReadOnlyContentFilters = function (editor) {
- if (editor.serializer) {
- registerFilters(editor);
- } else {
- editor.on('PreInit', function () {
- registerFilters(editor);
- });
- }
- };
- var isClickEvent = function (e) {
- return e.type === 'click';
- };
- var getAnchorHrefOpt = function (editor, elm) {
- var isRoot = function (elm) {
- return eq(elm, SugarElement.fromDom(editor.getBody()));
- };
- return closest$2(elm, 'a', isRoot).bind(function (a) {
- return getOpt(a, 'href');
- });
- };
- var processReadonlyEvents = function (editor, e) {
- if (isClickEvent(e) && !VK.metaKeyPressed(e)) {
- var elm = SugarElement.fromDom(e.target);
- getAnchorHrefOpt(editor, elm).each(function (href) {
- e.preventDefault();
- if (/^#/.test(href)) {
- var targetEl = editor.dom.select(href + ',[name="' + removeLeading(href, '#') + '"]');
- if (targetEl.length) {
- editor.selection.scrollIntoView(targetEl[0], true);
- }
- } else {
- window.open(href, '_blank', 'rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes');
- }
- });
- }
- };
- var registerReadOnlySelectionBlockers = function (editor) {
- editor.on('ShowCaret', function (e) {
- if (isReadOnly(editor)) {
- e.preventDefault();
- }
- });
- editor.on('ObjectSelected', function (e) {
- if (isReadOnly(editor)) {
- e.preventDefault();
- }
- });
- };
- var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel', ' ');
- var EventDispatcher = function () {
- function EventDispatcher(settings) {
- this.bindings = {};
- this.settings = settings || {};
- this.scope = this.settings.scope || this;
- this.toggleEvent = this.settings.toggleEvent || never;
- }
- EventDispatcher.isNative = function (name) {
- return !!nativeEvents[name.toLowerCase()];
- };
- EventDispatcher.prototype.fire = function (name, args) {
- var lcName = name.toLowerCase();
- var event = normalize$3(lcName, args || {}, this.scope);
- if (this.settings.beforeFire) {
- this.settings.beforeFire(event);
- }
- var handlers = this.bindings[lcName];
- if (handlers) {
- for (var i = 0, l = handlers.length; i < l; i++) {
- var callback = handlers[i];
- if (callback.removed) {
- continue;
- }
- if (callback.once) {
- this.off(lcName, callback.func);
- }
- if (event.isImmediatePropagationStopped()) {
- return event;
- }
- if (callback.func.call(this.scope, event) === false) {
- event.preventDefault();
- return event;
- }
- }
- }
- return event;
- };
- EventDispatcher.prototype.on = function (name, callback, prepend, extra) {
- if (callback === false) {
- callback = never;
- }
- if (callback) {
- var wrappedCallback = {
- func: callback,
- removed: false
- };
- if (extra) {
- Tools.extend(wrappedCallback, extra);
- }
- var names = name.toLowerCase().split(' ');
- var i = names.length;
- while (i--) {
- var currentName = names[i];
- var handlers = this.bindings[currentName];
- if (!handlers) {
- handlers = [];
- this.toggleEvent(currentName, true);
- }
- if (prepend) {
- handlers = __spreadArray([wrappedCallback], handlers, true);
- } else {
- handlers = __spreadArray(__spreadArray([], handlers, true), [wrappedCallback], false);
- }
- this.bindings[currentName] = handlers;
- }
- }
- return this;
- };
- EventDispatcher.prototype.off = function (name, callback) {
- var _this = this;
- if (name) {
- var names = name.toLowerCase().split(' ');
- var i = names.length;
- while (i--) {
- var currentName = names[i];
- var handlers = this.bindings[currentName];
- if (!currentName) {
- each$j(this.bindings, function (_value, bindingName) {
- _this.toggleEvent(bindingName, false);
- delete _this.bindings[bindingName];
- });
- return this;
- }
- if (handlers) {
- if (!callback) {
- handlers.length = 0;
- } else {
- var filteredHandlers = partition(handlers, function (handler) {
- return handler.func === callback;
- });
- handlers = filteredHandlers.fail;
- this.bindings[currentName] = handlers;
- each$k(filteredHandlers.pass, function (handler) {
- handler.removed = true;
- });
- }
- if (!handlers.length) {
- this.toggleEvent(name, false);
- delete this.bindings[currentName];
- }
- }
- }
- } else {
- each$j(this.bindings, function (_value, name) {
- _this.toggleEvent(name, false);
- });
- this.bindings = {};
- }
- return this;
- };
- EventDispatcher.prototype.once = function (name, callback, prepend) {
- return this.on(name, callback, prepend, { once: true });
- };
- EventDispatcher.prototype.has = function (name) {
- name = name.toLowerCase();
- return !(!this.bindings[name] || this.bindings[name].length === 0);
- };
- return EventDispatcher;
- }();
- var getEventDispatcher = function (obj) {
- if (!obj._eventDispatcher) {
- obj._eventDispatcher = new EventDispatcher({
- scope: obj,
- toggleEvent: function (name, state) {
- if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) {
- obj.toggleNativeEvent(name, state);
- }
- }
- });
- }
- return obj._eventDispatcher;
- };
- var Observable = {
- fire: function (name, args, bubble) {
- var self = this;
- if (self.removed && name !== 'remove' && name !== 'detach') {
- return args;
- }
- var dispatcherArgs = getEventDispatcher(self).fire(name, args);
- if (bubble !== false && self.parent) {
- var parent_1 = self.parent();
- while (parent_1 && !dispatcherArgs.isPropagationStopped()) {
- parent_1.fire(name, dispatcherArgs, false);
- parent_1 = parent_1.parent();
- }
- }
- return dispatcherArgs;
- },
- on: function (name, callback, prepend) {
- return getEventDispatcher(this).on(name, callback, prepend);
- },
- off: function (name, callback) {
- return getEventDispatcher(this).off(name, callback);
- },
- once: function (name, callback) {
- return getEventDispatcher(this).once(name, callback);
- },
- hasEventListeners: function (name) {
- return getEventDispatcher(this).has(name);
- }
- };
- var DOM$2 = DOMUtils.DOM;
- var customEventRootDelegates;
- var getEventTarget = function (editor, eventName) {
- if (eventName === 'selectionchange') {
- return editor.getDoc();
- }
- if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
- return editor.getDoc().documentElement;
- }
- var eventRoot = getEventRoot(editor);
- if (eventRoot) {
- if (!editor.eventRoot) {
- editor.eventRoot = DOM$2.select(eventRoot)[0];
- }
- return editor.eventRoot;
- }
- return editor.getBody();
- };
- var isListening = function (editor) {
- return !editor.hidden && !isReadOnly(editor);
- };
- var fireEvent = function (editor, eventName, e) {
- if (isListening(editor)) {
- editor.fire(eventName, e);
- } else if (isReadOnly(editor)) {
- processReadonlyEvents(editor, e);
- }
- };
- var bindEventDelegate = function (editor, eventName) {
- var delegate;
- if (!editor.delegates) {
- editor.delegates = {};
- }
- if (editor.delegates[eventName] || editor.removed) {
- return;
- }
- var eventRootElm = getEventTarget(editor, eventName);
- if (getEventRoot(editor)) {
- if (!customEventRootDelegates) {
- customEventRootDelegates = {};
- editor.editorManager.on('removeEditor', function () {
- if (!editor.editorManager.activeEditor) {
- if (customEventRootDelegates) {
- each$j(customEventRootDelegates, function (_value, name) {
- editor.dom.unbind(getEventTarget(editor, name));
- });
- customEventRootDelegates = null;
- }
- }
- });
- }
- if (customEventRootDelegates[eventName]) {
- return;
- }
- delegate = function (e) {
- var target = e.target;
- var editors = editor.editorManager.get();
- var i = editors.length;
- while (i--) {
- var body = editors[i].getBody();
- if (body === target || DOM$2.isChildOf(target, body)) {
- fireEvent(editors[i], eventName, e);
- }
- }
- };
- customEventRootDelegates[eventName] = delegate;
- DOM$2.bind(eventRootElm, eventName, delegate);
- } else {
- delegate = function (e) {
- fireEvent(editor, eventName, e);
- };
- DOM$2.bind(eventRootElm, eventName, delegate);
- editor.delegates[eventName] = delegate;
- }
- };
- var EditorObservable = __assign(__assign({}, Observable), {
- bindPendingEventDelegates: function () {
- var self = this;
- Tools.each(self._pendingNativeEvents, function (name) {
- bindEventDelegate(self, name);
- });
- },
- toggleNativeEvent: function (name, state) {
- var self = this;
- if (name === 'focus' || name === 'blur') {
- return;
- }
- if (self.removed) {
- return;
- }
- if (state) {
- if (self.initialized) {
- bindEventDelegate(self, name);
- } else {
- if (!self._pendingNativeEvents) {
- self._pendingNativeEvents = [name];
- } else {
- self._pendingNativeEvents.push(name);
- }
- }
- } else if (self.initialized) {
- self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
- delete self.delegates[name];
- }
- },
- unbindAllNativeEvents: function () {
- var self = this;
- var body = self.getBody();
- var dom = self.dom;
- if (self.delegates) {
- each$j(self.delegates, function (value, name) {
- self.dom.unbind(getEventTarget(self, name), name, value);
- });
- delete self.delegates;
- }
- if (!self.inline && body && dom) {
- body.onload = null;
- dom.unbind(self.getWin());
- dom.unbind(self.getDoc());
- }
- if (dom) {
- dom.unbind(body);
- dom.unbind(self.getContainer());
- }
- }
- });
- var defaultModes = [
- 'design',
- 'readonly'
- ];
- var switchToMode = function (editor, activeMode, availableModes, mode) {
- var oldMode = availableModes[activeMode.get()];
- var newMode = availableModes[mode];
- try {
- newMode.activate();
- } catch (e) {
- console.error('problem while activating editor mode ' + mode + ':', e);
- return;
- }
- oldMode.deactivate();
- if (oldMode.editorReadOnly !== newMode.editorReadOnly) {
- toggleReadOnly(editor, newMode.editorReadOnly);
- }
- activeMode.set(mode);
- fireSwitchMode(editor, mode);
- };
- var setMode = function (editor, availableModes, activeMode, mode) {
- if (mode === activeMode.get()) {
- return;
- } else if (!has$2(availableModes, mode)) {
- throw new Error('Editor mode \'' + mode + '\' is invalid');
- }
- if (editor.initialized) {
- switchToMode(editor, activeMode, availableModes, mode);
- } else {
- editor.on('init', function () {
- return switchToMode(editor, activeMode, availableModes, mode);
- });
- }
- };
- var registerMode = function (availableModes, mode, api) {
- var _a;
- if (contains$3(defaultModes, mode)) {
- throw new Error('Cannot override default mode ' + mode);
- }
- return __assign(__assign({}, availableModes), (_a = {}, _a[mode] = __assign(__assign({}, api), {
- deactivate: function () {
- try {
- api.deactivate();
- } catch (e) {
- console.error('problem while deactivating editor mode ' + mode + ':', e);
- }
- }
- }), _a));
- };
- var create$4 = function (editor) {
- var activeMode = Cell('design');
- var availableModes = Cell({
- design: {
- activate: noop,
- deactivate: noop,
- editorReadOnly: false
- },
- readonly: {
- activate: noop,
- deactivate: noop,
- editorReadOnly: true
- }
- });
- registerReadOnlyContentFilters(editor);
- registerReadOnlySelectionBlockers(editor);
- return {
- isReadOnly: function () {
- return isReadOnly(editor);
- },
- set: function (mode) {
- return setMode(editor, availableModes.get(), activeMode, mode);
- },
- get: function () {
- return activeMode.get();
- },
- register: function (mode, api) {
- availableModes.set(registerMode(availableModes.get(), mode, api));
- }
- };
- };
- var each$3 = Tools.each, explode$1 = Tools.explode;
- var keyCodeLookup = {
- f1: 112,
- f2: 113,
- f3: 114,
- f4: 115,
- f5: 116,
- f6: 117,
- f7: 118,
- f8: 119,
- f9: 120,
- f10: 121,
- f11: 122,
- f12: 123
- };
- var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
- var parseShortcut = function (pattern) {
- var key;
- var shortcut = {};
- each$3(explode$1(pattern.toLowerCase(), '+'), function (value) {
- if (value in modifierNames) {
- shortcut[value] = true;
- } else {
- if (/^[0-9]{2,}$/.test(value)) {
- shortcut.keyCode = parseInt(value, 10);
- } else {
- shortcut.charCode = value.charCodeAt(0);
- shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
- }
- }
- });
- var id = [shortcut.keyCode];
- for (key in modifierNames) {
- if (shortcut[key]) {
- id.push(key);
- } else {
- shortcut[key] = false;
- }
- }
- shortcut.id = id.join(',');
- if (shortcut.access) {
- shortcut.alt = true;
- if (Env.mac) {
- shortcut.ctrl = true;
- } else {
- shortcut.shift = true;
- }
- }
- if (shortcut.meta) {
- if (Env.mac) {
- shortcut.meta = true;
- } else {
- shortcut.ctrl = true;
- shortcut.meta = false;
- }
- }
- return shortcut;
- };
- var Shortcuts = function () {
- function Shortcuts(editor) {
- this.shortcuts = {};
- this.pendingPatterns = [];
- this.editor = editor;
- var self = this;
- editor.on('keyup keypress keydown', function (e) {
- if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) {
- each$3(self.shortcuts, function (shortcut) {
- if (self.matchShortcut(e, shortcut)) {
- self.pendingPatterns = shortcut.subpatterns.slice(0);
- if (e.type === 'keydown') {
- self.executeShortcutAction(shortcut);
- }
- return true;
- }
- });
- if (self.matchShortcut(e, self.pendingPatterns[0])) {
- if (self.pendingPatterns.length === 1) {
- if (e.type === 'keydown') {
- self.executeShortcutAction(self.pendingPatterns[0]);
- }
- }
- self.pendingPatterns.shift();
- }
- }
- });
- }
- Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) {
- var self = this;
- var func = self.normalizeCommandFunc(cmdFunc);
- each$3(explode$1(Tools.trim(pattern)), function (pattern) {
- var shortcut = self.createShortcut(pattern, desc, func, scope);
- self.shortcuts[shortcut.id] = shortcut;
- });
- return true;
- };
- Shortcuts.prototype.remove = function (pattern) {
- var shortcut = this.createShortcut(pattern);
- if (this.shortcuts[shortcut.id]) {
- delete this.shortcuts[shortcut.id];
- return true;
- }
- return false;
- };
- Shortcuts.prototype.normalizeCommandFunc = function (cmdFunc) {
- var self = this;
- var cmd = cmdFunc;
- if (typeof cmd === 'string') {
- return function () {
- self.editor.execCommand(cmd, false, null);
- };
- } else if (Tools.isArray(cmd)) {
- return function () {
- self.editor.execCommand(cmd[0], cmd[1], cmd[2]);
- };
- } else {
- return cmd;
- }
- };
- Shortcuts.prototype.createShortcut = function (pattern, desc, cmdFunc, scope) {
- var shortcuts = Tools.map(explode$1(pattern, '>'), parseShortcut);
- shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], {
- func: cmdFunc,
- scope: scope || this.editor
- });
- return Tools.extend(shortcuts[0], {
- desc: this.editor.translate(desc),
- subpatterns: shortcuts.slice(1)
- });
- };
- Shortcuts.prototype.hasModifier = function (e) {
- return e.altKey || e.ctrlKey || e.metaKey;
- };
- Shortcuts.prototype.isFunctionKey = function (e) {
- return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123;
- };
- Shortcuts.prototype.matchShortcut = function (e, shortcut) {
- if (!shortcut) {
- return false;
- }
- if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) {
- return false;
- }
- if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) {
- return false;
- }
- if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) {
- e.preventDefault();
- return true;
- }
- return false;
- };
- Shortcuts.prototype.executeShortcutAction = function (shortcut) {
- return shortcut.func ? shortcut.func.call(shortcut.scope) : null;
- };
- return Shortcuts;
- }();
- var create$3 = function () {
- var buttons = {};
- var menuItems = {};
- var popups = {};
- var icons = {};
- var contextMenus = {};
- var contextToolbars = {};
- var sidebars = {};
- var add = function (collection, type) {
- return function (name, spec) {
- return collection[name.toLowerCase()] = __assign(__assign({}, spec), { type: type });
- };
- };
- var addIcon = function (name, svgData) {
- return icons[name.toLowerCase()] = svgData;
- };
- return {
- addButton: add(buttons, 'button'),
- addGroupToolbarButton: add(buttons, 'grouptoolbarbutton'),
- addToggleButton: add(buttons, 'togglebutton'),
- addMenuButton: add(buttons, 'menubutton'),
- addSplitButton: add(buttons, 'splitbutton'),
- addMenuItem: add(menuItems, 'menuitem'),
- addNestedMenuItem: add(menuItems, 'nestedmenuitem'),
- addToggleMenuItem: add(menuItems, 'togglemenuitem'),
- addAutocompleter: add(popups, 'autocompleter'),
- addContextMenu: add(contextMenus, 'contextmenu'),
- addContextToolbar: add(contextToolbars, 'contexttoolbar'),
- addContextForm: add(contextToolbars, 'contextform'),
- addSidebar: add(sidebars, 'sidebar'),
- addIcon: addIcon,
- getAll: function () {
- return {
- buttons: buttons,
- menuItems: menuItems,
- icons: icons,
- popups: popups,
- contextMenus: contextMenus,
- contextToolbars: contextToolbars,
- sidebars: sidebars
- };
- }
- };
- };
- var registry = function () {
- var bridge = create$3();
- return {
- addAutocompleter: bridge.addAutocompleter,
- addButton: bridge.addButton,
- addContextForm: bridge.addContextForm,
- addContextMenu: bridge.addContextMenu,
- addContextToolbar: bridge.addContextToolbar,
- addIcon: bridge.addIcon,
- addMenuButton: bridge.addMenuButton,
- addMenuItem: bridge.addMenuItem,
- addNestedMenuItem: bridge.addNestedMenuItem,
- addSidebar: bridge.addSidebar,
- addSplitButton: bridge.addSplitButton,
- addToggleButton: bridge.addToggleButton,
- addGroupToolbarButton: bridge.addGroupToolbarButton,
- addToggleMenuItem: bridge.addToggleMenuItem,
- getAll: bridge.getAll
- };
- };
- var DOM$1 = DOMUtils.DOM;
- var extend$3 = Tools.extend, each$2 = Tools.each;
- var resolve = Tools.resolve;
- var ie = Env.ie;
- var Editor = function () {
- function Editor(id, settings, editorManager) {
- var _this = this;
- this.plugins = {};
- this.contentCSS = [];
- this.contentStyles = [];
- this.loadedCSS = {};
- this.isNotDirty = false;
- this.editorManager = editorManager;
- this.documentBaseUrl = editorManager.documentBaseURL;
- extend$3(this, EditorObservable);
- this.settings = getEditorSettings(this, id, this.documentBaseUrl, editorManager.defaultSettings, settings);
- if (this.settings.suffix) {
- editorManager.suffix = this.settings.suffix;
- }
- this.suffix = editorManager.suffix;
- if (this.settings.base_url) {
- editorManager._setBaseUrl(this.settings.base_url);
- }
- this.baseUri = editorManager.baseURI;
- if (this.settings.referrer_policy) {
- ScriptLoader.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy);
- DOMUtils.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy);
- }
- AddOnManager.languageLoad = this.settings.language_load;
- AddOnManager.baseURL = editorManager.baseURL;
- this.id = id;
- this.setDirty(false);
- this.documentBaseURI = new URI(this.settings.document_base_url, { base_uri: this.baseUri });
- this.baseURI = this.baseUri;
- this.inline = !!this.settings.inline;
- this.shortcuts = new Shortcuts(this);
- this.editorCommands = new EditorCommands(this);
- if (this.settings.cache_suffix) {
- Env.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, '');
- }
- this.ui = {
- registry: registry(),
- styleSheetLoader: undefined,
- show: noop,
- hide: noop,
- enable: noop,
- disable: noop,
- isDisabled: never
- };
- var self = this;
- var modeInstance = create$4(self);
- this.mode = modeInstance;
- this.setMode = modeInstance.set;
- editorManager.fire('SetupEditor', { editor: this });
- this.execCallback('setup', this);
- this.$ = DomQuery.overrideDefaults(function () {
- return {
- context: _this.inline ? _this.getBody() : _this.getDoc(),
- element: _this.getBody()
- };
- });
- }
- Editor.prototype.render = function () {
- render(this);
- };
- Editor.prototype.focus = function (skipFocus) {
- this.execCommand('mceFocus', false, skipFocus);
- };
- Editor.prototype.hasFocus = function () {
- return hasFocus(this);
- };
- Editor.prototype.execCallback = function (name) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var self = this;
- var callback = self.settings[name], scope;
- if (!callback) {
- return;
- }
- if (self.callbackLookup && (scope = self.callbackLookup[name])) {
- callback = scope.func;
- scope = scope.scope;
- }
- if (typeof callback === 'string') {
- scope = callback.replace(/\.\w+$/, '');
- scope = scope ? resolve(scope) : 0;
- callback = resolve(callback);
- self.callbackLookup = self.callbackLookup || {};
- self.callbackLookup[name] = {
- func: callback,
- scope: scope
- };
- }
- return callback.apply(scope || self, x);
- };
- Editor.prototype.translate = function (text) {
- return I18n.translate(text);
- };
- Editor.prototype.getParam = function (name, defaultVal, type) {
- return getParam(this, name, defaultVal, type);
- };
- Editor.prototype.hasPlugin = function (name, loaded) {
- var hasPlugin = contains$3(getPlugins(this).split(/[ ,]/), name);
- if (hasPlugin) {
- return loaded ? PluginManager.get(name) !== undefined : true;
- } else {
- return false;
- }
- };
- Editor.prototype.nodeChanged = function (args) {
- this._nodeChangeDispatcher.nodeChanged(args);
- };
- Editor.prototype.addCommand = function (name, callback, scope) {
- this.editorCommands.addCommand(name, callback, scope);
- };
- Editor.prototype.addQueryStateHandler = function (name, callback, scope) {
- this.editorCommands.addQueryStateHandler(name, callback, scope);
- };
- Editor.prototype.addQueryValueHandler = function (name, callback, scope) {
- this.editorCommands.addQueryValueHandler(name, callback, scope);
- };
- Editor.prototype.addShortcut = function (pattern, desc, cmdFunc, scope) {
- this.shortcuts.add(pattern, desc, cmdFunc, scope);
- };
- Editor.prototype.execCommand = function (cmd, ui, value, args) {
- return this.editorCommands.execCommand(cmd, ui, value, args);
- };
- Editor.prototype.queryCommandState = function (cmd) {
- return this.editorCommands.queryCommandState(cmd);
- };
- Editor.prototype.queryCommandValue = function (cmd) {
- return this.editorCommands.queryCommandValue(cmd);
- };
- Editor.prototype.queryCommandSupported = function (cmd) {
- return this.editorCommands.queryCommandSupported(cmd);
- };
- Editor.prototype.show = function () {
- var self = this;
- if (self.hidden) {
- self.hidden = false;
- if (self.inline) {
- self.getBody().contentEditable = 'true';
- } else {
- DOM$1.show(self.getContainer());
- DOM$1.hide(self.id);
- }
- self.load();
- self.fire('show');
- }
- };
- Editor.prototype.hide = function () {
- var self = this, doc = self.getDoc();
- if (!self.hidden) {
- if (ie && doc && !self.inline) {
- doc.execCommand('SelectAll');
- }
- self.save();
- if (self.inline) {
- self.getBody().contentEditable = 'false';
- if (self === self.editorManager.focusedEditor) {
- self.editorManager.focusedEditor = null;
- }
- } else {
- DOM$1.hide(self.getContainer());
- DOM$1.setStyle(self.id, 'display', self.orgDisplay);
- }
- self.hidden = true;
- self.fire('hide');
- }
- };
- Editor.prototype.isHidden = function () {
- return !!this.hidden;
- };
- Editor.prototype.setProgressState = function (state, time) {
- this.fire('ProgressState', {
- state: state,
- time: time
- });
- };
- Editor.prototype.load = function (args) {
- var self = this;
- var elm = self.getElement(), html;
- if (self.removed) {
- return '';
- }
- if (elm) {
- args = args || {};
- args.load = true;
- var value = isTextareaOrInput(elm) ? elm.value : elm.innerHTML;
- html = self.setContent(value, args);
- args.element = elm;
- if (!args.no_events) {
- self.fire('LoadContent', args);
- }
- args.element = elm = null;
- return html;
- }
- };
- Editor.prototype.save = function (args) {
- var self = this;
- var elm = self.getElement(), html, form;
- if (!elm || !self.initialized || self.removed) {
- return;
- }
- args = args || {};
- args.save = true;
- args.element = elm;
- html = args.content = self.getContent(args);
- if (!args.no_events) {
- self.fire('SaveContent', args);
- }
- if (args.format === 'raw') {
- self.fire('RawSaveContent', args);
- }
- html = args.content;
- if (!isTextareaOrInput(elm)) {
- if (args.is_removing || !self.inline) {
- elm.innerHTML = html;
- }
- if (form = DOM$1.getParent(self.id, 'form')) {
- each$2(form.elements, function (elm) {
- if (elm.name === self.id) {
- elm.value = html;
- return false;
- }
- });
- }
- } else {
- elm.value = html;
- }
- args.element = elm = null;
- if (args.set_dirty !== false) {
- self.setDirty(false);
- }
- return html;
- };
- Editor.prototype.setContent = function (content, args) {
- return setContent(this, content, args);
- };
- Editor.prototype.getContent = function (args) {
- return getContent(this, args);
- };
- Editor.prototype.insertContent = function (content, args) {
- if (args) {
- content = extend$3({ content: content }, args);
- }
- this.execCommand('mceInsertContent', false, content);
- };
- Editor.prototype.resetContent = function (initialContent) {
- if (initialContent === undefined) {
- setContent(this, this.startContent, { format: 'raw' });
- } else {
- setContent(this, initialContent);
- }
- this.undoManager.reset();
- this.setDirty(false);
- this.nodeChanged();
- };
- Editor.prototype.isDirty = function () {
- return !this.isNotDirty;
- };
- Editor.prototype.setDirty = function (state) {
- var oldState = !this.isNotDirty;
- this.isNotDirty = !state;
- if (state && state !== oldState) {
- this.fire('dirty');
- }
- };
- Editor.prototype.getContainer = function () {
- var self = this;
- if (!self.container) {
- self.container = DOM$1.get(self.editorContainer || self.id + '_parent');
- }
- return self.container;
- };
- Editor.prototype.getContentAreaContainer = function () {
- return this.contentAreaContainer;
- };
- Editor.prototype.getElement = function () {
- if (!this.targetElm) {
- this.targetElm = DOM$1.get(this.id);
- }
- return this.targetElm;
- };
- Editor.prototype.getWin = function () {
- var self = this;
- var elm;
- if (!self.contentWindow) {
- elm = self.iframeElement;
- if (elm) {
- self.contentWindow = elm.contentWindow;
- }
- }
- return self.contentWindow;
- };
- Editor.prototype.getDoc = function () {
- var self = this;
- var win;
- if (!self.contentDocument) {
- win = self.getWin();
- if (win) {
- self.contentDocument = win.document;
- }
- }
- return self.contentDocument;
- };
- Editor.prototype.getBody = function () {
- var doc = this.getDoc();
- return this.bodyElement || (doc ? doc.body : null);
- };
- Editor.prototype.convertURL = function (url, name, elm) {
- var self = this, settings = self.settings;
- if (settings.urlconverter_callback) {
- return self.execCallback('urlconverter_callback', url, elm, true, name);
- }
- if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) {
- return url;
- }
- if (settings.relative_urls) {
- return self.documentBaseURI.toRelative(url);
- }
- url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
- return url;
- };
- Editor.prototype.addVisual = function (elm) {
- addVisual(this, elm);
- };
- Editor.prototype.remove = function () {
- remove(this);
- };
- Editor.prototype.destroy = function (automatic) {
- destroy(this, automatic);
- };
- Editor.prototype.uploadImages = function (callback) {
- return this.editorUpload.uploadImages(callback);
- };
- Editor.prototype._scanForImages = function () {
- return this.editorUpload.scanForImages();
- };
- Editor.prototype.addButton = function () {
- throw new Error('editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead');
- };
- Editor.prototype.addSidebar = function () {
- throw new Error('editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead');
- };
- Editor.prototype.addMenuItem = function () {
- throw new Error('editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead');
- };
- Editor.prototype.addContextToolbar = function () {
- throw new Error('editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead');
- };
- return Editor;
- }();
- var DOM = DOMUtils.DOM;
- var explode = Tools.explode, each$1 = Tools.each, extend$2 = Tools.extend;
- var instanceCounter = 0, boundGlobalEvents = false;
- var beforeUnloadDelegate;
- var legacyEditors = [];
- var editors = [];
- var isValidLegacyKey = function (id) {
- return id !== 'length';
- };
- var globalEventDelegate = function (e) {
- var type = e.type;
- each$1(EditorManager.get(), function (editor) {
- switch (type) {
- case 'scroll':
- editor.fire('ScrollWindow', e);
- break;
- case 'resize':
- editor.fire('ResizeWindow', e);
- break;
- }
- });
- };
- var toggleGlobalEvents = function (state) {
- if (state !== boundGlobalEvents) {
- if (state) {
- DomQuery(window).on('resize scroll', globalEventDelegate);
- } else {
- DomQuery(window).off('resize scroll', globalEventDelegate);
- }
- boundGlobalEvents = state;
- }
- };
- var removeEditorFromList = function (targetEditor) {
- var oldEditors = editors;
- delete legacyEditors[targetEditor.id];
- for (var i = 0; i < legacyEditors.length; i++) {
- if (legacyEditors[i] === targetEditor) {
- legacyEditors.splice(i, 1);
- break;
- }
- }
- editors = filter$4(editors, function (editor) {
- return targetEditor !== editor;
- });
- if (EditorManager.activeEditor === targetEditor) {
- EditorManager.activeEditor = editors.length > 0 ? editors[0] : null;
- }
- if (EditorManager.focusedEditor === targetEditor) {
- EditorManager.focusedEditor = null;
- }
- return oldEditors.length !== editors.length;
- };
- var purgeDestroyedEditor = function (editor) {
- if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) {
- removeEditorFromList(editor);
- editor.unbindAllNativeEvents();
- editor.destroy(true);
- editor.removed = true;
- editor = null;
- }
- return editor;
- };
- var isQuirksMode = document.compatMode !== 'CSS1Compat';
- var EditorManager = __assign(__assign({}, Observable), {
- baseURI: null,
- baseURL: null,
- defaultSettings: {},
- documentBaseURL: null,
- suffix: null,
- $: DomQuery,
- majorVersion: '5',
- minorVersion: '10.3',
- releaseDate: '2022-02-09',
- editors: legacyEditors,
- i18n: I18n,
- activeEditor: null,
- focusedEditor: null,
- settings: {},
- setup: function () {
- var self = this;
- var baseURL, documentBaseURL, suffix = '';
- documentBaseURL = URI.getDocumentBaseUrl(document.location);
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
- documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
- if (!/[\/\\]$/.test(documentBaseURL)) {
- documentBaseURL += '/';
- }
- }
- var preInit = window.tinymce || window.tinyMCEPreInit;
- if (preInit) {
- baseURL = preInit.base || preInit.baseURL;
- suffix = preInit.suffix;
- } else {
- var scripts = document.getElementsByTagName('script');
- for (var i = 0; i < scripts.length; i++) {
- var src = scripts[i].src || '';
- if (src === '') {
- continue;
- }
- var srcScript = src.substring(src.lastIndexOf('/'));
- if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
- if (srcScript.indexOf('.min') !== -1) {
- suffix = '.min';
- }
- baseURL = src.substring(0, src.lastIndexOf('/'));
- break;
- }
- }
- if (!baseURL && document.currentScript) {
- var src = document.currentScript.src;
- if (src.indexOf('.min') !== -1) {
- suffix = '.min';
- }
- baseURL = src.substring(0, src.lastIndexOf('/'));
- }
- }
- self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
- self.documentBaseURL = documentBaseURL;
- self.baseURI = new URI(self.baseURL);
- self.suffix = suffix;
- setup$l(self);
- },
- overrideDefaults: function (defaultSettings) {
- var baseUrl = defaultSettings.base_url;
- if (baseUrl) {
- this._setBaseUrl(baseUrl);
- }
- var suffix = defaultSettings.suffix;
- if (defaultSettings.suffix) {
- this.suffix = suffix;
- }
- this.defaultSettings = defaultSettings;
- var pluginBaseUrls = defaultSettings.plugin_base_urls;
- if (pluginBaseUrls !== undefined) {
- each$j(pluginBaseUrls, function (pluginBaseUrl, pluginName) {
- AddOnManager.PluginManager.urls[pluginName] = pluginBaseUrl;
- });
- }
- },
- init: function (settings) {
- var self = this;
- var result;
- var invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu', ' ');
- var isInvalidInlineTarget = function (settings, elm) {
- return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets;
- };
- var createId = function (elm) {
- var id = elm.id;
- if (!id) {
- id = get$9(elm, 'name').filter(function (name) {
- return !DOM.get(name);
- }).getOrThunk(DOM.uniqueId);
- elm.setAttribute('id', id);
- }
- return id;
- };
- var execCallback = function (name) {
- var callback = settings[name];
- if (!callback) {
- return;
- }
- return callback.apply(self, []);
- };
- var hasClass = function (elm, className) {
- return className.constructor === RegExp ? className.test(elm.className) : DOM.hasClass(elm, className);
- };
- var findTargets = function (settings) {
- var targets = [];
- if (Env.browser.isIE() && Env.browser.version.major < 11) {
- initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/');
- return [];
- } else if (isQuirksMode) {
- initError('Failed to initialize the editor as the document is not in standards mode. ' + 'TinyMCE requires standards mode.');
- return [];
- }
- if (settings.types) {
- each$1(settings.types, function (type) {
- targets = targets.concat(DOM.select(type.selector));
- });
- return targets;
- } else if (settings.selector) {
- return DOM.select(settings.selector);
- } else if (settings.target) {
- return [settings.target];
- }
- switch (settings.mode) {
- case 'exact':
- var l = settings.elements || '';
- if (l.length > 0) {
- each$1(explode(l), function (id) {
- var elm = DOM.get(id);
- if (elm) {
- targets.push(elm);
- } else {
- each$1(document.forms, function (f) {
- each$1(f.elements, function (e) {
- if (e.name === id) {
- id = 'mce_editor_' + instanceCounter++;
- DOM.setAttrib(e, 'id', id);
- targets.push(e);
- }
- });
- });
- }
- });
- }
- break;
- case 'textareas':
- case 'specific_textareas':
- each$1(DOM.select('textarea'), function (elm) {
- if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
- return;
- }
- if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
- targets.push(elm);
- }
- });
- break;
- }
- return targets;
- };
- var provideResults = function (editors) {
- result = editors;
- };
- var initEditors = function () {
- var initCount = 0;
- var editors = [];
- var targets;
- var createEditor = function (id, settings, targetElm) {
- var editor = new Editor(id, settings, self);
- editors.push(editor);
- editor.on('init', function () {
- if (++initCount === targets.length) {
- provideResults(editors);
- }
- });
- editor.targetElm = editor.targetElm || targetElm;
- editor.render();
- };
- DOM.unbind(window, 'ready', initEditors);
- execCallback('onpageload');
- targets = DomQuery.unique(findTargets(settings));
- if (settings.types) {
- each$1(settings.types, function (type) {
- Tools.each(targets, function (elm) {
- if (DOM.is(elm, type.selector)) {
- createEditor(createId(elm), extend$2({}, settings, type), elm);
- return false;
- }
- return true;
- });
- });
- return;
- }
- Tools.each(targets, function (elm) {
- purgeDestroyedEditor(self.get(elm.id));
- });
- targets = Tools.grep(targets, function (elm) {
- return !self.get(elm.id);
- });
- if (targets.length === 0) {
- provideResults([]);
- } else {
- each$1(targets, function (elm) {
- if (isInvalidInlineTarget(settings, elm)) {
- initError('Could not initialize inline editor on invalid inline target element', elm);
- } else {
- createEditor(createId(elm), settings, elm);
- }
- });
- }
- };
- self.settings = settings;
- DOM.bind(window, 'ready', initEditors);
- return new promiseObj(function (resolve) {
- if (result) {
- resolve(result);
- } else {
- provideResults = function (editors) {
- resolve(editors);
- };
- }
- });
- },
- get: function (id) {
- if (arguments.length === 0) {
- return editors.slice(0);
- } else if (isString$1(id)) {
- return find$3(editors, function (editor) {
- return editor.id === id;
- }).getOr(null);
- } else if (isNumber(id)) {
- return editors[id] ? editors[id] : null;
- } else {
- return null;
- }
- },
- add: function (editor) {
- var self = this;
- var existingEditor = legacyEditors[editor.id];
- if (existingEditor === editor) {
- return editor;
- }
- if (self.get(editor.id) === null) {
- if (isValidLegacyKey(editor.id)) {
- legacyEditors[editor.id] = editor;
- }
- legacyEditors.push(editor);
- editors.push(editor);
- }
- toggleGlobalEvents(true);
- self.activeEditor = editor;
- self.fire('AddEditor', { editor: editor });
- if (!beforeUnloadDelegate) {
- beforeUnloadDelegate = function (e) {
- var event = self.fire('BeforeUnload');
- if (event.returnValue) {
- e.preventDefault();
- e.returnValue = event.returnValue;
- return event.returnValue;
- }
- };
- window.addEventListener('beforeunload', beforeUnloadDelegate);
- }
- return editor;
- },
- createEditor: function (id, settings) {
- return this.add(new Editor(id, settings, this));
- },
- remove: function (selector) {
- var self = this;
- var i, editor;
- if (!selector) {
- for (i = editors.length - 1; i >= 0; i--) {
- self.remove(editors[i]);
- }
- return;
- }
- if (isString$1(selector)) {
- each$1(DOM.select(selector), function (elm) {
- editor = self.get(elm.id);
- if (editor) {
- self.remove(editor);
- }
- });
- return;
- }
- editor = selector;
- if (isNull(self.get(editor.id))) {
- return null;
- }
- if (removeEditorFromList(editor)) {
- self.fire('RemoveEditor', { editor: editor });
- }
- if (editors.length === 0) {
- window.removeEventListener('beforeunload', beforeUnloadDelegate);
- }
- editor.remove();
- toggleGlobalEvents(editors.length > 0);
- return editor;
- },
- execCommand: function (cmd, ui, value) {
- var self = this, editor = self.get(value);
- switch (cmd) {
- case 'mceAddEditor':
- if (!self.get(value)) {
- new Editor(value, self.settings, self).render();
- }
- return true;
- case 'mceRemoveEditor':
- if (editor) {
- editor.remove();
- }
- return true;
- case 'mceToggleEditor':
- if (!editor) {
- self.execCommand('mceAddEditor', false, value);
- return true;
- }
- if (editor.isHidden()) {
- editor.show();
- } else {
- editor.hide();
- }
- return true;
- }
- if (self.activeEditor) {
- return self.activeEditor.execCommand(cmd, ui, value);
- }
- return false;
- },
- triggerSave: function () {
- each$1(editors, function (editor) {
- editor.save();
- });
- },
- addI18n: function (code, items) {
- I18n.add(code, items);
- },
- translate: function (text) {
- return I18n.translate(text);
- },
- setActive: function (editor) {
- var activeEditor = this.activeEditor;
- if (this.activeEditor !== editor) {
- if (activeEditor) {
- activeEditor.fire('deactivate', { relatedTarget: editor });
- }
- editor.fire('activate', { relatedTarget: activeEditor });
- }
- this.activeEditor = editor;
- },
- _setBaseUrl: function (baseUrl) {
- this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
- this.baseURI = new URI(this.baseURL);
- }
- });
- EditorManager.setup();
- var min$1 = Math.min, max$1 = Math.max, round$1 = Math.round;
- var relativePosition = function (rect, targetRect, rel) {
- var x = targetRect.x;
- var y = targetRect.y;
- var w = rect.w;
- var h = rect.h;
- var targetW = targetRect.w;
- var targetH = targetRect.h;
- var relChars = (rel || '').split('');
- if (relChars[0] === 'b') {
- y += targetH;
- }
- if (relChars[1] === 'r') {
- x += targetW;
- }
- if (relChars[0] === 'c') {
- y += round$1(targetH / 2);
- }
- if (relChars[1] === 'c') {
- x += round$1(targetW / 2);
- }
- if (relChars[3] === 'b') {
- y -= h;
- }
- if (relChars[4] === 'r') {
- x -= w;
- }
- if (relChars[3] === 'c') {
- y -= round$1(h / 2);
- }
- if (relChars[4] === 'c') {
- x -= round$1(w / 2);
- }
- return create$2(x, y, w, h);
- };
- var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
- var pos, i;
- for (i = 0; i < rels.length; i++) {
- pos = relativePosition(rect, targetRect, rels[i]);
- if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) {
- return rels[i];
- }
- }
- return null;
- };
- var inflate = function (rect, w, h) {
- return create$2(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
- };
- var intersect = function (rect, cropRect) {
- var x1 = max$1(rect.x, cropRect.x);
- var y1 = max$1(rect.y, cropRect.y);
- var x2 = min$1(rect.x + rect.w, cropRect.x + cropRect.w);
- var y2 = min$1(rect.y + rect.h, cropRect.y + cropRect.h);
- if (x2 - x1 < 0 || y2 - y1 < 0) {
- return null;
- }
- return create$2(x1, y1, x2 - x1, y2 - y1);
- };
- var clamp = function (rect, clampRect, fixedSize) {
- var x1 = rect.x;
- var y1 = rect.y;
- var x2 = rect.x + rect.w;
- var y2 = rect.y + rect.h;
- var cx2 = clampRect.x + clampRect.w;
- var cy2 = clampRect.y + clampRect.h;
- var underflowX1 = max$1(0, clampRect.x - x1);
- var underflowY1 = max$1(0, clampRect.y - y1);
- var overflowX2 = max$1(0, x2 - cx2);
- var overflowY2 = max$1(0, y2 - cy2);
- x1 += underflowX1;
- y1 += underflowY1;
- if (fixedSize) {
- x2 += underflowX1;
- y2 += underflowY1;
- x1 -= overflowX2;
- y1 -= overflowY2;
- }
- x2 -= overflowX2;
- y2 -= overflowY2;
- return create$2(x1, y1, x2 - x1, y2 - y1);
- };
- var create$2 = function (x, y, w, h) {
- return {
- x: x,
- y: y,
- w: w,
- h: h
- };
- };
- var fromClientRect = function (clientRect) {
- return create$2(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
- };
- var Rect = {
- inflate: inflate,
- relativePosition: relativePosition,
- findBestRelativePosition: findBestRelativePosition,
- intersect: intersect,
- clamp: clamp,
- create: create$2,
- fromClientRect: fromClientRect
- };
- var awaiter = function (resolveCb, rejectCb, timeout) {
- if (timeout === void 0) {
- timeout = 1000;
- }
- var done = false;
- var timer = null;
- var complete = function (completer) {
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (!done) {
- done = true;
- if (timer !== null) {
- clearTimeout(timer);
- timer = null;
- }
- completer.apply(null, args);
- }
- };
- };
- var resolve = complete(resolveCb);
- var reject = complete(rejectCb);
- var start = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (!done && timer === null) {
- timer = setTimeout(function () {
- return reject.apply(null, args);
- }, timeout);
- }
- };
- return {
- start: start,
- resolve: resolve,
- reject: reject
- };
- };
- var create$1 = function () {
- var tasks = {};
- var resultFns = {};
- var load = function (id, url) {
- var loadErrMsg = 'Script at URL "' + url + '" failed to load';
- var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second';
- if (tasks[id] !== undefined) {
- return tasks[id];
- } else {
- var task = new promiseObj(function (resolve, reject) {
- var waiter = awaiter(resolve, reject);
- resultFns[id] = waiter.resolve;
- ScriptLoader.ScriptLoader.loadScript(url, function () {
- return waiter.start(runErrMsg);
- }, function () {
- return waiter.reject(loadErrMsg);
- });
- });
- tasks[id] = task;
- return task;
- }
- };
- var add = function (id, data) {
- if (resultFns[id] !== undefined) {
- resultFns[id](data);
- delete resultFns[id];
- }
- tasks[id] = promiseObj.resolve(data);
- };
- return {
- load: load,
- add: add
- };
- };
- var Resource = create$1();
- var each = Tools.each, extend$1 = Tools.extend;
- var extendClass, initializing;
- var Class = function () {
- };
- Class.extend = extendClass = function (props) {
- var self = this;
- var _super = self.prototype;
- var Class = function () {
- var i, mixins, mixin;
- var self = this;
- if (!initializing) {
- if (self.init) {
- self.init.apply(self, arguments);
- }
- mixins = self.Mixins;
- if (mixins) {
- i = mixins.length;
- while (i--) {
- mixin = mixins[i];
- if (mixin.init) {
- mixin.init.apply(self, arguments);
- }
- }
- }
- }
- };
- var dummy = function () {
- return this;
- };
- var createMethod = function (name, fn) {
- return function () {
- var self = this;
- var tmp = self._super;
- self._super = _super[name];
- var ret = fn.apply(self, arguments);
- self._super = tmp;
- return ret;
- };
- };
- initializing = true;
- var prototype = new self();
- initializing = false;
- if (props.Mixins) {
- each(props.Mixins, function (mixin) {
- for (var name_1 in mixin) {
- if (name_1 !== 'init') {
- props[name_1] = mixin[name_1];
- }
- }
- });
- if (_super.Mixins) {
- props.Mixins = _super.Mixins.concat(props.Mixins);
- }
- }
- if (props.Methods) {
- each(props.Methods.split(','), function (name) {
- props[name] = dummy;
- });
- }
- if (props.Properties) {
- each(props.Properties.split(','), function (name) {
- var fieldName = '_' + name;
- props[name] = function (value) {
- var self = this;
- if (value !== undefined) {
- self[fieldName] = value;
- return self;
- }
- return self[fieldName];
- };
- });
- }
- if (props.Statics) {
- each(props.Statics, function (func, name) {
- Class[name] = func;
- });
- }
- if (props.Defaults && _super.Defaults) {
- props.Defaults = extend$1({}, _super.Defaults, props.Defaults);
- }
- each$j(props, function (member, name) {
- if (typeof member === 'function' && _super[name]) {
- prototype[name] = createMethod(name, member);
- } else {
- prototype[name] = member;
- }
- });
- Class.prototype = prototype;
- Class.constructor = Class;
- Class.extend = extendClass;
- return Class;
- };
- var min = Math.min, max = Math.max, round = Math.round;
- var Color = function (value) {
- var self = {};
- var r = 0, g = 0, b = 0;
- var rgb2hsv = function (r, g, b) {
- var h, s, v;
- h = 0;
- s = 0;
- v = 0;
- r = r / 255;
- g = g / 255;
- b = b / 255;
- var minRGB = min(r, min(g, b));
- var maxRGB = max(r, max(g, b));
- if (minRGB === maxRGB) {
- v = minRGB;
- return {
- h: 0,
- s: 0,
- v: v * 100
- };
- }
- var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r;
- h = r === minRGB ? 3 : b === minRGB ? 1 : 5;
- h = 60 * (h - d / (maxRGB - minRGB));
- s = (maxRGB - minRGB) / maxRGB;
- v = maxRGB;
- return {
- h: round(h),
- s: round(s * 100),
- v: round(v * 100)
- };
- };
- var hsvToRgb = function (hue, saturation, brightness) {
- hue = (parseInt(hue, 10) || 0) % 360;
- saturation = parseInt(saturation, 10) / 100;
- brightness = parseInt(brightness, 10) / 100;
- saturation = max(0, min(saturation, 1));
- brightness = max(0, min(brightness, 1));
- if (saturation === 0) {
- r = g = b = round(255 * brightness);
- return;
- }
- var side = hue / 60;
- var chroma = brightness * saturation;
- var x = chroma * (1 - Math.abs(side % 2 - 1));
- var match = brightness - chroma;
- switch (Math.floor(side)) {
- case 0:
- r = chroma;
- g = x;
- b = 0;
- break;
- case 1:
- r = x;
- g = chroma;
- b = 0;
- break;
- case 2:
- r = 0;
- g = chroma;
- b = x;
- break;
- case 3:
- r = 0;
- g = x;
- b = chroma;
- break;
- case 4:
- r = x;
- g = 0;
- b = chroma;
- break;
- case 5:
- r = chroma;
- g = 0;
- b = x;
- break;
- default:
- r = g = b = 0;
- }
- r = round(255 * (r + match));
- g = round(255 * (g + match));
- b = round(255 * (b + match));
- };
- var toHex = function () {
- var hex = function (val) {
- val = parseInt(val, 10).toString(16);
- return val.length > 1 ? val : '0' + val;
- };
- return '#' + hex(r) + hex(g) + hex(b);
- };
- var toRgb = function () {
- return {
- r: r,
- g: g,
- b: b
- };
- };
- var toHsv = function () {
- return rgb2hsv(r, g, b);
- };
- var parse = function (value) {
- var matches;
- if (typeof value === 'object') {
- if ('r' in value) {
- r = value.r;
- g = value.g;
- b = value.b;
- } else if ('v' in value) {
- hsvToRgb(value.h, value.s, value.v);
- }
- } else {
- if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) {
- r = parseInt(matches[1], 10);
- g = parseInt(matches[2], 10);
- b = parseInt(matches[3], 10);
- } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) {
- r = parseInt(matches[1], 16);
- g = parseInt(matches[2], 16);
- b = parseInt(matches[3], 16);
- } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) {
- r = parseInt(matches[1] + matches[1], 16);
- g = parseInt(matches[2] + matches[2], 16);
- b = parseInt(matches[3] + matches[3], 16);
- }
- }
- r = r < 0 ? 0 : r > 255 ? 255 : r;
- g = g < 0 ? 0 : g > 255 ? 255 : g;
- b = b < 0 ? 0 : b > 255 ? 255 : b;
- return self;
- };
- if (value) {
- parse(value);
- }
- self.toRgb = toRgb;
- self.toHsv = toHsv;
- self.toHex = toHex;
- self.parse = parse;
- return self;
- };
- var serialize = function (obj) {
- var data = JSON.stringify(obj);
- if (!isString$1(data)) {
- return data;
- }
- return data.replace(/[\u0080-\uFFFF]/g, function (match) {
- var hexCode = match.charCodeAt(0).toString(16);
- return '\\u' + '0000'.substring(hexCode.length) + hexCode;
- });
- };
- var JSONUtils = {
- serialize: serialize,
- parse: function (text) {
- try {
- return JSON.parse(text);
- } catch (ex) {
- }
- }
- };
- var JSONP = {
- callbacks: {},
- count: 0,
- send: function (settings) {
- var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
- var id = 'tinymce_jsonp_' + count;
- self.callbacks[count] = function (json) {
- dom.remove(id);
- delete self.callbacks[count];
- settings.callback(json);
- };
- dom.add(dom.doc.body, 'script', {
- id: id,
- src: settings.url,
- type: 'text/javascript'
- });
- self.count++;
- }
- };
- var XHR = __assign(__assign({}, Observable), {
- send: function (settings) {
- var xhr, count = 0;
- var ready = function () {
- if (!settings.async || xhr.readyState === 4 || count++ > 10000) {
- if (settings.success && count < 10000 && xhr.status === 200) {
- settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
- } else if (settings.error) {
- settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
- }
- xhr = null;
- } else {
- Delay.setTimeout(ready, 10);
- }
- };
- settings.scope = settings.scope || this;
- settings.success_scope = settings.success_scope || settings.scope;
- settings.error_scope = settings.error_scope || settings.scope;
- settings.async = settings.async !== false;
- settings.data = settings.data || '';
- XHR.fire('beforeInitialize', { settings: settings });
- xhr = new XMLHttpRequest();
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType(settings.content_type);
- }
- xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
- if (settings.crossDomain) {
- xhr.withCredentials = true;
- }
- if (settings.content_type) {
- xhr.setRequestHeader('Content-Type', settings.content_type);
- }
- if (settings.requestheaders) {
- Tools.each(settings.requestheaders, function (header) {
- xhr.setRequestHeader(header.key, header.value);
- });
- }
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- xhr = XHR.fire('beforeSend', {
- xhr: xhr,
- settings: settings
- }).xhr;
- xhr.send(settings.data);
- if (!settings.async) {
- return ready();
- }
- Delay.setTimeout(ready, 10);
- }
- });
- var extend = Tools.extend;
- var JSONRequest = function () {
- function JSONRequest(settings) {
- this.settings = extend({}, settings);
- this.count = 0;
- }
- JSONRequest.sendRPC = function (o) {
- return new JSONRequest().send(o);
- };
- JSONRequest.prototype.send = function (args) {
- var ecb = args.error, scb = args.success;
- var xhrArgs = extend(this.settings, args);
- xhrArgs.success = function (c, x) {
- c = JSONUtils.parse(c);
- if (typeof c === 'undefined') {
- c = { error: 'JSON Parse error.' };
- }
- if (c.error) {
- ecb.call(xhrArgs.error_scope || xhrArgs.scope, c.error, x);
- } else {
- scb.call(xhrArgs.success_scope || xhrArgs.scope, c.result);
- }
- };
- xhrArgs.error = function (ty, x) {
- if (ecb) {
- ecb.call(xhrArgs.error_scope || xhrArgs.scope, ty, x);
- }
- };
- xhrArgs.data = JSONUtils.serialize({
- id: args.id || 'c' + this.count++,
- method: args.method,
- params: args.params
- });
- xhrArgs.content_type = 'application/json';
- XHR.send(xhrArgs);
- };
- return JSONRequest;
- }();
- var create = function () {
- return function () {
- var data = {};
- var keys = [];
- var storage = {
- getItem: function (key) {
- var item = data[key];
- return item ? item : null;
- },
- setItem: function (key, value) {
- keys.push(key);
- data[key] = String(value);
- },
- key: function (index) {
- return keys[index];
- },
- removeItem: function (key) {
- keys = keys.filter(function (k) {
- return k === key;
- });
- delete data[key];
- },
- clear: function () {
- keys = [];
- data = {};
- },
- length: 0
- };
- Object.defineProperty(storage, 'length', {
- get: function () {
- return keys.length;
- },
- configurable: false,
- enumerable: false
- });
- return storage;
- }();
- };
- var localStorage;
- try {
- var test = '__storage_test__';
- localStorage = window.localStorage;
- localStorage.setItem(test, test);
- localStorage.removeItem(test);
- } catch (e) {
- localStorage = create();
- }
- var LocalStorage = localStorage;
- var publicApi = {
- geom: { Rect: Rect },
- util: {
- Promise: promiseObj,
- Delay: Delay,
- Tools: Tools,
- VK: VK,
- URI: URI,
- Class: Class,
- EventDispatcher: EventDispatcher,
- Observable: Observable,
- I18n: I18n,
- XHR: XHR,
- JSON: JSONUtils,
- JSONRequest: JSONRequest,
- JSONP: JSONP,
- LocalStorage: LocalStorage,
- Color: Color,
- ImageUploader: ImageUploader
- },
- dom: {
- EventUtils: EventUtils,
- Sizzle: Sizzle,
- DomQuery: DomQuery,
- TreeWalker: DomTreeWalker,
- TextSeeker: TextSeeker,
- DOMUtils: DOMUtils,
- ScriptLoader: ScriptLoader,
- RangeUtils: RangeUtils,
- Serializer: DomSerializer,
- StyleSheetLoader: StyleSheetLoader,
- ControlSelection: ControlSelection,
- BookmarkManager: BookmarkManager,
- Selection: EditorSelection,
- Event: EventUtils.Event
- },
- html: {
- Styles: Styles,
- Entities: Entities,
- Node: AstNode,
- Schema: Schema,
- SaxParser: SaxParser,
- DomParser: DomParser,
- Writer: Writer,
- Serializer: HtmlSerializer
- },
- Env: Env,
- AddOnManager: AddOnManager,
- Annotator: Annotator,
- Formatter: Formatter,
- UndoManager: UndoManager,
- EditorCommands: EditorCommands,
- WindowManager: WindowManager,
- NotificationManager: NotificationManager,
- EditorObservable: EditorObservable,
- Shortcuts: Shortcuts,
- Editor: Editor,
- FocusManager: FocusManager,
- EditorManager: EditorManager,
- DOM: DOMUtils.DOM,
- ScriptLoader: ScriptLoader.ScriptLoader,
- PluginManager: PluginManager,
- ThemeManager: ThemeManager,
- IconManager: IconManager,
- Resource: Resource,
- trim: Tools.trim,
- isArray: Tools.isArray,
- is: Tools.is,
- toArray: Tools.toArray,
- makeMap: Tools.makeMap,
- each: Tools.each,
- map: Tools.map,
- grep: Tools.grep,
- inArray: Tools.inArray,
- extend: Tools.extend,
- create: Tools.create,
- walk: Tools.walk,
- createNS: Tools.createNS,
- resolve: Tools.resolve,
- explode: Tools.explode,
- _addCacheSuffix: Tools._addCacheSuffix,
- isOpera: Env.opera,
- isWebKit: Env.webkit,
- isIE: Env.ie,
- isGecko: Env.gecko,
- isMac: Env.mac
- };
- var tinymce = Tools.extend(EditorManager, publicApi);
- var exportToModuleLoaders = function (tinymce) {
- if (true) {
- try {
- module.exports = tinymce;
- } catch (_) {
- }
- }
- };
- var exportToWindowGlobal = function (tinymce) {
- window.tinymce = tinymce;
- window.tinyMCE = tinymce;
- };
- exportToWindowGlobal(tinymce);
- exportToModuleLoaders(tinymce);
- }());
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(31).setImmediate))
- /***/ }),
- /* 54 */
- /***/ (function(module, exports, __webpack_require__) {
- var mapCacheClear = __webpack_require__(150),
- mapCacheDelete = __webpack_require__(166),
- mapCacheGet = __webpack_require__(168),
- mapCacheHas = __webpack_require__(169),
- mapCacheSet = __webpack_require__(170);
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `MapCache`.
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype['delete'] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- module.exports = MapCache;
- /***/ }),
- /* 55 */
- /***/ (function(module, exports, __webpack_require__) {
- var ListCache = __webpack_require__(12),
- stackClear = __webpack_require__(171),
- stackDelete = __webpack_require__(172),
- stackGet = __webpack_require__(173),
- stackHas = __webpack_require__(174),
- stackSet = __webpack_require__(175);
- /**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- // Add methods to `Stack`.
- Stack.prototype.clear = stackClear;
- Stack.prototype['delete'] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- module.exports = Stack;
- /***/ }),
- /* 56 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(112)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(114)
- /* template */
- var __vue_template__ = __webpack_require__(115)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-5eba4923"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/_components/ScrollerY.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-5eba4923", Component.options)
- } else {
- hotAPI.reload("data-v-5eba4923", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 57 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(138)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(140)
- /* template */
- var __vue_template__ = __webpack_require__(143)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-0c50b298"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/task/files.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-0c50b298", Component.options)
- } else {
- hotAPI.reload("data-v-0c50b298", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 58 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(144)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(146)
- /* template */
- var __vue_template__ = __webpack_require__(147)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-2951ea9e"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/task/logs.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-2951ea9e", Component.options)
- } else {
- hotAPI.reload("data-v-2951ea9e", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 59 */
- /***/ (function(module, exports, __webpack_require__) {
- var root = __webpack_require__(3);
- /** Built-in value references. */
- var Uint8Array = root.Uint8Array;
- module.exports = Uint8Array;
- /***/ }),
- /* 60 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseGetAllKeys = __webpack_require__(40),
- getSymbols = __webpack_require__(24),
- keys = __webpack_require__(19);
- /**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- module.exports = getAllKeys;
- /***/ }),
- /* 61 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseIsArguments = __webpack_require__(178),
- isObjectLike = __webpack_require__(8);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Built-in value references. */
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
- !propertyIsEnumerable.call(value, 'callee');
- };
- module.exports = isArguments;
- /***/ }),
- /* 62 */
- /***/ (function(module, exports) {
- /** Used as references for various `Number` constants. */
- var MAX_SAFE_INTEGER = 9007199254740991;
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (type == 'number' ||
- (type != 'symbol' && reIsUint.test(value))) &&
- (value > -1 && value % 1 == 0 && value < length);
- }
- module.exports = isIndex;
- /***/ }),
- /* 63 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseIsTypedArray = __webpack_require__(180),
- baseUnary = __webpack_require__(20),
- nodeUtil = __webpack_require__(26);
- /* Node.js helper references. */
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- module.exports = isTypedArray;
- /***/ }),
- /* 64 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(188)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(190)
- /* template */
- var __vue_template__ = __webpack_require__(191)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-1fd3fc13"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/report/content.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-1fd3fc13", Component.options)
- } else {
- hotAPI.reload("data-v-1fd3fc13", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 65 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(66);
- module.exports = __webpack_require__(285);
- /***/ }),
- /* 66 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App_vue__ = __webpack_require__(69);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__App_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__routes__ = __webpack_require__(136);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(192);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design__ = __webpack_require__(193);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_view_design__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modules_language__ = __webpack_require__(194);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modules_mixins__ = __webpack_require__(197);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common__ = __webpack_require__(198);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__common__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__main__ = __webpack_require__(199);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_Title_vue__ = __webpack_require__(202);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_Title_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__components_Title_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue__ = __webpack_require__(205);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_UserInput__ = __webpack_require__(208);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_UserInput___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__components_UserInput__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_UserView__ = __webpack_require__(219);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_UserView___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12__components_UserView__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_UserImg__ = __webpack_require__(226);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_UserImg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13__components_UserImg__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_WLoading__ = __webpack_require__(231);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_WLoading___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14__components_WLoading__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__components_project_task_detail__ = __webpack_require__(236);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__components_report_detail__ = __webpack_require__(281);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */]);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_4_view_design___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_5__modules_language__["a" /* default */]);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_6__modules_mixins__["a" /* default */]);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('VTitle', __WEBPACK_IMPORTED_MODULE_9__components_Title_vue___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('sreachTitle', __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserInput', __WEBPACK_IMPORTED_MODULE_11__components_UserInput___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserView', __WEBPACK_IMPORTED_MODULE_12__components_UserView___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserImg', __WEBPACK_IMPORTED_MODULE_13__components_UserImg___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('WLoading', __WEBPACK_IMPORTED_MODULE_14__components_WLoading___default.a);
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.taskDetail = __WEBPACK_IMPORTED_MODULE_15__components_project_task_detail__["a" /* default */];
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.reportDetail = __WEBPACK_IMPORTED_MODULE_16__components_report_detail__["a" /* default */];
- var originalPush = __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */].prototype.push;
- __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */].prototype.push = function push(location) {
- return originalPush.call(this, location).catch(function (err) {
- return err;
- });
- };
- var router = new __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */]({
- mode: 'history',
- routes: __WEBPACK_IMPORTED_MODULE_2__routes__["a" /* default */]
- });
- //进度条配置
- __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.config({
- color: '#3fcc25',
- failedColor: '#ff0000'
- });
- router.beforeEach(function (to, from, next) {
- __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.start();
- next();
- });
- router.afterEach(function (to, from, next) {
- __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.finish();
- });
- //加载函数
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.goForward = function (location, isReplace) {
- if (typeof location === 'string') location = { name: location };
- if (isReplace === true) {
- this.$router.replace(location);
- } else {
- this.$router.push(location);
- }
- };
- //返回函数
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.goBack = function (number) {
- var history = $A.jsonParse(window.sessionStorage['__history__'] || '{}');
- if ($A.runNum(history['::count']) > 2) {
- this.$router.go(typeof number === 'number' ? number : -1);
- } else {
- this.$router.replace((typeof number === 'undefined' ? 'undefined' : _typeof(number)) === "object" ? number : { path: '/' });
- }
- };
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$A = $A;
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.config.productionTip = false;
- var app = new __WEBPACK_IMPORTED_MODULE_0_vue___default.a({
- el: '#app',
- router: router,
- template: '<App/>',
- components: { App: __WEBPACK_IMPORTED_MODULE_1__App_vue___default.a }
- });
- $A.app = app;
- window.localStorage.setItem("__::WookTeam:check", "success");
- /***/ }),
- /* 67 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
- * Vue.js v2.6.14
- * (c) 2014-2021 Evan You
- * Released under the MIT License.
- */
- /* */
- var emptyObject = Object.freeze({});
- // These helpers produce better VM code in JS engines due to their
- // explicitness and function inlining.
- function isUndef (v) {
- return v === undefined || v === null
- }
- function isDef (v) {
- return v !== undefined && v !== null
- }
- function isTrue (v) {
- return v === true
- }
- function isFalse (v) {
- return v === false
- }
- /**
- * Check if value is primitive.
- */
- function isPrimitive (value) {
- return (
- typeof value === 'string' ||
- typeof value === 'number' ||
- // $flow-disable-line
- typeof value === 'symbol' ||
- typeof value === 'boolean'
- )
- }
- /**
- * Quick object check - this is primarily used to tell
- * Objects from primitive values when we know the value
- * is a JSON-compliant type.
- */
- function isObject (obj) {
- return obj !== null && typeof obj === 'object'
- }
- /**
- * Get the raw type string of a value, e.g., [object Object].
- */
- var _toString = Object.prototype.toString;
- function toRawType (value) {
- return _toString.call(value).slice(8, -1)
- }
- /**
- * Strict object type check. Only returns true
- * for plain JavaScript objects.
- */
- function isPlainObject (obj) {
- return _toString.call(obj) === '[object Object]'
- }
- function isRegExp (v) {
- return _toString.call(v) === '[object RegExp]'
- }
- /**
- * Check if val is a valid array index.
- */
- function isValidArrayIndex (val) {
- var n = parseFloat(String(val));
- return n >= 0 && Math.floor(n) === n && isFinite(val)
- }
- function isPromise (val) {
- return (
- isDef(val) &&
- typeof val.then === 'function' &&
- typeof val.catch === 'function'
- )
- }
- /**
- * Convert a value to a string that is actually rendered.
- */
- function toString (val) {
- return val == null
- ? ''
- : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
- ? JSON.stringify(val, null, 2)
- : String(val)
- }
- /**
- * Convert an input value to a number for persistence.
- * If the conversion fails, return original string.
- */
- function toNumber (val) {
- var n = parseFloat(val);
- return isNaN(n) ? val : n
- }
- /**
- * Make a map and return a function for checking if a key
- * is in that map.
- */
- function makeMap (
- str,
- expectsLowerCase
- ) {
- var map = Object.create(null);
- var list = str.split(',');
- for (var i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase
- ? function (val) { return map[val.toLowerCase()]; }
- : function (val) { return map[val]; }
- }
- /**
- * Check if a tag is a built-in tag.
- */
- var isBuiltInTag = makeMap('slot,component', true);
- /**
- * Check if an attribute is a reserved attribute.
- */
- var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
- /**
- * Remove an item from an array.
- */
- function remove (arr, item) {
- if (arr.length) {
- var index = arr.indexOf(item);
- if (index > -1) {
- return arr.splice(index, 1)
- }
- }
- }
- /**
- * Check whether an object has the property.
- */
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function hasOwn (obj, key) {
- return hasOwnProperty.call(obj, key)
- }
- /**
- * Create a cached version of a pure function.
- */
- function cached (fn) {
- var cache = Object.create(null);
- return (function cachedFn (str) {
- var hit = cache[str];
- return hit || (cache[str] = fn(str))
- })
- }
- /**
- * Camelize a hyphen-delimited string.
- */
- var camelizeRE = /-(\w)/g;
- var camelize = cached(function (str) {
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
- });
- /**
- * Capitalize a string.
- */
- var capitalize = cached(function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
- });
- /**
- * Hyphenate a camelCase string.
- */
- var hyphenateRE = /\B([A-Z])/g;
- var hyphenate = cached(function (str) {
- return str.replace(hyphenateRE, '-$1').toLowerCase()
- });
- /**
- * Simple bind polyfill for environments that do not support it,
- * e.g., PhantomJS 1.x. Technically, we don't need this anymore
- * since native bind is now performant enough in most browsers.
- * But removing it would mean breaking code that was able to run in
- * PhantomJS 1.x, so this must be kept for backward compatibility.
- */
- /* istanbul ignore next */
- function polyfillBind (fn, ctx) {
- function boundFn (a) {
- var l = arguments.length;
- return l
- ? l > 1
- ? fn.apply(ctx, arguments)
- : fn.call(ctx, a)
- : fn.call(ctx)
- }
- boundFn._length = fn.length;
- return boundFn
- }
- function nativeBind (fn, ctx) {
- return fn.bind(ctx)
- }
- var bind = Function.prototype.bind
- ? nativeBind
- : polyfillBind;
- /**
- * Convert an Array-like object to a real Array.
- */
- function toArray (list, start) {
- start = start || 0;
- var i = list.length - start;
- var ret = new Array(i);
- while (i--) {
- ret[i] = list[i + start];
- }
- return ret
- }
- /**
- * Mix properties into target object.
- */
- function extend (to, _from) {
- for (var key in _from) {
- to[key] = _from[key];
- }
- return to
- }
- /**
- * Merge an Array of Objects into a single Object.
- */
- function toObject (arr) {
- var res = {};
- for (var i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res
- }
- /* eslint-disable no-unused-vars */
- /**
- * Perform no operation.
- * Stubbing args to make Flow happy without leaving useless transpiled code
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
- */
- function noop (a, b, c) {}
- /**
- * Always return false.
- */
- var no = function (a, b, c) { return false; };
- /* eslint-enable no-unused-vars */
- /**
- * Return the same value.
- */
- var identity = function (_) { return _; };
- /**
- * Generate a string containing static keys from compiler modules.
- */
- function genStaticKeys (modules) {
- return modules.reduce(function (keys, m) {
- return keys.concat(m.staticKeys || [])
- }, []).join(',')
- }
- /**
- * Check if two values are loosely equal - that is,
- * if they are plain objects, do they have the same shape?
- */
- function looseEqual (a, b) {
- if (a === b) { return true }
- var isObjectA = isObject(a);
- var isObjectB = isObject(b);
- if (isObjectA && isObjectB) {
- try {
- var isArrayA = Array.isArray(a);
- var isArrayB = Array.isArray(b);
- if (isArrayA && isArrayB) {
- return a.length === b.length && a.every(function (e, i) {
- return looseEqual(e, b[i])
- })
- } else if (a instanceof Date && b instanceof Date) {
- return a.getTime() === b.getTime()
- } else if (!isArrayA && !isArrayB) {
- var keysA = Object.keys(a);
- var keysB = Object.keys(b);
- return keysA.length === keysB.length && keysA.every(function (key) {
- return looseEqual(a[key], b[key])
- })
- } else {
- /* istanbul ignore next */
- return false
- }
- } catch (e) {
- /* istanbul ignore next */
- return false
- }
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b)
- } else {
- return false
- }
- }
- /**
- * Return the first index at which a loosely equal value can be
- * found in the array (if value is a plain object, the array must
- * contain an object of the same shape), or -1 if it is not present.
- */
- function looseIndexOf (arr, val) {
- for (var i = 0; i < arr.length; i++) {
- if (looseEqual(arr[i], val)) { return i }
- }
- return -1
- }
- /**
- * Ensure a function is called only once.
- */
- function once (fn) {
- var called = false;
- return function () {
- if (!called) {
- called = true;
- fn.apply(this, arguments);
- }
- }
- }
- var SSR_ATTR = 'data-server-rendered';
- var ASSET_TYPES = [
- 'component',
- 'directive',
- 'filter'
- ];
- var LIFECYCLE_HOOKS = [
- 'beforeCreate',
- 'created',
- 'beforeMount',
- 'mounted',
- 'beforeUpdate',
- 'updated',
- 'beforeDestroy',
- 'destroyed',
- 'activated',
- 'deactivated',
- 'errorCaptured',
- 'serverPrefetch'
- ];
- /* */
- var config = ({
- /**
- * Option merge strategies (used in core/util/options)
- */
- // $flow-disable-line
- optionMergeStrategies: Object.create(null),
- /**
- * Whether to suppress warnings.
- */
- silent: false,
- /**
- * Show production mode tip message on boot?
- */
- productionTip: "development" !== 'production',
- /**
- * Whether to enable devtools
- */
- devtools: "development" !== 'production',
- /**
- * Whether to record perf
- */
- performance: false,
- /**
- * Error handler for watcher errors
- */
- errorHandler: null,
- /**
- * Warn handler for watcher warns
- */
- warnHandler: null,
- /**
- * Ignore certain custom elements
- */
- ignoredElements: [],
- /**
- * Custom user key aliases for v-on
- */
- // $flow-disable-line
- keyCodes: Object.create(null),
- /**
- * Check if a tag is reserved so that it cannot be registered as a
- * component. This is platform-dependent and may be overwritten.
- */
- isReservedTag: no,
- /**
- * Check if an attribute is reserved so that it cannot be used as a component
- * prop. This is platform-dependent and may be overwritten.
- */
- isReservedAttr: no,
- /**
- * Check if a tag is an unknown element.
- * Platform-dependent.
- */
- isUnknownElement: no,
- /**
- * Get the namespace of an element
- */
- getTagNamespace: noop,
- /**
- * Parse the real tag name for the specific platform.
- */
- parsePlatformTagName: identity,
- /**
- * Check if an attribute must be bound using property, e.g. value
- * Platform-dependent.
- */
- mustUseProp: no,
- /**
- * Perform updates asynchronously. Intended to be used by Vue Test Utils
- * This will significantly reduce performance if set to false.
- */
- async: true,
- /**
- * Exposed for legacy reasons
- */
- _lifecycleHooks: LIFECYCLE_HOOKS
- });
- /* */
- /**
- * unicode letters used for parsing html tags, component names and property paths.
- * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
- * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
- */
- var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
- /**
- * Check if a string starts with $ or _
- */
- function isReserved (str) {
- var c = (str + '').charCodeAt(0);
- return c === 0x24 || c === 0x5F
- }
- /**
- * Define a property.
- */
- function def (obj, key, val, enumerable) {
- Object.defineProperty(obj, key, {
- value: val,
- enumerable: !!enumerable,
- writable: true,
- configurable: true
- });
- }
- /**
- * Parse simple path.
- */
- var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
- function parsePath (path) {
- if (bailRE.test(path)) {
- return
- }
- var segments = path.split('.');
- return function (obj) {
- for (var i = 0; i < segments.length; i++) {
- if (!obj) { return }
- obj = obj[segments[i]];
- }
- return obj
- }
- }
- /* */
- // can we use __proto__?
- var hasProto = '__proto__' in {};
- // Browser environment sniffing
- var inBrowser = typeof window !== 'undefined';
- var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
- var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
- var isIE = UA && /msie|trident/.test(UA);
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
- var isEdge = UA && UA.indexOf('edge/') > 0;
- var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
- var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
- var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
- var isPhantomJS = UA && /phantomjs/.test(UA);
- var isFF = UA && UA.match(/firefox\/(\d+)/);
- // Firefox has a "watch" function on Object.prototype...
- var nativeWatch = ({}).watch;
- var supportsPassive = false;
- if (inBrowser) {
- try {
- var opts = {};
- Object.defineProperty(opts, 'passive', ({
- get: function get () {
- /* istanbul ignore next */
- supportsPassive = true;
- }
- })); // https://github.com/facebook/flow/issues/285
- window.addEventListener('test-passive', null, opts);
- } catch (e) {}
- }
- // this needs to be lazy-evaled because vue may be required before
- // vue-server-renderer can set VUE_ENV
- var _isServer;
- var isServerRendering = function () {
- if (_isServer === undefined) {
- /* istanbul ignore if */
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
- // detect presence of vue-server-renderer and avoid
- // Webpack shimming the process
- _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
- } else {
- _isServer = false;
- }
- }
- return _isServer
- };
- // detect devtools
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
- /* istanbul ignore next */
- function isNative (Ctor) {
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
- }
- var hasSymbol =
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
- var _Set;
- /* istanbul ignore if */ // $flow-disable-line
- if (typeof Set !== 'undefined' && isNative(Set)) {
- // use native Set when available.
- _Set = Set;
- } else {
- // a non-standard Set polyfill that only works with primitive keys.
- _Set = /*@__PURE__*/(function () {
- function Set () {
- this.set = Object.create(null);
- }
- Set.prototype.has = function has (key) {
- return this.set[key] === true
- };
- Set.prototype.add = function add (key) {
- this.set[key] = true;
- };
- Set.prototype.clear = function clear () {
- this.set = Object.create(null);
- };
- return Set;
- }());
- }
- /* */
- var warn = noop;
- var tip = noop;
- var generateComponentTrace = (noop); // work around flow check
- var formatComponentName = (noop);
- {
- var hasConsole = typeof console !== 'undefined';
- var classifyRE = /(?:^|[-_])(\w)/g;
- var classify = function (str) { return str
- .replace(classifyRE, function (c) { return c.toUpperCase(); })
- .replace(/[-_]/g, ''); };
- warn = function (msg, vm) {
- var trace = vm ? generateComponentTrace(vm) : '';
- if (config.warnHandler) {
- config.warnHandler.call(null, msg, vm, trace);
- } else if (hasConsole && (!config.silent)) {
- console.error(("[Vue warn]: " + msg + trace));
- }
- };
- tip = function (msg, vm) {
- if (hasConsole && (!config.silent)) {
- console.warn("[Vue tip]: " + msg + (
- vm ? generateComponentTrace(vm) : ''
- ));
- }
- };
- formatComponentName = function (vm, includeFile) {
- if (vm.$root === vm) {
- return '<Root>'
- }
- var options = typeof vm === 'function' && vm.cid != null
- ? vm.options
- : vm._isVue
- ? vm.$options || vm.constructor.options
- : vm;
- var name = options.name || options._componentTag;
- var file = options.__file;
- if (!name && file) {
- var match = file.match(/([^/\\]+)\.vue$/);
- name = match && match[1];
- }
- return (
- (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
- (file && includeFile !== false ? (" at " + file) : '')
- )
- };
- var repeat = function (str, n) {
- var res = '';
- while (n) {
- if (n % 2 === 1) { res += str; }
- if (n > 1) { str += str; }
- n >>= 1;
- }
- return res
- };
- generateComponentTrace = function (vm) {
- if (vm._isVue && vm.$parent) {
- var tree = [];
- var currentRecursiveSequence = 0;
- while (vm) {
- if (tree.length > 0) {
- var last = tree[tree.length - 1];
- if (last.constructor === vm.constructor) {
- currentRecursiveSequence++;
- vm = vm.$parent;
- continue
- } else if (currentRecursiveSequence > 0) {
- tree[tree.length - 1] = [last, currentRecursiveSequence];
- currentRecursiveSequence = 0;
- }
- }
- tree.push(vm);
- vm = vm.$parent;
- }
- return '\n\nfound in\n\n' + tree
- .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
- ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
- : formatComponentName(vm))); })
- .join('\n')
- } else {
- return ("\n\n(found in " + (formatComponentName(vm)) + ")")
- }
- };
- }
- /* */
- var uid = 0;
- /**
- * A dep is an observable that can have multiple
- * directives subscribing to it.
- */
- var Dep = function Dep () {
- this.id = uid++;
- this.subs = [];
- };
- Dep.prototype.addSub = function addSub (sub) {
- this.subs.push(sub);
- };
- Dep.prototype.removeSub = function removeSub (sub) {
- remove(this.subs, sub);
- };
- Dep.prototype.depend = function depend () {
- if (Dep.target) {
- Dep.target.addDep(this);
- }
- };
- Dep.prototype.notify = function notify () {
- // stabilize the subscriber list first
- var subs = this.subs.slice();
- if (!config.async) {
- // subs aren't sorted in scheduler if not running async
- // we need to sort them now to make sure they fire in correct
- // order
- subs.sort(function (a, b) { return a.id - b.id; });
- }
- for (var i = 0, l = subs.length; i < l; i++) {
- subs[i].update();
- }
- };
- // The current target watcher being evaluated.
- // This is globally unique because only one watcher
- // can be evaluated at a time.
- Dep.target = null;
- var targetStack = [];
- function pushTarget (target) {
- targetStack.push(target);
- Dep.target = target;
- }
- function popTarget () {
- targetStack.pop();
- Dep.target = targetStack[targetStack.length - 1];
- }
- /* */
- var VNode = function VNode (
- tag,
- data,
- children,
- text,
- elm,
- context,
- componentOptions,
- asyncFactory
- ) {
- this.tag = tag;
- this.data = data;
- this.children = children;
- this.text = text;
- this.elm = elm;
- this.ns = undefined;
- this.context = context;
- this.fnContext = undefined;
- this.fnOptions = undefined;
- this.fnScopeId = undefined;
- this.key = data && data.key;
- this.componentOptions = componentOptions;
- this.componentInstance = undefined;
- this.parent = undefined;
- this.raw = false;
- this.isStatic = false;
- this.isRootInsert = true;
- this.isComment = false;
- this.isCloned = false;
- this.isOnce = false;
- this.asyncFactory = asyncFactory;
- this.asyncMeta = undefined;
- this.isAsyncPlaceholder = false;
- };
- var prototypeAccessors = { child: { configurable: true } };
- // DEPRECATED: alias for componentInstance for backwards compat.
- /* istanbul ignore next */
- prototypeAccessors.child.get = function () {
- return this.componentInstance
- };
- Object.defineProperties( VNode.prototype, prototypeAccessors );
- var createEmptyVNode = function (text) {
- if ( text === void 0 ) text = '';
- var node = new VNode();
- node.text = text;
- node.isComment = true;
- return node
- };
- function createTextVNode (val) {
- return new VNode(undefined, undefined, undefined, String(val))
- }
- // optimized shallow clone
- // used for static nodes and slot nodes because they may be reused across
- // multiple renders, cloning them avoids errors when DOM manipulations rely
- // on their elm reference.
- function cloneVNode (vnode) {
- var cloned = new VNode(
- vnode.tag,
- vnode.data,
- // #7975
- // clone children array to avoid mutating original in case of cloning
- // a child.
- vnode.children && vnode.children.slice(),
- vnode.text,
- vnode.elm,
- vnode.context,
- vnode.componentOptions,
- vnode.asyncFactory
- );
- cloned.ns = vnode.ns;
- cloned.isStatic = vnode.isStatic;
- cloned.key = vnode.key;
- cloned.isComment = vnode.isComment;
- cloned.fnContext = vnode.fnContext;
- cloned.fnOptions = vnode.fnOptions;
- cloned.fnScopeId = vnode.fnScopeId;
- cloned.asyncMeta = vnode.asyncMeta;
- cloned.isCloned = true;
- return cloned
- }
- /*
- * not type checking this file because flow doesn't play well with
- * dynamically accessing methods on Array prototype
- */
- var arrayProto = Array.prototype;
- var arrayMethods = Object.create(arrayProto);
- var methodsToPatch = [
- 'push',
- 'pop',
- 'shift',
- 'unshift',
- 'splice',
- 'sort',
- 'reverse'
- ];
- /**
- * Intercept mutating methods and emit events
- */
- methodsToPatch.forEach(function (method) {
- // cache original method
- var original = arrayProto[method];
- def(arrayMethods, method, function mutator () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- var result = original.apply(this, args);
- var ob = this.__ob__;
- var inserted;
- switch (method) {
- case 'push':
- case 'unshift':
- inserted = args;
- break
- case 'splice':
- inserted = args.slice(2);
- break
- }
- if (inserted) { ob.observeArray(inserted); }
- // notify change
- ob.dep.notify();
- return result
- });
- });
- /* */
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
- /**
- * In some cases we may want to disable observation inside a component's
- * update computation.
- */
- var shouldObserve = true;
- function toggleObserving (value) {
- shouldObserve = value;
- }
- /**
- * Observer class that is attached to each observed
- * object. Once attached, the observer converts the target
- * object's property keys into getter/setters that
- * collect dependencies and dispatch updates.
- */
- var Observer = function Observer (value) {
- this.value = value;
- this.dep = new Dep();
- this.vmCount = 0;
- def(value, '__ob__', this);
- if (Array.isArray(value)) {
- if (hasProto) {
- protoAugment(value, arrayMethods);
- } else {
- copyAugment(value, arrayMethods, arrayKeys);
- }
- this.observeArray(value);
- } else {
- this.walk(value);
- }
- };
- /**
- * Walk through all properties and convert them into
- * getter/setters. This method should only be called when
- * value type is Object.
- */
- Observer.prototype.walk = function walk (obj) {
- var keys = Object.keys(obj);
- for (var i = 0; i < keys.length; i++) {
- defineReactive$$1(obj, keys[i]);
- }
- };
- /**
- * Observe a list of Array items.
- */
- Observer.prototype.observeArray = function observeArray (items) {
- for (var i = 0, l = items.length; i < l; i++) {
- observe(items[i]);
- }
- };
- // helpers
- /**
- * Augment a target Object or Array by intercepting
- * the prototype chain using __proto__
- */
- function protoAugment (target, src) {
- /* eslint-disable no-proto */
- target.__proto__ = src;
- /* eslint-enable no-proto */
- }
- /**
- * Augment a target Object or Array by defining
- * hidden properties.
- */
- /* istanbul ignore next */
- function copyAugment (target, src, keys) {
- for (var i = 0, l = keys.length; i < l; i++) {
- var key = keys[i];
- def(target, key, src[key]);
- }
- }
- /**
- * Attempt to create an observer instance for a value,
- * returns the new observer if successfully observed,
- * or the existing observer if the value already has one.
- */
- function observe (value, asRootData) {
- if (!isObject(value) || value instanceof VNode) {
- return
- }
- var ob;
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
- ob = value.__ob__;
- } else if (
- shouldObserve &&
- !isServerRendering() &&
- (Array.isArray(value) || isPlainObject(value)) &&
- Object.isExtensible(value) &&
- !value._isVue
- ) {
- ob = new Observer(value);
- }
- if (asRootData && ob) {
- ob.vmCount++;
- }
- return ob
- }
- /**
- * Define a reactive property on an Object.
- */
- function defineReactive$$1 (
- obj,
- key,
- val,
- customSetter,
- shallow
- ) {
- var dep = new Dep();
- var property = Object.getOwnPropertyDescriptor(obj, key);
- if (property && property.configurable === false) {
- return
- }
- // cater for pre-defined getter/setters
- var getter = property && property.get;
- var setter = property && property.set;
- if ((!getter || setter) && arguments.length === 2) {
- val = obj[key];
- }
- var childOb = !shallow && observe(val);
- Object.defineProperty(obj, key, {
- enumerable: true,
- configurable: true,
- get: function reactiveGetter () {
- var value = getter ? getter.call(obj) : val;
- if (Dep.target) {
- dep.depend();
- if (childOb) {
- childOb.dep.depend();
- if (Array.isArray(value)) {
- dependArray(value);
- }
- }
- }
- return value
- },
- set: function reactiveSetter (newVal) {
- var value = getter ? getter.call(obj) : val;
- /* eslint-disable no-self-compare */
- if (newVal === value || (newVal !== newVal && value !== value)) {
- return
- }
- /* eslint-enable no-self-compare */
- if (customSetter) {
- customSetter();
- }
- // #7981: for accessor properties without setter
- if (getter && !setter) { return }
- if (setter) {
- setter.call(obj, newVal);
- } else {
- val = newVal;
- }
- childOb = !shallow && observe(newVal);
- dep.notify();
- }
- });
- }
- /**
- * Set a property on an object. Adds the new property and
- * triggers change notification if the property doesn't
- * already exist.
- */
- function set (target, key, val) {
- if (isUndef(target) || isPrimitive(target)
- ) {
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.length = Math.max(target.length, key);
- target.splice(key, 1, val);
- return val
- }
- if (key in target && !(key in Object.prototype)) {
- target[key] = val;
- return val
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- warn(
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
- 'at runtime - declare it upfront in the data option.'
- );
- return val
- }
- if (!ob) {
- target[key] = val;
- return val
- }
- defineReactive$$1(ob.value, key, val);
- ob.dep.notify();
- return val
- }
- /**
- * Delete a property and trigger change if necessary.
- */
- function del (target, key) {
- if (isUndef(target) || isPrimitive(target)
- ) {
- warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
- }
- if (Array.isArray(target) && isValidArrayIndex(key)) {
- target.splice(key, 1);
- return
- }
- var ob = (target).__ob__;
- if (target._isVue || (ob && ob.vmCount)) {
- warn(
- 'Avoid deleting properties on a Vue instance or its root $data ' +
- '- just set it to null.'
- );
- return
- }
- if (!hasOwn(target, key)) {
- return
- }
- delete target[key];
- if (!ob) {
- return
- }
- ob.dep.notify();
- }
- /**
- * Collect dependencies on array elements when the array is touched, since
- * we cannot intercept array element access like property getters.
- */
- function dependArray (value) {
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
- e = value[i];
- e && e.__ob__ && e.__ob__.dep.depend();
- if (Array.isArray(e)) {
- dependArray(e);
- }
- }
- }
- /* */
- /**
- * Option overwriting strategies are functions that handle
- * how to merge a parent option value and a child option
- * value into the final value.
- */
- var strats = config.optionMergeStrategies;
- /**
- * Options with restrictions
- */
- {
- strats.el = strats.propsData = function (parent, child, vm, key) {
- if (!vm) {
- warn(
- "option \"" + key + "\" can only be used during instance " +
- 'creation with the `new` keyword.'
- );
- }
- return defaultStrat(parent, child)
- };
- }
- /**
- * Helper that recursively merges two data objects together.
- */
- function mergeData (to, from) {
- if (!from) { return to }
- var key, toVal, fromVal;
- var keys = hasSymbol
- ? Reflect.ownKeys(from)
- : Object.keys(from);
- for (var i = 0; i < keys.length; i++) {
- key = keys[i];
- // in case the object is already observed...
- if (key === '__ob__') { continue }
- toVal = to[key];
- fromVal = from[key];
- if (!hasOwn(to, key)) {
- set(to, key, fromVal);
- } else if (
- toVal !== fromVal &&
- isPlainObject(toVal) &&
- isPlainObject(fromVal)
- ) {
- mergeData(toVal, fromVal);
- }
- }
- return to
- }
- /**
- * Data
- */
- function mergeDataOrFn (
- parentVal,
- childVal,
- vm
- ) {
- if (!vm) {
- // in a Vue.extend merge, both should be functions
- if (!childVal) {
- return parentVal
- }
- if (!parentVal) {
- return childVal
- }
- // when parentVal & childVal are both present,
- // we need to return a function that returns the
- // merged result of both functions... no need to
- // check if parentVal is a function here because
- // it has to be a function to pass previous merges.
- return function mergedDataFn () {
- return mergeData(
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
- )
- }
- } else {
- return function mergedInstanceDataFn () {
- // instance merge
- var instanceData = typeof childVal === 'function'
- ? childVal.call(vm, vm)
- : childVal;
- var defaultData = typeof parentVal === 'function'
- ? parentVal.call(vm, vm)
- : parentVal;
- if (instanceData) {
- return mergeData(instanceData, defaultData)
- } else {
- return defaultData
- }
- }
- }
- }
- strats.data = function (
- parentVal,
- childVal,
- vm
- ) {
- if (!vm) {
- if (childVal && typeof childVal !== 'function') {
- warn(
- 'The "data" option should be a function ' +
- 'that returns a per-instance value in component ' +
- 'definitions.',
- vm
- );
- return parentVal
- }
- return mergeDataOrFn(parentVal, childVal)
- }
- return mergeDataOrFn(parentVal, childVal, vm)
- };
- /**
- * Hooks and props are merged as arrays.
- */
- function mergeHook (
- parentVal,
- childVal
- ) {
- var res = childVal
- ? parentVal
- ? parentVal.concat(childVal)
- : Array.isArray(childVal)
- ? childVal
- : [childVal]
- : parentVal;
- return res
- ? dedupeHooks(res)
- : res
- }
- function dedupeHooks (hooks) {
- var res = [];
- for (var i = 0; i < hooks.length; i++) {
- if (res.indexOf(hooks[i]) === -1) {
- res.push(hooks[i]);
- }
- }
- return res
- }
- LIFECYCLE_HOOKS.forEach(function (hook) {
- strats[hook] = mergeHook;
- });
- /**
- * Assets
- *
- * When a vm is present (instance creation), we need to do
- * a three-way merge between constructor options, instance
- * options and parent options.
- */
- function mergeAssets (
- parentVal,
- childVal,
- vm,
- key
- ) {
- var res = Object.create(parentVal || null);
- if (childVal) {
- assertObjectType(key, childVal, vm);
- return extend(res, childVal)
- } else {
- return res
- }
- }
- ASSET_TYPES.forEach(function (type) {
- strats[type + 's'] = mergeAssets;
- });
- /**
- * Watchers.
- *
- * Watchers hashes should not overwrite one
- * another, so we merge them as arrays.
- */
- strats.watch = function (
- parentVal,
- childVal,
- vm,
- key
- ) {
- // work around Firefox's Object.prototype.watch...
- if (parentVal === nativeWatch) { parentVal = undefined; }
- if (childVal === nativeWatch) { childVal = undefined; }
- /* istanbul ignore if */
- if (!childVal) { return Object.create(parentVal || null) }
- {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = {};
- extend(ret, parentVal);
- for (var key$1 in childVal) {
- var parent = ret[key$1];
- var child = childVal[key$1];
- if (parent && !Array.isArray(parent)) {
- parent = [parent];
- }
- ret[key$1] = parent
- ? parent.concat(child)
- : Array.isArray(child) ? child : [child];
- }
- return ret
- };
- /**
- * Other object hashes.
- */
- strats.props =
- strats.methods =
- strats.inject =
- strats.computed = function (
- parentVal,
- childVal,
- vm,
- key
- ) {
- if (childVal && "development" !== 'production') {
- assertObjectType(key, childVal, vm);
- }
- if (!parentVal) { return childVal }
- var ret = Object.create(null);
- extend(ret, parentVal);
- if (childVal) { extend(ret, childVal); }
- return ret
- };
- strats.provide = mergeDataOrFn;
- /**
- * Default strategy.
- */
- var defaultStrat = function (parentVal, childVal) {
- return childVal === undefined
- ? parentVal
- : childVal
- };
- /**
- * Validate component names
- */
- function checkComponents (options) {
- for (var key in options.components) {
- validateComponentName(key);
- }
- }
- function validateComponentName (name) {
- if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
- warn(
- 'Invalid component name: "' + name + '". Component names ' +
- 'should conform to valid custom element name in html5 specification.'
- );
- }
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
- warn(
- 'Do not use built-in or reserved HTML elements as component ' +
- 'id: ' + name
- );
- }
- }
- /**
- * Ensure all props option syntax are normalized into the
- * Object-based format.
- */
- function normalizeProps (options, vm) {
- var props = options.props;
- if (!props) { return }
- var res = {};
- var i, val, name;
- if (Array.isArray(props)) {
- i = props.length;
- while (i--) {
- val = props[i];
- if (typeof val === 'string') {
- name = camelize(val);
- res[name] = { type: null };
- } else {
- warn('props must be strings when using array syntax.');
- }
- }
- } else if (isPlainObject(props)) {
- for (var key in props) {
- val = props[key];
- name = camelize(key);
- res[name] = isPlainObject(val)
- ? val
- : { type: val };
- }
- } else {
- warn(
- "Invalid value for option \"props\": expected an Array or an Object, " +
- "but got " + (toRawType(props)) + ".",
- vm
- );
- }
- options.props = res;
- }
- /**
- * Normalize all injections into Object-based format
- */
- function normalizeInject (options, vm) {
- var inject = options.inject;
- if (!inject) { return }
- var normalized = options.inject = {};
- if (Array.isArray(inject)) {
- for (var i = 0; i < inject.length; i++) {
- normalized[inject[i]] = { from: inject[i] };
- }
- } else if (isPlainObject(inject)) {
- for (var key in inject) {
- var val = inject[key];
- normalized[key] = isPlainObject(val)
- ? extend({ from: key }, val)
- : { from: val };
- }
- } else {
- warn(
- "Invalid value for option \"inject\": expected an Array or an Object, " +
- "but got " + (toRawType(inject)) + ".",
- vm
- );
- }
- }
- /**
- * Normalize raw function directives into object format.
- */
- function normalizeDirectives (options) {
- var dirs = options.directives;
- if (dirs) {
- for (var key in dirs) {
- var def$$1 = dirs[key];
- if (typeof def$$1 === 'function') {
- dirs[key] = { bind: def$$1, update: def$$1 };
- }
- }
- }
- }
- function assertObjectType (name, value, vm) {
- if (!isPlainObject(value)) {
- warn(
- "Invalid value for option \"" + name + "\": expected an Object, " +
- "but got " + (toRawType(value)) + ".",
- vm
- );
- }
- }
- /**
- * Merge two option objects into a new one.
- * Core utility used in both instantiation and inheritance.
- */
- function mergeOptions (
- parent,
- child,
- vm
- ) {
- {
- checkComponents(child);
- }
- if (typeof child === 'function') {
- child = child.options;
- }
- normalizeProps(child, vm);
- normalizeInject(child, vm);
- normalizeDirectives(child);
- // Apply extends and mixins on the child options,
- // but only if it is a raw options object that isn't
- // the result of another mergeOptions call.
- // Only merged options has the _base property.
- if (!child._base) {
- if (child.extends) {
- parent = mergeOptions(parent, child.extends, vm);
- }
- if (child.mixins) {
- for (var i = 0, l = child.mixins.length; i < l; i++) {
- parent = mergeOptions(parent, child.mixins[i], vm);
- }
- }
- }
- var options = {};
- var key;
- for (key in parent) {
- mergeField(key);
- }
- for (key in child) {
- if (!hasOwn(parent, key)) {
- mergeField(key);
- }
- }
- function mergeField (key) {
- var strat = strats[key] || defaultStrat;
- options[key] = strat(parent[key], child[key], vm, key);
- }
- return options
- }
- /**
- * Resolve an asset.
- * This function is used because child instances need access
- * to assets defined in its ancestor chain.
- */
- function resolveAsset (
- options,
- type,
- id,
- warnMissing
- ) {
- /* istanbul ignore if */
- if (typeof id !== 'string') {
- return
- }
- var assets = options[type];
- // check local registration variations first
- if (hasOwn(assets, id)) { return assets[id] }
- var camelizedId = camelize(id);
- if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
- var PascalCaseId = capitalize(camelizedId);
- if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
- // fallback to prototype chain
- var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
- if (warnMissing && !res) {
- warn(
- 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
- options
- );
- }
- return res
- }
- /* */
- function validateProp (
- key,
- propOptions,
- propsData,
- vm
- ) {
- var prop = propOptions[key];
- var absent = !hasOwn(propsData, key);
- var value = propsData[key];
- // boolean casting
- var booleanIndex = getTypeIndex(Boolean, prop.type);
- if (booleanIndex > -1) {
- if (absent && !hasOwn(prop, 'default')) {
- value = false;
- } else if (value === '' || value === hyphenate(key)) {
- // only cast empty string / same name to boolean if
- // boolean has higher priority
- var stringIndex = getTypeIndex(String, prop.type);
- if (stringIndex < 0 || booleanIndex < stringIndex) {
- value = true;
- }
- }
- }
- // check default value
- if (value === undefined) {
- value = getPropDefaultValue(vm, prop, key);
- // since the default value is a fresh copy,
- // make sure to observe it.
- var prevShouldObserve = shouldObserve;
- toggleObserving(true);
- observe(value);
- toggleObserving(prevShouldObserve);
- }
- {
- assertProp(prop, key, value, vm, absent);
- }
- return value
- }
- /**
- * Get the default value of a prop.
- */
- function getPropDefaultValue (vm, prop, key) {
- // no default, return undefined
- if (!hasOwn(prop, 'default')) {
- return undefined
- }
- var def = prop.default;
- // warn against non-factory defaults for Object & Array
- if (isObject(def)) {
- warn(
- 'Invalid default value for prop "' + key + '": ' +
- 'Props with type Object/Array must use a factory function ' +
- 'to return the default value.',
- vm
- );
- }
- // the raw prop value was also undefined from previous render,
- // return previous default value to avoid unnecessary watcher trigger
- if (vm && vm.$options.propsData &&
- vm.$options.propsData[key] === undefined &&
- vm._props[key] !== undefined
- ) {
- return vm._props[key]
- }
- // call factory function for non-Function types
- // a value is Function if its prototype is function even across different execution context
- return typeof def === 'function' && getType(prop.type) !== 'Function'
- ? def.call(vm)
- : def
- }
- /**
- * Assert whether a prop is valid.
- */
- function assertProp (
- prop,
- name,
- value,
- vm,
- absent
- ) {
- if (prop.required && absent) {
- warn(
- 'Missing required prop: "' + name + '"',
- vm
- );
- return
- }
- if (value == null && !prop.required) {
- return
- }
- var type = prop.type;
- var valid = !type || type === true;
- var expectedTypes = [];
- if (type) {
- if (!Array.isArray(type)) {
- type = [type];
- }
- for (var i = 0; i < type.length && !valid; i++) {
- var assertedType = assertType(value, type[i], vm);
- expectedTypes.push(assertedType.expectedType || '');
- valid = assertedType.valid;
- }
- }
- var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
- if (!valid && haveExpectedTypes) {
- warn(
- getInvalidTypeMessage(name, value, expectedTypes),
- vm
- );
- return
- }
- var validator = prop.validator;
- if (validator) {
- if (!validator(value)) {
- warn(
- 'Invalid prop: custom validator check failed for prop "' + name + '".',
- vm
- );
- }
- }
- }
- var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
- function assertType (value, type, vm) {
- var valid;
- var expectedType = getType(type);
- if (simpleCheckRE.test(expectedType)) {
- var t = typeof value;
- valid = t === expectedType.toLowerCase();
- // for primitive wrapper objects
- if (!valid && t === 'object') {
- valid = value instanceof type;
- }
- } else if (expectedType === 'Object') {
- valid = isPlainObject(value);
- } else if (expectedType === 'Array') {
- valid = Array.isArray(value);
- } else {
- try {
- valid = value instanceof type;
- } catch (e) {
- warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
- valid = false;
- }
- }
- return {
- valid: valid,
- expectedType: expectedType
- }
- }
- var functionTypeCheckRE = /^\s*function (\w+)/;
- /**
- * Use function string name to check built-in types,
- * because a simple equality check will fail when running
- * across different vms / iframes.
- */
- function getType (fn) {
- var match = fn && fn.toString().match(functionTypeCheckRE);
- return match ? match[1] : ''
- }
- function isSameType (a, b) {
- return getType(a) === getType(b)
- }
- function getTypeIndex (type, expectedTypes) {
- if (!Array.isArray(expectedTypes)) {
- return isSameType(expectedTypes, type) ? 0 : -1
- }
- for (var i = 0, len = expectedTypes.length; i < len; i++) {
- if (isSameType(expectedTypes[i], type)) {
- return i
- }
- }
- return -1
- }
- function getInvalidTypeMessage (name, value, expectedTypes) {
- var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
- " Expected " + (expectedTypes.map(capitalize).join(', '));
- var expectedType = expectedTypes[0];
- var receivedType = toRawType(value);
- // check if we need to specify expected value
- if (
- expectedTypes.length === 1 &&
- isExplicable(expectedType) &&
- isExplicable(typeof value) &&
- !isBoolean(expectedType, receivedType)
- ) {
- message += " with value " + (styleValue(value, expectedType));
- }
- message += ", got " + receivedType + " ";
- // check if we need to specify received value
- if (isExplicable(receivedType)) {
- message += "with value " + (styleValue(value, receivedType)) + ".";
- }
- return message
- }
- function styleValue (value, type) {
- if (type === 'String') {
- return ("\"" + value + "\"")
- } else if (type === 'Number') {
- return ("" + (Number(value)))
- } else {
- return ("" + value)
- }
- }
- var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
- function isExplicable (value) {
- return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
- }
- function isBoolean () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
- }
- /* */
- function handleError (err, vm, info) {
- // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
- // See: https://github.com/vuejs/vuex/issues/1505
- pushTarget();
- try {
- if (vm) {
- var cur = vm;
- while ((cur = cur.$parent)) {
- var hooks = cur.$options.errorCaptured;
- if (hooks) {
- for (var i = 0; i < hooks.length; i++) {
- try {
- var capture = hooks[i].call(cur, err, vm, info) === false;
- if (capture) { return }
- } catch (e) {
- globalHandleError(e, cur, 'errorCaptured hook');
- }
- }
- }
- }
- }
- globalHandleError(err, vm, info);
- } finally {
- popTarget();
- }
- }
- function invokeWithErrorHandling (
- handler,
- context,
- args,
- vm,
- info
- ) {
- var res;
- try {
- res = args ? handler.apply(context, args) : handler.call(context);
- if (res && !res._isVue && isPromise(res) && !res._handled) {
- res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
- // issue #9511
- // avoid catch triggering multiple times when nested calls
- res._handled = true;
- }
- } catch (e) {
- handleError(e, vm, info);
- }
- return res
- }
- function globalHandleError (err, vm, info) {
- if (config.errorHandler) {
- try {
- return config.errorHandler.call(null, err, vm, info)
- } catch (e) {
- // if the user intentionally throws the original error in the handler,
- // do not log it twice
- if (e !== err) {
- logError(e, null, 'config.errorHandler');
- }
- }
- }
- logError(err, vm, info);
- }
- function logError (err, vm, info) {
- {
- warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
- }
- /* istanbul ignore else */
- if ((inBrowser || inWeex) && typeof console !== 'undefined') {
- console.error(err);
- } else {
- throw err
- }
- }
- /* */
- var isUsingMicroTask = false;
- var callbacks = [];
- var pending = false;
- function flushCallbacks () {
- pending = false;
- var copies = callbacks.slice(0);
- callbacks.length = 0;
- for (var i = 0; i < copies.length; i++) {
- copies[i]();
- }
- }
- // Here we have async deferring wrappers using microtasks.
- // In 2.5 we used (macro) tasks (in combination with microtasks).
- // However, it has subtle problems when state is changed right before repaint
- // (e.g. #6813, out-in transitions).
- // Also, using (macro) tasks in event handler would cause some weird behaviors
- // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
- // So we now use microtasks everywhere, again.
- // A major drawback of this tradeoff is that there are some scenarios
- // where microtasks have too high a priority and fire in between supposedly
- // sequential events (e.g. #4521, #6690, which have workarounds)
- // or even between bubbling of the same event (#6566).
- var timerFunc;
- // The nextTick behavior leverages the microtask queue, which can be accessed
- // via either native Promise.then or MutationObserver.
- // MutationObserver has wider support, however it is seriously bugged in
- // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
- // completely stops working after triggering a few times... so, if native
- // Promise is available, we will use it:
- /* istanbul ignore next, $flow-disable-line */
- if (typeof Promise !== 'undefined' && isNative(Promise)) {
- var p = Promise.resolve();
- timerFunc = function () {
- p.then(flushCallbacks);
- // In problematic UIWebViews, Promise.then doesn't completely break, but
- // it can get stuck in a weird state where callbacks are pushed into the
- // microtask queue but the queue isn't being flushed, until the browser
- // needs to do some other work, e.g. handle a timer. Therefore we can
- // "force" the microtask queue to be flushed by adding an empty timer.
- if (isIOS) { setTimeout(noop); }
- };
- isUsingMicroTask = true;
- } else if (!isIE && typeof MutationObserver !== 'undefined' && (
- isNative(MutationObserver) ||
- // PhantomJS and iOS 7.x
- MutationObserver.toString() === '[object MutationObserverConstructor]'
- )) {
- // Use MutationObserver where native Promise is not available,
- // e.g. PhantomJS, iOS7, Android 4.4
- // (#6466 MutationObserver is unreliable in IE11)
- var counter = 1;
- var observer = new MutationObserver(flushCallbacks);
- var textNode = document.createTextNode(String(counter));
- observer.observe(textNode, {
- characterData: true
- });
- timerFunc = function () {
- counter = (counter + 1) % 2;
- textNode.data = String(counter);
- };
- isUsingMicroTask = true;
- } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
- // Fallback to setImmediate.
- // Technically it leverages the (macro) task queue,
- // but it is still a better choice than setTimeout.
- timerFunc = function () {
- setImmediate(flushCallbacks);
- };
- } else {
- // Fallback to setTimeout.
- timerFunc = function () {
- setTimeout(flushCallbacks, 0);
- };
- }
- function nextTick (cb, ctx) {
- var _resolve;
- callbacks.push(function () {
- if (cb) {
- try {
- cb.call(ctx);
- } catch (e) {
- handleError(e, ctx, 'nextTick');
- }
- } else if (_resolve) {
- _resolve(ctx);
- }
- });
- if (!pending) {
- pending = true;
- timerFunc();
- }
- // $flow-disable-line
- if (!cb && typeof Promise !== 'undefined') {
- return new Promise(function (resolve) {
- _resolve = resolve;
- })
- }
- }
- /* */
- var mark;
- var measure;
- {
- var perf = inBrowser && window.performance;
- /* istanbul ignore if */
- if (
- perf &&
- perf.mark &&
- perf.measure &&
- perf.clearMarks &&
- perf.clearMeasures
- ) {
- mark = function (tag) { return perf.mark(tag); };
- measure = function (name, startTag, endTag) {
- perf.measure(name, startTag, endTag);
- perf.clearMarks(startTag);
- perf.clearMarks(endTag);
- // perf.clearMeasures(name)
- };
- }
- }
- /* not type checking this file because flow doesn't play well with Proxy */
- var initProxy;
- {
- var allowedGlobals = makeMap(
- 'Infinity,undefined,NaN,isFinite,isNaN,' +
- 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
- 'require' // for Webpack/Browserify
- );
- var warnNonPresent = function (target, key) {
- warn(
- "Property or method \"" + key + "\" is not defined on the instance but " +
- 'referenced during render. Make sure that this property is reactive, ' +
- 'either in the data option, or for class-based components, by ' +
- 'initializing the property. ' +
- 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
- target
- );
- };
- var warnReservedPrefix = function (target, key) {
- warn(
- "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
- 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
- 'prevent conflicts with Vue internals. ' +
- 'See: https://vuejs.org/v2/api/#data',
- target
- );
- };
- var hasProxy =
- typeof Proxy !== 'undefined' && isNative(Proxy);
- if (hasProxy) {
- var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
- config.keyCodes = new Proxy(config.keyCodes, {
- set: function set (target, key, value) {
- if (isBuiltInModifier(key)) {
- warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
- return false
- } else {
- target[key] = value;
- return true
- }
- }
- });
- }
- var hasHandler = {
- has: function has (target, key) {
- var has = key in target;
- var isAllowed = allowedGlobals(key) ||
- (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
- if (!has && !isAllowed) {
- if (key in target.$data) { warnReservedPrefix(target, key); }
- else { warnNonPresent(target, key); }
- }
- return has || !isAllowed
- }
- };
- var getHandler = {
- get: function get (target, key) {
- if (typeof key === 'string' && !(key in target)) {
- if (key in target.$data) { warnReservedPrefix(target, key); }
- else { warnNonPresent(target, key); }
- }
- return target[key]
- }
- };
- initProxy = function initProxy (vm) {
- if (hasProxy) {
- // determine which proxy handler to use
- var options = vm.$options;
- var handlers = options.render && options.render._withStripped
- ? getHandler
- : hasHandler;
- vm._renderProxy = new Proxy(vm, handlers);
- } else {
- vm._renderProxy = vm;
- }
- };
- }
- /* */
- var seenObjects = new _Set();
- /**
- * Recursively traverse an object to evoke all converted
- * getters, so that every nested property inside the object
- * is collected as a "deep" dependency.
- */
- function traverse (val) {
- _traverse(val, seenObjects);
- seenObjects.clear();
- }
- function _traverse (val, seen) {
- var i, keys;
- var isA = Array.isArray(val);
- if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
- return
- }
- if (val.__ob__) {
- var depId = val.__ob__.dep.id;
- if (seen.has(depId)) {
- return
- }
- seen.add(depId);
- }
- if (isA) {
- i = val.length;
- while (i--) { _traverse(val[i], seen); }
- } else {
- keys = Object.keys(val);
- i = keys.length;
- while (i--) { _traverse(val[keys[i]], seen); }
- }
- }
- /* */
- var normalizeEvent = cached(function (name) {
- var passive = name.charAt(0) === '&';
- name = passive ? name.slice(1) : name;
- var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
- name = once$$1 ? name.slice(1) : name;
- var capture = name.charAt(0) === '!';
- name = capture ? name.slice(1) : name;
- return {
- name: name,
- once: once$$1,
- capture: capture,
- passive: passive
- }
- });
- function createFnInvoker (fns, vm) {
- function invoker () {
- var arguments$1 = arguments;
- var fns = invoker.fns;
- if (Array.isArray(fns)) {
- var cloned = fns.slice();
- for (var i = 0; i < cloned.length; i++) {
- invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
- }
- } else {
- // return handler return value for single handlers
- return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
- }
- }
- invoker.fns = fns;
- return invoker
- }
- function updateListeners (
- on,
- oldOn,
- add,
- remove$$1,
- createOnceHandler,
- vm
- ) {
- var name, def$$1, cur, old, event;
- for (name in on) {
- def$$1 = cur = on[name];
- old = oldOn[name];
- event = normalizeEvent(name);
- if (isUndef(cur)) {
- warn(
- "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
- vm
- );
- } else if (isUndef(old)) {
- if (isUndef(cur.fns)) {
- cur = on[name] = createFnInvoker(cur, vm);
- }
- if (isTrue(event.once)) {
- cur = on[name] = createOnceHandler(event.name, cur, event.capture);
- }
- add(event.name, cur, event.capture, event.passive, event.params);
- } else if (cur !== old) {
- old.fns = cur;
- on[name] = old;
- }
- }
- for (name in oldOn) {
- if (isUndef(on[name])) {
- event = normalizeEvent(name);
- remove$$1(event.name, oldOn[name], event.capture);
- }
- }
- }
- /* */
- function mergeVNodeHook (def, hookKey, hook) {
- if (def instanceof VNode) {
- def = def.data.hook || (def.data.hook = {});
- }
- var invoker;
- var oldHook = def[hookKey];
- function wrappedHook () {
- hook.apply(this, arguments);
- // important: remove merged hook to ensure it's called only once
- // and prevent memory leak
- remove(invoker.fns, wrappedHook);
- }
- if (isUndef(oldHook)) {
- // no existing hook
- invoker = createFnInvoker([wrappedHook]);
- } else {
- /* istanbul ignore if */
- if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
- // already a merged invoker
- invoker = oldHook;
- invoker.fns.push(wrappedHook);
- } else {
- // existing plain hook
- invoker = createFnInvoker([oldHook, wrappedHook]);
- }
- }
- invoker.merged = true;
- def[hookKey] = invoker;
- }
- /* */
- function extractPropsFromVNodeData (
- data,
- Ctor,
- tag
- ) {
- // we are only extracting raw values here.
- // validation and default values are handled in the child
- // component itself.
- var propOptions = Ctor.options.props;
- if (isUndef(propOptions)) {
- return
- }
- var res = {};
- var attrs = data.attrs;
- var props = data.props;
- if (isDef(attrs) || isDef(props)) {
- for (var key in propOptions) {
- var altKey = hyphenate(key);
- {
- var keyInLowerCase = key.toLowerCase();
- if (
- key !== keyInLowerCase &&
- attrs && hasOwn(attrs, keyInLowerCase)
- ) {
- tip(
- "Prop \"" + keyInLowerCase + "\" is passed to component " +
- (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
- " \"" + key + "\". " +
- "Note that HTML attributes are case-insensitive and camelCased " +
- "props need to use their kebab-case equivalents when using in-DOM " +
- "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
- );
- }
- }
- checkProp(res, props, key, altKey, true) ||
- checkProp(res, attrs, key, altKey, false);
- }
- }
- return res
- }
- function checkProp (
- res,
- hash,
- key,
- altKey,
- preserve
- ) {
- if (isDef(hash)) {
- if (hasOwn(hash, key)) {
- res[key] = hash[key];
- if (!preserve) {
- delete hash[key];
- }
- return true
- } else if (hasOwn(hash, altKey)) {
- res[key] = hash[altKey];
- if (!preserve) {
- delete hash[altKey];
- }
- return true
- }
- }
- return false
- }
- /* */
- // The template compiler attempts to minimize the need for normalization by
- // statically analyzing the template at compile time.
- //
- // For plain HTML markup, normalization can be completely skipped because the
- // generated render function is guaranteed to return Array<VNode>. There are
- // two cases where extra normalization is needed:
- // 1. When the children contains components - because a functional component
- // may return an Array instead of a single root. In this case, just a simple
- // normalization is needed - if any child is an Array, we flatten the whole
- // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
- // because functional components already normalize their own children.
- function simpleNormalizeChildren (children) {
- for (var i = 0; i < children.length; i++) {
- if (Array.isArray(children[i])) {
- return Array.prototype.concat.apply([], children)
- }
- }
- return children
- }
- // 2. When the children contains constructs that always generated nested Arrays,
- // e.g. <template>, <slot>, v-for, or when the children is provided by user
- // with hand-written render functions / JSX. In such cases a full normalization
- // is needed to cater to all possible types of children values.
- function normalizeChildren (children) {
- return isPrimitive(children)
- ? [createTextVNode(children)]
- : Array.isArray(children)
- ? normalizeArrayChildren(children)
- : undefined
- }
- function isTextNode (node) {
- return isDef(node) && isDef(node.text) && isFalse(node.isComment)
- }
- function normalizeArrayChildren (children, nestedIndex) {
- var res = [];
- var i, c, lastIndex, last;
- for (i = 0; i < children.length; i++) {
- c = children[i];
- if (isUndef(c) || typeof c === 'boolean') { continue }
- lastIndex = res.length - 1;
- last = res[lastIndex];
- // nested
- if (Array.isArray(c)) {
- if (c.length > 0) {
- c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
- // merge adjacent text nodes
- if (isTextNode(c[0]) && isTextNode(last)) {
- res[lastIndex] = createTextVNode(last.text + (c[0]).text);
- c.shift();
- }
- res.push.apply(res, c);
- }
- } else if (isPrimitive(c)) {
- if (isTextNode(last)) {
- // merge adjacent text nodes
- // this is necessary for SSR hydration because text nodes are
- // essentially merged when rendered to HTML strings
- res[lastIndex] = createTextVNode(last.text + c);
- } else if (c !== '') {
- // convert primitive to vnode
- res.push(createTextVNode(c));
- }
- } else {
- if (isTextNode(c) && isTextNode(last)) {
- // merge adjacent text nodes
- res[lastIndex] = createTextVNode(last.text + c.text);
- } else {
- // default key for nested array children (likely generated by v-for)
- if (isTrue(children._isVList) &&
- isDef(c.tag) &&
- isUndef(c.key) &&
- isDef(nestedIndex)) {
- c.key = "__vlist" + nestedIndex + "_" + i + "__";
- }
- res.push(c);
- }
- }
- }
- return res
- }
- /* */
- function initProvide (vm) {
- var provide = vm.$options.provide;
- if (provide) {
- vm._provided = typeof provide === 'function'
- ? provide.call(vm)
- : provide;
- }
- }
- function initInjections (vm) {
- var result = resolveInject(vm.$options.inject, vm);
- if (result) {
- toggleObserving(false);
- Object.keys(result).forEach(function (key) {
- /* istanbul ignore else */
- {
- defineReactive$$1(vm, key, result[key], function () {
- warn(
- "Avoid mutating an injected value directly since the changes will be " +
- "overwritten whenever the provided component re-renders. " +
- "injection being mutated: \"" + key + "\"",
- vm
- );
- });
- }
- });
- toggleObserving(true);
- }
- }
- function resolveInject (inject, vm) {
- if (inject) {
- // inject is :any because flow is not smart enough to figure out cached
- var result = Object.create(null);
- var keys = hasSymbol
- ? Reflect.ownKeys(inject)
- : Object.keys(inject);
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- // #6574 in case the inject object is observed...
- if (key === '__ob__') { continue }
- var provideKey = inject[key].from;
- var source = vm;
- while (source) {
- if (source._provided && hasOwn(source._provided, provideKey)) {
- result[key] = source._provided[provideKey];
- break
- }
- source = source.$parent;
- }
- if (!source) {
- if ('default' in inject[key]) {
- var provideDefault = inject[key].default;
- result[key] = typeof provideDefault === 'function'
- ? provideDefault.call(vm)
- : provideDefault;
- } else {
- warn(("Injection \"" + key + "\" not found"), vm);
- }
- }
- }
- return result
- }
- }
- /* */
- /**
- * Runtime helper for resolving raw children VNodes into a slot object.
- */
- function resolveSlots (
- children,
- context
- ) {
- if (!children || !children.length) {
- return {}
- }
- var slots = {};
- for (var i = 0, l = children.length; i < l; i++) {
- var child = children[i];
- var data = child.data;
- // remove slot attribute if the node is resolved as a Vue slot node
- if (data && data.attrs && data.attrs.slot) {
- delete data.attrs.slot;
- }
- // named slots should only be respected if the vnode was rendered in the
- // same context.
- if ((child.context === context || child.fnContext === context) &&
- data && data.slot != null
- ) {
- var name = data.slot;
- var slot = (slots[name] || (slots[name] = []));
- if (child.tag === 'template') {
- slot.push.apply(slot, child.children || []);
- } else {
- slot.push(child);
- }
- } else {
- (slots.default || (slots.default = [])).push(child);
- }
- }
- // ignore slots that contains only whitespace
- for (var name$1 in slots) {
- if (slots[name$1].every(isWhitespace)) {
- delete slots[name$1];
- }
- }
- return slots
- }
- function isWhitespace (node) {
- return (node.isComment && !node.asyncFactory) || node.text === ' '
- }
- /* */
- function isAsyncPlaceholder (node) {
- return node.isComment && node.asyncFactory
- }
- /* */
- function normalizeScopedSlots (
- slots,
- normalSlots,
- prevSlots
- ) {
- var res;
- var hasNormalSlots = Object.keys(normalSlots).length > 0;
- var isStable = slots ? !!slots.$stable : !hasNormalSlots;
- var key = slots && slots.$key;
- if (!slots) {
- res = {};
- } else if (slots._normalized) {
- // fast path 1: child component re-render only, parent did not change
- return slots._normalized
- } else if (
- isStable &&
- prevSlots &&
- prevSlots !== emptyObject &&
- key === prevSlots.$key &&
- !hasNormalSlots &&
- !prevSlots.$hasNormal
- ) {
- // fast path 2: stable scoped slots w/ no normal slots to proxy,
- // only need to normalize once
- return prevSlots
- } else {
- res = {};
- for (var key$1 in slots) {
- if (slots[key$1] && key$1[0] !== '$') {
- res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
- }
- }
- }
- // expose normal slots on scopedSlots
- for (var key$2 in normalSlots) {
- if (!(key$2 in res)) {
- res[key$2] = proxyNormalSlot(normalSlots, key$2);
- }
- }
- // avoriaz seems to mock a non-extensible $scopedSlots object
- // and when that is passed down this would cause an error
- if (slots && Object.isExtensible(slots)) {
- (slots)._normalized = res;
- }
- def(res, '$stable', isStable);
- def(res, '$key', key);
- def(res, '$hasNormal', hasNormalSlots);
- return res
- }
- function normalizeScopedSlot(normalSlots, key, fn) {
- var normalized = function () {
- var res = arguments.length ? fn.apply(null, arguments) : fn({});
- res = res && typeof res === 'object' && !Array.isArray(res)
- ? [res] // single vnode
- : normalizeChildren(res);
- var vnode = res && res[0];
- return res && (
- !vnode ||
- (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
- ) ? undefined
- : res
- };
- // this is a slot using the new v-slot syntax without scope. although it is
- // compiled as a scoped slot, render fn users would expect it to be present
- // on this.$slots because the usage is semantically a normal slot.
- if (fn.proxy) {
- Object.defineProperty(normalSlots, key, {
- get: normalized,
- enumerable: true,
- configurable: true
- });
- }
- return normalized
- }
- function proxyNormalSlot(slots, key) {
- return function () { return slots[key]; }
- }
- /* */
- /**
- * Runtime helper for rendering v-for lists.
- */
- function renderList (
- val,
- render
- ) {
- var ret, i, l, keys, key;
- if (Array.isArray(val) || typeof val === 'string') {
- ret = new Array(val.length);
- for (i = 0, l = val.length; i < l; i++) {
- ret[i] = render(val[i], i);
- }
- } else if (typeof val === 'number') {
- ret = new Array(val);
- for (i = 0; i < val; i++) {
- ret[i] = render(i + 1, i);
- }
- } else if (isObject(val)) {
- if (hasSymbol && val[Symbol.iterator]) {
- ret = [];
- var iterator = val[Symbol.iterator]();
- var result = iterator.next();
- while (!result.done) {
- ret.push(render(result.value, ret.length));
- result = iterator.next();
- }
- } else {
- keys = Object.keys(val);
- ret = new Array(keys.length);
- for (i = 0, l = keys.length; i < l; i++) {
- key = keys[i];
- ret[i] = render(val[key], key, i);
- }
- }
- }
- if (!isDef(ret)) {
- ret = [];
- }
- (ret)._isVList = true;
- return ret
- }
- /* */
- /**
- * Runtime helper for rendering <slot>
- */
- function renderSlot (
- name,
- fallbackRender,
- props,
- bindObject
- ) {
- var scopedSlotFn = this.$scopedSlots[name];
- var nodes;
- if (scopedSlotFn) {
- // scoped slot
- props = props || {};
- if (bindObject) {
- if (!isObject(bindObject)) {
- warn('slot v-bind without argument expects an Object', this);
- }
- props = extend(extend({}, bindObject), props);
- }
- nodes =
- scopedSlotFn(props) ||
- (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
- } else {
- nodes =
- this.$slots[name] ||
- (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
- }
- var target = props && props.slot;
- if (target) {
- return this.$createElement('template', { slot: target }, nodes)
- } else {
- return nodes
- }
- }
- /* */
- /**
- * Runtime helper for resolving filters
- */
- function resolveFilter (id) {
- return resolveAsset(this.$options, 'filters', id, true) || identity
- }
- /* */
- function isKeyNotMatch (expect, actual) {
- if (Array.isArray(expect)) {
- return expect.indexOf(actual) === -1
- } else {
- return expect !== actual
- }
- }
- /**
- * Runtime helper for checking keyCodes from config.
- * exposed as Vue.prototype._k
- * passing in eventKeyName as last argument separately for backwards compat
- */
- function checkKeyCodes (
- eventKeyCode,
- key,
- builtInKeyCode,
- eventKeyName,
- builtInKeyName
- ) {
- var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
- if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
- return isKeyNotMatch(builtInKeyName, eventKeyName)
- } else if (mappedKeyCode) {
- return isKeyNotMatch(mappedKeyCode, eventKeyCode)
- } else if (eventKeyName) {
- return hyphenate(eventKeyName) !== key
- }
- return eventKeyCode === undefined
- }
- /* */
- /**
- * Runtime helper for merging v-bind="object" into a VNode's data.
- */
- function bindObjectProps (
- data,
- tag,
- value,
- asProp,
- isSync
- ) {
- if (value) {
- if (!isObject(value)) {
- warn(
- 'v-bind without argument expects an Object or Array value',
- this
- );
- } else {
- if (Array.isArray(value)) {
- value = toObject(value);
- }
- var hash;
- var loop = function ( key ) {
- if (
- key === 'class' ||
- key === 'style' ||
- isReservedAttribute(key)
- ) {
- hash = data;
- } else {
- var type = data.attrs && data.attrs.type;
- hash = asProp || config.mustUseProp(tag, type, key)
- ? data.domProps || (data.domProps = {})
- : data.attrs || (data.attrs = {});
- }
- var camelizedKey = camelize(key);
- var hyphenatedKey = hyphenate(key);
- if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
- hash[key] = value[key];
- if (isSync) {
- var on = data.on || (data.on = {});
- on[("update:" + key)] = function ($event) {
- value[key] = $event;
- };
- }
- }
- };
- for (var key in value) loop( key );
- }
- }
- return data
- }
- /* */
- /**
- * Runtime helper for rendering static trees.
- */
- function renderStatic (
- index,
- isInFor
- ) {
- var cached = this._staticTrees || (this._staticTrees = []);
- var tree = cached[index];
- // if has already-rendered static tree and not inside v-for,
- // we can reuse the same tree.
- if (tree && !isInFor) {
- return tree
- }
- // otherwise, render a fresh tree.
- tree = cached[index] = this.$options.staticRenderFns[index].call(
- this._renderProxy,
- null,
- this // for render fns generated for functional component templates
- );
- markStatic(tree, ("__static__" + index), false);
- return tree
- }
- /**
- * Runtime helper for v-once.
- * Effectively it means marking the node as static with a unique key.
- */
- function markOnce (
- tree,
- index,
- key
- ) {
- markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
- return tree
- }
- function markStatic (
- tree,
- key,
- isOnce
- ) {
- if (Array.isArray(tree)) {
- for (var i = 0; i < tree.length; i++) {
- if (tree[i] && typeof tree[i] !== 'string') {
- markStaticNode(tree[i], (key + "_" + i), isOnce);
- }
- }
- } else {
- markStaticNode(tree, key, isOnce);
- }
- }
- function markStaticNode (node, key, isOnce) {
- node.isStatic = true;
- node.key = key;
- node.isOnce = isOnce;
- }
- /* */
- function bindObjectListeners (data, value) {
- if (value) {
- if (!isPlainObject(value)) {
- warn(
- 'v-on without argument expects an Object value',
- this
- );
- } else {
- var on = data.on = data.on ? extend({}, data.on) : {};
- for (var key in value) {
- var existing = on[key];
- var ours = value[key];
- on[key] = existing ? [].concat(existing, ours) : ours;
- }
- }
- }
- return data
- }
- /* */
- function resolveScopedSlots (
- fns, // see flow/vnode
- res,
- // the following are added in 2.6
- hasDynamicKeys,
- contentHashKey
- ) {
- res = res || { $stable: !hasDynamicKeys };
- for (var i = 0; i < fns.length; i++) {
- var slot = fns[i];
- if (Array.isArray(slot)) {
- resolveScopedSlots(slot, res, hasDynamicKeys);
- } else if (slot) {
- // marker for reverse proxying v-slot without scope on this.$slots
- if (slot.proxy) {
- slot.fn.proxy = true;
- }
- res[slot.key] = slot.fn;
- }
- }
- if (contentHashKey) {
- (res).$key = contentHashKey;
- }
- return res
- }
- /* */
- function bindDynamicKeys (baseObj, values) {
- for (var i = 0; i < values.length; i += 2) {
- var key = values[i];
- if (typeof key === 'string' && key) {
- baseObj[values[i]] = values[i + 1];
- } else if (key !== '' && key !== null) {
- // null is a special value for explicitly removing a binding
- warn(
- ("Invalid value for dynamic directive argument (expected string or null): " + key),
- this
- );
- }
- }
- return baseObj
- }
- // helper to dynamically append modifier runtime markers to event names.
- // ensure only append when value is already string, otherwise it will be cast
- // to string and cause the type check to miss.
- function prependModifier (value, symbol) {
- return typeof value === 'string' ? symbol + value : value
- }
- /* */
- function installRenderHelpers (target) {
- target._o = markOnce;
- target._n = toNumber;
- target._s = toString;
- target._l = renderList;
- target._t = renderSlot;
- target._q = looseEqual;
- target._i = looseIndexOf;
- target._m = renderStatic;
- target._f = resolveFilter;
- target._k = checkKeyCodes;
- target._b = bindObjectProps;
- target._v = createTextVNode;
- target._e = createEmptyVNode;
- target._u = resolveScopedSlots;
- target._g = bindObjectListeners;
- target._d = bindDynamicKeys;
- target._p = prependModifier;
- }
- /* */
- function FunctionalRenderContext (
- data,
- props,
- children,
- parent,
- Ctor
- ) {
- var this$1 = this;
- var options = Ctor.options;
- // ensure the createElement function in functional components
- // gets a unique context - this is necessary for correct named slot check
- var contextVm;
- if (hasOwn(parent, '_uid')) {
- contextVm = Object.create(parent);
- // $flow-disable-line
- contextVm._original = parent;
- } else {
- // the context vm passed in is a functional context as well.
- // in this case we want to make sure we are able to get a hold to the
- // real context instance.
- contextVm = parent;
- // $flow-disable-line
- parent = parent._original;
- }
- var isCompiled = isTrue(options._compiled);
- var needNormalization = !isCompiled;
- this.data = data;
- this.props = props;
- this.children = children;
- this.parent = parent;
- this.listeners = data.on || emptyObject;
- this.injections = resolveInject(options.inject, parent);
- this.slots = function () {
- if (!this$1.$slots) {
- normalizeScopedSlots(
- data.scopedSlots,
- this$1.$slots = resolveSlots(children, parent)
- );
- }
- return this$1.$slots
- };
- Object.defineProperty(this, 'scopedSlots', ({
- enumerable: true,
- get: function get () {
- return normalizeScopedSlots(data.scopedSlots, this.slots())
- }
- }));
- // support for compiled functional template
- if (isCompiled) {
- // exposing $options for renderStatic()
- this.$options = options;
- // pre-resolve slots for renderSlot()
- this.$slots = this.slots();
- this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
- }
- if (options._scopeId) {
- this._c = function (a, b, c, d) {
- var vnode = createElement(contextVm, a, b, c, d, needNormalization);
- if (vnode && !Array.isArray(vnode)) {
- vnode.fnScopeId = options._scopeId;
- vnode.fnContext = parent;
- }
- return vnode
- };
- } else {
- this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
- }
- }
- installRenderHelpers(FunctionalRenderContext.prototype);
- function createFunctionalComponent (
- Ctor,
- propsData,
- data,
- contextVm,
- children
- ) {
- var options = Ctor.options;
- var props = {};
- var propOptions = options.props;
- if (isDef(propOptions)) {
- for (var key in propOptions) {
- props[key] = validateProp(key, propOptions, propsData || emptyObject);
- }
- } else {
- if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
- if (isDef(data.props)) { mergeProps(props, data.props); }
- }
- var renderContext = new FunctionalRenderContext(
- data,
- props,
- children,
- contextVm,
- Ctor
- );
- var vnode = options.render.call(null, renderContext._c, renderContext);
- if (vnode instanceof VNode) {
- return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
- } else if (Array.isArray(vnode)) {
- var vnodes = normalizeChildren(vnode) || [];
- var res = new Array(vnodes.length);
- for (var i = 0; i < vnodes.length; i++) {
- res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
- }
- return res
- }
- }
- function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
- // #7817 clone node before setting fnContext, otherwise if the node is reused
- // (e.g. it was from a cached normal slot) the fnContext causes named slots
- // that should not be matched to match.
- var clone = cloneVNode(vnode);
- clone.fnContext = contextVm;
- clone.fnOptions = options;
- {
- (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
- }
- if (data.slot) {
- (clone.data || (clone.data = {})).slot = data.slot;
- }
- return clone
- }
- function mergeProps (to, from) {
- for (var key in from) {
- to[camelize(key)] = from[key];
- }
- }
- /* */
- /* */
- /* */
- /* */
- // inline hooks to be invoked on component VNodes during patch
- var componentVNodeHooks = {
- init: function init (vnode, hydrating) {
- if (
- vnode.componentInstance &&
- !vnode.componentInstance._isDestroyed &&
- vnode.data.keepAlive
- ) {
- // kept-alive components, treat as a patch
- var mountedNode = vnode; // work around flow
- componentVNodeHooks.prepatch(mountedNode, mountedNode);
- } else {
- var child = vnode.componentInstance = createComponentInstanceForVnode(
- vnode,
- activeInstance
- );
- child.$mount(hydrating ? vnode.elm : undefined, hydrating);
- }
- },
- prepatch: function prepatch (oldVnode, vnode) {
- var options = vnode.componentOptions;
- var child = vnode.componentInstance = oldVnode.componentInstance;
- updateChildComponent(
- child,
- options.propsData, // updated props
- options.listeners, // updated listeners
- vnode, // new parent vnode
- options.children // new children
- );
- },
- insert: function insert (vnode) {
- var context = vnode.context;
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isMounted) {
- componentInstance._isMounted = true;
- callHook(componentInstance, 'mounted');
- }
- if (vnode.data.keepAlive) {
- if (context._isMounted) {
- // vue-router#1212
- // During updates, a kept-alive component's child components may
- // change, so directly walking the tree here may call activated hooks
- // on incorrect children. Instead we push them into a queue which will
- // be processed after the whole patch process ended.
- queueActivatedComponent(componentInstance);
- } else {
- activateChildComponent(componentInstance, true /* direct */);
- }
- }
- },
- destroy: function destroy (vnode) {
- var componentInstance = vnode.componentInstance;
- if (!componentInstance._isDestroyed) {
- if (!vnode.data.keepAlive) {
- componentInstance.$destroy();
- } else {
- deactivateChildComponent(componentInstance, true /* direct */);
- }
- }
- }
- };
- var hooksToMerge = Object.keys(componentVNodeHooks);
- function createComponent (
- Ctor,
- data,
- context,
- children,
- tag
- ) {
- if (isUndef(Ctor)) {
- return
- }
- var baseCtor = context.$options._base;
- // plain options object: turn it into a constructor
- if (isObject(Ctor)) {
- Ctor = baseCtor.extend(Ctor);
- }
- // if at this stage it's not a constructor or an async component factory,
- // reject.
- if (typeof Ctor !== 'function') {
- {
- warn(("Invalid Component definition: " + (String(Ctor))), context);
- }
- return
- }
- // async component
- var asyncFactory;
- if (isUndef(Ctor.cid)) {
- asyncFactory = Ctor;
- Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
- if (Ctor === undefined) {
- // return a placeholder node for async component, which is rendered
- // as a comment node but preserves all the raw information for the node.
- // the information will be used for async server-rendering and hydration.
- return createAsyncPlaceholder(
- asyncFactory,
- data,
- context,
- children,
- tag
- )
- }
- }
- data = data || {};
- // resolve constructor options in case global mixins are applied after
- // component constructor creation
- resolveConstructorOptions(Ctor);
- // transform component v-model data into props & events
- if (isDef(data.model)) {
- transformModel(Ctor.options, data);
- }
- // extract props
- var propsData = extractPropsFromVNodeData(data, Ctor, tag);
- // functional component
- if (isTrue(Ctor.options.functional)) {
- return createFunctionalComponent(Ctor, propsData, data, context, children)
- }
- // extract listeners, since these needs to be treated as
- // child component listeners instead of DOM listeners
- var listeners = data.on;
- // replace with listeners with .native modifier
- // so it gets processed during parent component patch.
- data.on = data.nativeOn;
- if (isTrue(Ctor.options.abstract)) {
- // abstract components do not keep anything
- // other than props & listeners & slot
- // work around flow
- var slot = data.slot;
- data = {};
- if (slot) {
- data.slot = slot;
- }
- }
- // install component management hooks onto the placeholder node
- installComponentHooks(data);
- // return a placeholder vnode
- var name = Ctor.options.name || tag;
- var vnode = new VNode(
- ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
- data, undefined, undefined, undefined, context,
- { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
- asyncFactory
- );
- return vnode
- }
- function createComponentInstanceForVnode (
- // we know it's MountedComponentVNode but flow doesn't
- vnode,
- // activeInstance in lifecycle state
- parent
- ) {
- var options = {
- _isComponent: true,
- _parentVnode: vnode,
- parent: parent
- };
- // check inline-template render functions
- var inlineTemplate = vnode.data.inlineTemplate;
- if (isDef(inlineTemplate)) {
- options.render = inlineTemplate.render;
- options.staticRenderFns = inlineTemplate.staticRenderFns;
- }
- return new vnode.componentOptions.Ctor(options)
- }
- function installComponentHooks (data) {
- var hooks = data.hook || (data.hook = {});
- for (var i = 0; i < hooksToMerge.length; i++) {
- var key = hooksToMerge[i];
- var existing = hooks[key];
- var toMerge = componentVNodeHooks[key];
- if (existing !== toMerge && !(existing && existing._merged)) {
- hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
- }
- }
- }
- function mergeHook$1 (f1, f2) {
- var merged = function (a, b) {
- // flow complains about extra args which is why we use any
- f1(a, b);
- f2(a, b);
- };
- merged._merged = true;
- return merged
- }
- // transform component v-model info (value and callback) into
- // prop and event handler respectively.
- function transformModel (options, data) {
- var prop = (options.model && options.model.prop) || 'value';
- var event = (options.model && options.model.event) || 'input'
- ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
- var on = data.on || (data.on = {});
- var existing = on[event];
- var callback = data.model.callback;
- if (isDef(existing)) {
- if (
- Array.isArray(existing)
- ? existing.indexOf(callback) === -1
- : existing !== callback
- ) {
- on[event] = [callback].concat(existing);
- }
- } else {
- on[event] = callback;
- }
- }
- /* */
- var SIMPLE_NORMALIZE = 1;
- var ALWAYS_NORMALIZE = 2;
- // wrapper function for providing a more flexible interface
- // without getting yelled at by flow
- function createElement (
- context,
- tag,
- data,
- children,
- normalizationType,
- alwaysNormalize
- ) {
- if (Array.isArray(data) || isPrimitive(data)) {
- normalizationType = children;
- children = data;
- data = undefined;
- }
- if (isTrue(alwaysNormalize)) {
- normalizationType = ALWAYS_NORMALIZE;
- }
- return _createElement(context, tag, data, children, normalizationType)
- }
- function _createElement (
- context,
- tag,
- data,
- children,
- normalizationType
- ) {
- if (isDef(data) && isDef((data).__ob__)) {
- warn(
- "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
- 'Always create fresh vnode data objects in each render!',
- context
- );
- return createEmptyVNode()
- }
- // object syntax in v-bind
- if (isDef(data) && isDef(data.is)) {
- tag = data.is;
- }
- if (!tag) {
- // in case of component :is set to falsy value
- return createEmptyVNode()
- }
- // warn against non-primitive key
- if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
- ) {
- {
- warn(
- 'Avoid using non-primitive value as key, ' +
- 'use string/number value instead.',
- context
- );
- }
- }
- // support single function children as default scoped slot
- if (Array.isArray(children) &&
- typeof children[0] === 'function'
- ) {
- data = data || {};
- data.scopedSlots = { default: children[0] };
- children.length = 0;
- }
- if (normalizationType === ALWAYS_NORMALIZE) {
- children = normalizeChildren(children);
- } else if (normalizationType === SIMPLE_NORMALIZE) {
- children = simpleNormalizeChildren(children);
- }
- var vnode, ns;
- if (typeof tag === 'string') {
- var Ctor;
- ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
- if (config.isReservedTag(tag)) {
- // platform built-in elements
- if (isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') {
- warn(
- ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
- context
- );
- }
- vnode = new VNode(
- config.parsePlatformTagName(tag), data, children,
- undefined, undefined, context
- );
- } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
- // component
- vnode = createComponent(Ctor, data, context, children, tag);
- } else {
- // unknown or unlisted namespaced elements
- // check at runtime because it may get assigned a namespace when its
- // parent normalizes children
- vnode = new VNode(
- tag, data, children,
- undefined, undefined, context
- );
- }
- } else {
- // direct component options / constructor
- vnode = createComponent(tag, data, context, children);
- }
- if (Array.isArray(vnode)) {
- return vnode
- } else if (isDef(vnode)) {
- if (isDef(ns)) { applyNS(vnode, ns); }
- if (isDef(data)) { registerDeepBindings(data); }
- return vnode
- } else {
- return createEmptyVNode()
- }
- }
- function applyNS (vnode, ns, force) {
- vnode.ns = ns;
- if (vnode.tag === 'foreignObject') {
- // use default namespace inside foreignObject
- ns = undefined;
- force = true;
- }
- if (isDef(vnode.children)) {
- for (var i = 0, l = vnode.children.length; i < l; i++) {
- var child = vnode.children[i];
- if (isDef(child.tag) && (
- isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
- applyNS(child, ns, force);
- }
- }
- }
- }
- // ref #5318
- // necessary to ensure parent re-render when deep bindings like :style and
- // :class are used on slot nodes
- function registerDeepBindings (data) {
- if (isObject(data.style)) {
- traverse(data.style);
- }
- if (isObject(data.class)) {
- traverse(data.class);
- }
- }
- /* */
- function initRender (vm) {
- vm._vnode = null; // the root of the child tree
- vm._staticTrees = null; // v-once cached trees
- var options = vm.$options;
- var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
- var renderContext = parentVnode && parentVnode.context;
- vm.$slots = resolveSlots(options._renderChildren, renderContext);
- vm.$scopedSlots = emptyObject;
- // bind the createElement fn to this instance
- // so that we get proper render context inside it.
- // args order: tag, data, children, normalizationType, alwaysNormalize
- // internal version is used by render functions compiled from templates
- vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
- // normalization is always applied for the public version, used in
- // user-written render functions.
- vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
- // $attrs & $listeners are exposed for easier HOC creation.
- // they need to be reactive so that HOCs using them are always updated
- var parentData = parentVnode && parentVnode.data;
- /* istanbul ignore else */
- {
- defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
- !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
- }, true);
- defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
- !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
- }, true);
- }
- }
- var currentRenderingInstance = null;
- function renderMixin (Vue) {
- // install runtime convenience helpers
- installRenderHelpers(Vue.prototype);
- Vue.prototype.$nextTick = function (fn) {
- return nextTick(fn, this)
- };
- Vue.prototype._render = function () {
- var vm = this;
- var ref = vm.$options;
- var render = ref.render;
- var _parentVnode = ref._parentVnode;
- if (_parentVnode) {
- vm.$scopedSlots = normalizeScopedSlots(
- _parentVnode.data.scopedSlots,
- vm.$slots,
- vm.$scopedSlots
- );
- }
- // set parent vnode. this allows render functions to have access
- // to the data on the placeholder node.
- vm.$vnode = _parentVnode;
- // render self
- var vnode;
- try {
- // There's no need to maintain a stack because all render fns are called
- // separately from one another. Nested component's render fns are called
- // when parent component is patched.
- currentRenderingInstance = vm;
- vnode = render.call(vm._renderProxy, vm.$createElement);
- } catch (e) {
- handleError(e, vm, "render");
- // return error render result,
- // or previous vnode to prevent render error causing blank component
- /* istanbul ignore else */
- if (vm.$options.renderError) {
- try {
- vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
- } catch (e) {
- handleError(e, vm, "renderError");
- vnode = vm._vnode;
- }
- } else {
- vnode = vm._vnode;
- }
- } finally {
- currentRenderingInstance = null;
- }
- // if the returned array contains only a single node, allow it
- if (Array.isArray(vnode) && vnode.length === 1) {
- vnode = vnode[0];
- }
- // return empty vnode in case the render function errored out
- if (!(vnode instanceof VNode)) {
- if (Array.isArray(vnode)) {
- warn(
- 'Multiple root nodes returned from render function. Render function ' +
- 'should return a single root node.',
- vm
- );
- }
- vnode = createEmptyVNode();
- }
- // set parent
- vnode.parent = _parentVnode;
- return vnode
- };
- }
- /* */
- function ensureCtor (comp, base) {
- if (
- comp.__esModule ||
- (hasSymbol && comp[Symbol.toStringTag] === 'Module')
- ) {
- comp = comp.default;
- }
- return isObject(comp)
- ? base.extend(comp)
- : comp
- }
- function createAsyncPlaceholder (
- factory,
- data,
- context,
- children,
- tag
- ) {
- var node = createEmptyVNode();
- node.asyncFactory = factory;
- node.asyncMeta = { data: data, context: context, children: children, tag: tag };
- return node
- }
- function resolveAsyncComponent (
- factory,
- baseCtor
- ) {
- if (isTrue(factory.error) && isDef(factory.errorComp)) {
- return factory.errorComp
- }
- if (isDef(factory.resolved)) {
- return factory.resolved
- }
- var owner = currentRenderingInstance;
- if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
- // already pending
- factory.owners.push(owner);
- }
- if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
- return factory.loadingComp
- }
- if (owner && !isDef(factory.owners)) {
- var owners = factory.owners = [owner];
- var sync = true;
- var timerLoading = null;
- var timerTimeout = null
- ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
- var forceRender = function (renderCompleted) {
- for (var i = 0, l = owners.length; i < l; i++) {
- (owners[i]).$forceUpdate();
- }
- if (renderCompleted) {
- owners.length = 0;
- if (timerLoading !== null) {
- clearTimeout(timerLoading);
- timerLoading = null;
- }
- if (timerTimeout !== null) {
- clearTimeout(timerTimeout);
- timerTimeout = null;
- }
- }
- };
- var resolve = once(function (res) {
- // cache resolved
- factory.resolved = ensureCtor(res, baseCtor);
- // invoke callbacks only if this is not a synchronous resolve
- // (async resolves are shimmed as synchronous during SSR)
- if (!sync) {
- forceRender(true);
- } else {
- owners.length = 0;
- }
- });
- var reject = once(function (reason) {
- warn(
- "Failed to resolve async component: " + (String(factory)) +
- (reason ? ("\nReason: " + reason) : '')
- );
- if (isDef(factory.errorComp)) {
- factory.error = true;
- forceRender(true);
- }
- });
- var res = factory(resolve, reject);
- if (isObject(res)) {
- if (isPromise(res)) {
- // () => Promise
- if (isUndef(factory.resolved)) {
- res.then(resolve, reject);
- }
- } else if (isPromise(res.component)) {
- res.component.then(resolve, reject);
- if (isDef(res.error)) {
- factory.errorComp = ensureCtor(res.error, baseCtor);
- }
- if (isDef(res.loading)) {
- factory.loadingComp = ensureCtor(res.loading, baseCtor);
- if (res.delay === 0) {
- factory.loading = true;
- } else {
- timerLoading = setTimeout(function () {
- timerLoading = null;
- if (isUndef(factory.resolved) && isUndef(factory.error)) {
- factory.loading = true;
- forceRender(false);
- }
- }, res.delay || 200);
- }
- }
- if (isDef(res.timeout)) {
- timerTimeout = setTimeout(function () {
- timerTimeout = null;
- if (isUndef(factory.resolved)) {
- reject(
- "timeout (" + (res.timeout) + "ms)"
- );
- }
- }, res.timeout);
- }
- }
- }
- sync = false;
- // return in case resolved synchronously
- return factory.loading
- ? factory.loadingComp
- : factory.resolved
- }
- }
- /* */
- function getFirstComponentChild (children) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- var c = children[i];
- if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
- return c
- }
- }
- }
- }
- /* */
- /* */
- function initEvents (vm) {
- vm._events = Object.create(null);
- vm._hasHookEvent = false;
- // init parent attached events
- var listeners = vm.$options._parentListeners;
- if (listeners) {
- updateComponentListeners(vm, listeners);
- }
- }
- var target;
- function add (event, fn) {
- target.$on(event, fn);
- }
- function remove$1 (event, fn) {
- target.$off(event, fn);
- }
- function createOnceHandler (event, fn) {
- var _target = target;
- return function onceHandler () {
- var res = fn.apply(null, arguments);
- if (res !== null) {
- _target.$off(event, onceHandler);
- }
- }
- }
- function updateComponentListeners (
- vm,
- listeners,
- oldListeners
- ) {
- target = vm;
- updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
- target = undefined;
- }
- function eventsMixin (Vue) {
- var hookRE = /^hook:/;
- Vue.prototype.$on = function (event, fn) {
- var vm = this;
- if (Array.isArray(event)) {
- for (var i = 0, l = event.length; i < l; i++) {
- vm.$on(event[i], fn);
- }
- } else {
- (vm._events[event] || (vm._events[event] = [])).push(fn);
- // optimize hook:event cost by using a boolean flag marked at registration
- // instead of a hash lookup
- if (hookRE.test(event)) {
- vm._hasHookEvent = true;
- }
- }
- return vm
- };
- Vue.prototype.$once = function (event, fn) {
- var vm = this;
- function on () {
- vm.$off(event, on);
- fn.apply(vm, arguments);
- }
- on.fn = fn;
- vm.$on(event, on);
- return vm
- };
- Vue.prototype.$off = function (event, fn) {
- var vm = this;
- // all
- if (!arguments.length) {
- vm._events = Object.create(null);
- return vm
- }
- // array of events
- if (Array.isArray(event)) {
- for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
- vm.$off(event[i$1], fn);
- }
- return vm
- }
- // specific event
- var cbs = vm._events[event];
- if (!cbs) {
- return vm
- }
- if (!fn) {
- vm._events[event] = null;
- return vm
- }
- // specific handler
- var cb;
- var i = cbs.length;
- while (i--) {
- cb = cbs[i];
- if (cb === fn || cb.fn === fn) {
- cbs.splice(i, 1);
- break
- }
- }
- return vm
- };
- Vue.prototype.$emit = function (event) {
- var vm = this;
- {
- var lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
- tip(
- "Event \"" + lowerCaseEvent + "\" is emitted in component " +
- (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
- "Note that HTML attributes are case-insensitive and you cannot use " +
- "v-on to listen to camelCase events when using in-DOM templates. " +
- "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
- );
- }
- }
- var cbs = vm._events[event];
- if (cbs) {
- cbs = cbs.length > 1 ? toArray(cbs) : cbs;
- var args = toArray(arguments, 1);
- var info = "event handler for \"" + event + "\"";
- for (var i = 0, l = cbs.length; i < l; i++) {
- invokeWithErrorHandling(cbs[i], vm, args, vm, info);
- }
- }
- return vm
- };
- }
- /* */
- var activeInstance = null;
- var isUpdatingChildComponent = false;
- function setActiveInstance(vm) {
- var prevActiveInstance = activeInstance;
- activeInstance = vm;
- return function () {
- activeInstance = prevActiveInstance;
- }
- }
- function initLifecycle (vm) {
- var options = vm.$options;
- // locate first non-abstract parent
- var parent = options.parent;
- if (parent && !options.abstract) {
- while (parent.$options.abstract && parent.$parent) {
- parent = parent.$parent;
- }
- parent.$children.push(vm);
- }
- vm.$parent = parent;
- vm.$root = parent ? parent.$root : vm;
- vm.$children = [];
- vm.$refs = {};
- vm._watcher = null;
- vm._inactive = null;
- vm._directInactive = false;
- vm._isMounted = false;
- vm._isDestroyed = false;
- vm._isBeingDestroyed = false;
- }
- function lifecycleMixin (Vue) {
- Vue.prototype._update = function (vnode, hydrating) {
- var vm = this;
- var prevEl = vm.$el;
- var prevVnode = vm._vnode;
- var restoreActiveInstance = setActiveInstance(vm);
- vm._vnode = vnode;
- // Vue.prototype.__patch__ is injected in entry points
- // based on the rendering backend used.
- if (!prevVnode) {
- // initial render
- vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
- } else {
- // updates
- vm.$el = vm.__patch__(prevVnode, vnode);
- }
- restoreActiveInstance();
- // update __vue__ reference
- if (prevEl) {
- prevEl.__vue__ = null;
- }
- if (vm.$el) {
- vm.$el.__vue__ = vm;
- }
- // if parent is an HOC, update its $el as well
- if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
- vm.$parent.$el = vm.$el;
- }
- // updated hook is called by the scheduler to ensure that children are
- // updated in a parent's updated hook.
- };
- Vue.prototype.$forceUpdate = function () {
- var vm = this;
- if (vm._watcher) {
- vm._watcher.update();
- }
- };
- Vue.prototype.$destroy = function () {
- var vm = this;
- if (vm._isBeingDestroyed) {
- return
- }
- callHook(vm, 'beforeDestroy');
- vm._isBeingDestroyed = true;
- // remove self from parent
- var parent = vm.$parent;
- if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
- remove(parent.$children, vm);
- }
- // teardown watchers
- if (vm._watcher) {
- vm._watcher.teardown();
- }
- var i = vm._watchers.length;
- while (i--) {
- vm._watchers[i].teardown();
- }
- // remove reference from data ob
- // frozen object may not have observer.
- if (vm._data.__ob__) {
- vm._data.__ob__.vmCount--;
- }
- // call the last hook...
- vm._isDestroyed = true;
- // invoke destroy hooks on current rendered tree
- vm.__patch__(vm._vnode, null);
- // fire destroyed hook
- callHook(vm, 'destroyed');
- // turn off all instance listeners.
- vm.$off();
- // remove __vue__ reference
- if (vm.$el) {
- vm.$el.__vue__ = null;
- }
- // release circular reference (#6759)
- if (vm.$vnode) {
- vm.$vnode.parent = null;
- }
- };
- }
- function mountComponent (
- vm,
- el,
- hydrating
- ) {
- vm.$el = el;
- if (!vm.$options.render) {
- vm.$options.render = createEmptyVNode;
- {
- /* istanbul ignore if */
- if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
- vm.$options.el || el) {
- warn(
- 'You are using the runtime-only build of Vue where the template ' +
- 'compiler is not available. Either pre-compile the templates into ' +
- 'render functions, or use the compiler-included build.',
- vm
- );
- } else {
- warn(
- 'Failed to mount component: template or render function not defined.',
- vm
- );
- }
- }
- }
- callHook(vm, 'beforeMount');
- var updateComponent;
- /* istanbul ignore if */
- if (config.performance && mark) {
- updateComponent = function () {
- var name = vm._name;
- var id = vm._uid;
- var startTag = "vue-perf-start:" + id;
- var endTag = "vue-perf-end:" + id;
- mark(startTag);
- var vnode = vm._render();
- mark(endTag);
- measure(("vue " + name + " render"), startTag, endTag);
- mark(startTag);
- vm._update(vnode, hydrating);
- mark(endTag);
- measure(("vue " + name + " patch"), startTag, endTag);
- };
- } else {
- updateComponent = function () {
- vm._update(vm._render(), hydrating);
- };
- }
- // we set this to vm._watcher inside the watcher's constructor
- // since the watcher's initial patch may call $forceUpdate (e.g. inside child
- // component's mounted hook), which relies on vm._watcher being already defined
- new Watcher(vm, updateComponent, noop, {
- before: function before () {
- if (vm._isMounted && !vm._isDestroyed) {
- callHook(vm, 'beforeUpdate');
- }
- }
- }, true /* isRenderWatcher */);
- hydrating = false;
- // manually mounted instance, call mounted on self
- // mounted is called for render-created child components in its inserted hook
- if (vm.$vnode == null) {
- vm._isMounted = true;
- callHook(vm, 'mounted');
- }
- return vm
- }
- function updateChildComponent (
- vm,
- propsData,
- listeners,
- parentVnode,
- renderChildren
- ) {
- {
- isUpdatingChildComponent = true;
- }
- // determine whether component has slot children
- // we need to do this before overwriting $options._renderChildren.
- // check if there are dynamic scopedSlots (hand-written or compiled but with
- // dynamic slot names). Static scoped slots compiled from template has the
- // "$stable" marker.
- var newScopedSlots = parentVnode.data.scopedSlots;
- var oldScopedSlots = vm.$scopedSlots;
- var hasDynamicScopedSlot = !!(
- (newScopedSlots && !newScopedSlots.$stable) ||
- (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
- (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
- (!newScopedSlots && vm.$scopedSlots.$key)
- );
- // Any static slot children from the parent may have changed during parent's
- // update. Dynamic scoped slots may also have changed. In such cases, a forced
- // update is necessary to ensure correctness.
- var needsForceUpdate = !!(
- renderChildren || // has new static slots
- vm.$options._renderChildren || // has old static slots
- hasDynamicScopedSlot
- );
- vm.$options._parentVnode = parentVnode;
- vm.$vnode = parentVnode; // update vm's placeholder node without re-render
- if (vm._vnode) { // update child tree's parent
- vm._vnode.parent = parentVnode;
- }
- vm.$options._renderChildren = renderChildren;
- // update $attrs and $listeners hash
- // these are also reactive so they may trigger child update if the child
- // used them during render
- vm.$attrs = parentVnode.data.attrs || emptyObject;
- vm.$listeners = listeners || emptyObject;
- // update props
- if (propsData && vm.$options.props) {
- toggleObserving(false);
- var props = vm._props;
- var propKeys = vm.$options._propKeys || [];
- for (var i = 0; i < propKeys.length; i++) {
- var key = propKeys[i];
- var propOptions = vm.$options.props; // wtf flow?
- props[key] = validateProp(key, propOptions, propsData, vm);
- }
- toggleObserving(true);
- // keep a copy of raw propsData
- vm.$options.propsData = propsData;
- }
- // update listeners
- listeners = listeners || emptyObject;
- var oldListeners = vm.$options._parentListeners;
- vm.$options._parentListeners = listeners;
- updateComponentListeners(vm, listeners, oldListeners);
- // resolve slots + force update if has children
- if (needsForceUpdate) {
- vm.$slots = resolveSlots(renderChildren, parentVnode.context);
- vm.$forceUpdate();
- }
- {
- isUpdatingChildComponent = false;
- }
- }
- function isInInactiveTree (vm) {
- while (vm && (vm = vm.$parent)) {
- if (vm._inactive) { return true }
- }
- return false
- }
- function activateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = false;
- if (isInInactiveTree(vm)) {
- return
- }
- } else if (vm._directInactive) {
- return
- }
- if (vm._inactive || vm._inactive === null) {
- vm._inactive = false;
- for (var i = 0; i < vm.$children.length; i++) {
- activateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'activated');
- }
- }
- function deactivateChildComponent (vm, direct) {
- if (direct) {
- vm._directInactive = true;
- if (isInInactiveTree(vm)) {
- return
- }
- }
- if (!vm._inactive) {
- vm._inactive = true;
- for (var i = 0; i < vm.$children.length; i++) {
- deactivateChildComponent(vm.$children[i]);
- }
- callHook(vm, 'deactivated');
- }
- }
- function callHook (vm, hook) {
- // #7573 disable dep collection when invoking lifecycle hooks
- pushTarget();
- var handlers = vm.$options[hook];
- var info = hook + " hook";
- if (handlers) {
- for (var i = 0, j = handlers.length; i < j; i++) {
- invokeWithErrorHandling(handlers[i], vm, null, vm, info);
- }
- }
- if (vm._hasHookEvent) {
- vm.$emit('hook:' + hook);
- }
- popTarget();
- }
- /* */
- var MAX_UPDATE_COUNT = 100;
- var queue = [];
- var activatedChildren = [];
- var has = {};
- var circular = {};
- var waiting = false;
- var flushing = false;
- var index = 0;
- /**
- * Reset the scheduler's state.
- */
- function resetSchedulerState () {
- index = queue.length = activatedChildren.length = 0;
- has = {};
- {
- circular = {};
- }
- waiting = flushing = false;
- }
- // Async edge case #6566 requires saving the timestamp when event listeners are
- // attached. However, calling performance.now() has a perf overhead especially
- // if the page has thousands of event listeners. Instead, we take a timestamp
- // every time the scheduler flushes and use that for all event listeners
- // attached during that flush.
- var currentFlushTimestamp = 0;
- // Async edge case fix requires storing an event listener's attach timestamp.
- var getNow = Date.now;
- // Determine what event timestamp the browser is using. Annoyingly, the
- // timestamp can either be hi-res (relative to page load) or low-res
- // (relative to UNIX epoch), so in order to compare time we have to use the
- // same timestamp type when saving the flush timestamp.
- // All IE versions use low-res event timestamps, and have problematic clock
- // implementations (#9632)
- if (inBrowser && !isIE) {
- var performance = window.performance;
- if (
- performance &&
- typeof performance.now === 'function' &&
- getNow() > document.createEvent('Event').timeStamp
- ) {
- // if the event timestamp, although evaluated AFTER the Date.now(), is
- // smaller than it, it means the event is using a hi-res timestamp,
- // and we need to use the hi-res version for event listener timestamps as
- // well.
- getNow = function () { return performance.now(); };
- }
- }
- /**
- * Flush both queues and run the watchers.
- */
- function flushSchedulerQueue () {
- currentFlushTimestamp = getNow();
- flushing = true;
- var watcher, id;
- // Sort queue before flush.
- // This ensures that:
- // 1. Components are updated from parent to child. (because parent is always
- // created before the child)
- // 2. A component's user watchers are run before its render watcher (because
- // user watchers are created before the render watcher)
- // 3. If a component is destroyed during a parent component's watcher run,
- // its watchers can be skipped.
- queue.sort(function (a, b) { return a.id - b.id; });
- // do not cache length because more watchers might be pushed
- // as we run existing watchers
- for (index = 0; index < queue.length; index++) {
- watcher = queue[index];
- if (watcher.before) {
- watcher.before();
- }
- id = watcher.id;
- has[id] = null;
- watcher.run();
- // in dev build, check and stop circular updates.
- if (has[id] != null) {
- circular[id] = (circular[id] || 0) + 1;
- if (circular[id] > MAX_UPDATE_COUNT) {
- warn(
- 'You may have an infinite update loop ' + (
- watcher.user
- ? ("in watcher with expression \"" + (watcher.expression) + "\"")
- : "in a component render function."
- ),
- watcher.vm
- );
- break
- }
- }
- }
- // keep copies of post queues before resetting state
- var activatedQueue = activatedChildren.slice();
- var updatedQueue = queue.slice();
- resetSchedulerState();
- // call component updated and activated hooks
- callActivatedHooks(activatedQueue);
- callUpdatedHooks(updatedQueue);
- // devtool hook
- /* istanbul ignore if */
- if (devtools && config.devtools) {
- devtools.emit('flush');
- }
- }
- function callUpdatedHooks (queue) {
- var i = queue.length;
- while (i--) {
- var watcher = queue[i];
- var vm = watcher.vm;
- if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
- callHook(vm, 'updated');
- }
- }
- }
- /**
- * Queue a kept-alive component that was activated during patch.
- * The queue will be processed after the entire tree has been patched.
- */
- function queueActivatedComponent (vm) {
- // setting _inactive to false here so that a render function can
- // rely on checking whether it's in an inactive tree (e.g. router-view)
- vm._inactive = false;
- activatedChildren.push(vm);
- }
- function callActivatedHooks (queue) {
- for (var i = 0; i < queue.length; i++) {
- queue[i]._inactive = true;
- activateChildComponent(queue[i], true /* true */);
- }
- }
- /**
- * Push a watcher into the watcher queue.
- * Jobs with duplicate IDs will be skipped unless it's
- * pushed when the queue is being flushed.
- */
- function queueWatcher (watcher) {
- var id = watcher.id;
- if (has[id] == null) {
- has[id] = true;
- if (!flushing) {
- queue.push(watcher);
- } else {
- // if already flushing, splice the watcher based on its id
- // if already past its id, it will be run next immediately.
- var i = queue.length - 1;
- while (i > index && queue[i].id > watcher.id) {
- i--;
- }
- queue.splice(i + 1, 0, watcher);
- }
- // queue the flush
- if (!waiting) {
- waiting = true;
- if (!config.async) {
- flushSchedulerQueue();
- return
- }
- nextTick(flushSchedulerQueue);
- }
- }
- }
- /* */
- var uid$2 = 0;
- /**
- * A watcher parses an expression, collects dependencies,
- * and fires callback when the expression value changes.
- * This is used for both the $watch() api and directives.
- */
- var Watcher = function Watcher (
- vm,
- expOrFn,
- cb,
- options,
- isRenderWatcher
- ) {
- this.vm = vm;
- if (isRenderWatcher) {
- vm._watcher = this;
- }
- vm._watchers.push(this);
- // options
- if (options) {
- this.deep = !!options.deep;
- this.user = !!options.user;
- this.lazy = !!options.lazy;
- this.sync = !!options.sync;
- this.before = options.before;
- } else {
- this.deep = this.user = this.lazy = this.sync = false;
- }
- this.cb = cb;
- this.id = ++uid$2; // uid for batching
- this.active = true;
- this.dirty = this.lazy; // for lazy watchers
- this.deps = [];
- this.newDeps = [];
- this.depIds = new _Set();
- this.newDepIds = new _Set();
- this.expression = expOrFn.toString();
- // parse expression for getter
- if (typeof expOrFn === 'function') {
- this.getter = expOrFn;
- } else {
- this.getter = parsePath(expOrFn);
- if (!this.getter) {
- this.getter = noop;
- warn(
- "Failed watching path: \"" + expOrFn + "\" " +
- 'Watcher only accepts simple dot-delimited paths. ' +
- 'For full control, use a function instead.',
- vm
- );
- }
- }
- this.value = this.lazy
- ? undefined
- : this.get();
- };
- /**
- * Evaluate the getter, and re-collect dependencies.
- */
- Watcher.prototype.get = function get () {
- pushTarget(this);
- var value;
- var vm = this.vm;
- try {
- value = this.getter.call(vm, vm);
- } catch (e) {
- if (this.user) {
- handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
- } else {
- throw e
- }
- } finally {
- // "touch" every property so they are all tracked as
- // dependencies for deep watching
- if (this.deep) {
- traverse(value);
- }
- popTarget();
- this.cleanupDeps();
- }
- return value
- };
- /**
- * Add a dependency to this directive.
- */
- Watcher.prototype.addDep = function addDep (dep) {
- var id = dep.id;
- if (!this.newDepIds.has(id)) {
- this.newDepIds.add(id);
- this.newDeps.push(dep);
- if (!this.depIds.has(id)) {
- dep.addSub(this);
- }
- }
- };
- /**
- * Clean up for dependency collection.
- */
- Watcher.prototype.cleanupDeps = function cleanupDeps () {
- var i = this.deps.length;
- while (i--) {
- var dep = this.deps[i];
- if (!this.newDepIds.has(dep.id)) {
- dep.removeSub(this);
- }
- }
- var tmp = this.depIds;
- this.depIds = this.newDepIds;
- this.newDepIds = tmp;
- this.newDepIds.clear();
- tmp = this.deps;
- this.deps = this.newDeps;
- this.newDeps = tmp;
- this.newDeps.length = 0;
- };
- /**
- * Subscriber interface.
- * Will be called when a dependency changes.
- */
- Watcher.prototype.update = function update () {
- /* istanbul ignore else */
- if (this.lazy) {
- this.dirty = true;
- } else if (this.sync) {
- this.run();
- } else {
- queueWatcher(this);
- }
- };
- /**
- * Scheduler job interface.
- * Will be called by the scheduler.
- */
- Watcher.prototype.run = function run () {
- if (this.active) {
- var value = this.get();
- if (
- value !== this.value ||
- // Deep watchers and watchers on Object/Arrays should fire even
- // when the value is the same, because the value may
- // have mutated.
- isObject(value) ||
- this.deep
- ) {
- // set new value
- var oldValue = this.value;
- this.value = value;
- if (this.user) {
- var info = "callback for watcher \"" + (this.expression) + "\"";
- invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
- } else {
- this.cb.call(this.vm, value, oldValue);
- }
- }
- }
- };
- /**
- * Evaluate the value of the watcher.
- * This only gets called for lazy watchers.
- */
- Watcher.prototype.evaluate = function evaluate () {
- this.value = this.get();
- this.dirty = false;
- };
- /**
- * Depend on all deps collected by this watcher.
- */
- Watcher.prototype.depend = function depend () {
- var i = this.deps.length;
- while (i--) {
- this.deps[i].depend();
- }
- };
- /**
- * Remove self from all dependencies' subscriber list.
- */
- Watcher.prototype.teardown = function teardown () {
- if (this.active) {
- // remove self from vm's watcher list
- // this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed.
- if (!this.vm._isBeingDestroyed) {
- remove(this.vm._watchers, this);
- }
- var i = this.deps.length;
- while (i--) {
- this.deps[i].removeSub(this);
- }
- this.active = false;
- }
- };
- /* */
- var sharedPropertyDefinition = {
- enumerable: true,
- configurable: true,
- get: noop,
- set: noop
- };
- function proxy (target, sourceKey, key) {
- sharedPropertyDefinition.get = function proxyGetter () {
- return this[sourceKey][key]
- };
- sharedPropertyDefinition.set = function proxySetter (val) {
- this[sourceKey][key] = val;
- };
- Object.defineProperty(target, key, sharedPropertyDefinition);
- }
- function initState (vm) {
- vm._watchers = [];
- var opts = vm.$options;
- if (opts.props) { initProps(vm, opts.props); }
- if (opts.methods) { initMethods(vm, opts.methods); }
- if (opts.data) {
- initData(vm);
- } else {
- observe(vm._data = {}, true /* asRootData */);
- }
- if (opts.computed) { initComputed(vm, opts.computed); }
- if (opts.watch && opts.watch !== nativeWatch) {
- initWatch(vm, opts.watch);
- }
- }
- function initProps (vm, propsOptions) {
- var propsData = vm.$options.propsData || {};
- var props = vm._props = {};
- // cache prop keys so that future props updates can iterate using Array
- // instead of dynamic object key enumeration.
- var keys = vm.$options._propKeys = [];
- var isRoot = !vm.$parent;
- // root instance props should be converted
- if (!isRoot) {
- toggleObserving(false);
- }
- var loop = function ( key ) {
- keys.push(key);
- var value = validateProp(key, propsOptions, propsData, vm);
- /* istanbul ignore else */
- {
- var hyphenatedKey = hyphenate(key);
- if (isReservedAttribute(hyphenatedKey) ||
- config.isReservedAttr(hyphenatedKey)) {
- warn(
- ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
- vm
- );
- }
- defineReactive$$1(props, key, value, function () {
- if (!isRoot && !isUpdatingChildComponent) {
- warn(
- "Avoid mutating a prop directly since the value will be " +
- "overwritten whenever the parent component re-renders. " +
- "Instead, use a data or computed property based on the prop's " +
- "value. Prop being mutated: \"" + key + "\"",
- vm
- );
- }
- });
- }
- // static props are already proxied on the component's prototype
- // during Vue.extend(). We only need to proxy props defined at
- // instantiation here.
- if (!(key in vm)) {
- proxy(vm, "_props", key);
- }
- };
- for (var key in propsOptions) loop( key );
- toggleObserving(true);
- }
- function initData (vm) {
- var data = vm.$options.data;
- data = vm._data = typeof data === 'function'
- ? getData(data, vm)
- : data || {};
- if (!isPlainObject(data)) {
- data = {};
- warn(
- 'data functions should return an object:\n' +
- 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
- vm
- );
- }
- // proxy data on instance
- var keys = Object.keys(data);
- var props = vm.$options.props;
- var methods = vm.$options.methods;
- var i = keys.length;
- while (i--) {
- var key = keys[i];
- {
- if (methods && hasOwn(methods, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a data property."),
- vm
- );
- }
- }
- if (props && hasOwn(props, key)) {
- warn(
- "The data property \"" + key + "\" is already declared as a prop. " +
- "Use prop default value instead.",
- vm
- );
- } else if (!isReserved(key)) {
- proxy(vm, "_data", key);
- }
- }
- // observe data
- observe(data, true /* asRootData */);
- }
- function getData (data, vm) {
- // #7573 disable dep collection when invoking data getters
- pushTarget();
- try {
- return data.call(vm, vm)
- } catch (e) {
- handleError(e, vm, "data()");
- return {}
- } finally {
- popTarget();
- }
- }
- var computedWatcherOptions = { lazy: true };
- function initComputed (vm, computed) {
- // $flow-disable-line
- var watchers = vm._computedWatchers = Object.create(null);
- // computed properties are just getters during SSR
- var isSSR = isServerRendering();
- for (var key in computed) {
- var userDef = computed[key];
- var getter = typeof userDef === 'function' ? userDef : userDef.get;
- if (getter == null) {
- warn(
- ("Getter is missing for computed property \"" + key + "\"."),
- vm
- );
- }
- if (!isSSR) {
- // create internal watcher for the computed property.
- watchers[key] = new Watcher(
- vm,
- getter || noop,
- noop,
- computedWatcherOptions
- );
- }
- // component-defined computed properties are already defined on the
- // component prototype. We only need to define computed properties defined
- // at instantiation here.
- if (!(key in vm)) {
- defineComputed(vm, key, userDef);
- } else {
- if (key in vm.$data) {
- warn(("The computed property \"" + key + "\" is already defined in data."), vm);
- } else if (vm.$options.props && key in vm.$options.props) {
- warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
- } else if (vm.$options.methods && key in vm.$options.methods) {
- warn(("The computed property \"" + key + "\" is already defined as a method."), vm);
- }
- }
- }
- }
- function defineComputed (
- target,
- key,
- userDef
- ) {
- var shouldCache = !isServerRendering();
- if (typeof userDef === 'function') {
- sharedPropertyDefinition.get = shouldCache
- ? createComputedGetter(key)
- : createGetterInvoker(userDef);
- sharedPropertyDefinition.set = noop;
- } else {
- sharedPropertyDefinition.get = userDef.get
- ? shouldCache && userDef.cache !== false
- ? createComputedGetter(key)
- : createGetterInvoker(userDef.get)
- : noop;
- sharedPropertyDefinition.set = userDef.set || noop;
- }
- if (sharedPropertyDefinition.set === noop) {
- sharedPropertyDefinition.set = function () {
- warn(
- ("Computed property \"" + key + "\" was assigned to but it has no setter."),
- this
- );
- };
- }
- Object.defineProperty(target, key, sharedPropertyDefinition);
- }
- function createComputedGetter (key) {
- return function computedGetter () {
- var watcher = this._computedWatchers && this._computedWatchers[key];
- if (watcher) {
- if (watcher.dirty) {
- watcher.evaluate();
- }
- if (Dep.target) {
- watcher.depend();
- }
- return watcher.value
- }
- }
- }
- function createGetterInvoker(fn) {
- return function computedGetter () {
- return fn.call(this, this)
- }
- }
- function initMethods (vm, methods) {
- var props = vm.$options.props;
- for (var key in methods) {
- {
- if (typeof methods[key] !== 'function') {
- warn(
- "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
- "Did you reference the function correctly?",
- vm
- );
- }
- if (props && hasOwn(props, key)) {
- warn(
- ("Method \"" + key + "\" has already been defined as a prop."),
- vm
- );
- }
- if ((key in vm) && isReserved(key)) {
- warn(
- "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
- "Avoid defining component methods that start with _ or $."
- );
- }
- }
- vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
- }
- }
- function initWatch (vm, watch) {
- for (var key in watch) {
- var handler = watch[key];
- if (Array.isArray(handler)) {
- for (var i = 0; i < handler.length; i++) {
- createWatcher(vm, key, handler[i]);
- }
- } else {
- createWatcher(vm, key, handler);
- }
- }
- }
- function createWatcher (
- vm,
- expOrFn,
- handler,
- options
- ) {
- if (isPlainObject(handler)) {
- options = handler;
- handler = handler.handler;
- }
- if (typeof handler === 'string') {
- handler = vm[handler];
- }
- return vm.$watch(expOrFn, handler, options)
- }
- function stateMixin (Vue) {
- // flow somehow has problems with directly declared definition object
- // when using Object.defineProperty, so we have to procedurally build up
- // the object here.
- var dataDef = {};
- dataDef.get = function () { return this._data };
- var propsDef = {};
- propsDef.get = function () { return this._props };
- {
- dataDef.set = function () {
- warn(
- 'Avoid replacing instance root $data. ' +
- 'Use nested data properties instead.',
- this
- );
- };
- propsDef.set = function () {
- warn("$props is readonly.", this);
- };
- }
- Object.defineProperty(Vue.prototype, '$data', dataDef);
- Object.defineProperty(Vue.prototype, '$props', propsDef);
- Vue.prototype.$set = set;
- Vue.prototype.$delete = del;
- Vue.prototype.$watch = function (
- expOrFn,
- cb,
- options
- ) {
- var vm = this;
- if (isPlainObject(cb)) {
- return createWatcher(vm, expOrFn, cb, options)
- }
- options = options || {};
- options.user = true;
- var watcher = new Watcher(vm, expOrFn, cb, options);
- if (options.immediate) {
- var info = "callback for immediate watcher \"" + (watcher.expression) + "\"";
- pushTarget();
- invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
- popTarget();
- }
- return function unwatchFn () {
- watcher.teardown();
- }
- };
- }
- /* */
- var uid$3 = 0;
- function initMixin (Vue) {
- Vue.prototype._init = function (options) {
- var vm = this;
- // a uid
- vm._uid = uid$3++;
- var startTag, endTag;
- /* istanbul ignore if */
- if (config.performance && mark) {
- startTag = "vue-perf-start:" + (vm._uid);
- endTag = "vue-perf-end:" + (vm._uid);
- mark(startTag);
- }
- // a flag to avoid this being observed
- vm._isVue = true;
- // merge options
- if (options && options._isComponent) {
- // optimize internal component instantiation
- // since dynamic options merging is pretty slow, and none of the
- // internal component options needs special treatment.
- initInternalComponent(vm, options);
- } else {
- vm.$options = mergeOptions(
- resolveConstructorOptions(vm.constructor),
- options || {},
- vm
- );
- }
- /* istanbul ignore else */
- {
- initProxy(vm);
- }
- // expose real self
- vm._self = vm;
- initLifecycle(vm);
- initEvents(vm);
- initRender(vm);
- callHook(vm, 'beforeCreate');
- initInjections(vm); // resolve injections before data/props
- initState(vm);
- initProvide(vm); // resolve provide after data/props
- callHook(vm, 'created');
- /* istanbul ignore if */
- if (config.performance && mark) {
- vm._name = formatComponentName(vm, false);
- mark(endTag);
- measure(("vue " + (vm._name) + " init"), startTag, endTag);
- }
- if (vm.$options.el) {
- vm.$mount(vm.$options.el);
- }
- };
- }
- function initInternalComponent (vm, options) {
- var opts = vm.$options = Object.create(vm.constructor.options);
- // doing this because it's faster than dynamic enumeration.
- var parentVnode = options._parentVnode;
- opts.parent = options.parent;
- opts._parentVnode = parentVnode;
- var vnodeComponentOptions = parentVnode.componentOptions;
- opts.propsData = vnodeComponentOptions.propsData;
- opts._parentListeners = vnodeComponentOptions.listeners;
- opts._renderChildren = vnodeComponentOptions.children;
- opts._componentTag = vnodeComponentOptions.tag;
- if (options.render) {
- opts.render = options.render;
- opts.staticRenderFns = options.staticRenderFns;
- }
- }
- function resolveConstructorOptions (Ctor) {
- var options = Ctor.options;
- if (Ctor.super) {
- var superOptions = resolveConstructorOptions(Ctor.super);
- var cachedSuperOptions = Ctor.superOptions;
- if (superOptions !== cachedSuperOptions) {
- // super option changed,
- // need to resolve new options.
- Ctor.superOptions = superOptions;
- // check if there are any late-modified/attached options (#4976)
- var modifiedOptions = resolveModifiedOptions(Ctor);
- // update base extend options
- if (modifiedOptions) {
- extend(Ctor.extendOptions, modifiedOptions);
- }
- options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
- if (options.name) {
- options.components[options.name] = Ctor;
- }
- }
- }
- return options
- }
- function resolveModifiedOptions (Ctor) {
- var modified;
- var latest = Ctor.options;
- var sealed = Ctor.sealedOptions;
- for (var key in latest) {
- if (latest[key] !== sealed[key]) {
- if (!modified) { modified = {}; }
- modified[key] = latest[key];
- }
- }
- return modified
- }
- function Vue (options) {
- if (!(this instanceof Vue)
- ) {
- warn('Vue is a constructor and should be called with the `new` keyword');
- }
- this._init(options);
- }
- initMixin(Vue);
- stateMixin(Vue);
- eventsMixin(Vue);
- lifecycleMixin(Vue);
- renderMixin(Vue);
- /* */
- function initUse (Vue) {
- Vue.use = function (plugin) {
- var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
- if (installedPlugins.indexOf(plugin) > -1) {
- return this
- }
- // additional parameters
- var args = toArray(arguments, 1);
- args.unshift(this);
- if (typeof plugin.install === 'function') {
- plugin.install.apply(plugin, args);
- } else if (typeof plugin === 'function') {
- plugin.apply(null, args);
- }
- installedPlugins.push(plugin);
- return this
- };
- }
- /* */
- function initMixin$1 (Vue) {
- Vue.mixin = function (mixin) {
- this.options = mergeOptions(this.options, mixin);
- return this
- };
- }
- /* */
- function initExtend (Vue) {
- /**
- * Each instance constructor, including Vue, has a unique
- * cid. This enables us to create wrapped "child
- * constructors" for prototypal inheritance and cache them.
- */
- Vue.cid = 0;
- var cid = 1;
- /**
- * Class inheritance
- */
- Vue.extend = function (extendOptions) {
- extendOptions = extendOptions || {};
- var Super = this;
- var SuperId = Super.cid;
- var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
- if (cachedCtors[SuperId]) {
- return cachedCtors[SuperId]
- }
- var name = extendOptions.name || Super.options.name;
- if (name) {
- validateComponentName(name);
- }
- var Sub = function VueComponent (options) {
- this._init(options);
- };
- Sub.prototype = Object.create(Super.prototype);
- Sub.prototype.constructor = Sub;
- Sub.cid = cid++;
- Sub.options = mergeOptions(
- Super.options,
- extendOptions
- );
- Sub['super'] = Super;
- // For props and computed properties, we define the proxy getters on
- // the Vue instances at extension time, on the extended prototype. This
- // avoids Object.defineProperty calls for each instance created.
- if (Sub.options.props) {
- initProps$1(Sub);
- }
- if (Sub.options.computed) {
- initComputed$1(Sub);
- }
- // allow further extension/mixin/plugin usage
- Sub.extend = Super.extend;
- Sub.mixin = Super.mixin;
- Sub.use = Super.use;
- // create asset registers, so extended classes
- // can have their private assets too.
- ASSET_TYPES.forEach(function (type) {
- Sub[type] = Super[type];
- });
- // enable recursive self-lookup
- if (name) {
- Sub.options.components[name] = Sub;
- }
- // keep a reference to the super options at extension time.
- // later at instantiation we can check if Super's options have
- // been updated.
- Sub.superOptions = Super.options;
- Sub.extendOptions = extendOptions;
- Sub.sealedOptions = extend({}, Sub.options);
- // cache constructor
- cachedCtors[SuperId] = Sub;
- return Sub
- };
- }
- function initProps$1 (Comp) {
- var props = Comp.options.props;
- for (var key in props) {
- proxy(Comp.prototype, "_props", key);
- }
- }
- function initComputed$1 (Comp) {
- var computed = Comp.options.computed;
- for (var key in computed) {
- defineComputed(Comp.prototype, key, computed[key]);
- }
- }
- /* */
- function initAssetRegisters (Vue) {
- /**
- * Create asset registration methods.
- */
- ASSET_TYPES.forEach(function (type) {
- Vue[type] = function (
- id,
- definition
- ) {
- if (!definition) {
- return this.options[type + 's'][id]
- } else {
- /* istanbul ignore if */
- if (type === 'component') {
- validateComponentName(id);
- }
- if (type === 'component' && isPlainObject(definition)) {
- definition.name = definition.name || id;
- definition = this.options._base.extend(definition);
- }
- if (type === 'directive' && typeof definition === 'function') {
- definition = { bind: definition, update: definition };
- }
- this.options[type + 's'][id] = definition;
- return definition
- }
- };
- });
- }
- /* */
- function getComponentName (opts) {
- return opts && (opts.Ctor.options.name || opts.tag)
- }
- function matches (pattern, name) {
- if (Array.isArray(pattern)) {
- return pattern.indexOf(name) > -1
- } else if (typeof pattern === 'string') {
- return pattern.split(',').indexOf(name) > -1
- } else if (isRegExp(pattern)) {
- return pattern.test(name)
- }
- /* istanbul ignore next */
- return false
- }
- function pruneCache (keepAliveInstance, filter) {
- var cache = keepAliveInstance.cache;
- var keys = keepAliveInstance.keys;
- var _vnode = keepAliveInstance._vnode;
- for (var key in cache) {
- var entry = cache[key];
- if (entry) {
- var name = entry.name;
- if (name && !filter(name)) {
- pruneCacheEntry(cache, key, keys, _vnode);
- }
- }
- }
- }
- function pruneCacheEntry (
- cache,
- key,
- keys,
- current
- ) {
- var entry = cache[key];
- if (entry && (!current || entry.tag !== current.tag)) {
- entry.componentInstance.$destroy();
- }
- cache[key] = null;
- remove(keys, key);
- }
- var patternTypes = [String, RegExp, Array];
- var KeepAlive = {
- name: 'keep-alive',
- abstract: true,
- props: {
- include: patternTypes,
- exclude: patternTypes,
- max: [String, Number]
- },
- methods: {
- cacheVNode: function cacheVNode() {
- var ref = this;
- var cache = ref.cache;
- var keys = ref.keys;
- var vnodeToCache = ref.vnodeToCache;
- var keyToCache = ref.keyToCache;
- if (vnodeToCache) {
- var tag = vnodeToCache.tag;
- var componentInstance = vnodeToCache.componentInstance;
- var componentOptions = vnodeToCache.componentOptions;
- cache[keyToCache] = {
- name: getComponentName(componentOptions),
- tag: tag,
- componentInstance: componentInstance,
- };
- keys.push(keyToCache);
- // prune oldest entry
- if (this.max && keys.length > parseInt(this.max)) {
- pruneCacheEntry(cache, keys[0], keys, this._vnode);
- }
- this.vnodeToCache = null;
- }
- }
- },
- created: function created () {
- this.cache = Object.create(null);
- this.keys = [];
- },
- destroyed: function destroyed () {
- for (var key in this.cache) {
- pruneCacheEntry(this.cache, key, this.keys);
- }
- },
- mounted: function mounted () {
- var this$1 = this;
- this.cacheVNode();
- this.$watch('include', function (val) {
- pruneCache(this$1, function (name) { return matches(val, name); });
- });
- this.$watch('exclude', function (val) {
- pruneCache(this$1, function (name) { return !matches(val, name); });
- });
- },
- updated: function updated () {
- this.cacheVNode();
- },
- render: function render () {
- var slot = this.$slots.default;
- var vnode = getFirstComponentChild(slot);
- var componentOptions = vnode && vnode.componentOptions;
- if (componentOptions) {
- // check pattern
- var name = getComponentName(componentOptions);
- var ref = this;
- var include = ref.include;
- var exclude = ref.exclude;
- if (
- // not included
- (include && (!name || !matches(include, name))) ||
- // excluded
- (exclude && name && matches(exclude, name))
- ) {
- return vnode
- }
- var ref$1 = this;
- var cache = ref$1.cache;
- var keys = ref$1.keys;
- var key = vnode.key == null
- // same constructor may get registered as different local components
- // so cid alone is not enough (#3269)
- ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
- : vnode.key;
- if (cache[key]) {
- vnode.componentInstance = cache[key].componentInstance;
- // make current key freshest
- remove(keys, key);
- keys.push(key);
- } else {
- // delay setting the cache until update
- this.vnodeToCache = vnode;
- this.keyToCache = key;
- }
- vnode.data.keepAlive = true;
- }
- return vnode || (slot && slot[0])
- }
- };
- var builtInComponents = {
- KeepAlive: KeepAlive
- };
- /* */
- function initGlobalAPI (Vue) {
- // config
- var configDef = {};
- configDef.get = function () { return config; };
- {
- configDef.set = function () {
- warn(
- 'Do not replace the Vue.config object, set individual fields instead.'
- );
- };
- }
- Object.defineProperty(Vue, 'config', configDef);
- // exposed util methods.
- // NOTE: these are not considered part of the public API - avoid relying on
- // them unless you are aware of the risk.
- Vue.util = {
- warn: warn,
- extend: extend,
- mergeOptions: mergeOptions,
- defineReactive: defineReactive$$1
- };
- Vue.set = set;
- Vue.delete = del;
- Vue.nextTick = nextTick;
- // 2.6 explicit observable API
- Vue.observable = function (obj) {
- observe(obj);
- return obj
- };
- Vue.options = Object.create(null);
- ASSET_TYPES.forEach(function (type) {
- Vue.options[type + 's'] = Object.create(null);
- });
- // this is used to identify the "base" constructor to extend all plain-object
- // components with in Weex's multi-instance scenarios.
- Vue.options._base = Vue;
- extend(Vue.options.components, builtInComponents);
- initUse(Vue);
- initMixin$1(Vue);
- initExtend(Vue);
- initAssetRegisters(Vue);
- }
- initGlobalAPI(Vue);
- Object.defineProperty(Vue.prototype, '$isServer', {
- get: isServerRendering
- });
- Object.defineProperty(Vue.prototype, '$ssrContext', {
- get: function get () {
- /* istanbul ignore next */
- return this.$vnode && this.$vnode.ssrContext
- }
- });
- // expose FunctionalRenderContext for ssr runtime helper installation
- Object.defineProperty(Vue, 'FunctionalRenderContext', {
- value: FunctionalRenderContext
- });
- Vue.version = '2.6.14';
- /* */
- // these are reserved for web because they are directly compiled away
- // during template compilation
- var isReservedAttr = makeMap('style,class');
- // attributes that should be using props for binding
- var acceptValue = makeMap('input,textarea,option,select,progress');
- var mustUseProp = function (tag, type, attr) {
- return (
- (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
- (attr === 'selected' && tag === 'option') ||
- (attr === 'checked' && tag === 'input') ||
- (attr === 'muted' && tag === 'video')
- )
- };
- var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
- var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
- var convertEnumeratedValue = function (key, value) {
- return isFalsyAttrValue(value) || value === 'false'
- ? 'false'
- // allow arbitrary string value for contenteditable
- : key === 'contenteditable' && isValidContentEditableValue(value)
- ? value
- : 'true'
- };
- var isBooleanAttr = makeMap(
- 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
- 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
- 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
- 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
- 'required,reversed,scoped,seamless,selected,sortable,' +
- 'truespeed,typemustmatch,visible'
- );
- var xlinkNS = 'http://www.w3.org/1999/xlink';
- var isXlink = function (name) {
- return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
- };
- var getXlinkProp = function (name) {
- return isXlink(name) ? name.slice(6, name.length) : ''
- };
- var isFalsyAttrValue = function (val) {
- return val == null || val === false
- };
- /* */
- function genClassForVnode (vnode) {
- var data = vnode.data;
- var parentNode = vnode;
- var childNode = vnode;
- while (isDef(childNode.componentInstance)) {
- childNode = childNode.componentInstance._vnode;
- if (childNode && childNode.data) {
- data = mergeClassData(childNode.data, data);
- }
- }
- while (isDef(parentNode = parentNode.parent)) {
- if (parentNode && parentNode.data) {
- data = mergeClassData(data, parentNode.data);
- }
- }
- return renderClass(data.staticClass, data.class)
- }
- function mergeClassData (child, parent) {
- return {
- staticClass: concat(child.staticClass, parent.staticClass),
- class: isDef(child.class)
- ? [child.class, parent.class]
- : parent.class
- }
- }
- function renderClass (
- staticClass,
- dynamicClass
- ) {
- if (isDef(staticClass) || isDef(dynamicClass)) {
- return concat(staticClass, stringifyClass(dynamicClass))
- }
- /* istanbul ignore next */
- return ''
- }
- function concat (a, b) {
- return a ? b ? (a + ' ' + b) : a : (b || '')
- }
- function stringifyClass (value) {
- if (Array.isArray(value)) {
- return stringifyArray(value)
- }
- if (isObject(value)) {
- return stringifyObject(value)
- }
- if (typeof value === 'string') {
- return value
- }
- /* istanbul ignore next */
- return ''
- }
- function stringifyArray (value) {
- var res = '';
- var stringified;
- for (var i = 0, l = value.length; i < l; i++) {
- if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
- if (res) { res += ' '; }
- res += stringified;
- }
- }
- return res
- }
- function stringifyObject (value) {
- var res = '';
- for (var key in value) {
- if (value[key]) {
- if (res) { res += ' '; }
- res += key;
- }
- }
- return res
- }
- /* */
- var namespaceMap = {
- svg: 'http://www.w3.org/2000/svg',
- math: 'http://www.w3.org/1998/Math/MathML'
- };
- var isHTMLTag = makeMap(
- 'html,body,base,head,link,meta,style,title,' +
- 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
- 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
- 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
- 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
- 'embed,object,param,source,canvas,script,noscript,del,ins,' +
- 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
- 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
- 'output,progress,select,textarea,' +
- 'details,dialog,menu,menuitem,summary,' +
- 'content,element,shadow,template,blockquote,iframe,tfoot'
- );
- // this map is intentionally selective, only covering SVG elements that may
- // contain child elements.
- var isSVG = makeMap(
- 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
- 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
- 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
- true
- );
- var isPreTag = function (tag) { return tag === 'pre'; };
- var isReservedTag = function (tag) {
- return isHTMLTag(tag) || isSVG(tag)
- };
- function getTagNamespace (tag) {
- if (isSVG(tag)) {
- return 'svg'
- }
- // basic support for MathML
- // note it doesn't support other MathML elements being component roots
- if (tag === 'math') {
- return 'math'
- }
- }
- var unknownElementCache = Object.create(null);
- function isUnknownElement (tag) {
- /* istanbul ignore if */
- if (!inBrowser) {
- return true
- }
- if (isReservedTag(tag)) {
- return false
- }
- tag = tag.toLowerCase();
- /* istanbul ignore if */
- if (unknownElementCache[tag] != null) {
- return unknownElementCache[tag]
- }
- var el = document.createElement(tag);
- if (tag.indexOf('-') > -1) {
- // http://stackoverflow.com/a/28210364/1070244
- return (unknownElementCache[tag] = (
- el.constructor === window.HTMLUnknownElement ||
- el.constructor === window.HTMLElement
- ))
- } else {
- return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
- }
- }
- var isTextInputType = makeMap('text,number,password,search,email,tel,url');
- /* */
- /**
- * Query an element selector if it's not an element already.
- */
- function query (el) {
- if (typeof el === 'string') {
- var selected = document.querySelector(el);
- if (!selected) {
- warn(
- 'Cannot find element: ' + el
- );
- return document.createElement('div')
- }
- return selected
- } else {
- return el
- }
- }
- /* */
- function createElement$1 (tagName, vnode) {
- var elm = document.createElement(tagName);
- if (tagName !== 'select') {
- return elm
- }
- // false or null will remove the attribute but undefined will not
- if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
- elm.setAttribute('multiple', 'multiple');
- }
- return elm
- }
- function createElementNS (namespace, tagName) {
- return document.createElementNS(namespaceMap[namespace], tagName)
- }
- function createTextNode (text) {
- return document.createTextNode(text)
- }
- function createComment (text) {
- return document.createComment(text)
- }
- function insertBefore (parentNode, newNode, referenceNode) {
- parentNode.insertBefore(newNode, referenceNode);
- }
- function removeChild (node, child) {
- node.removeChild(child);
- }
- function appendChild (node, child) {
- node.appendChild(child);
- }
- function parentNode (node) {
- return node.parentNode
- }
- function nextSibling (node) {
- return node.nextSibling
- }
- function tagName (node) {
- return node.tagName
- }
- function setTextContent (node, text) {
- node.textContent = text;
- }
- function setStyleScope (node, scopeId) {
- node.setAttribute(scopeId, '');
- }
- var nodeOps = /*#__PURE__*/Object.freeze({
- createElement: createElement$1,
- createElementNS: createElementNS,
- createTextNode: createTextNode,
- createComment: createComment,
- insertBefore: insertBefore,
- removeChild: removeChild,
- appendChild: appendChild,
- parentNode: parentNode,
- nextSibling: nextSibling,
- tagName: tagName,
- setTextContent: setTextContent,
- setStyleScope: setStyleScope
- });
- /* */
- var ref = {
- create: function create (_, vnode) {
- registerRef(vnode);
- },
- update: function update (oldVnode, vnode) {
- if (oldVnode.data.ref !== vnode.data.ref) {
- registerRef(oldVnode, true);
- registerRef(vnode);
- }
- },
- destroy: function destroy (vnode) {
- registerRef(vnode, true);
- }
- };
- function registerRef (vnode, isRemoval) {
- var key = vnode.data.ref;
- if (!isDef(key)) { return }
- var vm = vnode.context;
- var ref = vnode.componentInstance || vnode.elm;
- var refs = vm.$refs;
- if (isRemoval) {
- if (Array.isArray(refs[key])) {
- remove(refs[key], ref);
- } else if (refs[key] === ref) {
- refs[key] = undefined;
- }
- } else {
- if (vnode.data.refInFor) {
- if (!Array.isArray(refs[key])) {
- refs[key] = [ref];
- } else if (refs[key].indexOf(ref) < 0) {
- // $flow-disable-line
- refs[key].push(ref);
- }
- } else {
- refs[key] = ref;
- }
- }
- }
- /**
- * Virtual DOM patching algorithm based on Snabbdom by
- * Simon Friis Vindum (@paldepind)
- * Licensed under the MIT License
- * https://github.com/paldepind/snabbdom/blob/master/LICENSE
- *
- * modified by Evan You (@yyx990803)
- *
- * Not type-checking this because this file is perf-critical and the cost
- * of making flow understand it is not worth it.
- */
- var emptyNode = new VNode('', {}, []);
- var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
- function sameVnode (a, b) {
- return (
- a.key === b.key &&
- a.asyncFactory === b.asyncFactory && (
- (
- a.tag === b.tag &&
- a.isComment === b.isComment &&
- isDef(a.data) === isDef(b.data) &&
- sameInputType(a, b)
- ) || (
- isTrue(a.isAsyncPlaceholder) &&
- isUndef(b.asyncFactory.error)
- )
- )
- )
- }
- function sameInputType (a, b) {
- if (a.tag !== 'input') { return true }
- var i;
- var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
- var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
- return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
- }
- function createKeyToOldIdx (children, beginIdx, endIdx) {
- var i, key;
- var map = {};
- for (i = beginIdx; i <= endIdx; ++i) {
- key = children[i].key;
- if (isDef(key)) { map[key] = i; }
- }
- return map
- }
- function createPatchFunction (backend) {
- var i, j;
- var cbs = {};
- var modules = backend.modules;
- var nodeOps = backend.nodeOps;
- for (i = 0; i < hooks.length; ++i) {
- cbs[hooks[i]] = [];
- for (j = 0; j < modules.length; ++j) {
- if (isDef(modules[j][hooks[i]])) {
- cbs[hooks[i]].push(modules[j][hooks[i]]);
- }
- }
- }
- function emptyNodeAt (elm) {
- return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
- }
- function createRmCb (childElm, listeners) {
- function remove$$1 () {
- if (--remove$$1.listeners === 0) {
- removeNode(childElm);
- }
- }
- remove$$1.listeners = listeners;
- return remove$$1
- }
- function removeNode (el) {
- var parent = nodeOps.parentNode(el);
- // element may have already been removed due to v-html / v-text
- if (isDef(parent)) {
- nodeOps.removeChild(parent, el);
- }
- }
- function isUnknownElement$$1 (vnode, inVPre) {
- return (
- !inVPre &&
- !vnode.ns &&
- !(
- config.ignoredElements.length &&
- config.ignoredElements.some(function (ignore) {
- return isRegExp(ignore)
- ? ignore.test(vnode.tag)
- : ignore === vnode.tag
- })
- ) &&
- config.isUnknownElement(vnode.tag)
- )
- }
- var creatingElmInVPre = 0;
- function createElm (
- vnode,
- insertedVnodeQueue,
- parentElm,
- refElm,
- nested,
- ownerArray,
- index
- ) {
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // This vnode was used in a previous render!
- // now it's used as a new node, overwriting its elm would cause
- // potential patch errors down the road when it's used as an insertion
- // reference node. Instead, we clone the node on-demand before creating
- // associated DOM element for it.
- vnode = ownerArray[index] = cloneVNode(vnode);
- }
- vnode.isRootInsert = !nested; // for transition enter check
- if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
- return
- }
- var data = vnode.data;
- var children = vnode.children;
- var tag = vnode.tag;
- if (isDef(tag)) {
- {
- if (data && data.pre) {
- creatingElmInVPre++;
- }
- if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
- warn(
- 'Unknown custom element: <' + tag + '> - did you ' +
- 'register the component correctly? For recursive components, ' +
- 'make sure to provide the "name" option.',
- vnode.context
- );
- }
- }
- vnode.elm = vnode.ns
- ? nodeOps.createElementNS(vnode.ns, tag)
- : nodeOps.createElement(tag, vnode);
- setScope(vnode);
- /* istanbul ignore if */
- {
- createChildren(vnode, children, insertedVnodeQueue);
- if (isDef(data)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- }
- insert(parentElm, vnode.elm, refElm);
- }
- if (data && data.pre) {
- creatingElmInVPre--;
- }
- } else if (isTrue(vnode.isComment)) {
- vnode.elm = nodeOps.createComment(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- } else {
- vnode.elm = nodeOps.createTextNode(vnode.text);
- insert(parentElm, vnode.elm, refElm);
- }
- }
- function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i = vnode.data;
- if (isDef(i)) {
- var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
- if (isDef(i = i.hook) && isDef(i = i.init)) {
- i(vnode, false /* hydrating */);
- }
- // after calling the init hook, if the vnode is a child component
- // it should've created a child instance and mounted it. the child
- // component also has set the placeholder vnode's elm.
- // in that case we can just return the element and be done.
- if (isDef(vnode.componentInstance)) {
- initComponent(vnode, insertedVnodeQueue);
- insert(parentElm, vnode.elm, refElm);
- if (isTrue(isReactivated)) {
- reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
- }
- return true
- }
- }
- }
- function initComponent (vnode, insertedVnodeQueue) {
- if (isDef(vnode.data.pendingInsert)) {
- insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
- vnode.data.pendingInsert = null;
- }
- vnode.elm = vnode.componentInstance.$el;
- if (isPatchable(vnode)) {
- invokeCreateHooks(vnode, insertedVnodeQueue);
- setScope(vnode);
- } else {
- // empty component root.
- // skip all element-related modules except for ref (#3455)
- registerRef(vnode);
- // make sure to invoke the insert hook
- insertedVnodeQueue.push(vnode);
- }
- }
- function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
- var i;
- // hack for #4339: a reactivated component with inner transition
- // does not trigger because the inner node's created hooks are not called
- // again. It's not ideal to involve module-specific logic in here but
- // there doesn't seem to be a better way to do it.
- var innerNode = vnode;
- while (innerNode.componentInstance) {
- innerNode = innerNode.componentInstance._vnode;
- if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
- for (i = 0; i < cbs.activate.length; ++i) {
- cbs.activate[i](emptyNode, innerNode);
- }
- insertedVnodeQueue.push(innerNode);
- break
- }
- }
- // unlike a newly created component,
- // a reactivated keep-alive component doesn't insert itself
- insert(parentElm, vnode.elm, refElm);
- }
- function insert (parent, elm, ref$$1) {
- if (isDef(parent)) {
- if (isDef(ref$$1)) {
- if (nodeOps.parentNode(ref$$1) === parent) {
- nodeOps.insertBefore(parent, elm, ref$$1);
- }
- } else {
- nodeOps.appendChild(parent, elm);
- }
- }
- }
- function createChildren (vnode, children, insertedVnodeQueue) {
- if (Array.isArray(children)) {
- {
- checkDuplicateKeys(children);
- }
- for (var i = 0; i < children.length; ++i) {
- createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
- }
- } else if (isPrimitive(vnode.text)) {
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
- }
- }
- function isPatchable (vnode) {
- while (vnode.componentInstance) {
- vnode = vnode.componentInstance._vnode;
- }
- return isDef(vnode.tag)
- }
- function invokeCreateHooks (vnode, insertedVnodeQueue) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, vnode);
- }
- i = vnode.data.hook; // Reuse variable
- if (isDef(i)) {
- if (isDef(i.create)) { i.create(emptyNode, vnode); }
- if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
- }
- }
- // set scope id attribute for scoped CSS.
- // this is implemented as a special case to avoid the overhead
- // of going through the normal attribute patching process.
- function setScope (vnode) {
- var i;
- if (isDef(i = vnode.fnScopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- } else {
- var ancestor = vnode;
- while (ancestor) {
- if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- ancestor = ancestor.parent;
- }
- }
- // for slot content they should also get the scopeId from the host instance.
- if (isDef(i = activeInstance) &&
- i !== vnode.context &&
- i !== vnode.fnContext &&
- isDef(i = i.$options._scopeId)
- ) {
- nodeOps.setStyleScope(vnode.elm, i);
- }
- }
- function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
- for (; startIdx <= endIdx; ++startIdx) {
- createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
- }
- }
- function invokeDestroyHook (vnode) {
- var i, j;
- var data = vnode.data;
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
- for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
- }
- if (isDef(i = vnode.children)) {
- for (j = 0; j < vnode.children.length; ++j) {
- invokeDestroyHook(vnode.children[j]);
- }
- }
- }
- function removeVnodes (vnodes, startIdx, endIdx) {
- for (; startIdx <= endIdx; ++startIdx) {
- var ch = vnodes[startIdx];
- if (isDef(ch)) {
- if (isDef(ch.tag)) {
- removeAndInvokeRemoveHook(ch);
- invokeDestroyHook(ch);
- } else { // Text node
- removeNode(ch.elm);
- }
- }
- }
- }
- function removeAndInvokeRemoveHook (vnode, rm) {
- if (isDef(rm) || isDef(vnode.data)) {
- var i;
- var listeners = cbs.remove.length + 1;
- if (isDef(rm)) {
- // we have a recursively passed down rm callback
- // increase the listeners count
- rm.listeners += listeners;
- } else {
- // directly removing
- rm = createRmCb(vnode.elm, listeners);
- }
- // recursively invoke hooks on child component root node
- if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
- removeAndInvokeRemoveHook(i, rm);
- }
- for (i = 0; i < cbs.remove.length; ++i) {
- cbs.remove[i](vnode, rm);
- }
- if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
- i(vnode, rm);
- } else {
- rm();
- }
- } else {
- removeNode(vnode.elm);
- }
- }
- function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
- var oldStartIdx = 0;
- var newStartIdx = 0;
- var oldEndIdx = oldCh.length - 1;
- var oldStartVnode = oldCh[0];
- var oldEndVnode = oldCh[oldEndIdx];
- var newEndIdx = newCh.length - 1;
- var newStartVnode = newCh[0];
- var newEndVnode = newCh[newEndIdx];
- var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
- // removeOnly is a special flag used only by <transition-group>
- // to ensure removed elements stay in correct relative positions
- // during leaving transitions
- var canMove = !removeOnly;
- {
- checkDuplicateKeys(newCh);
- }
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
- if (isUndef(oldStartVnode)) {
- oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
- } else if (isUndef(oldEndVnode)) {
- oldEndVnode = oldCh[--oldEndIdx];
- } else if (sameVnode(oldStartVnode, newStartVnode)) {
- patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- oldStartVnode = oldCh[++oldStartIdx];
- newStartVnode = newCh[++newStartIdx];
- } else if (sameVnode(oldEndVnode, newEndVnode)) {
- patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
- oldEndVnode = oldCh[--oldEndIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
- patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
- canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
- oldStartVnode = oldCh[++oldStartIdx];
- newEndVnode = newCh[--newEndIdx];
- } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
- patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
- oldEndVnode = oldCh[--oldEndIdx];
- newStartVnode = newCh[++newStartIdx];
- } else {
- if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
- idxInOld = isDef(newStartVnode.key)
- ? oldKeyToIdx[newStartVnode.key]
- : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
- if (isUndef(idxInOld)) { // New element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- } else {
- vnodeToMove = oldCh[idxInOld];
- if (sameVnode(vnodeToMove, newStartVnode)) {
- patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
- oldCh[idxInOld] = undefined;
- canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
- } else {
- // same key but different element. treat as new element
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
- }
- }
- newStartVnode = newCh[++newStartIdx];
- }
- }
- if (oldStartIdx > oldEndIdx) {
- refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
- addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
- } else if (newStartIdx > newEndIdx) {
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
- }
- }
- function checkDuplicateKeys (children) {
- var seenKeys = {};
- for (var i = 0; i < children.length; i++) {
- var vnode = children[i];
- var key = vnode.key;
- if (isDef(key)) {
- if (seenKeys[key]) {
- warn(
- ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
- vnode.context
- );
- } else {
- seenKeys[key] = true;
- }
- }
- }
- }
- function findIdxInOld (node, oldCh, start, end) {
- for (var i = start; i < end; i++) {
- var c = oldCh[i];
- if (isDef(c) && sameVnode(node, c)) { return i }
- }
- }
- function patchVnode (
- oldVnode,
- vnode,
- insertedVnodeQueue,
- ownerArray,
- index,
- removeOnly
- ) {
- if (oldVnode === vnode) {
- return
- }
- if (isDef(vnode.elm) && isDef(ownerArray)) {
- // clone reused vnode
- vnode = ownerArray[index] = cloneVNode(vnode);
- }
- var elm = vnode.elm = oldVnode.elm;
- if (isTrue(oldVnode.isAsyncPlaceholder)) {
- if (isDef(vnode.asyncFactory.resolved)) {
- hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
- } else {
- vnode.isAsyncPlaceholder = true;
- }
- return
- }
- // reuse element for static trees.
- // note we only do this if the vnode is cloned -
- // if the new node is not cloned it means the render functions have been
- // reset by the hot-reload-api and we need to do a proper re-render.
- if (isTrue(vnode.isStatic) &&
- isTrue(oldVnode.isStatic) &&
- vnode.key === oldVnode.key &&
- (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
- ) {
- vnode.componentInstance = oldVnode.componentInstance;
- return
- }
- var i;
- var data = vnode.data;
- if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
- i(oldVnode, vnode);
- }
- var oldCh = oldVnode.children;
- var ch = vnode.children;
- if (isDef(data) && isPatchable(vnode)) {
- for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
- if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
- }
- if (isUndef(vnode.text)) {
- if (isDef(oldCh) && isDef(ch)) {
- if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
- } else if (isDef(ch)) {
- {
- checkDuplicateKeys(ch);
- }
- if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
- addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
- } else if (isDef(oldCh)) {
- removeVnodes(oldCh, 0, oldCh.length - 1);
- } else if (isDef(oldVnode.text)) {
- nodeOps.setTextContent(elm, '');
- }
- } else if (oldVnode.text !== vnode.text) {
- nodeOps.setTextContent(elm, vnode.text);
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
- }
- }
- function invokeInsertHook (vnode, queue, initial) {
- // delay insert hooks for component root nodes, invoke them after the
- // element is really inserted
- if (isTrue(initial) && isDef(vnode.parent)) {
- vnode.parent.data.pendingInsert = queue;
- } else {
- for (var i = 0; i < queue.length; ++i) {
- queue[i].data.hook.insert(queue[i]);
- }
- }
- }
- var hydrationBailed = false;
- // list of modules that can skip create hook during hydration because they
- // are already rendered on the client or has no need for initialization
- // Note: style is excluded because it relies on initial clone for future
- // deep updates (#7063).
- var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
- // Note: this is a browser-only function so we can assume elms are DOM nodes.
- function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
- var i;
- var tag = vnode.tag;
- var data = vnode.data;
- var children = vnode.children;
- inVPre = inVPre || (data && data.pre);
- vnode.elm = elm;
- if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
- vnode.isAsyncPlaceholder = true;
- return true
- }
- // assert node match
- {
- if (!assertNodeMatch(elm, vnode, inVPre)) {
- return false
- }
- }
- if (isDef(data)) {
- if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
- if (isDef(i = vnode.componentInstance)) {
- // child component. it should have hydrated its own tree.
- initComponent(vnode, insertedVnodeQueue);
- return true
- }
- }
- if (isDef(tag)) {
- if (isDef(children)) {
- // empty element, allow client to pick up and populate children
- if (!elm.hasChildNodes()) {
- createChildren(vnode, children, insertedVnodeQueue);
- } else {
- // v-html and domProps: innerHTML
- if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
- if (i !== elm.innerHTML) {
- /* istanbul ignore if */
- if (typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('server innerHTML: ', i);
- console.warn('client innerHTML: ', elm.innerHTML);
- }
- return false
- }
- } else {
- // iterate and compare children lists
- var childrenMatch = true;
- var childNode = elm.firstChild;
- for (var i$1 = 0; i$1 < children.length; i$1++) {
- if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
- childrenMatch = false;
- break
- }
- childNode = childNode.nextSibling;
- }
- // if childNode is not null, it means the actual childNodes list is
- // longer than the virtual children list.
- if (!childrenMatch || childNode) {
- /* istanbul ignore if */
- if (typeof console !== 'undefined' &&
- !hydrationBailed
- ) {
- hydrationBailed = true;
- console.warn('Parent: ', elm);
- console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
- }
- return false
- }
- }
- }
- }
- if (isDef(data)) {
- var fullInvoke = false;
- for (var key in data) {
- if (!isRenderedModule(key)) {
- fullInvoke = true;
- invokeCreateHooks(vnode, insertedVnodeQueue);
- break
- }
- }
- if (!fullInvoke && data['class']) {
- // ensure collecting deps for deep class bindings for future updates
- traverse(data['class']);
- }
- }
- } else if (elm.data !== vnode.text) {
- elm.data = vnode.text;
- }
- return true
- }
- function assertNodeMatch (node, vnode, inVPre) {
- if (isDef(vnode.tag)) {
- return vnode.tag.indexOf('vue-component') === 0 || (
- !isUnknownElement$$1(vnode, inVPre) &&
- vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
- )
- } else {
- return node.nodeType === (vnode.isComment ? 8 : 3)
- }
- }
- return function patch (oldVnode, vnode, hydrating, removeOnly) {
- if (isUndef(vnode)) {
- if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
- return
- }
- var isInitialPatch = false;
- var insertedVnodeQueue = [];
- if (isUndef(oldVnode)) {
- // empty mount (likely as component), create new root element
- isInitialPatch = true;
- createElm(vnode, insertedVnodeQueue);
- } else {
- var isRealElement = isDef(oldVnode.nodeType);
- if (!isRealElement && sameVnode(oldVnode, vnode)) {
- // patch existing root node
- patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
- } else {
- if (isRealElement) {
- // mounting to a real element
- // check if this is server-rendered content and if we can perform
- // a successful hydration.
- if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
- oldVnode.removeAttribute(SSR_ATTR);
- hydrating = true;
- }
- if (isTrue(hydrating)) {
- if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
- invokeInsertHook(vnode, insertedVnodeQueue, true);
- return oldVnode
- } else {
- warn(
- 'The client-side rendered virtual DOM tree is not matching ' +
- 'server-rendered content. This is likely caused by incorrect ' +
- 'HTML markup, for example nesting block-level elements inside ' +
- '<p>, or missing <tbody>. Bailing hydration and performing ' +
- 'full client-side render.'
- );
- }
- }
- // either not server-rendered, or hydration failed.
- // create an empty node and replace it
- oldVnode = emptyNodeAt(oldVnode);
- }
- // replacing existing element
- var oldElm = oldVnode.elm;
- var parentElm = nodeOps.parentNode(oldElm);
- // create new node
- createElm(
- vnode,
- insertedVnodeQueue,
- // extremely rare edge case: do not insert if old element is in a
- // leaving transition. Only happens when combining transition +
- // keep-alive + HOCs. (#4590)
- oldElm._leaveCb ? null : parentElm,
- nodeOps.nextSibling(oldElm)
- );
- // update parent placeholder node element, recursively
- if (isDef(vnode.parent)) {
- var ancestor = vnode.parent;
- var patchable = isPatchable(vnode);
- while (ancestor) {
- for (var i = 0; i < cbs.destroy.length; ++i) {
- cbs.destroy[i](ancestor);
- }
- ancestor.elm = vnode.elm;
- if (patchable) {
- for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
- cbs.create[i$1](emptyNode, ancestor);
- }
- // #6513
- // invoke insert hooks that may have been merged by create hooks.
- // e.g. for directives that uses the "inserted" hook.
- var insert = ancestor.data.hook.insert;
- if (insert.merged) {
- // start at index 1 to avoid re-invoking component mounted hook
- for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
- insert.fns[i$2]();
- }
- }
- } else {
- registerRef(ancestor);
- }
- ancestor = ancestor.parent;
- }
- }
- // destroy old node
- if (isDef(parentElm)) {
- removeVnodes([oldVnode], 0, 0);
- } else if (isDef(oldVnode.tag)) {
- invokeDestroyHook(oldVnode);
- }
- }
- }
- invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
- return vnode.elm
- }
- }
- /* */
- var directives = {
- create: updateDirectives,
- update: updateDirectives,
- destroy: function unbindDirectives (vnode) {
- updateDirectives(vnode, emptyNode);
- }
- };
- function updateDirectives (oldVnode, vnode) {
- if (oldVnode.data.directives || vnode.data.directives) {
- _update(oldVnode, vnode);
- }
- }
- function _update (oldVnode, vnode) {
- var isCreate = oldVnode === emptyNode;
- var isDestroy = vnode === emptyNode;
- var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
- var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
- var dirsWithInsert = [];
- var dirsWithPostpatch = [];
- var key, oldDir, dir;
- for (key in newDirs) {
- oldDir = oldDirs[key];
- dir = newDirs[key];
- if (!oldDir) {
- // new directive, bind
- callHook$1(dir, 'bind', vnode, oldVnode);
- if (dir.def && dir.def.inserted) {
- dirsWithInsert.push(dir);
- }
- } else {
- // existing directive, update
- dir.oldValue = oldDir.value;
- dir.oldArg = oldDir.arg;
- callHook$1(dir, 'update', vnode, oldVnode);
- if (dir.def && dir.def.componentUpdated) {
- dirsWithPostpatch.push(dir);
- }
- }
- }
- if (dirsWithInsert.length) {
- var callInsert = function () {
- for (var i = 0; i < dirsWithInsert.length; i++) {
- callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
- }
- };
- if (isCreate) {
- mergeVNodeHook(vnode, 'insert', callInsert);
- } else {
- callInsert();
- }
- }
- if (dirsWithPostpatch.length) {
- mergeVNodeHook(vnode, 'postpatch', function () {
- for (var i = 0; i < dirsWithPostpatch.length; i++) {
- callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
- }
- });
- }
- if (!isCreate) {
- for (key in oldDirs) {
- if (!newDirs[key]) {
- // no longer present, unbind
- callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
- }
- }
- }
- }
- var emptyModifiers = Object.create(null);
- function normalizeDirectives$1 (
- dirs,
- vm
- ) {
- var res = Object.create(null);
- if (!dirs) {
- // $flow-disable-line
- return res
- }
- var i, dir;
- for (i = 0; i < dirs.length; i++) {
- dir = dirs[i];
- if (!dir.modifiers) {
- // $flow-disable-line
- dir.modifiers = emptyModifiers;
- }
- res[getRawDirName(dir)] = dir;
- dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
- }
- // $flow-disable-line
- return res
- }
- function getRawDirName (dir) {
- return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
- }
- function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
- var fn = dir.def && dir.def[hook];
- if (fn) {
- try {
- fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
- } catch (e) {
- handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
- }
- }
- }
- var baseModules = [
- ref,
- directives
- ];
- /* */
- function updateAttrs (oldVnode, vnode) {
- var opts = vnode.componentOptions;
- if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
- return
- }
- if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
- return
- }
- var key, cur, old;
- var elm = vnode.elm;
- var oldAttrs = oldVnode.data.attrs || {};
- var attrs = vnode.data.attrs || {};
- // clone observed objects, as the user probably wants to mutate it
- if (isDef(attrs.__ob__)) {
- attrs = vnode.data.attrs = extend({}, attrs);
- }
- for (key in attrs) {
- cur = attrs[key];
- old = oldAttrs[key];
- if (old !== cur) {
- setAttr(elm, key, cur, vnode.data.pre);
- }
- }
- // #4391: in IE9, setting type can reset value for input[type=radio]
- // #6666: IE/Edge forces progress value down to 1 before setting a max
- /* istanbul ignore if */
- if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
- setAttr(elm, 'value', attrs.value);
- }
- for (key in oldAttrs) {
- if (isUndef(attrs[key])) {
- if (isXlink(key)) {
- elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
- } else if (!isEnumeratedAttr(key)) {
- elm.removeAttribute(key);
- }
- }
- }
- }
- function setAttr (el, key, value, isInPre) {
- if (isInPre || el.tagName.indexOf('-') > -1) {
- baseSetAttr(el, key, value);
- } else if (isBooleanAttr(key)) {
- // set attribute for blank value
- // e.g. <option disabled>Select one</option>
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key);
- } else {
- // technically allowfullscreen is a boolean attribute for <iframe>,
- // but Flash expects a value of "true" when used on <embed> tag
- value = key === 'allowfullscreen' && el.tagName === 'EMBED'
- ? 'true'
- : key;
- el.setAttribute(key, value);
- }
- } else if (isEnumeratedAttr(key)) {
- el.setAttribute(key, convertEnumeratedValue(key, value));
- } else if (isXlink(key)) {
- if (isFalsyAttrValue(value)) {
- el.removeAttributeNS(xlinkNS, getXlinkProp(key));
- } else {
- el.setAttributeNS(xlinkNS, key, value);
- }
- } else {
- baseSetAttr(el, key, value);
- }
- }
- function baseSetAttr (el, key, value) {
- if (isFalsyAttrValue(value)) {
- el.removeAttribute(key);
- } else {
- // #7138: IE10 & 11 fires input event when setting placeholder on
- // <textarea>... block the first input event and remove the blocker
- // immediately.
- /* istanbul ignore if */
- if (
- isIE && !isIE9 &&
- el.tagName === 'TEXTAREA' &&
- key === 'placeholder' && value !== '' && !el.__ieph
- ) {
- var blocker = function (e) {
- e.stopImmediatePropagation();
- el.removeEventListener('input', blocker);
- };
- el.addEventListener('input', blocker);
- // $flow-disable-line
- el.__ieph = true; /* IE placeholder patched */
- }
- el.setAttribute(key, value);
- }
- }
- var attrs = {
- create: updateAttrs,
- update: updateAttrs
- };
- /* */
- function updateClass (oldVnode, vnode) {
- var el = vnode.elm;
- var data = vnode.data;
- var oldData = oldVnode.data;
- if (
- isUndef(data.staticClass) &&
- isUndef(data.class) && (
- isUndef(oldData) || (
- isUndef(oldData.staticClass) &&
- isUndef(oldData.class)
- )
- )
- ) {
- return
- }
- var cls = genClassForVnode(vnode);
- // handle transition classes
- var transitionClass = el._transitionClasses;
- if (isDef(transitionClass)) {
- cls = concat(cls, stringifyClass(transitionClass));
- }
- // set the class
- if (cls !== el._prevClass) {
- el.setAttribute('class', cls);
- el._prevClass = cls;
- }
- }
- var klass = {
- create: updateClass,
- update: updateClass
- };
- /* */
- var validDivisionCharRE = /[\w).+\-_$\]]/;
- function parseFilters (exp) {
- var inSingle = false;
- var inDouble = false;
- var inTemplateString = false;
- var inRegex = false;
- var curly = 0;
- var square = 0;
- var paren = 0;
- var lastFilterIndex = 0;
- var c, prev, i, expression, filters;
- for (i = 0; i < exp.length; i++) {
- prev = c;
- c = exp.charCodeAt(i);
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
- } else if (inDouble) {
- if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
- } else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
- } else if (inRegex) {
- if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
- } else if (
- c === 0x7C && // pipe
- exp.charCodeAt(i + 1) !== 0x7C &&
- exp.charCodeAt(i - 1) !== 0x7C &&
- !curly && !square && !paren
- ) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1;
- expression = exp.slice(0, i).trim();
- } else {
- pushFilter();
- }
- } else {
- switch (c) {
- case 0x22: inDouble = true; break // "
- case 0x27: inSingle = true; break // '
- case 0x60: inTemplateString = true; break // `
- case 0x28: paren++; break // (
- case 0x29: paren--; break // )
- case 0x5B: square++; break // [
- case 0x5D: square--; break // ]
- case 0x7B: curly++; break // {
- case 0x7D: curly--; break // }
- }
- if (c === 0x2f) { // /
- var j = i - 1;
- var p = (void 0);
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j);
- if (p !== ' ') { break }
- }
- if (!p || !validDivisionCharRE.test(p)) {
- inRegex = true;
- }
- }
- }
- }
- if (expression === undefined) {
- expression = exp.slice(0, i).trim();
- } else if (lastFilterIndex !== 0) {
- pushFilter();
- }
- function pushFilter () {
- (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
- lastFilterIndex = i + 1;
- }
- if (filters) {
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i]);
- }
- }
- return expression
- }
- function wrapFilter (exp, filter) {
- var i = filter.indexOf('(');
- if (i < 0) {
- // _f: resolveFilter
- return ("_f(\"" + filter + "\")(" + exp + ")")
- } else {
- var name = filter.slice(0, i);
- var args = filter.slice(i + 1);
- return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
- }
- }
- /* */
- /* eslint-disable no-unused-vars */
- function baseWarn (msg, range) {
- console.error(("[Vue compiler]: " + msg));
- }
- /* eslint-enable no-unused-vars */
- function pluckModuleFunction (
- modules,
- key
- ) {
- return modules
- ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
- : []
- }
- function addProp (el, name, value, range, dynamic) {
- (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
- el.plain = false;
- }
- function addAttr (el, name, value, range, dynamic) {
- var attrs = dynamic
- ? (el.dynamicAttrs || (el.dynamicAttrs = []))
- : (el.attrs || (el.attrs = []));
- attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
- el.plain = false;
- }
- // add a raw attr (use this in preTransforms)
- function addRawAttr (el, name, value, range) {
- el.attrsMap[name] = value;
- el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
- }
- function addDirective (
- el,
- name,
- rawName,
- value,
- arg,
- isDynamicArg,
- modifiers,
- range
- ) {
- (el.directives || (el.directives = [])).push(rangeSetItem({
- name: name,
- rawName: rawName,
- value: value,
- arg: arg,
- isDynamicArg: isDynamicArg,
- modifiers: modifiers
- }, range));
- el.plain = false;
- }
- function prependModifierMarker (symbol, name, dynamic) {
- return dynamic
- ? ("_p(" + name + ",\"" + symbol + "\")")
- : symbol + name // mark the event as captured
- }
- function addHandler (
- el,
- name,
- value,
- modifiers,
- important,
- warn,
- range,
- dynamic
- ) {
- modifiers = modifiers || emptyObject;
- // warn prevent and passive modifier
- /* istanbul ignore if */
- if (
- warn &&
- modifiers.prevent && modifiers.passive
- ) {
- warn(
- 'passive and prevent can\'t be used together. ' +
- 'Passive handler can\'t prevent default event.',
- range
- );
- }
- // normalize click.right and click.middle since they don't actually fire
- // this is technically browser-specific, but at least for now browsers are
- // the only target envs that have right/middle clicks.
- if (modifiers.right) {
- if (dynamic) {
- name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
- } else if (name === 'click') {
- name = 'contextmenu';
- delete modifiers.right;
- }
- } else if (modifiers.middle) {
- if (dynamic) {
- name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
- } else if (name === 'click') {
- name = 'mouseup';
- }
- }
- // check capture modifier
- if (modifiers.capture) {
- delete modifiers.capture;
- name = prependModifierMarker('!', name, dynamic);
- }
- if (modifiers.once) {
- delete modifiers.once;
- name = prependModifierMarker('~', name, dynamic);
- }
- /* istanbul ignore if */
- if (modifiers.passive) {
- delete modifiers.passive;
- name = prependModifierMarker('&', name, dynamic);
- }
- var events;
- if (modifiers.native) {
- delete modifiers.native;
- events = el.nativeEvents || (el.nativeEvents = {});
- } else {
- events = el.events || (el.events = {});
- }
- var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
- if (modifiers !== emptyObject) {
- newHandler.modifiers = modifiers;
- }
- var handlers = events[name];
- /* istanbul ignore if */
- if (Array.isArray(handlers)) {
- important ? handlers.unshift(newHandler) : handlers.push(newHandler);
- } else if (handlers) {
- events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
- } else {
- events[name] = newHandler;
- }
- el.plain = false;
- }
- function getRawBindingAttr (
- el,
- name
- ) {
- return el.rawAttrsMap[':' + name] ||
- el.rawAttrsMap['v-bind:' + name] ||
- el.rawAttrsMap[name]
- }
- function getBindingAttr (
- el,
- name,
- getStatic
- ) {
- var dynamicValue =
- getAndRemoveAttr(el, ':' + name) ||
- getAndRemoveAttr(el, 'v-bind:' + name);
- if (dynamicValue != null) {
- return parseFilters(dynamicValue)
- } else if (getStatic !== false) {
- var staticValue = getAndRemoveAttr(el, name);
- if (staticValue != null) {
- return JSON.stringify(staticValue)
- }
- }
- }
- // note: this only removes the attr from the Array (attrsList) so that it
- // doesn't get processed by processAttrs.
- // By default it does NOT remove it from the map (attrsMap) because the map is
- // needed during codegen.
- function getAndRemoveAttr (
- el,
- name,
- removeFromMap
- ) {
- var val;
- if ((val = el.attrsMap[name]) != null) {
- var list = el.attrsList;
- for (var i = 0, l = list.length; i < l; i++) {
- if (list[i].name === name) {
- list.splice(i, 1);
- break
- }
- }
- }
- if (removeFromMap) {
- delete el.attrsMap[name];
- }
- return val
- }
- function getAndRemoveAttrByRegex (
- el,
- name
- ) {
- var list = el.attrsList;
- for (var i = 0, l = list.length; i < l; i++) {
- var attr = list[i];
- if (name.test(attr.name)) {
- list.splice(i, 1);
- return attr
- }
- }
- }
- function rangeSetItem (
- item,
- range
- ) {
- if (range) {
- if (range.start != null) {
- item.start = range.start;
- }
- if (range.end != null) {
- item.end = range.end;
- }
- }
- return item
- }
- /* */
- /**
- * Cross-platform code generation for component v-model
- */
- function genComponentModel (
- el,
- value,
- modifiers
- ) {
- var ref = modifiers || {};
- var number = ref.number;
- var trim = ref.trim;
- var baseValueExpression = '$$v';
- var valueExpression = baseValueExpression;
- if (trim) {
- valueExpression =
- "(typeof " + baseValueExpression + " === 'string'" +
- "? " + baseValueExpression + ".trim()" +
- ": " + baseValueExpression + ")";
- }
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
- var assignment = genAssignmentCode(value, valueExpression);
- el.model = {
- value: ("(" + value + ")"),
- expression: JSON.stringify(value),
- callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
- };
- }
- /**
- * Cross-platform codegen helper for generating v-model value assignment code.
- */
- function genAssignmentCode (
- value,
- assignment
- ) {
- var res = parseModel(value);
- if (res.key === null) {
- return (value + "=" + assignment)
- } else {
- return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
- }
- }
- /**
- * Parse a v-model expression into a base path and a final key segment.
- * Handles both dot-path and possible square brackets.
- *
- * Possible cases:
- *
- * - test
- * - test[key]
- * - test[test1[key]]
- * - test["a"][key]
- * - xxx.test[a[a].test1[key]]
- * - test.xxx.a["asa"][test1[key]]
- *
- */
- var len, str, chr, index$1, expressionPos, expressionEndPos;
- function parseModel (val) {
- // Fix https://github.com/vuejs/vue/pull/7730
- // allow v-model="obj.val " (trailing whitespace)
- val = val.trim();
- len = val.length;
- if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
- index$1 = val.lastIndexOf('.');
- if (index$1 > -1) {
- return {
- exp: val.slice(0, index$1),
- key: '"' + val.slice(index$1 + 1) + '"'
- }
- } else {
- return {
- exp: val,
- key: null
- }
- }
- }
- str = val;
- index$1 = expressionPos = expressionEndPos = 0;
- while (!eof()) {
- chr = next();
- /* istanbul ignore if */
- if (isStringStart(chr)) {
- parseString(chr);
- } else if (chr === 0x5B) {
- parseBracket(chr);
- }
- }
- return {
- exp: val.slice(0, expressionPos),
- key: val.slice(expressionPos + 1, expressionEndPos)
- }
- }
- function next () {
- return str.charCodeAt(++index$1)
- }
- function eof () {
- return index$1 >= len
- }
- function isStringStart (chr) {
- return chr === 0x22 || chr === 0x27
- }
- function parseBracket (chr) {
- var inBracket = 1;
- expressionPos = index$1;
- while (!eof()) {
- chr = next();
- if (isStringStart(chr)) {
- parseString(chr);
- continue
- }
- if (chr === 0x5B) { inBracket++; }
- if (chr === 0x5D) { inBracket--; }
- if (inBracket === 0) {
- expressionEndPos = index$1;
- break
- }
- }
- }
- function parseString (chr) {
- var stringQuote = chr;
- while (!eof()) {
- chr = next();
- if (chr === stringQuote) {
- break
- }
- }
- }
- /* */
- var warn$1;
- // in some cases, the event used has to be determined at runtime
- // so we used some reserved tokens during compile.
- var RANGE_TOKEN = '__r';
- var CHECKBOX_RADIO_TOKEN = '__c';
- function model (
- el,
- dir,
- _warn
- ) {
- warn$1 = _warn;
- var value = dir.value;
- var modifiers = dir.modifiers;
- var tag = el.tag;
- var type = el.attrsMap.type;
- {
- // inputs with type="file" are read only and setting the input's
- // value will throw an error.
- if (tag === 'input' && type === 'file') {
- warn$1(
- "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
- "File inputs are read only. Use a v-on:change listener instead.",
- el.rawAttrsMap['v-model']
- );
- }
- }
- if (el.component) {
- genComponentModel(el, value, modifiers);
- // component v-model doesn't need extra runtime
- return false
- } else if (tag === 'select') {
- genSelect(el, value, modifiers);
- } else if (tag === 'input' && type === 'checkbox') {
- genCheckboxModel(el, value, modifiers);
- } else if (tag === 'input' && type === 'radio') {
- genRadioModel(el, value, modifiers);
- } else if (tag === 'input' || tag === 'textarea') {
- genDefaultModel(el, value, modifiers);
- } else if (!config.isReservedTag(tag)) {
- genComponentModel(el, value, modifiers);
- // component v-model doesn't need extra runtime
- return false
- } else {
- warn$1(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "v-model is not supported on this element type. " +
- 'If you are working with contenteditable, it\'s recommended to ' +
- 'wrap a library dedicated for that purpose inside a custom component.',
- el.rawAttrsMap['v-model']
- );
- }
- // ensure runtime directive metadata
- return true
- }
- function genCheckboxModel (
- el,
- value,
- modifiers
- ) {
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
- var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
- addProp(el, 'checked',
- "Array.isArray(" + value + ")" +
- "?_i(" + value + "," + valueBinding + ")>-1" + (
- trueValueBinding === 'true'
- ? (":(" + value + ")")
- : (":_q(" + value + "," + trueValueBinding + ")")
- )
- );
- addHandler(el, 'change',
- "var $$a=" + value + "," +
- '$$el=$event.target,' +
- "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
- 'if(Array.isArray($$a)){' +
- "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
- '$$i=_i($$a,$$v);' +
- "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
- "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
- "}else{" + (genAssignmentCode(value, '$$c')) + "}",
- null, true
- );
- }
- function genRadioModel (
- el,
- value,
- modifiers
- ) {
- var number = modifiers && modifiers.number;
- var valueBinding = getBindingAttr(el, 'value') || 'null';
- valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
- addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
- addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
- }
- function genSelect (
- el,
- value,
- modifiers
- ) {
- var number = modifiers && modifiers.number;
- var selectedVal = "Array.prototype.filter" +
- ".call($event.target.options,function(o){return o.selected})" +
- ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
- "return " + (number ? '_n(val)' : 'val') + "})";
- var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
- var code = "var $$selectedVal = " + selectedVal + ";";
- code = code + " " + (genAssignmentCode(value, assignment));
- addHandler(el, 'change', code, null, true);
- }
- function genDefaultModel (
- el,
- value,
- modifiers
- ) {
- var type = el.attrsMap.type;
- // warn if v-bind:value conflicts with v-model
- // except for inputs with v-bind:type
- {
- var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
- var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
- if (value$1 && !typeBinding) {
- var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
- warn$1(
- binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
- 'because the latter already expands to a value binding internally',
- el.rawAttrsMap[binding]
- );
- }
- }
- var ref = modifiers || {};
- var lazy = ref.lazy;
- var number = ref.number;
- var trim = ref.trim;
- var needCompositionGuard = !lazy && type !== 'range';
- var event = lazy
- ? 'change'
- : type === 'range'
- ? RANGE_TOKEN
- : 'input';
- var valueExpression = '$event.target.value';
- if (trim) {
- valueExpression = "$event.target.value.trim()";
- }
- if (number) {
- valueExpression = "_n(" + valueExpression + ")";
- }
- var code = genAssignmentCode(value, valueExpression);
- if (needCompositionGuard) {
- code = "if($event.target.composing)return;" + code;
- }
- addProp(el, 'value', ("(" + value + ")"));
- addHandler(el, event, code, null, true);
- if (trim || number) {
- addHandler(el, 'blur', '$forceUpdate()');
- }
- }
- /* */
- // normalize v-model event tokens that can only be determined at runtime.
- // it's important to place the event as the first in the array because
- // the whole point is ensuring the v-model callback gets called before
- // user-attached handlers.
- function normalizeEvents (on) {
- /* istanbul ignore if */
- if (isDef(on[RANGE_TOKEN])) {
- // IE input[type=range] only supports `change` event
- var event = isIE ? 'change' : 'input';
- on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
- delete on[RANGE_TOKEN];
- }
- // This was originally intended to fix #4521 but no longer necessary
- // after 2.5. Keeping it for backwards compat with generated code from < 2.4
- /* istanbul ignore if */
- if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
- on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
- delete on[CHECKBOX_RADIO_TOKEN];
- }
- }
- var target$1;
- function createOnceHandler$1 (event, handler, capture) {
- var _target = target$1; // save current target element in closure
- return function onceHandler () {
- var res = handler.apply(null, arguments);
- if (res !== null) {
- remove$2(event, onceHandler, capture, _target);
- }
- }
- }
- // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
- // implementation and does not fire microtasks in between event propagation, so
- // safe to exclude.
- var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
- function add$1 (
- name,
- handler,
- capture,
- passive
- ) {
- // async edge case #6566: inner click event triggers patch, event handler
- // attached to outer element during patch, and triggered again. This
- // happens because browsers fire microtask ticks between event propagation.
- // the solution is simple: we save the timestamp when a handler is attached,
- // and the handler would only fire if the event passed to it was fired
- // AFTER it was attached.
- if (useMicrotaskFix) {
- var attachedTimestamp = currentFlushTimestamp;
- var original = handler;
- handler = original._wrapper = function (e) {
- if (
- // no bubbling, should always fire.
- // this is just a safety net in case event.timeStamp is unreliable in
- // certain weird environments...
- e.target === e.currentTarget ||
- // event is fired after handler attachment
- e.timeStamp >= attachedTimestamp ||
- // bail for environments that have buggy event.timeStamp implementations
- // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
- // #9681 QtWebEngine event.timeStamp is negative value
- e.timeStamp <= 0 ||
- // #9448 bail if event is fired in another document in a multi-page
- // electron/nw.js app, since event.timeStamp will be using a different
- // starting reference
- e.target.ownerDocument !== document
- ) {
- return original.apply(this, arguments)
- }
- };
- }
- target$1.addEventListener(
- name,
- handler,
- supportsPassive
- ? { capture: capture, passive: passive }
- : capture
- );
- }
- function remove$2 (
- name,
- handler,
- capture,
- _target
- ) {
- (_target || target$1).removeEventListener(
- name,
- handler._wrapper || handler,
- capture
- );
- }
- function updateDOMListeners (oldVnode, vnode) {
- if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
- return
- }
- var on = vnode.data.on || {};
- var oldOn = oldVnode.data.on || {};
- target$1 = vnode.elm;
- normalizeEvents(on);
- updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
- target$1 = undefined;
- }
- var events = {
- create: updateDOMListeners,
- update: updateDOMListeners
- };
- /* */
- var svgContainer;
- function updateDOMProps (oldVnode, vnode) {
- if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
- return
- }
- var key, cur;
- var elm = vnode.elm;
- var oldProps = oldVnode.data.domProps || {};
- var props = vnode.data.domProps || {};
- // clone observed objects, as the user probably wants to mutate it
- if (isDef(props.__ob__)) {
- props = vnode.data.domProps = extend({}, props);
- }
- for (key in oldProps) {
- if (!(key in props)) {
- elm[key] = '';
- }
- }
- for (key in props) {
- cur = props[key];
- // ignore children if the node has textContent or innerHTML,
- // as these will throw away existing DOM nodes and cause removal errors
- // on subsequent patches (#3360)
- if (key === 'textContent' || key === 'innerHTML') {
- if (vnode.children) { vnode.children.length = 0; }
- if (cur === oldProps[key]) { continue }
- // #6601 work around Chrome version <= 55 bug where single textNode
- // replaced by innerHTML/textContent retains its parentNode property
- if (elm.childNodes.length === 1) {
- elm.removeChild(elm.childNodes[0]);
- }
- }
- if (key === 'value' && elm.tagName !== 'PROGRESS') {
- // store value as _value as well since
- // non-string values will be stringified
- elm._value = cur;
- // avoid resetting cursor position when value is the same
- var strCur = isUndef(cur) ? '' : String(cur);
- if (shouldUpdateValue(elm, strCur)) {
- elm.value = strCur;
- }
- } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
- // IE doesn't support innerHTML for SVG elements
- svgContainer = svgContainer || document.createElement('div');
- svgContainer.innerHTML = "<svg>" + cur + "</svg>";
- var svg = svgContainer.firstChild;
- while (elm.firstChild) {
- elm.removeChild(elm.firstChild);
- }
- while (svg.firstChild) {
- elm.appendChild(svg.firstChild);
- }
- } else if (
- // skip the update if old and new VDOM state is the same.
- // `value` is handled separately because the DOM value may be temporarily
- // out of sync with VDOM state due to focus, composition and modifiers.
- // This #4521 by skipping the unnecessary `checked` update.
- cur !== oldProps[key]
- ) {
- // some property updates can throw
- // e.g. `value` on <progress> w/ non-finite value
- try {
- elm[key] = cur;
- } catch (e) {}
- }
- }
- }
- // check platforms/web/util/attrs.js acceptValue
- function shouldUpdateValue (elm, checkVal) {
- return (!elm.composing && (
- elm.tagName === 'OPTION' ||
- isNotInFocusAndDirty(elm, checkVal) ||
- isDirtyWithModifiers(elm, checkVal)
- ))
- }
- function isNotInFocusAndDirty (elm, checkVal) {
- // return true when textbox (.number and .trim) loses focus and its value is
- // not equal to the updated value
- var notInFocus = true;
- // #6157
- // work around IE bug when accessing document.activeElement in an iframe
- try { notInFocus = document.activeElement !== elm; } catch (e) {}
- return notInFocus && elm.value !== checkVal
- }
- function isDirtyWithModifiers (elm, newVal) {
- var value = elm.value;
- var modifiers = elm._vModifiers; // injected by v-model runtime
- if (isDef(modifiers)) {
- if (modifiers.number) {
- return toNumber(value) !== toNumber(newVal)
- }
- if (modifiers.trim) {
- return value.trim() !== newVal.trim()
- }
- }
- return value !== newVal
- }
- var domProps = {
- create: updateDOMProps,
- update: updateDOMProps
- };
- /* */
- var parseStyleText = cached(function (cssText) {
- var res = {};
- var listDelimiter = /;(?![^(]*\))/g;
- var propertyDelimiter = /:(.+)/;
- cssText.split(listDelimiter).forEach(function (item) {
- if (item) {
- var tmp = item.split(propertyDelimiter);
- tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return res
- });
- // merge static and dynamic style data on the same vnode
- function normalizeStyleData (data) {
- var style = normalizeStyleBinding(data.style);
- // static style is pre-processed into an object during compilation
- // and is always a fresh object, so it's safe to merge into it
- return data.staticStyle
- ? extend(data.staticStyle, style)
- : style
- }
- // normalize possible array / string values into Object
- function normalizeStyleBinding (bindingStyle) {
- if (Array.isArray(bindingStyle)) {
- return toObject(bindingStyle)
- }
- if (typeof bindingStyle === 'string') {
- return parseStyleText(bindingStyle)
- }
- return bindingStyle
- }
- /**
- * parent component style should be after child's
- * so that parent component's style could override it
- */
- function getStyle (vnode, checkChild) {
- var res = {};
- var styleData;
- if (checkChild) {
- var childNode = vnode;
- while (childNode.componentInstance) {
- childNode = childNode.componentInstance._vnode;
- if (
- childNode && childNode.data &&
- (styleData = normalizeStyleData(childNode.data))
- ) {
- extend(res, styleData);
- }
- }
- }
- if ((styleData = normalizeStyleData(vnode.data))) {
- extend(res, styleData);
- }
- var parentNode = vnode;
- while ((parentNode = parentNode.parent)) {
- if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
- extend(res, styleData);
- }
- }
- return res
- }
- /* */
- var cssVarRE = /^--/;
- var importantRE = /\s*!important$/;
- var setProp = function (el, name, val) {
- /* istanbul ignore if */
- if (cssVarRE.test(name)) {
- el.style.setProperty(name, val);
- } else if (importantRE.test(val)) {
- el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
- } else {
- var normalizedName = normalize(name);
- if (Array.isArray(val)) {
- // Support values array created by autoprefixer, e.g.
- // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
- // Set them one by one, and the browser will only set those it can recognize
- for (var i = 0, len = val.length; i < len; i++) {
- el.style[normalizedName] = val[i];
- }
- } else {
- el.style[normalizedName] = val;
- }
- }
- };
- var vendorNames = ['Webkit', 'Moz', 'ms'];
- var emptyStyle;
- var normalize = cached(function (prop) {
- emptyStyle = emptyStyle || document.createElement('div').style;
- prop = camelize(prop);
- if (prop !== 'filter' && (prop in emptyStyle)) {
- return prop
- }
- var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
- for (var i = 0; i < vendorNames.length; i++) {
- var name = vendorNames[i] + capName;
- if (name in emptyStyle) {
- return name
- }
- }
- });
- function updateStyle (oldVnode, vnode) {
- var data = vnode.data;
- var oldData = oldVnode.data;
- if (isUndef(data.staticStyle) && isUndef(data.style) &&
- isUndef(oldData.staticStyle) && isUndef(oldData.style)
- ) {
- return
- }
- var cur, name;
- var el = vnode.elm;
- var oldStaticStyle = oldData.staticStyle;
- var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
- // if static style exists, stylebinding already merged into it when doing normalizeStyleData
- var oldStyle = oldStaticStyle || oldStyleBinding;
- var style = normalizeStyleBinding(vnode.data.style) || {};
- // store normalized style under a different key for next diff
- // make sure to clone it if it's reactive, since the user likely wants
- // to mutate it.
- vnode.data.normalizedStyle = isDef(style.__ob__)
- ? extend({}, style)
- : style;
- var newStyle = getStyle(vnode, true);
- for (name in oldStyle) {
- if (isUndef(newStyle[name])) {
- setProp(el, name, '');
- }
- }
- for (name in newStyle) {
- cur = newStyle[name];
- if (cur !== oldStyle[name]) {
- // ie9 setting to null has no effect, must use empty string
- setProp(el, name, cur == null ? '' : cur);
- }
- }
- }
- var style = {
- create: updateStyle,
- update: updateStyle
- };
- /* */
- var whitespaceRE = /\s+/;
- /**
- * Add class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
- function addClass (el, cls) {
- /* istanbul ignore if */
- if (!cls || !(cls = cls.trim())) {
- return
- }
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
- } else {
- el.classList.add(cls);
- }
- } else {
- var cur = " " + (el.getAttribute('class') || '') + " ";
- if (cur.indexOf(' ' + cls + ' ') < 0) {
- el.setAttribute('class', (cur + cls).trim());
- }
- }
- }
- /**
- * Remove class with compatibility for SVG since classList is not supported on
- * SVG elements in IE
- */
- function removeClass (el, cls) {
- /* istanbul ignore if */
- if (!cls || !(cls = cls.trim())) {
- return
- }
- /* istanbul ignore else */
- if (el.classList) {
- if (cls.indexOf(' ') > -1) {
- cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
- } else {
- el.classList.remove(cls);
- }
- if (!el.classList.length) {
- el.removeAttribute('class');
- }
- } else {
- var cur = " " + (el.getAttribute('class') || '') + " ";
- var tar = ' ' + cls + ' ';
- while (cur.indexOf(tar) >= 0) {
- cur = cur.replace(tar, ' ');
- }
- cur = cur.trim();
- if (cur) {
- el.setAttribute('class', cur);
- } else {
- el.removeAttribute('class');
- }
- }
- }
- /* */
- function resolveTransition (def$$1) {
- if (!def$$1) {
- return
- }
- /* istanbul ignore else */
- if (typeof def$$1 === 'object') {
- var res = {};
- if (def$$1.css !== false) {
- extend(res, autoCssTransition(def$$1.name || 'v'));
- }
- extend(res, def$$1);
- return res
- } else if (typeof def$$1 === 'string') {
- return autoCssTransition(def$$1)
- }
- }
- var autoCssTransition = cached(function (name) {
- return {
- enterClass: (name + "-enter"),
- enterToClass: (name + "-enter-to"),
- enterActiveClass: (name + "-enter-active"),
- leaveClass: (name + "-leave"),
- leaveToClass: (name + "-leave-to"),
- leaveActiveClass: (name + "-leave-active")
- }
- });
- var hasTransition = inBrowser && !isIE9;
- var TRANSITION = 'transition';
- var ANIMATION = 'animation';
- // Transition property/event sniffing
- var transitionProp = 'transition';
- var transitionEndEvent = 'transitionend';
- var animationProp = 'animation';
- var animationEndEvent = 'animationend';
- if (hasTransition) {
- /* istanbul ignore if */
- if (window.ontransitionend === undefined &&
- window.onwebkittransitionend !== undefined
- ) {
- transitionProp = 'WebkitTransition';
- transitionEndEvent = 'webkitTransitionEnd';
- }
- if (window.onanimationend === undefined &&
- window.onwebkitanimationend !== undefined
- ) {
- animationProp = 'WebkitAnimation';
- animationEndEvent = 'webkitAnimationEnd';
- }
- }
- // binding to window is necessary to make hot reload work in IE in strict mode
- var raf = inBrowser
- ? window.requestAnimationFrame
- ? window.requestAnimationFrame.bind(window)
- : setTimeout
- : /* istanbul ignore next */ function (fn) { return fn(); };
- function nextFrame (fn) {
- raf(function () {
- raf(fn);
- });
- }
- function addTransitionClass (el, cls) {
- var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
- if (transitionClasses.indexOf(cls) < 0) {
- transitionClasses.push(cls);
- addClass(el, cls);
- }
- }
- function removeTransitionClass (el, cls) {
- if (el._transitionClasses) {
- remove(el._transitionClasses, cls);
- }
- removeClass(el, cls);
- }
- function whenTransitionEnds (
- el,
- expectedType,
- cb
- ) {
- var ref = getTransitionInfo(el, expectedType);
- var type = ref.type;
- var timeout = ref.timeout;
- var propCount = ref.propCount;
- if (!type) { return cb() }
- var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
- var ended = 0;
- var end = function () {
- el.removeEventListener(event, onEnd);
- cb();
- };
- var onEnd = function (e) {
- if (e.target === el) {
- if (++ended >= propCount) {
- end();
- }
- }
- };
- setTimeout(function () {
- if (ended < propCount) {
- end();
- }
- }, timeout + 1);
- el.addEventListener(event, onEnd);
- }
- var transformRE = /\b(transform|all)(,|$)/;
- function getTransitionInfo (el, expectedType) {
- var styles = window.getComputedStyle(el);
- // JSDOM may return undefined for transition properties
- var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
- var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
- var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
- var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
- var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
- var animationTimeout = getTimeout(animationDelays, animationDurations);
- var type;
- var timeout = 0;
- var propCount = 0;
- /* istanbul ignore if */
- if (expectedType === TRANSITION) {
- if (transitionTimeout > 0) {
- type = TRANSITION;
- timeout = transitionTimeout;
- propCount = transitionDurations.length;
- }
- } else if (expectedType === ANIMATION) {
- if (animationTimeout > 0) {
- type = ANIMATION;
- timeout = animationTimeout;
- propCount = animationDurations.length;
- }
- } else {
- timeout = Math.max(transitionTimeout, animationTimeout);
- type = timeout > 0
- ? transitionTimeout > animationTimeout
- ? TRANSITION
- : ANIMATION
- : null;
- propCount = type
- ? type === TRANSITION
- ? transitionDurations.length
- : animationDurations.length
- : 0;
- }
- var hasTransform =
- type === TRANSITION &&
- transformRE.test(styles[transitionProp + 'Property']);
- return {
- type: type,
- timeout: timeout,
- propCount: propCount,
- hasTransform: hasTransform
- }
- }
- function getTimeout (delays, durations) {
- /* istanbul ignore next */
- while (delays.length < durations.length) {
- delays = delays.concat(delays);
- }
- return Math.max.apply(null, durations.map(function (d, i) {
- return toMs(d) + toMs(delays[i])
- }))
- }
- // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
- // in a locale-dependent way, using a comma instead of a dot.
- // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
- // as a floor function) causing unexpected behaviors
- function toMs (s) {
- return Number(s.slice(0, -1).replace(',', '.')) * 1000
- }
- /* */
- function enter (vnode, toggleDisplay) {
- var el = vnode.elm;
- // call leave callback now
- if (isDef(el._leaveCb)) {
- el._leaveCb.cancelled = true;
- el._leaveCb();
- }
- var data = resolveTransition(vnode.data.transition);
- if (isUndef(data)) {
- return
- }
- /* istanbul ignore if */
- if (isDef(el._enterCb) || el.nodeType !== 1) {
- return
- }
- var css = data.css;
- var type = data.type;
- var enterClass = data.enterClass;
- var enterToClass = data.enterToClass;
- var enterActiveClass = data.enterActiveClass;
- var appearClass = data.appearClass;
- var appearToClass = data.appearToClass;
- var appearActiveClass = data.appearActiveClass;
- var beforeEnter = data.beforeEnter;
- var enter = data.enter;
- var afterEnter = data.afterEnter;
- var enterCancelled = data.enterCancelled;
- var beforeAppear = data.beforeAppear;
- var appear = data.appear;
- var afterAppear = data.afterAppear;
- var appearCancelled = data.appearCancelled;
- var duration = data.duration;
- // activeInstance will always be the <transition> component managing this
- // transition. One edge case to check is when the <transition> is placed
- // as the root node of a child component. In that case we need to check
- // <transition>'s parent for appear check.
- var context = activeInstance;
- var transitionNode = activeInstance.$vnode;
- while (transitionNode && transitionNode.parent) {
- context = transitionNode.context;
- transitionNode = transitionNode.parent;
- }
- var isAppear = !context._isMounted || !vnode.isRootInsert;
- if (isAppear && !appear && appear !== '') {
- return
- }
- var startClass = isAppear && appearClass
- ? appearClass
- : enterClass;
- var activeClass = isAppear && appearActiveClass
- ? appearActiveClass
- : enterActiveClass;
- var toClass = isAppear && appearToClass
- ? appearToClass
- : enterToClass;
- var beforeEnterHook = isAppear
- ? (beforeAppear || beforeEnter)
- : beforeEnter;
- var enterHook = isAppear
- ? (typeof appear === 'function' ? appear : enter)
- : enter;
- var afterEnterHook = isAppear
- ? (afterAppear || afterEnter)
- : afterEnter;
- var enterCancelledHook = isAppear
- ? (appearCancelled || enterCancelled)
- : enterCancelled;
- var explicitEnterDuration = toNumber(
- isObject(duration)
- ? duration.enter
- : duration
- );
- if (explicitEnterDuration != null) {
- checkDuration(explicitEnterDuration, 'enter', vnode);
- }
- var expectsCSS = css !== false && !isIE9;
- var userWantsControl = getHookArgumentsLength(enterHook);
- var cb = el._enterCb = once(function () {
- if (expectsCSS) {
- removeTransitionClass(el, toClass);
- removeTransitionClass(el, activeClass);
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, startClass);
- }
- enterCancelledHook && enterCancelledHook(el);
- } else {
- afterEnterHook && afterEnterHook(el);
- }
- el._enterCb = null;
- });
- if (!vnode.data.show) {
- // remove pending leave element on enter by injecting an insert hook
- mergeVNodeHook(vnode, 'insert', function () {
- var parent = el.parentNode;
- var pendingNode = parent && parent._pending && parent._pending[vnode.key];
- if (pendingNode &&
- pendingNode.tag === vnode.tag &&
- pendingNode.elm._leaveCb
- ) {
- pendingNode.elm._leaveCb();
- }
- enterHook && enterHook(el, cb);
- });
- }
- // start enter transition
- beforeEnterHook && beforeEnterHook(el);
- if (expectsCSS) {
- addTransitionClass(el, startClass);
- addTransitionClass(el, activeClass);
- nextFrame(function () {
- removeTransitionClass(el, startClass);
- if (!cb.cancelled) {
- addTransitionClass(el, toClass);
- if (!userWantsControl) {
- if (isValidDuration(explicitEnterDuration)) {
- setTimeout(cb, explicitEnterDuration);
- } else {
- whenTransitionEnds(el, type, cb);
- }
- }
- }
- });
- }
- if (vnode.data.show) {
- toggleDisplay && toggleDisplay();
- enterHook && enterHook(el, cb);
- }
- if (!expectsCSS && !userWantsControl) {
- cb();
- }
- }
- function leave (vnode, rm) {
- var el = vnode.elm;
- // call enter callback now
- if (isDef(el._enterCb)) {
- el._enterCb.cancelled = true;
- el._enterCb();
- }
- var data = resolveTransition(vnode.data.transition);
- if (isUndef(data) || el.nodeType !== 1) {
- return rm()
- }
- /* istanbul ignore if */
- if (isDef(el._leaveCb)) {
- return
- }
- var css = data.css;
- var type = data.type;
- var leaveClass = data.leaveClass;
- var leaveToClass = data.leaveToClass;
- var leaveActiveClass = data.leaveActiveClass;
- var beforeLeave = data.beforeLeave;
- var leave = data.leave;
- var afterLeave = data.afterLeave;
- var leaveCancelled = data.leaveCancelled;
- var delayLeave = data.delayLeave;
- var duration = data.duration;
- var expectsCSS = css !== false && !isIE9;
- var userWantsControl = getHookArgumentsLength(leave);
- var explicitLeaveDuration = toNumber(
- isObject(duration)
- ? duration.leave
- : duration
- );
- if (isDef(explicitLeaveDuration)) {
- checkDuration(explicitLeaveDuration, 'leave', vnode);
- }
- var cb = el._leaveCb = once(function () {
- if (el.parentNode && el.parentNode._pending) {
- el.parentNode._pending[vnode.key] = null;
- }
- if (expectsCSS) {
- removeTransitionClass(el, leaveToClass);
- removeTransitionClass(el, leaveActiveClass);
- }
- if (cb.cancelled) {
- if (expectsCSS) {
- removeTransitionClass(el, leaveClass);
- }
- leaveCancelled && leaveCancelled(el);
- } else {
- rm();
- afterLeave && afterLeave(el);
- }
- el._leaveCb = null;
- });
- if (delayLeave) {
- delayLeave(performLeave);
- } else {
- performLeave();
- }
- function performLeave () {
- // the delayed leave may have already been cancelled
- if (cb.cancelled) {
- return
- }
- // record leaving element
- if (!vnode.data.show && el.parentNode) {
- (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
- }
- beforeLeave && beforeLeave(el);
- if (expectsCSS) {
- addTransitionClass(el, leaveClass);
- addTransitionClass(el, leaveActiveClass);
- nextFrame(function () {
- removeTransitionClass(el, leaveClass);
- if (!cb.cancelled) {
- addTransitionClass(el, leaveToClass);
- if (!userWantsControl) {
- if (isValidDuration(explicitLeaveDuration)) {
- setTimeout(cb, explicitLeaveDuration);
- } else {
- whenTransitionEnds(el, type, cb);
- }
- }
- }
- });
- }
- leave && leave(el, cb);
- if (!expectsCSS && !userWantsControl) {
- cb();
- }
- }
- }
- // only used in dev mode
- function checkDuration (val, name, vnode) {
- if (typeof val !== 'number') {
- warn(
- "<transition> explicit " + name + " duration is not a valid number - " +
- "got " + (JSON.stringify(val)) + ".",
- vnode.context
- );
- } else if (isNaN(val)) {
- warn(
- "<transition> explicit " + name + " duration is NaN - " +
- 'the duration expression might be incorrect.',
- vnode.context
- );
- }
- }
- function isValidDuration (val) {
- return typeof val === 'number' && !isNaN(val)
- }
- /**
- * Normalize a transition hook's argument length. The hook may be:
- * - a merged hook (invoker) with the original in .fns
- * - a wrapped component method (check ._length)
- * - a plain function (.length)
- */
- function getHookArgumentsLength (fn) {
- if (isUndef(fn)) {
- return false
- }
- var invokerFns = fn.fns;
- if (isDef(invokerFns)) {
- // invoker
- return getHookArgumentsLength(
- Array.isArray(invokerFns)
- ? invokerFns[0]
- : invokerFns
- )
- } else {
- return (fn._length || fn.length) > 1
- }
- }
- function _enter (_, vnode) {
- if (vnode.data.show !== true) {
- enter(vnode);
- }
- }
- var transition = inBrowser ? {
- create: _enter,
- activate: _enter,
- remove: function remove$$1 (vnode, rm) {
- /* istanbul ignore else */
- if (vnode.data.show !== true) {
- leave(vnode, rm);
- } else {
- rm();
- }
- }
- } : {};
- var platformModules = [
- attrs,
- klass,
- events,
- domProps,
- style,
- transition
- ];
- /* */
- // the directive module should be applied last, after all
- // built-in modules have been applied.
- var modules = platformModules.concat(baseModules);
- var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
- /**
- * Not type checking this file because flow doesn't like attaching
- * properties to Elements.
- */
- /* istanbul ignore if */
- if (isIE9) {
- // http://www.matts411.com/post/internet-explorer-9-oninput/
- document.addEventListener('selectionchange', function () {
- var el = document.activeElement;
- if (el && el.vmodel) {
- trigger(el, 'input');
- }
- });
- }
- var directive = {
- inserted: function inserted (el, binding, vnode, oldVnode) {
- if (vnode.tag === 'select') {
- // #6903
- if (oldVnode.elm && !oldVnode.elm._vOptions) {
- mergeVNodeHook(vnode, 'postpatch', function () {
- directive.componentUpdated(el, binding, vnode);
- });
- } else {
- setSelected(el, binding, vnode.context);
- }
- el._vOptions = [].map.call(el.options, getValue);
- } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
- el._vModifiers = binding.modifiers;
- if (!binding.modifiers.lazy) {
- el.addEventListener('compositionstart', onCompositionStart);
- el.addEventListener('compositionend', onCompositionEnd);
- // Safari < 10.2 & UIWebView doesn't fire compositionend when
- // switching focus before confirming composition choice
- // this also fixes the issue where some browsers e.g. iOS Chrome
- // fires "change" instead of "input" on autocomplete.
- el.addEventListener('change', onCompositionEnd);
- /* istanbul ignore if */
- if (isIE9) {
- el.vmodel = true;
- }
- }
- }
- },
- componentUpdated: function componentUpdated (el, binding, vnode) {
- if (vnode.tag === 'select') {
- setSelected(el, binding, vnode.context);
- // in case the options rendered by v-for have changed,
- // it's possible that the value is out-of-sync with the rendered options.
- // detect such cases and filter out values that no longer has a matching
- // option in the DOM.
- var prevOptions = el._vOptions;
- var curOptions = el._vOptions = [].map.call(el.options, getValue);
- if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
- // trigger change event if
- // no matching option found for at least one value
- var needReset = el.multiple
- ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
- : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
- if (needReset) {
- trigger(el, 'change');
- }
- }
- }
- }
- };
- function setSelected (el, binding, vm) {
- actuallySetSelected(el, binding, vm);
- /* istanbul ignore if */
- if (isIE || isEdge) {
- setTimeout(function () {
- actuallySetSelected(el, binding, vm);
- }, 0);
- }
- }
- function actuallySetSelected (el, binding, vm) {
- var value = binding.value;
- var isMultiple = el.multiple;
- if (isMultiple && !Array.isArray(value)) {
- warn(
- "<select multiple v-model=\"" + (binding.expression) + "\"> " +
- "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
- vm
- );
- return
- }
- var selected, option;
- for (var i = 0, l = el.options.length; i < l; i++) {
- option = el.options[i];
- if (isMultiple) {
- selected = looseIndexOf(value, getValue(option)) > -1;
- if (option.selected !== selected) {
- option.selected = selected;
- }
- } else {
- if (looseEqual(getValue(option), value)) {
- if (el.selectedIndex !== i) {
- el.selectedIndex = i;
- }
- return
- }
- }
- }
- if (!isMultiple) {
- el.selectedIndex = -1;
- }
- }
- function hasNoMatchingOption (value, options) {
- return options.every(function (o) { return !looseEqual(o, value); })
- }
- function getValue (option) {
- return '_value' in option
- ? option._value
- : option.value
- }
- function onCompositionStart (e) {
- e.target.composing = true;
- }
- function onCompositionEnd (e) {
- // prevent triggering an input event for no reason
- if (!e.target.composing) { return }
- e.target.composing = false;
- trigger(e.target, 'input');
- }
- function trigger (el, type) {
- var e = document.createEvent('HTMLEvents');
- e.initEvent(type, true, true);
- el.dispatchEvent(e);
- }
- /* */
- // recursively search for possible transition defined inside the component root
- function locateNode (vnode) {
- return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
- ? locateNode(vnode.componentInstance._vnode)
- : vnode
- }
- var show = {
- bind: function bind (el, ref, vnode) {
- var value = ref.value;
- vnode = locateNode(vnode);
- var transition$$1 = vnode.data && vnode.data.transition;
- var originalDisplay = el.__vOriginalDisplay =
- el.style.display === 'none' ? '' : el.style.display;
- if (value && transition$$1) {
- vnode.data.show = true;
- enter(vnode, function () {
- el.style.display = originalDisplay;
- });
- } else {
- el.style.display = value ? originalDisplay : 'none';
- }
- },
- update: function update (el, ref, vnode) {
- var value = ref.value;
- var oldValue = ref.oldValue;
- /* istanbul ignore if */
- if (!value === !oldValue) { return }
- vnode = locateNode(vnode);
- var transition$$1 = vnode.data && vnode.data.transition;
- if (transition$$1) {
- vnode.data.show = true;
- if (value) {
- enter(vnode, function () {
- el.style.display = el.__vOriginalDisplay;
- });
- } else {
- leave(vnode, function () {
- el.style.display = 'none';
- });
- }
- } else {
- el.style.display = value ? el.__vOriginalDisplay : 'none';
- }
- },
- unbind: function unbind (
- el,
- binding,
- vnode,
- oldVnode,
- isDestroy
- ) {
- if (!isDestroy) {
- el.style.display = el.__vOriginalDisplay;
- }
- }
- };
- var platformDirectives = {
- model: directive,
- show: show
- };
- /* */
- var transitionProps = {
- name: String,
- appear: Boolean,
- css: Boolean,
- mode: String,
- type: String,
- enterClass: String,
- leaveClass: String,
- enterToClass: String,
- leaveToClass: String,
- enterActiveClass: String,
- leaveActiveClass: String,
- appearClass: String,
- appearActiveClass: String,
- appearToClass: String,
- duration: [Number, String, Object]
- };
- // in case the child is also an abstract component, e.g. <keep-alive>
- // we want to recursively retrieve the real component to be rendered
- function getRealChild (vnode) {
- var compOptions = vnode && vnode.componentOptions;
- if (compOptions && compOptions.Ctor.options.abstract) {
- return getRealChild(getFirstComponentChild(compOptions.children))
- } else {
- return vnode
- }
- }
- function extractTransitionData (comp) {
- var data = {};
- var options = comp.$options;
- // props
- for (var key in options.propsData) {
- data[key] = comp[key];
- }
- // events.
- // extract listeners and pass them directly to the transition methods
- var listeners = options._parentListeners;
- for (var key$1 in listeners) {
- data[camelize(key$1)] = listeners[key$1];
- }
- return data
- }
- function placeholder (h, rawChild) {
- if (/\d-keep-alive$/.test(rawChild.tag)) {
- return h('keep-alive', {
- props: rawChild.componentOptions.propsData
- })
- }
- }
- function hasParentTransition (vnode) {
- while ((vnode = vnode.parent)) {
- if (vnode.data.transition) {
- return true
- }
- }
- }
- function isSameChild (child, oldChild) {
- return oldChild.key === child.key && oldChild.tag === child.tag
- }
- var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
- var isVShowDirective = function (d) { return d.name === 'show'; };
- var Transition = {
- name: 'transition',
- props: transitionProps,
- abstract: true,
- render: function render (h) {
- var this$1 = this;
- var children = this.$slots.default;
- if (!children) {
- return
- }
- // filter out text nodes (possible whitespaces)
- children = children.filter(isNotTextNode);
- /* istanbul ignore if */
- if (!children.length) {
- return
- }
- // warn multiple elements
- if (children.length > 1) {
- warn(
- '<transition> can only be used on a single element. Use ' +
- '<transition-group> for lists.',
- this.$parent
- );
- }
- var mode = this.mode;
- // warn invalid mode
- if (mode && mode !== 'in-out' && mode !== 'out-in'
- ) {
- warn(
- 'invalid <transition> mode: ' + mode,
- this.$parent
- );
- }
- var rawChild = children[0];
- // if this is a component root node and the component's
- // parent container node also has transition, skip.
- if (hasParentTransition(this.$vnode)) {
- return rawChild
- }
- // apply transition data to child
- // use getRealChild() to ignore abstract components e.g. keep-alive
- var child = getRealChild(rawChild);
- /* istanbul ignore if */
- if (!child) {
- return rawChild
- }
- if (this._leaving) {
- return placeholder(h, rawChild)
- }
- // ensure a key that is unique to the vnode type and to this transition
- // component instance. This key will be used to remove pending leaving nodes
- // during entering.
- var id = "__transition-" + (this._uid) + "-";
- child.key = child.key == null
- ? child.isComment
- ? id + 'comment'
- : id + child.tag
- : isPrimitive(child.key)
- ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
- : child.key;
- var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
- var oldRawChild = this._vnode;
- var oldChild = getRealChild(oldRawChild);
- // mark v-show
- // so that the transition module can hand over the control to the directive
- if (child.data.directives && child.data.directives.some(isVShowDirective)) {
- child.data.show = true;
- }
- if (
- oldChild &&
- oldChild.data &&
- !isSameChild(child, oldChild) &&
- !isAsyncPlaceholder(oldChild) &&
- // #6687 component root is a comment node
- !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
- ) {
- // replace old child transition data with fresh one
- // important for dynamic transitions!
- var oldData = oldChild.data.transition = extend({}, data);
- // handle transition mode
- if (mode === 'out-in') {
- // return placeholder node and queue update when leave finishes
- this._leaving = true;
- mergeVNodeHook(oldData, 'afterLeave', function () {
- this$1._leaving = false;
- this$1.$forceUpdate();
- });
- return placeholder(h, rawChild)
- } else if (mode === 'in-out') {
- if (isAsyncPlaceholder(child)) {
- return oldRawChild
- }
- var delayedLeave;
- var performLeave = function () { delayedLeave(); };
- mergeVNodeHook(data, 'afterEnter', performLeave);
- mergeVNodeHook(data, 'enterCancelled', performLeave);
- mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
- }
- }
- return rawChild
- }
- };
- /* */
- var props = extend({
- tag: String,
- moveClass: String
- }, transitionProps);
- delete props.mode;
- var TransitionGroup = {
- props: props,
- beforeMount: function beforeMount () {
- var this$1 = this;
- var update = this._update;
- this._update = function (vnode, hydrating) {
- var restoreActiveInstance = setActiveInstance(this$1);
- // force removing pass
- this$1.__patch__(
- this$1._vnode,
- this$1.kept,
- false, // hydrating
- true // removeOnly (!important, avoids unnecessary moves)
- );
- this$1._vnode = this$1.kept;
- restoreActiveInstance();
- update.call(this$1, vnode, hydrating);
- };
- },
- render: function render (h) {
- var tag = this.tag || this.$vnode.data.tag || 'span';
- var map = Object.create(null);
- var prevChildren = this.prevChildren = this.children;
- var rawChildren = this.$slots.default || [];
- var children = this.children = [];
- var transitionData = extractTransitionData(this);
- for (var i = 0; i < rawChildren.length; i++) {
- var c = rawChildren[i];
- if (c.tag) {
- if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
- children.push(c);
- map[c.key] = c
- ;(c.data || (c.data = {})).transition = transitionData;
- } else {
- var opts = c.componentOptions;
- var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
- warn(("<transition-group> children must be keyed: <" + name + ">"));
- }
- }
- }
- if (prevChildren) {
- var kept = [];
- var removed = [];
- for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
- var c$1 = prevChildren[i$1];
- c$1.data.transition = transitionData;
- c$1.data.pos = c$1.elm.getBoundingClientRect();
- if (map[c$1.key]) {
- kept.push(c$1);
- } else {
- removed.push(c$1);
- }
- }
- this.kept = h(tag, null, kept);
- this.removed = removed;
- }
- return h(tag, null, children)
- },
- updated: function updated () {
- var children = this.prevChildren;
- var moveClass = this.moveClass || ((this.name || 'v') + '-move');
- if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
- return
- }
- // we divide the work into three loops to avoid mixing DOM reads and writes
- // in each iteration - which helps prevent layout thrashing.
- children.forEach(callPendingCbs);
- children.forEach(recordPosition);
- children.forEach(applyTranslation);
- // force reflow to put everything in position
- // assign to this to avoid being removed in tree-shaking
- // $flow-disable-line
- this._reflow = document.body.offsetHeight;
- children.forEach(function (c) {
- if (c.data.moved) {
- var el = c.elm;
- var s = el.style;
- addTransitionClass(el, moveClass);
- s.transform = s.WebkitTransform = s.transitionDuration = '';
- el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
- if (e && e.target !== el) {
- return
- }
- if (!e || /transform$/.test(e.propertyName)) {
- el.removeEventListener(transitionEndEvent, cb);
- el._moveCb = null;
- removeTransitionClass(el, moveClass);
- }
- });
- }
- });
- },
- methods: {
- hasMove: function hasMove (el, moveClass) {
- /* istanbul ignore if */
- if (!hasTransition) {
- return false
- }
- /* istanbul ignore if */
- if (this._hasMove) {
- return this._hasMove
- }
- // Detect whether an element with the move class applied has
- // CSS transitions. Since the element may be inside an entering
- // transition at this very moment, we make a clone of it and remove
- // all other transition classes applied to ensure only the move class
- // is applied.
- var clone = el.cloneNode();
- if (el._transitionClasses) {
- el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
- }
- addClass(clone, moveClass);
- clone.style.display = 'none';
- this.$el.appendChild(clone);
- var info = getTransitionInfo(clone);
- this.$el.removeChild(clone);
- return (this._hasMove = info.hasTransform)
- }
- }
- };
- function callPendingCbs (c) {
- /* istanbul ignore if */
- if (c.elm._moveCb) {
- c.elm._moveCb();
- }
- /* istanbul ignore if */
- if (c.elm._enterCb) {
- c.elm._enterCb();
- }
- }
- function recordPosition (c) {
- c.data.newPos = c.elm.getBoundingClientRect();
- }
- function applyTranslation (c) {
- var oldPos = c.data.pos;
- var newPos = c.data.newPos;
- var dx = oldPos.left - newPos.left;
- var dy = oldPos.top - newPos.top;
- if (dx || dy) {
- c.data.moved = true;
- var s = c.elm.style;
- s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
- s.transitionDuration = '0s';
- }
- }
- var platformComponents = {
- Transition: Transition,
- TransitionGroup: TransitionGroup
- };
- /* */
- // install platform specific utils
- Vue.config.mustUseProp = mustUseProp;
- Vue.config.isReservedTag = isReservedTag;
- Vue.config.isReservedAttr = isReservedAttr;
- Vue.config.getTagNamespace = getTagNamespace;
- Vue.config.isUnknownElement = isUnknownElement;
- // install platform runtime directives & components
- extend(Vue.options.directives, platformDirectives);
- extend(Vue.options.components, platformComponents);
- // install platform patch function
- Vue.prototype.__patch__ = inBrowser ? patch : noop;
- // public mount method
- Vue.prototype.$mount = function (
- el,
- hydrating
- ) {
- el = el && inBrowser ? query(el) : undefined;
- return mountComponent(this, el, hydrating)
- };
- // devtools global hook
- /* istanbul ignore next */
- if (inBrowser) {
- setTimeout(function () {
- if (config.devtools) {
- if (devtools) {
- devtools.emit('init', Vue);
- } else {
- console[console.info ? 'info' : 'log'](
- 'Download the Vue Devtools extension for a better development experience:\n' +
- 'https://github.com/vuejs/vue-devtools'
- );
- }
- }
- if (config.productionTip !== false &&
- typeof console !== 'undefined'
- ) {
- console[console.info ? 'info' : 'log'](
- "You are running Vue in development mode.\n" +
- "Make sure to turn on production mode when deploying for production.\n" +
- "See more tips at https://vuejs.org/guide/deployment.html"
- );
- }
- }, 0);
- }
- /* */
- var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
- var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
- var buildRegex = cached(function (delimiters) {
- var open = delimiters[0].replace(regexEscapeRE, '\\$&');
- var close = delimiters[1].replace(regexEscapeRE, '\\$&');
- return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
- });
- function parseText (
- text,
- delimiters
- ) {
- var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
- if (!tagRE.test(text)) {
- return
- }
- var tokens = [];
- var rawTokens = [];
- var lastIndex = tagRE.lastIndex = 0;
- var match, index, tokenValue;
- while ((match = tagRE.exec(text))) {
- index = match.index;
- // push text token
- if (index > lastIndex) {
- rawTokens.push(tokenValue = text.slice(lastIndex, index));
- tokens.push(JSON.stringify(tokenValue));
- }
- // tag token
- var exp = parseFilters(match[1].trim());
- tokens.push(("_s(" + exp + ")"));
- rawTokens.push({ '@binding': exp });
- lastIndex = index + match[0].length;
- }
- if (lastIndex < text.length) {
- rawTokens.push(tokenValue = text.slice(lastIndex));
- tokens.push(JSON.stringify(tokenValue));
- }
- return {
- expression: tokens.join('+'),
- tokens: rawTokens
- }
- }
- /* */
- function transformNode (el, options) {
- var warn = options.warn || baseWarn;
- var staticClass = getAndRemoveAttr(el, 'class');
- if (staticClass) {
- var res = parseText(staticClass, options.delimiters);
- if (res) {
- warn(
- "class=\"" + staticClass + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div class="{{ val }}">, use <div :class="val">.',
- el.rawAttrsMap['class']
- );
- }
- }
- if (staticClass) {
- el.staticClass = JSON.stringify(staticClass);
- }
- var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
- if (classBinding) {
- el.classBinding = classBinding;
- }
- }
- function genData (el) {
- var data = '';
- if (el.staticClass) {
- data += "staticClass:" + (el.staticClass) + ",";
- }
- if (el.classBinding) {
- data += "class:" + (el.classBinding) + ",";
- }
- return data
- }
- var klass$1 = {
- staticKeys: ['staticClass'],
- transformNode: transformNode,
- genData: genData
- };
- /* */
- function transformNode$1 (el, options) {
- var warn = options.warn || baseWarn;
- var staticStyle = getAndRemoveAttr(el, 'style');
- if (staticStyle) {
- /* istanbul ignore if */
- {
- var res = parseText(staticStyle, options.delimiters);
- if (res) {
- warn(
- "style=\"" + staticStyle + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div style="{{ val }}">, use <div :style="val">.',
- el.rawAttrsMap['style']
- );
- }
- }
- el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
- }
- var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
- if (styleBinding) {
- el.styleBinding = styleBinding;
- }
- }
- function genData$1 (el) {
- var data = '';
- if (el.staticStyle) {
- data += "staticStyle:" + (el.staticStyle) + ",";
- }
- if (el.styleBinding) {
- data += "style:(" + (el.styleBinding) + "),";
- }
- return data
- }
- var style$1 = {
- staticKeys: ['staticStyle'],
- transformNode: transformNode$1,
- genData: genData$1
- };
- /* */
- var decoder;
- var he = {
- decode: function decode (html) {
- decoder = decoder || document.createElement('div');
- decoder.innerHTML = html;
- return decoder.textContent
- }
- };
- /* */
- var isUnaryTag = makeMap(
- 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
- 'link,meta,param,source,track,wbr'
- );
- // Elements that you can, intentionally, leave open
- // (and which close themselves)
- var canBeLeftOpenTag = makeMap(
- 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
- );
- // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
- // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
- var isNonPhrasingTag = makeMap(
- 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
- 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
- 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
- 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
- 'title,tr,track'
- );
- /**
- * Not type-checking this file because it's mostly vendor code.
- */
- // Regular Expressions for parsing tags and attributes
- var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
- var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
- var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
- var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
- var startTagOpen = new RegExp(("^<" + qnameCapture));
- var startTagClose = /^\s*(\/?)>/;
- var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
- var doctype = /^<!DOCTYPE [^>]+>/i;
- // #7298: escape - to avoid being passed as HTML comment when inlined in page
- var comment = /^<!\--/;
- var conditionalComment = /^<!\[/;
- // Special Elements (can contain anything)
- var isPlainTextElement = makeMap('script,style,textarea', true);
- var reCache = {};
- var decodingMap = {
- '<': '<',
- '>': '>',
- '"': '"',
- '&': '&',
- ' ': '\n',
- '	': '\t',
- ''': "'"
- };
- var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
- var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
- // #5992
- var isIgnoreNewlineTag = makeMap('pre,textarea', true);
- var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
- function decodeAttr (value, shouldDecodeNewlines) {
- var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
- return value.replace(re, function (match) { return decodingMap[match]; })
- }
- function parseHTML (html, options) {
- var stack = [];
- var expectHTML = options.expectHTML;
- var isUnaryTag$$1 = options.isUnaryTag || no;
- var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
- var index = 0;
- var last, lastTag;
- while (html) {
- last = html;
- // Make sure we're not in a plaintext content element like script/style
- if (!lastTag || !isPlainTextElement(lastTag)) {
- var textEnd = html.indexOf('<');
- if (textEnd === 0) {
- // Comment:
- if (comment.test(html)) {
- var commentEnd = html.indexOf('-->');
- if (commentEnd >= 0) {
- if (options.shouldKeepComment) {
- options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
- }
- advance(commentEnd + 3);
- continue
- }
- }
- // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
- if (conditionalComment.test(html)) {
- var conditionalEnd = html.indexOf(']>');
- if (conditionalEnd >= 0) {
- advance(conditionalEnd + 2);
- continue
- }
- }
- // Doctype:
- var doctypeMatch = html.match(doctype);
- if (doctypeMatch) {
- advance(doctypeMatch[0].length);
- continue
- }
- // End tag:
- var endTagMatch = html.match(endTag);
- if (endTagMatch) {
- var curIndex = index;
- advance(endTagMatch[0].length);
- parseEndTag(endTagMatch[1], curIndex, index);
- continue
- }
- // Start tag:
- var startTagMatch = parseStartTag();
- if (startTagMatch) {
- handleStartTag(startTagMatch);
- if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
- advance(1);
- }
- continue
- }
- }
- var text = (void 0), rest = (void 0), next = (void 0);
- if (textEnd >= 0) {
- rest = html.slice(textEnd);
- while (
- !endTag.test(rest) &&
- !startTagOpen.test(rest) &&
- !comment.test(rest) &&
- !conditionalComment.test(rest)
- ) {
- // < in plain text, be forgiving and treat it as text
- next = rest.indexOf('<', 1);
- if (next < 0) { break }
- textEnd += next;
- rest = html.slice(textEnd);
- }
- text = html.substring(0, textEnd);
- }
- if (textEnd < 0) {
- text = html;
- }
- if (text) {
- advance(text.length);
- }
- if (options.chars && text) {
- options.chars(text, index - text.length, index);
- }
- } else {
- var endTagLength = 0;
- var stackedTag = lastTag.toLowerCase();
- var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
- var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
- endTagLength = endTag.length;
- if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
- text = text
- .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
- .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
- }
- if (shouldIgnoreFirstNewline(stackedTag, text)) {
- text = text.slice(1);
- }
- if (options.chars) {
- options.chars(text);
- }
- return ''
- });
- index += html.length - rest$1.length;
- html = rest$1;
- parseEndTag(stackedTag, index - endTagLength, index);
- }
- if (html === last) {
- options.chars && options.chars(html);
- if (!stack.length && options.warn) {
- options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
- }
- break
- }
- }
- // Clean up any remaining tags
- parseEndTag();
- function advance (n) {
- index += n;
- html = html.substring(n);
- }
- function parseStartTag () {
- var start = html.match(startTagOpen);
- if (start) {
- var match = {
- tagName: start[1],
- attrs: [],
- start: index
- };
- advance(start[0].length);
- var end, attr;
- while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
- attr.start = index;
- advance(attr[0].length);
- attr.end = index;
- match.attrs.push(attr);
- }
- if (end) {
- match.unarySlash = end[1];
- advance(end[0].length);
- match.end = index;
- return match
- }
- }
- }
- function handleStartTag (match) {
- var tagName = match.tagName;
- var unarySlash = match.unarySlash;
- if (expectHTML) {
- if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
- parseEndTag(lastTag);
- }
- if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
- parseEndTag(tagName);
- }
- }
- var unary = isUnaryTag$$1(tagName) || !!unarySlash;
- var l = match.attrs.length;
- var attrs = new Array(l);
- for (var i = 0; i < l; i++) {
- var args = match.attrs[i];
- var value = args[3] || args[4] || args[5] || '';
- var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
- ? options.shouldDecodeNewlinesForHref
- : options.shouldDecodeNewlines;
- attrs[i] = {
- name: args[1],
- value: decodeAttr(value, shouldDecodeNewlines)
- };
- if (options.outputSourceRange) {
- attrs[i].start = args.start + args[0].match(/^\s*/).length;
- attrs[i].end = args.end;
- }
- }
- if (!unary) {
- stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
- lastTag = tagName;
- }
- if (options.start) {
- options.start(tagName, attrs, unary, match.start, match.end);
- }
- }
- function parseEndTag (tagName, start, end) {
- var pos, lowerCasedTagName;
- if (start == null) { start = index; }
- if (end == null) { end = index; }
- // Find the closest opened tag of the same type
- if (tagName) {
- lowerCasedTagName = tagName.toLowerCase();
- for (pos = stack.length - 1; pos >= 0; pos--) {
- if (stack[pos].lowerCasedTag === lowerCasedTagName) {
- break
- }
- }
- } else {
- // If no tag name is provided, clean shop
- pos = 0;
- }
- if (pos >= 0) {
- // Close all the open elements, up the stack
- for (var i = stack.length - 1; i >= pos; i--) {
- if (i > pos || !tagName &&
- options.warn
- ) {
- options.warn(
- ("tag <" + (stack[i].tag) + "> has no matching end tag."),
- { start: stack[i].start, end: stack[i].end }
- );
- }
- if (options.end) {
- options.end(stack[i].tag, start, end);
- }
- }
- // Remove the open elements from the stack
- stack.length = pos;
- lastTag = pos && stack[pos - 1].tag;
- } else if (lowerCasedTagName === 'br') {
- if (options.start) {
- options.start(tagName, [], true, start, end);
- }
- } else if (lowerCasedTagName === 'p') {
- if (options.start) {
- options.start(tagName, [], false, start, end);
- }
- if (options.end) {
- options.end(tagName, start, end);
- }
- }
- }
- }
- /* */
- var onRE = /^@|^v-on:/;
- var dirRE = /^v-|^@|^:|^#/;
- var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- var stripParensRE = /^\(|\)$/g;
- var dynamicArgRE = /^\[.*\]$/;
- var argRE = /:(.*)$/;
- var bindRE = /^:|^\.|^v-bind:/;
- var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
- var slotRE = /^v-slot(:|$)|^#/;
- var lineBreakRE = /[\r\n]/;
- var whitespaceRE$1 = /[ \f\t\r\n]+/g;
- var invalidAttributeRE = /[\s"'<>\/=]/;
- var decodeHTMLCached = cached(he.decode);
- var emptySlotScopeToken = "_empty_";
- // configurable state
- var warn$2;
- var delimiters;
- var transforms;
- var preTransforms;
- var postTransforms;
- var platformIsPreTag;
- var platformMustUseProp;
- var platformGetTagNamespace;
- var maybeComponent;
- function createASTElement (
- tag,
- attrs,
- parent
- ) {
- return {
- type: 1,
- tag: tag,
- attrsList: attrs,
- attrsMap: makeAttrsMap(attrs),
- rawAttrsMap: {},
- parent: parent,
- children: []
- }
- }
- /**
- * Convert HTML string to AST.
- */
- function parse (
- template,
- options
- ) {
- warn$2 = options.warn || baseWarn;
- platformIsPreTag = options.isPreTag || no;
- platformMustUseProp = options.mustUseProp || no;
- platformGetTagNamespace = options.getTagNamespace || no;
- var isReservedTag = options.isReservedTag || no;
- maybeComponent = function (el) { return !!(
- el.component ||
- el.attrsMap[':is'] ||
- el.attrsMap['v-bind:is'] ||
- !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
- ); };
- transforms = pluckModuleFunction(options.modules, 'transformNode');
- preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
- postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
- delimiters = options.delimiters;
- var stack = [];
- var preserveWhitespace = options.preserveWhitespace !== false;
- var whitespaceOption = options.whitespace;
- var root;
- var currentParent;
- var inVPre = false;
- var inPre = false;
- var warned = false;
- function warnOnce (msg, range) {
- if (!warned) {
- warned = true;
- warn$2(msg, range);
- }
- }
- function closeElement (element) {
- trimEndingWhitespace(element);
- if (!inVPre && !element.processed) {
- element = processElement(element, options);
- }
- // tree management
- if (!stack.length && element !== root) {
- // allow root elements with v-if, v-else-if and v-else
- if (root.if && (element.elseif || element.else)) {
- {
- checkRootConstraints(element);
- }
- addIfCondition(root, {
- exp: element.elseif,
- block: element
- });
- } else {
- warnOnce(
- "Component template should contain exactly one root element. " +
- "If you are using v-if on multiple elements, " +
- "use v-else-if to chain them instead.",
- { start: element.start }
- );
- }
- }
- if (currentParent && !element.forbidden) {
- if (element.elseif || element.else) {
- processIfConditions(element, currentParent);
- } else {
- if (element.slotScope) {
- // scoped slot
- // keep it in the children list so that v-else(-if) conditions can
- // find it as the prev node.
- var name = element.slotTarget || '"default"'
- ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
- }
- currentParent.children.push(element);
- element.parent = currentParent;
- }
- }
- // final children cleanup
- // filter out scoped slots
- element.children = element.children.filter(function (c) { return !(c).slotScope; });
- // remove trailing whitespace node again
- trimEndingWhitespace(element);
- // check pre state
- if (element.pre) {
- inVPre = false;
- }
- if (platformIsPreTag(element.tag)) {
- inPre = false;
- }
- // apply post-transforms
- for (var i = 0; i < postTransforms.length; i++) {
- postTransforms[i](element, options);
- }
- }
- function trimEndingWhitespace (el) {
- // remove trailing whitespace node
- if (!inPre) {
- var lastNode;
- while (
- (lastNode = el.children[el.children.length - 1]) &&
- lastNode.type === 3 &&
- lastNode.text === ' '
- ) {
- el.children.pop();
- }
- }
- }
- function checkRootConstraints (el) {
- if (el.tag === 'slot' || el.tag === 'template') {
- warnOnce(
- "Cannot use <" + (el.tag) + "> as component root element because it may " +
- 'contain multiple nodes.',
- { start: el.start }
- );
- }
- if (el.attrsMap.hasOwnProperty('v-for')) {
- warnOnce(
- 'Cannot use v-for on stateful component root element because ' +
- 'it renders multiple elements.',
- el.rawAttrsMap['v-for']
- );
- }
- }
- parseHTML(template, {
- warn: warn$2,
- expectHTML: options.expectHTML,
- isUnaryTag: options.isUnaryTag,
- canBeLeftOpenTag: options.canBeLeftOpenTag,
- shouldDecodeNewlines: options.shouldDecodeNewlines,
- shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
- shouldKeepComment: options.comments,
- outputSourceRange: options.outputSourceRange,
- start: function start (tag, attrs, unary, start$1, end) {
- // check namespace.
- // inherit parent ns if there is one
- var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
- // handle IE svg bug
- /* istanbul ignore if */
- if (isIE && ns === 'svg') {
- attrs = guardIESVGBug(attrs);
- }
- var element = createASTElement(tag, attrs, currentParent);
- if (ns) {
- element.ns = ns;
- }
- {
- if (options.outputSourceRange) {
- element.start = start$1;
- element.end = end;
- element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
- cumulated[attr.name] = attr;
- return cumulated
- }, {});
- }
- attrs.forEach(function (attr) {
- if (invalidAttributeRE.test(attr.name)) {
- warn$2(
- "Invalid dynamic argument expression: attribute names cannot contain " +
- "spaces, quotes, <, >, / or =.",
- {
- start: attr.start + attr.name.indexOf("["),
- end: attr.start + attr.name.length
- }
- );
- }
- });
- }
- if (isForbiddenTag(element) && !isServerRendering()) {
- element.forbidden = true;
- warn$2(
- 'Templates should only be responsible for mapping the state to the ' +
- 'UI. Avoid placing tags with side-effects in your templates, such as ' +
- "<" + tag + ">" + ', as they will not be parsed.',
- { start: element.start }
- );
- }
- // apply pre-transforms
- for (var i = 0; i < preTransforms.length; i++) {
- element = preTransforms[i](element, options) || element;
- }
- if (!inVPre) {
- processPre(element);
- if (element.pre) {
- inVPre = true;
- }
- }
- if (platformIsPreTag(element.tag)) {
- inPre = true;
- }
- if (inVPre) {
- processRawAttrs(element);
- } else if (!element.processed) {
- // structural directives
- processFor(element);
- processIf(element);
- processOnce(element);
- }
- if (!root) {
- root = element;
- {
- checkRootConstraints(root);
- }
- }
- if (!unary) {
- currentParent = element;
- stack.push(element);
- } else {
- closeElement(element);
- }
- },
- end: function end (tag, start, end$1) {
- var element = stack[stack.length - 1];
- // pop stack
- stack.length -= 1;
- currentParent = stack[stack.length - 1];
- if (options.outputSourceRange) {
- element.end = end$1;
- }
- closeElement(element);
- },
- chars: function chars (text, start, end) {
- if (!currentParent) {
- {
- if (text === template) {
- warnOnce(
- 'Component template requires a root element, rather than just text.',
- { start: start }
- );
- } else if ((text = text.trim())) {
- warnOnce(
- ("text \"" + text + "\" outside root element will be ignored."),
- { start: start }
- );
- }
- }
- return
- }
- // IE textarea placeholder bug
- /* istanbul ignore if */
- if (isIE &&
- currentParent.tag === 'textarea' &&
- currentParent.attrsMap.placeholder === text
- ) {
- return
- }
- var children = currentParent.children;
- if (inPre || text.trim()) {
- text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
- } else if (!children.length) {
- // remove the whitespace-only node right after an opening tag
- text = '';
- } else if (whitespaceOption) {
- if (whitespaceOption === 'condense') {
- // in condense mode, remove the whitespace node if it contains
- // line break, otherwise condense to a single space
- text = lineBreakRE.test(text) ? '' : ' ';
- } else {
- text = ' ';
- }
- } else {
- text = preserveWhitespace ? ' ' : '';
- }
- if (text) {
- if (!inPre && whitespaceOption === 'condense') {
- // condense consecutive whitespaces into single space
- text = text.replace(whitespaceRE$1, ' ');
- }
- var res;
- var child;
- if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
- child = {
- type: 2,
- expression: res.expression,
- tokens: res.tokens,
- text: text
- };
- } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
- child = {
- type: 3,
- text: text
- };
- }
- if (child) {
- if (options.outputSourceRange) {
- child.start = start;
- child.end = end;
- }
- children.push(child);
- }
- }
- },
- comment: function comment (text, start, end) {
- // adding anything as a sibling to the root node is forbidden
- // comments should still be allowed, but ignored
- if (currentParent) {
- var child = {
- type: 3,
- text: text,
- isComment: true
- };
- if (options.outputSourceRange) {
- child.start = start;
- child.end = end;
- }
- currentParent.children.push(child);
- }
- }
- });
- return root
- }
- function processPre (el) {
- if (getAndRemoveAttr(el, 'v-pre') != null) {
- el.pre = true;
- }
- }
- function processRawAttrs (el) {
- var list = el.attrsList;
- var len = list.length;
- if (len) {
- var attrs = el.attrs = new Array(len);
- for (var i = 0; i < len; i++) {
- attrs[i] = {
- name: list[i].name,
- value: JSON.stringify(list[i].value)
- };
- if (list[i].start != null) {
- attrs[i].start = list[i].start;
- attrs[i].end = list[i].end;
- }
- }
- } else if (!el.pre) {
- // non root node in pre blocks with no attributes
- el.plain = true;
- }
- }
- function processElement (
- element,
- options
- ) {
- processKey(element);
- // determine whether this is a plain element after
- // removing structural attributes
- element.plain = (
- !element.key &&
- !element.scopedSlots &&
- !element.attrsList.length
- );
- processRef(element);
- processSlotContent(element);
- processSlotOutlet(element);
- processComponent(element);
- for (var i = 0; i < transforms.length; i++) {
- element = transforms[i](element, options) || element;
- }
- processAttrs(element);
- return element
- }
- function processKey (el) {
- var exp = getBindingAttr(el, 'key');
- if (exp) {
- {
- if (el.tag === 'template') {
- warn$2(
- "<template> cannot be keyed. Place the key on real elements instead.",
- getRawBindingAttr(el, 'key')
- );
- }
- if (el.for) {
- var iterator = el.iterator2 || el.iterator1;
- var parent = el.parent;
- if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
- warn$2(
- "Do not use v-for index as key on <transition-group> children, " +
- "this is the same as not using keys.",
- getRawBindingAttr(el, 'key'),
- true /* tip */
- );
- }
- }
- }
- el.key = exp;
- }
- }
- function processRef (el) {
- var ref = getBindingAttr(el, 'ref');
- if (ref) {
- el.ref = ref;
- el.refInFor = checkInFor(el);
- }
- }
- function processFor (el) {
- var exp;
- if ((exp = getAndRemoveAttr(el, 'v-for'))) {
- var res = parseFor(exp);
- if (res) {
- extend(el, res);
- } else {
- warn$2(
- ("Invalid v-for expression: " + exp),
- el.rawAttrsMap['v-for']
- );
- }
- }
- }
- function parseFor (exp) {
- var inMatch = exp.match(forAliasRE);
- if (!inMatch) { return }
- var res = {};
- res.for = inMatch[2].trim();
- var alias = inMatch[1].trim().replace(stripParensRE, '');
- var iteratorMatch = alias.match(forIteratorRE);
- if (iteratorMatch) {
- res.alias = alias.replace(forIteratorRE, '').trim();
- res.iterator1 = iteratorMatch[1].trim();
- if (iteratorMatch[2]) {
- res.iterator2 = iteratorMatch[2].trim();
- }
- } else {
- res.alias = alias;
- }
- return res
- }
- function processIf (el) {
- var exp = getAndRemoveAttr(el, 'v-if');
- if (exp) {
- el.if = exp;
- addIfCondition(el, {
- exp: exp,
- block: el
- });
- } else {
- if (getAndRemoveAttr(el, 'v-else') != null) {
- el.else = true;
- }
- var elseif = getAndRemoveAttr(el, 'v-else-if');
- if (elseif) {
- el.elseif = elseif;
- }
- }
- }
- function processIfConditions (el, parent) {
- var prev = findPrevElement(parent.children);
- if (prev && prev.if) {
- addIfCondition(prev, {
- exp: el.elseif,
- block: el
- });
- } else {
- warn$2(
- "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
- "used on element <" + (el.tag) + "> without corresponding v-if.",
- el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
- );
- }
- }
- function findPrevElement (children) {
- var i = children.length;
- while (i--) {
- if (children[i].type === 1) {
- return children[i]
- } else {
- if (children[i].text !== ' ') {
- warn$2(
- "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
- "will be ignored.",
- children[i]
- );
- }
- children.pop();
- }
- }
- }
- function addIfCondition (el, condition) {
- if (!el.ifConditions) {
- el.ifConditions = [];
- }
- el.ifConditions.push(condition);
- }
- function processOnce (el) {
- var once$$1 = getAndRemoveAttr(el, 'v-once');
- if (once$$1 != null) {
- el.once = true;
- }
- }
- // handle content being passed to a component as slot,
- // e.g. <template slot="xxx">, <div slot-scope="xxx">
- function processSlotContent (el) {
- var slotScope;
- if (el.tag === 'template') {
- slotScope = getAndRemoveAttr(el, 'scope');
- /* istanbul ignore if */
- if (slotScope) {
- warn$2(
- "the \"scope\" attribute for scoped slots have been deprecated and " +
- "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
- "can also be used on plain elements in addition to <template> to " +
- "denote scoped slots.",
- el.rawAttrsMap['scope'],
- true
- );
- }
- el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
- } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
- /* istanbul ignore if */
- if (el.attrsMap['v-for']) {
- warn$2(
- "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
- "(v-for takes higher priority). Use a wrapper <template> for the " +
- "scoped slot to make it clearer.",
- el.rawAttrsMap['slot-scope'],
- true
- );
- }
- el.slotScope = slotScope;
- }
- // slot="xxx"
- var slotTarget = getBindingAttr(el, 'slot');
- if (slotTarget) {
- el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
- el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
- // preserve slot as an attribute for native shadow DOM compat
- // only for non-scoped slots.
- if (el.tag !== 'template' && !el.slotScope) {
- addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
- }
- }
- // 2.6 v-slot syntax
- {
- if (el.tag === 'template') {
- // v-slot on <template>
- var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
- if (slotBinding) {
- {
- if (el.slotTarget || el.slotScope) {
- warn$2(
- "Unexpected mixed usage of different slot syntaxes.",
- el
- );
- }
- if (el.parent && !maybeComponent(el.parent)) {
- warn$2(
- "<template v-slot> can only appear at the root level inside " +
- "the receiving component",
- el
- );
- }
- }
- var ref = getSlotName(slotBinding);
- var name = ref.name;
- var dynamic = ref.dynamic;
- el.slotTarget = name;
- el.slotTargetDynamic = dynamic;
- el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
- }
- } else {
- // v-slot on component, denotes default slot
- var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
- if (slotBinding$1) {
- {
- if (!maybeComponent(el)) {
- warn$2(
- "v-slot can only be used on components or <template>.",
- slotBinding$1
- );
- }
- if (el.slotScope || el.slotTarget) {
- warn$2(
- "Unexpected mixed usage of different slot syntaxes.",
- el
- );
- }
- if (el.scopedSlots) {
- warn$2(
- "To avoid scope ambiguity, the default slot should also use " +
- "<template> syntax when there are other named slots.",
- slotBinding$1
- );
- }
- }
- // add the component's children to its default slot
- var slots = el.scopedSlots || (el.scopedSlots = {});
- var ref$1 = getSlotName(slotBinding$1);
- var name$1 = ref$1.name;
- var dynamic$1 = ref$1.dynamic;
- var slotContainer = slots[name$1] = createASTElement('template', [], el);
- slotContainer.slotTarget = name$1;
- slotContainer.slotTargetDynamic = dynamic$1;
- slotContainer.children = el.children.filter(function (c) {
- if (!c.slotScope) {
- c.parent = slotContainer;
- return true
- }
- });
- slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
- // remove children as they are returned from scopedSlots now
- el.children = [];
- // mark el non-plain so data gets generated
- el.plain = false;
- }
- }
- }
- }
- function getSlotName (binding) {
- var name = binding.name.replace(slotRE, '');
- if (!name) {
- if (binding.name[0] !== '#') {
- name = 'default';
- } else {
- warn$2(
- "v-slot shorthand syntax requires a slot name.",
- binding
- );
- }
- }
- return dynamicArgRE.test(name)
- // dynamic [name]
- ? { name: name.slice(1, -1), dynamic: true }
- // static name
- : { name: ("\"" + name + "\""), dynamic: false }
- }
- // handle <slot/> outlets
- function processSlotOutlet (el) {
- if (el.tag === 'slot') {
- el.slotName = getBindingAttr(el, 'name');
- if (el.key) {
- warn$2(
- "`key` does not work on <slot> because slots are abstract outlets " +
- "and can possibly expand into multiple elements. " +
- "Use the key on a wrapping element instead.",
- getRawBindingAttr(el, 'key')
- );
- }
- }
- }
- function processComponent (el) {
- var binding;
- if ((binding = getBindingAttr(el, 'is'))) {
- el.component = binding;
- }
- if (getAndRemoveAttr(el, 'inline-template') != null) {
- el.inlineTemplate = true;
- }
- }
- function processAttrs (el) {
- var list = el.attrsList;
- var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
- for (i = 0, l = list.length; i < l; i++) {
- name = rawName = list[i].name;
- value = list[i].value;
- if (dirRE.test(name)) {
- // mark element as dynamic
- el.hasBindings = true;
- // modifiers
- modifiers = parseModifiers(name.replace(dirRE, ''));
- // support .foo shorthand syntax for the .prop modifier
- if (modifiers) {
- name = name.replace(modifierRE, '');
- }
- if (bindRE.test(name)) { // v-bind
- name = name.replace(bindRE, '');
- value = parseFilters(value);
- isDynamic = dynamicArgRE.test(name);
- if (isDynamic) {
- name = name.slice(1, -1);
- }
- if (
- value.trim().length === 0
- ) {
- warn$2(
- ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
- );
- }
- if (modifiers) {
- if (modifiers.prop && !isDynamic) {
- name = camelize(name);
- if (name === 'innerHtml') { name = 'innerHTML'; }
- }
- if (modifiers.camel && !isDynamic) {
- name = camelize(name);
- }
- if (modifiers.sync) {
- syncGen = genAssignmentCode(value, "$event");
- if (!isDynamic) {
- addHandler(
- el,
- ("update:" + (camelize(name))),
- syncGen,
- null,
- false,
- warn$2,
- list[i]
- );
- if (hyphenate(name) !== camelize(name)) {
- addHandler(
- el,
- ("update:" + (hyphenate(name))),
- syncGen,
- null,
- false,
- warn$2,
- list[i]
- );
- }
- } else {
- // handler w/ dynamic event name
- addHandler(
- el,
- ("\"update:\"+(" + name + ")"),
- syncGen,
- null,
- false,
- warn$2,
- list[i],
- true // dynamic
- );
- }
- }
- }
- if ((modifiers && modifiers.prop) || (
- !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
- )) {
- addProp(el, name, value, list[i], isDynamic);
- } else {
- addAttr(el, name, value, list[i], isDynamic);
- }
- } else if (onRE.test(name)) { // v-on
- name = name.replace(onRE, '');
- isDynamic = dynamicArgRE.test(name);
- if (isDynamic) {
- name = name.slice(1, -1);
- }
- addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
- } else { // normal directives
- name = name.replace(dirRE, '');
- // parse arg
- var argMatch = name.match(argRE);
- var arg = argMatch && argMatch[1];
- isDynamic = false;
- if (arg) {
- name = name.slice(0, -(arg.length + 1));
- if (dynamicArgRE.test(arg)) {
- arg = arg.slice(1, -1);
- isDynamic = true;
- }
- }
- addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
- if (name === 'model') {
- checkForAliasModel(el, value);
- }
- }
- } else {
- // literal attribute
- {
- var res = parseText(value, delimiters);
- if (res) {
- warn$2(
- name + "=\"" + value + "\": " +
- 'Interpolation inside attributes has been removed. ' +
- 'Use v-bind or the colon shorthand instead. For example, ' +
- 'instead of <div id="{{ val }}">, use <div :id="val">.',
- list[i]
- );
- }
- }
- addAttr(el, name, JSON.stringify(value), list[i]);
- // #6887 firefox doesn't update muted state if set via attribute
- // even immediately after element creation
- if (!el.component &&
- name === 'muted' &&
- platformMustUseProp(el.tag, el.attrsMap.type, name)) {
- addProp(el, name, 'true', list[i]);
- }
- }
- }
- }
- function checkInFor (el) {
- var parent = el;
- while (parent) {
- if (parent.for !== undefined) {
- return true
- }
- parent = parent.parent;
- }
- return false
- }
- function parseModifiers (name) {
- var match = name.match(modifierRE);
- if (match) {
- var ret = {};
- match.forEach(function (m) { ret[m.slice(1)] = true; });
- return ret
- }
- }
- function makeAttrsMap (attrs) {
- var map = {};
- for (var i = 0, l = attrs.length; i < l; i++) {
- if (
- map[attrs[i].name] && !isIE && !isEdge
- ) {
- warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
- }
- map[attrs[i].name] = attrs[i].value;
- }
- return map
- }
- // for script (e.g. type="x/template") or style, do not decode content
- function isTextTag (el) {
- return el.tag === 'script' || el.tag === 'style'
- }
- function isForbiddenTag (el) {
- return (
- el.tag === 'style' ||
- (el.tag === 'script' && (
- !el.attrsMap.type ||
- el.attrsMap.type === 'text/javascript'
- ))
- )
- }
- var ieNSBug = /^xmlns:NS\d+/;
- var ieNSPrefix = /^NS\d+:/;
- /* istanbul ignore next */
- function guardIESVGBug (attrs) {
- var res = [];
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (!ieNSBug.test(attr.name)) {
- attr.name = attr.name.replace(ieNSPrefix, '');
- res.push(attr);
- }
- }
- return res
- }
- function checkForAliasModel (el, value) {
- var _el = el;
- while (_el) {
- if (_el.for && _el.alias === value) {
- warn$2(
- "<" + (el.tag) + " v-model=\"" + value + "\">: " +
- "You are binding v-model directly to a v-for iteration alias. " +
- "This will not be able to modify the v-for source array because " +
- "writing to the alias is like modifying a function local variable. " +
- "Consider using an array of objects and use v-model on an object property instead.",
- el.rawAttrsMap['v-model']
- );
- }
- _el = _el.parent;
- }
- }
- /* */
- function preTransformNode (el, options) {
- if (el.tag === 'input') {
- var map = el.attrsMap;
- if (!map['v-model']) {
- return
- }
- var typeBinding;
- if (map[':type'] || map['v-bind:type']) {
- typeBinding = getBindingAttr(el, 'type');
- }
- if (!map.type && !typeBinding && map['v-bind']) {
- typeBinding = "(" + (map['v-bind']) + ").type";
- }
- if (typeBinding) {
- var ifCondition = getAndRemoveAttr(el, 'v-if', true);
- var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
- var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
- var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
- // 1. checkbox
- var branch0 = cloneASTElement(el);
- // process for on the main node
- processFor(branch0);
- addRawAttr(branch0, 'type', 'checkbox');
- processElement(branch0, options);
- branch0.processed = true; // prevent it from double-processed
- branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
- addIfCondition(branch0, {
- exp: branch0.if,
- block: branch0
- });
- // 2. add radio else-if condition
- var branch1 = cloneASTElement(el);
- getAndRemoveAttr(branch1, 'v-for', true);
- addRawAttr(branch1, 'type', 'radio');
- processElement(branch1, options);
- addIfCondition(branch0, {
- exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
- block: branch1
- });
- // 3. other
- var branch2 = cloneASTElement(el);
- getAndRemoveAttr(branch2, 'v-for', true);
- addRawAttr(branch2, ':type', typeBinding);
- processElement(branch2, options);
- addIfCondition(branch0, {
- exp: ifCondition,
- block: branch2
- });
- if (hasElse) {
- branch0.else = true;
- } else if (elseIfCondition) {
- branch0.elseif = elseIfCondition;
- }
- return branch0
- }
- }
- }
- function cloneASTElement (el) {
- return createASTElement(el.tag, el.attrsList.slice(), el.parent)
- }
- var model$1 = {
- preTransformNode: preTransformNode
- };
- var modules$1 = [
- klass$1,
- style$1,
- model$1
- ];
- /* */
- function text (el, dir) {
- if (dir.value) {
- addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
- }
- }
- /* */
- function html (el, dir) {
- if (dir.value) {
- addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
- }
- }
- var directives$1 = {
- model: model,
- text: text,
- html: html
- };
- /* */
- var baseOptions = {
- expectHTML: true,
- modules: modules$1,
- directives: directives$1,
- isPreTag: isPreTag,
- isUnaryTag: isUnaryTag,
- mustUseProp: mustUseProp,
- canBeLeftOpenTag: canBeLeftOpenTag,
- isReservedTag: isReservedTag,
- getTagNamespace: getTagNamespace,
- staticKeys: genStaticKeys(modules$1)
- };
- /* */
- var isStaticKey;
- var isPlatformReservedTag;
- var genStaticKeysCached = cached(genStaticKeys$1);
- /**
- * Goal of the optimizer: walk the generated template AST tree
- * and detect sub-trees that are purely static, i.e. parts of
- * the DOM that never needs to change.
- *
- * Once we detect these sub-trees, we can:
- *
- * 1. Hoist them into constants, so that we no longer need to
- * create fresh nodes for them on each re-render;
- * 2. Completely skip them in the patching process.
- */
- function optimize (root, options) {
- if (!root) { return }
- isStaticKey = genStaticKeysCached(options.staticKeys || '');
- isPlatformReservedTag = options.isReservedTag || no;
- // first pass: mark all non-static nodes.
- markStatic$1(root);
- // second pass: mark static roots.
- markStaticRoots(root, false);
- }
- function genStaticKeys$1 (keys) {
- return makeMap(
- 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
- (keys ? ',' + keys : '')
- )
- }
- function markStatic$1 (node) {
- node.static = isStatic(node);
- if (node.type === 1) {
- // do not make component slot content static. this avoids
- // 1. components not able to mutate slot nodes
- // 2. static slot content fails for hot-reloading
- if (
- !isPlatformReservedTag(node.tag) &&
- node.tag !== 'slot' &&
- node.attrsMap['inline-template'] == null
- ) {
- return
- }
- for (var i = 0, l = node.children.length; i < l; i++) {
- var child = node.children[i];
- markStatic$1(child);
- if (!child.static) {
- node.static = false;
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- var block = node.ifConditions[i$1].block;
- markStatic$1(block);
- if (!block.static) {
- node.static = false;
- }
- }
- }
- }
- }
- function markStaticRoots (node, isInFor) {
- if (node.type === 1) {
- if (node.static || node.once) {
- node.staticInFor = isInFor;
- }
- // For a node to qualify as a static root, it should have children that
- // are not just static text. Otherwise the cost of hoisting out will
- // outweigh the benefits and it's better off to just always render it fresh.
- if (node.static && node.children.length && !(
- node.children.length === 1 &&
- node.children[0].type === 3
- )) {
- node.staticRoot = true;
- return
- } else {
- node.staticRoot = false;
- }
- if (node.children) {
- for (var i = 0, l = node.children.length; i < l; i++) {
- markStaticRoots(node.children[i], isInFor || !!node.for);
- }
- }
- if (node.ifConditions) {
- for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
- markStaticRoots(node.ifConditions[i$1].block, isInFor);
- }
- }
- }
- }
- function isStatic (node) {
- if (node.type === 2) { // expression
- return false
- }
- if (node.type === 3) { // text
- return true
- }
- return !!(node.pre || (
- !node.hasBindings && // no dynamic bindings
- !node.if && !node.for && // not v-if or v-for or v-else
- !isBuiltInTag(node.tag) && // not a built-in
- isPlatformReservedTag(node.tag) && // not a component
- !isDirectChildOfTemplateFor(node) &&
- Object.keys(node).every(isStaticKey)
- ))
- }
- function isDirectChildOfTemplateFor (node) {
- while (node.parent) {
- node = node.parent;
- if (node.tag !== 'template') {
- return false
- }
- if (node.for) {
- return true
- }
- }
- return false
- }
- /* */
- var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
- var fnInvokeRE = /\([^)]*?\);*$/;
- var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
- // KeyboardEvent.keyCode aliases
- var keyCodes = {
- esc: 27,
- tab: 9,
- enter: 13,
- space: 32,
- up: 38,
- left: 37,
- right: 39,
- down: 40,
- 'delete': [8, 46]
- };
- // KeyboardEvent.key aliases
- var keyNames = {
- // #7880: IE11 and Edge use `Esc` for Escape key name.
- esc: ['Esc', 'Escape'],
- tab: 'Tab',
- enter: 'Enter',
- // #9112: IE11 uses `Spacebar` for Space key name.
- space: [' ', 'Spacebar'],
- // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
- up: ['Up', 'ArrowUp'],
- left: ['Left', 'ArrowLeft'],
- right: ['Right', 'ArrowRight'],
- down: ['Down', 'ArrowDown'],
- // #9112: IE11 uses `Del` for Delete key name.
- 'delete': ['Backspace', 'Delete', 'Del']
- };
- // #4868: modifiers that prevent the execution of the listener
- // need to explicitly return null so that we can determine whether to remove
- // the listener for .once
- var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
- var modifierCode = {
- stop: '$event.stopPropagation();',
- prevent: '$event.preventDefault();',
- self: genGuard("$event.target !== $event.currentTarget"),
- ctrl: genGuard("!$event.ctrlKey"),
- shift: genGuard("!$event.shiftKey"),
- alt: genGuard("!$event.altKey"),
- meta: genGuard("!$event.metaKey"),
- left: genGuard("'button' in $event && $event.button !== 0"),
- middle: genGuard("'button' in $event && $event.button !== 1"),
- right: genGuard("'button' in $event && $event.button !== 2")
- };
- function genHandlers (
- events,
- isNative
- ) {
- var prefix = isNative ? 'nativeOn:' : 'on:';
- var staticHandlers = "";
- var dynamicHandlers = "";
- for (var name in events) {
- var handlerCode = genHandler(events[name]);
- if (events[name] && events[name].dynamic) {
- dynamicHandlers += name + "," + handlerCode + ",";
- } else {
- staticHandlers += "\"" + name + "\":" + handlerCode + ",";
- }
- }
- staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
- if (dynamicHandlers) {
- return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
- } else {
- return prefix + staticHandlers
- }
- }
- function genHandler (handler) {
- if (!handler) {
- return 'function(){}'
- }
- if (Array.isArray(handler)) {
- return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
- }
- var isMethodPath = simplePathRE.test(handler.value);
- var isFunctionExpression = fnExpRE.test(handler.value);
- var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
- if (!handler.modifiers) {
- if (isMethodPath || isFunctionExpression) {
- return handler.value
- }
- return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
- } else {
- var code = '';
- var genModifierCode = '';
- var keys = [];
- for (var key in handler.modifiers) {
- if (modifierCode[key]) {
- genModifierCode += modifierCode[key];
- // left/right
- if (keyCodes[key]) {
- keys.push(key);
- }
- } else if (key === 'exact') {
- var modifiers = (handler.modifiers);
- genModifierCode += genGuard(
- ['ctrl', 'shift', 'alt', 'meta']
- .filter(function (keyModifier) { return !modifiers[keyModifier]; })
- .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
- .join('||')
- );
- } else {
- keys.push(key);
- }
- }
- if (keys.length) {
- code += genKeyFilter(keys);
- }
- // Make sure modifiers like prevent and stop get executed after key filtering
- if (genModifierCode) {
- code += genModifierCode;
- }
- var handlerCode = isMethodPath
- ? ("return " + (handler.value) + ".apply(null, arguments)")
- : isFunctionExpression
- ? ("return (" + (handler.value) + ").apply(null, arguments)")
- : isFunctionInvocation
- ? ("return " + (handler.value))
- : handler.value;
- return ("function($event){" + code + handlerCode + "}")
- }
- }
- function genKeyFilter (keys) {
- return (
- // make sure the key filters only apply to KeyboardEvents
- // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
- // key events that do not have keyCode property...
- "if(!$event.type.indexOf('key')&&" +
- (keys.map(genFilterCode).join('&&')) + ")return null;"
- )
- }
- function genFilterCode (key) {
- var keyVal = parseInt(key, 10);
- if (keyVal) {
- return ("$event.keyCode!==" + keyVal)
- }
- var keyCode = keyCodes[key];
- var keyName = keyNames[key];
- return (
- "_k($event.keyCode," +
- (JSON.stringify(key)) + "," +
- (JSON.stringify(keyCode)) + "," +
- "$event.key," +
- "" + (JSON.stringify(keyName)) +
- ")"
- )
- }
- /* */
- function on (el, dir) {
- if (dir.modifiers) {
- warn("v-on without argument does not support modifiers.");
- }
- el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
- }
- /* */
- function bind$1 (el, dir) {
- el.wrapData = function (code) {
- return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
- };
- }
- /* */
- var baseDirectives = {
- on: on,
- bind: bind$1,
- cloak: noop
- };
- /* */
- var CodegenState = function CodegenState (options) {
- this.options = options;
- this.warn = options.warn || baseWarn;
- this.transforms = pluckModuleFunction(options.modules, 'transformCode');
- this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
- this.directives = extend(extend({}, baseDirectives), options.directives);
- var isReservedTag = options.isReservedTag || no;
- this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
- this.onceId = 0;
- this.staticRenderFns = [];
- this.pre = false;
- };
- function generate (
- ast,
- options
- ) {
- var state = new CodegenState(options);
- // fix #11483, Root level <script> tags should not be rendered.
- var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
- return {
- render: ("with(this){return " + code + "}"),
- staticRenderFns: state.staticRenderFns
- }
- }
- function genElement (el, state) {
- if (el.parent) {
- el.pre = el.pre || el.parent.pre;
- }
- if (el.staticRoot && !el.staticProcessed) {
- return genStatic(el, state)
- } else if (el.once && !el.onceProcessed) {
- return genOnce(el, state)
- } else if (el.for && !el.forProcessed) {
- return genFor(el, state)
- } else if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
- return genChildren(el, state) || 'void 0'
- } else if (el.tag === 'slot') {
- return genSlot(el, state)
- } else {
- // component or element
- var code;
- if (el.component) {
- code = genComponent(el.component, el, state);
- } else {
- var data;
- if (!el.plain || (el.pre && state.maybeComponent(el))) {
- data = genData$2(el, state);
- }
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
- }
- // module transforms
- for (var i = 0; i < state.transforms.length; i++) {
- code = state.transforms[i](el, code);
- }
- return code
- }
- }
- // hoist static sub-trees out
- function genStatic (el, state) {
- el.staticProcessed = true;
- // Some elements (templates) need to behave differently inside of a v-pre
- // node. All pre nodes are static roots, so we can use this as a location to
- // wrap a state change and reset it upon exiting the pre node.
- var originalPreState = state.pre;
- if (el.pre) {
- state.pre = el.pre;
- }
- state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
- state.pre = originalPreState;
- return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
- }
- // v-once
- function genOnce (el, state) {
- el.onceProcessed = true;
- if (el.if && !el.ifProcessed) {
- return genIf(el, state)
- } else if (el.staticInFor) {
- var key = '';
- var parent = el.parent;
- while (parent) {
- if (parent.for) {
- key = parent.key;
- break
- }
- parent = parent.parent;
- }
- if (!key) {
- state.warn(
- "v-once can only be used inside v-for that is keyed. ",
- el.rawAttrsMap['v-once']
- );
- return genElement(el, state)
- }
- return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
- } else {
- return genStatic(el, state)
- }
- }
- function genIf (
- el,
- state,
- altGen,
- altEmpty
- ) {
- el.ifProcessed = true; // avoid recursion
- return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
- }
- function genIfConditions (
- conditions,
- state,
- altGen,
- altEmpty
- ) {
- if (!conditions.length) {
- return altEmpty || '_e()'
- }
- var condition = conditions.shift();
- if (condition.exp) {
- return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
- } else {
- return ("" + (genTernaryExp(condition.block)))
- }
- // v-if with v-once should generate code like (a)?_m(0):_m(1)
- function genTernaryExp (el) {
- return altGen
- ? altGen(el, state)
- : el.once
- ? genOnce(el, state)
- : genElement(el, state)
- }
- }
- function genFor (
- el,
- state,
- altGen,
- altHelper
- ) {
- var exp = el.for;
- var alias = el.alias;
- var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
- var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
- if (state.maybeComponent(el) &&
- el.tag !== 'slot' &&
- el.tag !== 'template' &&
- !el.key
- ) {
- state.warn(
- "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
- "v-for should have explicit keys. " +
- "See https://vuejs.org/guide/list.html#key for more info.",
- el.rawAttrsMap['v-for'],
- true /* tip */
- );
- }
- el.forProcessed = true; // avoid recursion
- return (altHelper || '_l') + "((" + exp + ")," +
- "function(" + alias + iterator1 + iterator2 + "){" +
- "return " + ((altGen || genElement)(el, state)) +
- '})'
- }
- function genData$2 (el, state) {
- var data = '{';
- // directives first.
- // directives may mutate the el's other properties before they are generated.
- var dirs = genDirectives(el, state);
- if (dirs) { data += dirs + ','; }
- // key
- if (el.key) {
- data += "key:" + (el.key) + ",";
- }
- // ref
- if (el.ref) {
- data += "ref:" + (el.ref) + ",";
- }
- if (el.refInFor) {
- data += "refInFor:true,";
- }
- // pre
- if (el.pre) {
- data += "pre:true,";
- }
- // record original tag name for components using "is" attribute
- if (el.component) {
- data += "tag:\"" + (el.tag) + "\",";
- }
- // module data generation functions
- for (var i = 0; i < state.dataGenFns.length; i++) {
- data += state.dataGenFns[i](el);
- }
- // attributes
- if (el.attrs) {
- data += "attrs:" + (genProps(el.attrs)) + ",";
- }
- // DOM props
- if (el.props) {
- data += "domProps:" + (genProps(el.props)) + ",";
- }
- // event handlers
- if (el.events) {
- data += (genHandlers(el.events, false)) + ",";
- }
- if (el.nativeEvents) {
- data += (genHandlers(el.nativeEvents, true)) + ",";
- }
- // slot target
- // only for non-scoped slots
- if (el.slotTarget && !el.slotScope) {
- data += "slot:" + (el.slotTarget) + ",";
- }
- // scoped slots
- if (el.scopedSlots) {
- data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
- }
- // component v-model
- if (el.model) {
- data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
- }
- // inline-template
- if (el.inlineTemplate) {
- var inlineTemplate = genInlineTemplate(el, state);
- if (inlineTemplate) {
- data += inlineTemplate + ",";
- }
- }
- data = data.replace(/,$/, '') + '}';
- // v-bind dynamic argument wrap
- // v-bind with dynamic arguments must be applied using the same v-bind object
- // merge helper so that class/style/mustUseProp attrs are handled correctly.
- if (el.dynamicAttrs) {
- data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
- }
- // v-bind data wrap
- if (el.wrapData) {
- data = el.wrapData(data);
- }
- // v-on data wrap
- if (el.wrapListeners) {
- data = el.wrapListeners(data);
- }
- return data
- }
- function genDirectives (el, state) {
- var dirs = el.directives;
- if (!dirs) { return }
- var res = 'directives:[';
- var hasRuntime = false;
- var i, l, dir, needRuntime;
- for (i = 0, l = dirs.length; i < l; i++) {
- dir = dirs[i];
- needRuntime = true;
- var gen = state.directives[dir.name];
- if (gen) {
- // compile-time directive that manipulates AST.
- // returns true if it also needs a runtime counterpart.
- needRuntime = !!gen(el, dir, state.warn);
- }
- if (needRuntime) {
- hasRuntime = true;
- res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
- }
- }
- if (hasRuntime) {
- return res.slice(0, -1) + ']'
- }
- }
- function genInlineTemplate (el, state) {
- var ast = el.children[0];
- if (el.children.length !== 1 || ast.type !== 1) {
- state.warn(
- 'Inline-template components must have exactly one child element.',
- { start: el.start }
- );
- }
- if (ast && ast.type === 1) {
- var inlineRenderFns = generate(ast, state.options);
- return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
- }
- }
- function genScopedSlots (
- el,
- slots,
- state
- ) {
- // by default scoped slots are considered "stable", this allows child
- // components with only scoped slots to skip forced updates from parent.
- // but in some cases we have to bail-out of this optimization
- // for example if the slot contains dynamic names, has v-if or v-for on them...
- var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
- var slot = slots[key];
- return (
- slot.slotTargetDynamic ||
- slot.if ||
- slot.for ||
- containsSlotChild(slot) // is passing down slot from parent which may be dynamic
- )
- });
- // #9534: if a component with scoped slots is inside a conditional branch,
- // it's possible for the same component to be reused but with different
- // compiled slot content. To avoid that, we generate a unique key based on
- // the generated code of all the slot contents.
- var needsKey = !!el.if;
- // OR when it is inside another scoped slot or v-for (the reactivity may be
- // disconnected due to the intermediate scope variable)
- // #9438, #9506
- // TODO: this can be further optimized by properly analyzing in-scope bindings
- // and skip force updating ones that do not actually use scope variables.
- if (!needsForceUpdate) {
- var parent = el.parent;
- while (parent) {
- if (
- (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
- parent.for
- ) {
- needsForceUpdate = true;
- break
- }
- if (parent.if) {
- needsKey = true;
- }
- parent = parent.parent;
- }
- }
- var generatedSlots = Object.keys(slots)
- .map(function (key) { return genScopedSlot(slots[key], state); })
- .join(',');
- return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
- }
- function hash(str) {
- var hash = 5381;
- var i = str.length;
- while(i) {
- hash = (hash * 33) ^ str.charCodeAt(--i);
- }
- return hash >>> 0
- }
- function containsSlotChild (el) {
- if (el.type === 1) {
- if (el.tag === 'slot') {
- return true
- }
- return el.children.some(containsSlotChild)
- }
- return false
- }
- function genScopedSlot (
- el,
- state
- ) {
- var isLegacySyntax = el.attrsMap['slot-scope'];
- if (el.if && !el.ifProcessed && !isLegacySyntax) {
- return genIf(el, state, genScopedSlot, "null")
- }
- if (el.for && !el.forProcessed) {
- return genFor(el, state, genScopedSlot)
- }
- var slotScope = el.slotScope === emptySlotScopeToken
- ? ""
- : String(el.slotScope);
- var fn = "function(" + slotScope + "){" +
- "return " + (el.tag === 'template'
- ? el.if && isLegacySyntax
- ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
- : genChildren(el, state) || 'undefined'
- : genElement(el, state)) + "}";
- // reverse proxy v-slot without scope on this.$slots
- var reverseProxy = slotScope ? "" : ",proxy:true";
- return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
- }
- function genChildren (
- el,
- state,
- checkSkip,
- altGenElement,
- altGenNode
- ) {
- var children = el.children;
- if (children.length) {
- var el$1 = children[0];
- // optimize single v-for
- if (children.length === 1 &&
- el$1.for &&
- el$1.tag !== 'template' &&
- el$1.tag !== 'slot'
- ) {
- var normalizationType = checkSkip
- ? state.maybeComponent(el$1) ? ",1" : ",0"
- : "";
- return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
- }
- var normalizationType$1 = checkSkip
- ? getNormalizationType(children, state.maybeComponent)
- : 0;
- var gen = altGenNode || genNode;
- return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
- }
- }
- // determine the normalization needed for the children array.
- // 0: no normalization needed
- // 1: simple normalization needed (possible 1-level deep nested array)
- // 2: full normalization needed
- function getNormalizationType (
- children,
- maybeComponent
- ) {
- var res = 0;
- for (var i = 0; i < children.length; i++) {
- var el = children[i];
- if (el.type !== 1) {
- continue
- }
- if (needsNormalization(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
- res = 2;
- break
- }
- if (maybeComponent(el) ||
- (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
- res = 1;
- }
- }
- return res
- }
- function needsNormalization (el) {
- return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
- }
- function genNode (node, state) {
- if (node.type === 1) {
- return genElement(node, state)
- } else if (node.type === 3 && node.isComment) {
- return genComment(node)
- } else {
- return genText(node)
- }
- }
- function genText (text) {
- return ("_v(" + (text.type === 2
- ? text.expression // no need for () because already wrapped in _s()
- : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
- }
- function genComment (comment) {
- return ("_e(" + (JSON.stringify(comment.text)) + ")")
- }
- function genSlot (el, state) {
- var slotName = el.slotName || '"default"';
- var children = genChildren(el, state);
- var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
- var attrs = el.attrs || el.dynamicAttrs
- ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
- // slot props are camelized
- name: camelize(attr.name),
- value: attr.value,
- dynamic: attr.dynamic
- }); }))
- : null;
- var bind$$1 = el.attrsMap['v-bind'];
- if ((attrs || bind$$1) && !children) {
- res += ",null";
- }
- if (attrs) {
- res += "," + attrs;
- }
- if (bind$$1) {
- res += (attrs ? '' : ',null') + "," + bind$$1;
- }
- return res + ')'
- }
- // componentName is el.component, take it as argument to shun flow's pessimistic refinement
- function genComponent (
- componentName,
- el,
- state
- ) {
- var children = el.inlineTemplate ? null : genChildren(el, state, true);
- return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
- }
- function genProps (props) {
- var staticProps = "";
- var dynamicProps = "";
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- var value = transformSpecialNewlines(prop.value);
- if (prop.dynamic) {
- dynamicProps += (prop.name) + "," + value + ",";
- } else {
- staticProps += "\"" + (prop.name) + "\":" + value + ",";
- }
- }
- staticProps = "{" + (staticProps.slice(0, -1)) + "}";
- if (dynamicProps) {
- return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
- } else {
- return staticProps
- }
- }
- // #3895, #4268
- function transformSpecialNewlines (text) {
- return text
- .replace(/\u2028/g, '\\u2028')
- .replace(/\u2029/g, '\\u2029')
- }
- /* */
- // these keywords should not appear inside expressions, but operators like
- // typeof, instanceof and in are allowed
- var prohibitedKeywordRE = new RegExp('\\b' + (
- 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments'
- ).split(',').join('\\b|\\b') + '\\b');
- // these unary operators should not be used as property/method names
- var unaryOperatorsRE = new RegExp('\\b' + (
- 'delete,typeof,void'
- ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
- // strip strings in expressions
- var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
- // detect problematic expressions in a template
- function detectErrors (ast, warn) {
- if (ast) {
- checkNode(ast, warn);
- }
- }
- function checkNode (node, warn) {
- if (node.type === 1) {
- for (var name in node.attrsMap) {
- if (dirRE.test(name)) {
- var value = node.attrsMap[name];
- if (value) {
- var range = node.rawAttrsMap[name];
- if (name === 'v-for') {
- checkFor(node, ("v-for=\"" + value + "\""), warn, range);
- } else if (name === 'v-slot' || name[0] === '#') {
- checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
- } else if (onRE.test(name)) {
- checkEvent(value, (name + "=\"" + value + "\""), warn, range);
- } else {
- checkExpression(value, (name + "=\"" + value + "\""), warn, range);
- }
- }
- }
- }
- if (node.children) {
- for (var i = 0; i < node.children.length; i++) {
- checkNode(node.children[i], warn);
- }
- }
- } else if (node.type === 2) {
- checkExpression(node.expression, node.text, warn, node);
- }
- }
- function checkEvent (exp, text, warn, range) {
- var stripped = exp.replace(stripStringRE, '');
- var keywordMatch = stripped.match(unaryOperatorsRE);
- if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
- warn(
- "avoid using JavaScript unary operator as property name: " +
- "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
- range
- );
- }
- checkExpression(exp, text, warn, range);
- }
- function checkFor (node, text, warn, range) {
- checkExpression(node.for || '', text, warn, range);
- checkIdentifier(node.alias, 'v-for alias', text, warn, range);
- checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
- checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
- }
- function checkIdentifier (
- ident,
- type,
- text,
- warn,
- range
- ) {
- if (typeof ident === 'string') {
- try {
- new Function(("var " + ident + "=_"));
- } catch (e) {
- warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
- }
- }
- }
- function checkExpression (exp, text, warn, range) {
- try {
- new Function(("return " + exp));
- } catch (e) {
- var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
- if (keywordMatch) {
- warn(
- "avoid using JavaScript keyword as property name: " +
- "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
- range
- );
- } else {
- warn(
- "invalid expression: " + (e.message) + " in\n\n" +
- " " + exp + "\n\n" +
- " Raw expression: " + (text.trim()) + "\n",
- range
- );
- }
- }
- }
- function checkFunctionParameterExpression (exp, text, warn, range) {
- try {
- new Function(exp, '');
- } catch (e) {
- warn(
- "invalid function parameter expression: " + (e.message) + " in\n\n" +
- " " + exp + "\n\n" +
- " Raw expression: " + (text.trim()) + "\n",
- range
- );
- }
- }
- /* */
- var range = 2;
- function generateCodeFrame (
- source,
- start,
- end
- ) {
- if ( start === void 0 ) start = 0;
- if ( end === void 0 ) end = source.length;
- var lines = source.split(/\r?\n/);
- var count = 0;
- var res = [];
- for (var i = 0; i < lines.length; i++) {
- count += lines[i].length + 1;
- if (count >= start) {
- for (var j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length) { continue }
- res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
- var lineLength = lines[j].length;
- if (j === i) {
- // push underline
- var pad = start - (count - lineLength) + 1;
- var length = end > count ? lineLength - pad : end - start;
- res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
- } else if (j > i) {
- if (end > count) {
- var length$1 = Math.min(end - count, lineLength);
- res.push(" | " + repeat$1("^", length$1));
- }
- count += lineLength + 1;
- }
- }
- break
- }
- }
- return res.join('\n')
- }
- function repeat$1 (str, n) {
- var result = '';
- if (n > 0) {
- while (true) { // eslint-disable-line
- if (n & 1) { result += str; }
- n >>>= 1;
- if (n <= 0) { break }
- str += str;
- }
- }
- return result
- }
- /* */
- function createFunction (code, errors) {
- try {
- return new Function(code)
- } catch (err) {
- errors.push({ err: err, code: code });
- return noop
- }
- }
- function createCompileToFunctionFn (compile) {
- var cache = Object.create(null);
- return function compileToFunctions (
- template,
- options,
- vm
- ) {
- options = extend({}, options);
- var warn$$1 = options.warn || warn;
- delete options.warn;
- /* istanbul ignore if */
- {
- // detect possible CSP restriction
- try {
- new Function('return 1');
- } catch (e) {
- if (e.toString().match(/unsafe-eval|CSP/)) {
- warn$$1(
- 'It seems you are using the standalone build of Vue.js in an ' +
- 'environment with Content Security Policy that prohibits unsafe-eval. ' +
- 'The template compiler cannot work in this environment. Consider ' +
- 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
- 'templates into render functions.'
- );
- }
- }
- }
- // check cache
- var key = options.delimiters
- ? String(options.delimiters) + template
- : template;
- if (cache[key]) {
- return cache[key]
- }
- // compile
- var compiled = compile(template, options);
- // check compilation errors/tips
- {
- if (compiled.errors && compiled.errors.length) {
- if (options.outputSourceRange) {
- compiled.errors.forEach(function (e) {
- warn$$1(
- "Error compiling template:\n\n" + (e.msg) + "\n\n" +
- generateCodeFrame(template, e.start, e.end),
- vm
- );
- });
- } else {
- warn$$1(
- "Error compiling template:\n\n" + template + "\n\n" +
- compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
- vm
- );
- }
- }
- if (compiled.tips && compiled.tips.length) {
- if (options.outputSourceRange) {
- compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
- } else {
- compiled.tips.forEach(function (msg) { return tip(msg, vm); });
- }
- }
- }
- // turn code into functions
- var res = {};
- var fnGenErrors = [];
- res.render = createFunction(compiled.render, fnGenErrors);
- res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
- return createFunction(code, fnGenErrors)
- });
- // check function generation errors.
- // this should only happen if there is a bug in the compiler itself.
- // mostly for codegen development use
- /* istanbul ignore if */
- {
- if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
- warn$$1(
- "Failed to generate render function:\n\n" +
- fnGenErrors.map(function (ref) {
- var err = ref.err;
- var code = ref.code;
- return ((err.toString()) + " in\n\n" + code + "\n");
- }).join('\n'),
- vm
- );
- }
- }
- return (cache[key] = res)
- }
- }
- /* */
- function createCompilerCreator (baseCompile) {
- return function createCompiler (baseOptions) {
- function compile (
- template,
- options
- ) {
- var finalOptions = Object.create(baseOptions);
- var errors = [];
- var tips = [];
- var warn = function (msg, range, tip) {
- (tip ? tips : errors).push(msg);
- };
- if (options) {
- if (options.outputSourceRange) {
- // $flow-disable-line
- var leadingSpaceLength = template.match(/^\s*/)[0].length;
- warn = function (msg, range, tip) {
- var data = { msg: msg };
- if (range) {
- if (range.start != null) {
- data.start = range.start + leadingSpaceLength;
- }
- if (range.end != null) {
- data.end = range.end + leadingSpaceLength;
- }
- }
- (tip ? tips : errors).push(data);
- };
- }
- // merge custom modules
- if (options.modules) {
- finalOptions.modules =
- (baseOptions.modules || []).concat(options.modules);
- }
- // merge custom directives
- if (options.directives) {
- finalOptions.directives = extend(
- Object.create(baseOptions.directives || null),
- options.directives
- );
- }
- // copy other options
- for (var key in options) {
- if (key !== 'modules' && key !== 'directives') {
- finalOptions[key] = options[key];
- }
- }
- }
- finalOptions.warn = warn;
- var compiled = baseCompile(template.trim(), finalOptions);
- {
- detectErrors(compiled.ast, warn);
- }
- compiled.errors = errors;
- compiled.tips = tips;
- return compiled
- }
- return {
- compile: compile,
- compileToFunctions: createCompileToFunctionFn(compile)
- }
- }
- }
- /* */
- // `createCompilerCreator` allows creating compilers that use alternative
- // parser/optimizer/codegen, e.g the SSR optimizing compiler.
- // Here we just export a default compiler using the default parts.
- var createCompiler = createCompilerCreator(function baseCompile (
- template,
- options
- ) {
- var ast = parse(template.trim(), options);
- if (options.optimize !== false) {
- optimize(ast, options);
- }
- var code = generate(ast, options);
- return {
- ast: ast,
- render: code.render,
- staticRenderFns: code.staticRenderFns
- }
- });
- /* */
- var ref$1 = createCompiler(baseOptions);
- var compile = ref$1.compile;
- var compileToFunctions = ref$1.compileToFunctions;
- /* */
- // check whether current browser encodes a char inside attribute values
- var div;
- function getShouldDecode (href) {
- div = div || document.createElement('div');
- div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
- return div.innerHTML.indexOf(' ') > 0
- }
- // #3663: IE encodes newlines inside attribute values while other browsers don't
- var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
- // #6828: chrome encodes content in a[href]
- var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
- /* */
- var idToTemplate = cached(function (id) {
- var el = query(id);
- return el && el.innerHTML
- });
- var mount = Vue.prototype.$mount;
- Vue.prototype.$mount = function (
- el,
- hydrating
- ) {
- el = el && query(el);
- /* istanbul ignore if */
- if (el === document.body || el === document.documentElement) {
- warn(
- "Do not mount Vue to <html> or <body> - mount to normal elements instead."
- );
- return this
- }
- var options = this.$options;
- // resolve template/el and convert to render function
- if (!options.render) {
- var template = options.template;
- if (template) {
- if (typeof template === 'string') {
- if (template.charAt(0) === '#') {
- template = idToTemplate(template);
- /* istanbul ignore if */
- if (!template) {
- warn(
- ("Template element not found or is empty: " + (options.template)),
- this
- );
- }
- }
- } else if (template.nodeType) {
- template = template.innerHTML;
- } else {
- {
- warn('invalid template option:' + template, this);
- }
- return this
- }
- } else if (el) {
- template = getOuterHTML(el);
- }
- if (template) {
- /* istanbul ignore if */
- if (config.performance && mark) {
- mark('compile');
- }
- var ref = compileToFunctions(template, {
- outputSourceRange: "development" !== 'production',
- shouldDecodeNewlines: shouldDecodeNewlines,
- shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
- delimiters: options.delimiters,
- comments: options.comments
- }, this);
- var render = ref.render;
- var staticRenderFns = ref.staticRenderFns;
- options.render = render;
- options.staticRenderFns = staticRenderFns;
- /* istanbul ignore if */
- if (config.performance && mark) {
- mark('compile end');
- measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
- }
- }
- }
- return mount.call(this, el, hydrating)
- };
- /**
- * Get outerHTML of elements, taking care
- * of SVG elements in IE as well.
- */
- function getOuterHTML (el) {
- if (el.outerHTML) {
- return el.outerHTML
- } else {
- var container = document.createElement('div');
- container.appendChild(el.cloneNode(true));
- return container.innerHTML
- }
- }
- Vue.compile = compileToFunctions;
- module.exports = Vue;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(31).setImmediate))
- /***/ }),
- /* 68 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
- "use strict";
- if (global.setImmediate) {
- return;
- }
- var nextHandle = 1; // Spec says greater than zero
- var tasksByHandle = {};
- var currentlyRunningATask = false;
- var doc = global.document;
- var registerImmediate;
- function setImmediate(callback) {
- // Callback can either be a function or a string
- if (typeof callback !== "function") {
- callback = new Function("" + callback);
- }
- // Copy function arguments
- var args = new Array(arguments.length - 1);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i + 1];
- }
- // Store and register the task
- var task = { callback: callback, args: args };
- tasksByHandle[nextHandle] = task;
- registerImmediate(nextHandle);
- return nextHandle++;
- }
- function clearImmediate(handle) {
- delete tasksByHandle[handle];
- }
- function run(task) {
- var callback = task.callback;
- var args = task.args;
- switch (args.length) {
- case 0:
- callback();
- break;
- case 1:
- callback(args[0]);
- break;
- case 2:
- callback(args[0], args[1]);
- break;
- case 3:
- callback(args[0], args[1], args[2]);
- break;
- default:
- callback.apply(undefined, args);
- break;
- }
- }
- function runIfPresent(handle) {
- // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
- // So if we're currently running a task, we'll need to delay this invocation.
- if (currentlyRunningATask) {
- // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
- // "too much recursion" error.
- setTimeout(runIfPresent, 0, handle);
- } else {
- var task = tasksByHandle[handle];
- if (task) {
- currentlyRunningATask = true;
- try {
- run(task);
- } finally {
- clearImmediate(handle);
- currentlyRunningATask = false;
- }
- }
- }
- }
- function installNextTickImplementation() {
- registerImmediate = function(handle) {
- process.nextTick(function () { runIfPresent(handle); });
- };
- }
- function canUsePostMessage() {
- // The test against `importScripts` prevents this implementation from being installed inside a web worker,
- // where `global.postMessage` means something completely different and can't be used for this purpose.
- if (global.postMessage && !global.importScripts) {
- var postMessageIsAsynchronous = true;
- var oldOnMessage = global.onmessage;
- global.onmessage = function() {
- postMessageIsAsynchronous = false;
- };
- global.postMessage("", "*");
- global.onmessage = oldOnMessage;
- return postMessageIsAsynchronous;
- }
- }
- function installPostMessageImplementation() {
- // Installs an event handler on `global` for the `message` event: see
- // * https://developer.mozilla.org/en/DOM/window.postMessage
- // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
- var messagePrefix = "setImmediate$" + Math.random() + "$";
- var onGlobalMessage = function(event) {
- if (event.source === global &&
- typeof event.data === "string" &&
- event.data.indexOf(messagePrefix) === 0) {
- runIfPresent(+event.data.slice(messagePrefix.length));
- }
- };
- if (global.addEventListener) {
- global.addEventListener("message", onGlobalMessage, false);
- } else {
- global.attachEvent("onmessage", onGlobalMessage);
- }
- registerImmediate = function(handle) {
- global.postMessage(messagePrefix + handle, "*");
- };
- }
- function installMessageChannelImplementation() {
- var channel = new MessageChannel();
- channel.port1.onmessage = function(event) {
- var handle = event.data;
- runIfPresent(handle);
- };
- registerImmediate = function(handle) {
- channel.port2.postMessage(handle);
- };
- }
- function installReadyStateChangeImplementation() {
- var html = doc.documentElement;
- registerImmediate = function(handle) {
- // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
- // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
- var script = doc.createElement("script");
- script.onreadystatechange = function () {
- runIfPresent(handle);
- script.onreadystatechange = null;
- html.removeChild(script);
- script = null;
- };
- html.appendChild(script);
- };
- }
- function installSetTimeoutImplementation() {
- registerImmediate = function(handle) {
- setTimeout(runIfPresent, 0, handle);
- };
- }
- // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
- var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
- attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
- // Don't get fooled by e.g. browserify environments.
- if ({}.toString.call(global.process) === "[object process]") {
- // For Node.js before 0.9
- installNextTickImplementation();
- } else if (canUsePostMessage()) {
- // For non-IE10 modern browsers
- installPostMessageImplementation();
- } else if (global.MessageChannel) {
- // For web workers, where supported
- installMessageChannelImplementation();
- } else if (doc && "onreadystatechange" in doc.createElement("script")) {
- // For IE 6–8
- installReadyStateChangeImplementation();
- } else {
- // For older browsers
- installSetTimeoutImplementation();
- }
- attachTo.setImmediate = setImmediate;
- attachTo.clearImmediate = clearImmediate;
- }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(52)))
- /***/ }),
- /* 69 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(70)
- __webpack_require__(73)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(75)
- /* template */
- var __vue_template__ = __webpack_require__(135)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-0fbb5d46"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/App.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-0fbb5d46", Component.options)
- } else {
- hotAPI.reload("data-v-0fbb5d46", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 70 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(71);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("29742c7e", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./App.vue", function() {
- var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./App.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 71 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\nbody { overflow-x: hidden;\n}\n", ""]);
- // exports
- /***/ }),
- /* 72 */
- /***/ (function(module, exports) {
- /**
- * Translates the list format produced by css-loader into something
- * easier to manipulate.
- */
- module.exports = function listToStyles (parentId, list) {
- var styles = []
- var newStyles = {}
- for (var i = 0; i < list.length; i++) {
- var item = list[i]
- var id = item[0]
- var css = item[1]
- var media = item[2]
- var sourceMap = item[3]
- var part = {
- id: parentId + ':' + i,
- css: css,
- media: media,
- sourceMap: sourceMap
- }
- if (!newStyles[id]) {
- styles.push(newStyles[id] = { id: id, parts: [part] })
- } else {
- newStyles[id].parts.push(part)
- }
- }
- return styles
- }
- /***/ }),
- /* 73 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(74);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("4c209231", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./App.vue", function() {
- var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./App.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 74 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.child-view[data-v-0fbb5d46] {\n position: absolute;\n width: 100%;\n min-height: 100%;\n background-color: #f1f2f7;\n -webkit-transition: all .3s cubic-bezier(.55, 0, .1, 1);\n transition: all .3s cubic-bezier(.55, 0, .1, 1);\n}\n.app-slide-no-leave-to[data-v-0fbb5d46] {display: none;\n}\n/**\n * 左右模式\n */\n.app-slide-left-leave-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-left-leave-to[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-left-enter-active[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(30%,0);transform:translate(30%,0)\n}\n.app-slide-left-enter-to[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-leave-active[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-leave-to[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(30%,0);transform:translate(30%,0)\n}\n.app-slide-right-enter-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-enter[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n\n/**\n * 上下模式\n */\n.app-slide-up-leave-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-up-leave-to[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-up-enter-active[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(0,20%);transform:translate(0,20%)\n}\n.app-slide-up-enter-to[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-leave-active[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-leave-to[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(0,20%);transform:translate(0,20%)\n}\n.app-slide-down-enter-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-enter[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n", ""]);
- // exports
- /***/ }),
- /* 75 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_WSpinner__ = __webpack_require__(76);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_WSpinner___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_WSpinner__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_WHeader__ = __webpack_require__(81);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_WHeader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__components_WHeader__);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- components: { WHeader: __WEBPACK_IMPORTED_MODULE_1__components_WHeader___default.a, WSpinner: __WEBPACK_IMPORTED_MODULE_0__components_WSpinner___default.a },
- data: function data() {
- return {
- transitionName: null
- };
- },
- mounted: function mounted() {
- var _this = this;
- this.checkToken();
- //
- var hash = window.location.hash;
- if (hash.indexOf("#") === 0) {
- hash = hash.substr(1);
- if (hash) {
- this.$nextTick(function () {
- hash = $A.removeURLParameter(hash, 'token');
- _this.goForward({ path: hash });
- });
- }
- }
- this.sessionStorage('/', 1);
- var pathname = window.location.pathname;
- if (pathname && this.sessionStorage(pathname) === 0) {
- this.sessionStorage(pathname, this.sessionStorage('::count') + 1);
- }
- //
- setInterval(function () {
- _this.searchEnter();
- }, 1000);
- //
- this.handleWebSocket();
- $A.setOnUserInfoListener("app", function () {
- _this.handleWebSocket();
- });
- },
- watch: {
- '$route': function $route(To, From) {
- if (this.transitionName === null) {
- this.transitionName = 'app-slide-no';
- return;
- }
- if (typeof To.name === 'undefined' || typeof From.name === 'undefined') {
- return;
- }
- this.slideType(To, From);
- }
- },
- methods: {
- checkToken: function checkToken() {
- var _this2 = this;
- var token = $A.urlParameter("token");
- if ($A.count(token) > 10) {
- $.setToken(decodeURIComponent(token));
- $A.getUserInfo(true);
- var path = $A.removeURLParameter(window.location.href, 'token');
- var uri = document.createElement('a');
- uri.href = path;
- if (uri.pathname) {
- var query = $A.urlParameterAll();
- if (typeof query['token'] !== "undefined") delete query['token'];
- this.$nextTick(function () {
- _this2.goForward({ path: uri.pathname, query: query }, true);
- });
- }
- }
- },
- slideType: function slideType(To, From) {
- var isBack = this.$router.isBack;
- this.$router.isBack = false;
- //
- var ToIndex = this.sessionStorage(To.path);
- var FromIndex = this.sessionStorage(From.path);
- if (ToIndex && ToIndex < FromIndex) {
- isBack = true; //后退
- this.sessionStorage(true, ToIndex);
- } else {
- isBack = false; //前进
- this.sessionStorage(To.path, this.sessionStorage('::count') + 1);
- }
- //
- if (To.meta.slide === false || From.meta.slide === false) {
- //取消动画
- this.transitionName = 'app-slide-no';
- } else if (To.meta.slide === 'up' || From.meta.slide === 'up' || To.meta.slide === 'down' || From.meta.slide === 'down') {
- //上下动画
- if (isBack) {
- this.transitionName = 'app-slide-down';
- } else {
- this.transitionName = 'app-slide-up';
- }
- } else {
- //左右动画(默认)
- if (isBack) {
- this.transitionName = 'app-slide-right';
- } else {
- this.transitionName = 'app-slide-left';
- }
- }
- },
- sessionStorage: function sessionStorage(path, num) {
- var conut = 0;
- var history = JSON.parse(window.sessionStorage['__history__'] || '{}');
- if (path === true) {
- var items = {};
- for (var i in history) {
- if (history.hasOwnProperty(i)) {
- if (parseInt(history[i]) <= num) {
- items[i] = history[i];
- conut++;
- }
- }
- }
- history = items;
- history['::count'] = Math.max(num, conut);
- window.sessionStorage['__history__'] = JSON.stringify(history);
- return history;
- }
- if (typeof num === 'undefined') {
- return parseInt(history[path] || 0);
- }
- if (path === "/") num = 1;
- history[path] = num;
- for (var key in history) {
- if (history.hasOwnProperty(key) && key !== '::count') {
- conut++;
- }
- }
- history['::count'] = Math.max(num, conut);
- window.sessionStorage['__history__'] = JSON.stringify(history);
- },
- searchEnter: function searchEnter() {
- var row = $A(".sreachBox");
- if (row.length === 0) {
- return;
- }
- if (row.attr("data-enter-init") === "init") {
- return;
- }
- row.attr("data-enter-init", "init");
- //
- var buttons = row.find("button[type='button']");
- var button = null;
- if (buttons.length === 0) {
- return;
- }
- buttons.each(function (index, item) {
- if ($A(item).text().indexOf("搜索")) {
- button = $A(item);
- }
- });
- if (button === null) {
- return;
- }
- row.find("input.ivu-input").keydown(function (e) {
- if (e.keyCode == 13) {
- if (!button.hasClass("ivu-btn-loading")) {
- button.click();
- }
- }
- });
- },
- handleWebSocket: function handleWebSocket() {
- var _this3 = this;
- if ($A.getToken() === false) {
- $A.WSOB.close();
- } else {
- $A.WSOB.setOnMsgListener("app", function (msgDetail) {
- if (msgDetail.username == _this3.usrName) {
- return;
- }
- switch (msgDetail.messageType) {
- case 'open':
- window.localStorage.setItem("__::WookTeam:config", $A.jsonStringify(Object.assign(msgDetail.config, {
- nickname: $A.getNickName(false)
- })));
- break;
- case 'close':
- window.localStorage.setItem("__::WookTeam:config", $A.jsonStringify({}));
- break;
- case 'info':
- if (msgDetail.body.type == 'update') {
- $A.getUserInfo(true);
- }
- break;
- case 'user':
- if (msgDetail.body.type == 'taskA') {
- $A.triggerTaskInfoListener(msgDetail.body.act, msgDetail.body.taskDetail, false);
- }
- break;
- case 'kick':
- $A.token("");
- $A.storage("userInfo", {});
- $A.triggerUserInfoListener({});
- //
- var id = 'inip_' + Math.round(Math.random() * 10000);
- var ip = msgDetail.body.ip;
- var ip2 = ip.substring(0, ip.lastIndexOf('.')) + '.*';
- _this3.$Modal.warning({
- title: _this3.$L("系统提示"),
- content: _this3.$L('您的帐号在其他地方(%)登录,您被迫退出,如果这不是您本人的操作,请注意帐号安全!', '<span id="' + id + '">' + ip2 + '</span>'),
- onOk: function onOk() {
- _this3.goForward({ path: '/' }, true);
- }
- });
- _this3.$nextTick(function () {
- $A.getIpInfo(ip, function (res) {
- if (res.ret === 1) {
- $A("span#" + id).text(res.data.textSmall);
- $A("span#" + id).attr("title", ip2);
- }
- });
- });
- break;
- }
- });
- }
- }
- }
- });
- /***/ }),
- /* 76 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(77)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(79)
- /* template */
- var __vue_template__ = __webpack_require__(80)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-1f542a12"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/WSpinner.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-1f542a12", Component.options)
- } else {
- hotAPI.reload("data-v-1f542a12", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 77 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(78);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("0de25de8", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1f542a12\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WSpinner.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1f542a12\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WSpinner.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 78 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.w-spinner[data-v-1f542a12] {\n display: none;\n position: fixed;\n z-index: 9999;\n bottom: 20px;\n right: 20px;\n margin: 0 auto;\n width: 30px;\n height: 30px;\n}\n.w-spinner .w-circular[data-v-1f542a12] {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}\n", ""]);
- // exports
- /***/ }),
- /* 79 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'WSpinner'
- });
- /***/ }),
- /* 80 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { staticClass: "w-spinner" },
- [_c("w-loading", { staticClass: "w-circular" })],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-1f542a12", module.exports)
- }
- }
- /***/ }),
- /* 81 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(82)
- __webpack_require__(84)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(86)
- /* template */
- var __vue_template__ = __webpack_require__(134)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-2df6db1f"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/WHeader.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-2df6db1f", Component.options)
- } else {
- hotAPI.reload("data-v-2df6db1f", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 82 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(83);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("3e511ece", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WHeader.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WHeader.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 83 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.w-header-chat-draver .ivu-drawer-wrap,\n.w-header-chat-draver .ivu-drawer-mask {\n z-index: 1001;\n}\n.w-header-chat-draver .w-header-chat-close {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 1;\n color: #ffffff;\n font-size: 32px;\n width: 68px;\n height: 58px;\n line-height: 58px;\n text-align: center;\n cursor: pointer;\n}\n@media (max-width: 768px) {\n.w-header-chat-draver .w-header-chat-close {\n width: 50px;\n height: 50px;\n line-height: 50px;\n}\n}\n.w-header-chat-draver .w-header-chat-close > i {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.w-header-chat-draver .w-header-chat-close:hover > i {\n -webkit-transform: scale(1.12) rotate(90deg);\n transform: scale(1.12) rotate(90deg);\n}\n", ""]);
- // exports
- /***/ }),
- /* 84 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(85);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("2b23ebf8", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./WHeader.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./WHeader.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 85 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.w-header[data-v-2df6db1f] {\n z-index: 15;\n position: fixed;\n left: 0;\n top: 0;\n right: 0;\n font-size: 14px;\n background: #0396f2 linear-gradient(45deg, #0396f2 0%, #0285d7 100%);\n -webkit-box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.25);\n}\n.w-header .icon[data-v-2df6db1f] {\n font-size: 16px;\n margin-right: 3px;\n}\n.w-header .w-header-row[data-v-2df6db1f] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n color: #fff;\n height: 40px;\n position: relative;\n z-index: 10;\n margin: 0 32px;\n}\n.w-header .w-header-row .w-header-row-left[data-v-2df6db1f] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n overflow-x: auto;\n -webkit-backface-visibility: hidden;\n -webkit-overflow-scrolling: touch;\n}\n.w-header .w-header-row .w-header-row-left li[data-v-2df6db1f] {\n line-height: 40px;\n color: #fff;\n display: inline-block;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f] {\n color: #fff;\n display: block;\n min-width: 116px;\n text-align: center;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f]:visited {\n color: #fff;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f]:hover {\n color: #f2f2f2;\n}\n.w-header .w-header-row .w-header-row-left li[data-v-2df6db1f]:hover, .w-header .w-header-row .w-header-row-left li.active[data-v-2df6db1f] {\n background: #0277c0;\n}\n.w-header .w-header-row .w-header-row-right[data-v-2df6db1f] {\n white-space: nowrap;\n text-align: right;\n line-height: 40px;\n margin-right: -5px;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f] {\n display: inline-block;\n position: relative;\n padding-left: 10px;\n padding-right: 10px;\n margin-right: -5px;\n cursor: pointer;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f]:hover {\n background: #0277c0;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-mticon[data-v-2df6db1f] {\n vertical-align: top;\n margin-top: 8px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-mticon-9[data-v-2df6db1f] {\n vertical-align: top;\n margin-top: 9px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-info-num[data-v-2df6db1f] {\n position: absolute;\n top: 2px;\n left: 22px;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9);\n transform: scale(0.9);\n z-index: 1;\n}\n.w-header .w-header-row .w-header-row-right .right-info .userimg[data-v-2df6db1f] {\n display: none;\n width: 26px;\n height: 26px;\n margin-top: 7px;\n vertical-align: top;\n border-radius: 50%;\n}\n.w-header .w-header-row .w-header-row-right .right-info .username[data-v-2df6db1f] {\n display: inline-block;\n}\n@media (max-width: 768px) {\n.w-header .w-header-row[data-v-2df6db1f] {\n margin: 0 16px;\n}\n.w-header .w-header-row .w-header-row-left .dropdown-menu[data-v-2df6db1f] {\n font-size: 28px;\n vertical-align: top;\n margin-top: 6px;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f] {\n padding-left: 8px;\n padding-right: 8px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .userimg[data-v-2df6db1f] {\n display: inline-block;\n}\n.w-header .w-header-row .w-header-row-right .right-info .username[data-v-2df6db1f] {\n display: none;\n}\n}\n.setting-auto-day[data-v-2df6db1f] {\n display: block;\n width: 110px;\n margin-top: 12px;\n line-height: 32px;\n margin-bottom: -10px;\n}\n.setting-bg[data-v-2df6db1f] {\n margin-top: 6px;\n margin-bottom: -24px;\n}\n.setting-bg[data-v-2df6db1f]:after, .setting-bg[data-v-2df6db1f]:before {\n display: table;\n content: \"\";\n}\n.setting-bg li[data-v-2df6db1f] {\n margin: 0 16px 16px 0;\n width: 160px;\n height: 124px;\n display: inline-block;\n cursor: pointer;\n border: solid 2px #fff;\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.setting-bg li.active[data-v-2df6db1f], .setting-bg li[data-v-2df6db1f]:hover {\n border-color: #0396f2;\n -webkit-transform: scale(1.02);\n transform: scale(1.02);\n}\n", ""]);
- // exports
- /***/ }),
- /* 86 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ImgUpload__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__ImgUpload__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__project_header_create__ = __webpack_require__(91);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__project_header_create___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__project_header_create__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__project_header_archived__ = __webpack_require__(100);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__project_header_archived___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__project_header_archived__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chat_Index__ = __webpack_require__(105);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chat_Index___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__chat_Index__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer__ = __webpack_require__(49);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__iview_WDrawer__);
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'WHeader',
- components: { WDrawer: __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer___default.a, ChatIndex: __WEBPACK_IMPORTED_MODULE_3__chat_Index___default.a, HeaderArchived: __WEBPACK_IMPORTED_MODULE_2__project_header_archived___default.a, HeaderCreate: __WEBPACK_IMPORTED_MODULE_1__project_header_create___default.a, ImgUpload: __WEBPACK_IMPORTED_MODULE_0__ImgUpload___default.a },
- data: function data() {
- return {
- tabActive: '',
- loadIng: 0,
- isAdmin: false,
- systemDrawerShow: false,
- userDrawerShow: false,
- userDrawerTab: 'personal',
- formSystem: {
- github: 'show',
- reg: 'open',
- callav: 'open',
- autoArchived: 'close',
- archivedDay: 7
- },
- formDatum: {
- userimg: '',
- nickname: '',
- profession: ''
- },
- ruleDatum: {},
- formPass: {
- oldpass: '',
- newpass: '',
- checkpass: ''
- },
- rulePass: {},
- formSetting: {
- bgid: 0
- },
- chatDrawerShow: false,
- chatUnreadTotal: 0
- };
- },
- mounted: function mounted() {
- this.isAdmin = $A.identity('admin');
- this.formatDatum();
- //
- this.tabActive = this.$route.meta.tabActive;
- //
- if ($A.urlParameter("open") === 'chat' && $A.getToken() !== false) {
- this.chatDrawerShow = true;
- }
- },
- watch: {
- '$route': function $route() {
- this.tabActive = this.$route.meta.tabActive;
- this.systemDrawerShow = false;
- this.chatDrawerShow = $A.urlParameter("open") === 'chat' && $A.getToken() !== false;
- if (!this.usrInfo.changepass) {
- this.userDrawerShow = false;
- }
- },
- usrName: function usrName() {
- this.isAdmin = $A.identity('admin');
- this.formatDatum();
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- var _this = this;
- this.ruleDatum = {
- nickname: [{ required: true, message: this.$L('请输入昵称!'), trigger: 'change' }, { type: 'string', min: 2, message: this.$L('昵称长度至少2位!'), trigger: 'change' }]
- };
- this.rulePass = {
- oldpass: [{ required: true, message: this.$L('请输入旧密码!'), trigger: 'change' }, { type: 'string', min: 6, message: this.$L('密码长度至少6位!'), trigger: 'change' }],
- newpass: [{
- validator: function validator(rule, value, callback) {
- if (value === '') {
- callback(new Error(_this.$L('请输入新密码!')));
- } else {
- if (_this.formPass.checkpass !== '') {
- _this.$refs.formPass.validateField('checkpass');
- }
- callback();
- }
- },
- required: true,
- trigger: 'change'
- }, { type: 'string', min: 6, message: this.$L('密码长度至少6位!'), trigger: 'change' }],
- checkpass: [{
- validator: function validator(rule, value, callback) {
- if (value === '') {
- callback(new Error(_this.$L('请重新输入新密码!')));
- } else if (value !== _this.formPass.newpass) {
- callback(new Error(_this.$L('两次密码输入不一致!')));
- } else {
- callback();
- }
- },
- required: true,
- trigger: 'change'
- }]
- };
- },
- formatDatum: function formatDatum() {
- this.$set(this.formDatum, 'userimg', this.usrInfo.userimg);
- this.$set(this.formDatum, 'nickname', this.usrInfo.nickname);
- this.$set(this.formDatum, 'profession', this.usrInfo.profession);
- this.$set(this.formSetting, 'bgid', this.usrInfo.bgid);
- this.formDatum__reset = $A.cloneData(this.formDatum);
- this.formSetting__reset = $A.cloneData(this.formSetting);
- this.formPass__reset = $A.cloneData(this.formPass);
- this.changepass();
- },
- changepass: function changepass() {
- var _this2 = this;
- if (this.usrInfo.changepass) {
- this.userDrawerShow = true;
- this.userDrawerTab = 'account';
- setTimeout(function () {
- _this2.changepass();
- }, 500);
- }
- },
- getBgUrl: function getBgUrl(id, thumb) {
- id = Math.max(1, parseInt(id));
- return 'url(' + window.location.origin + '/images/bg/' + (thumb ? 'thumb/' : '') + id + '.jpg' + ')';
- },
- tabPage: function tabPage(path) {
- this.goForward({ path: '/' + path });
- },
- setRightSelect: function setRightSelect(act) {
- switch (act) {
- case 'system':
- this.systemSetting(false);
- this.systemDrawerShow = true;
- break;
- case 'user':
- this.userDrawerShow = true;
- break;
- case 'out':
- this.logout();
- break;
- }
- },
- logout: function logout() {
- this.$Modal.confirm({
- title: this.$L('退出登录'),
- content: this.$L('您确定要退出登录吗?'),
- onOk: function onOk() {
- $A.userLogout();
- }
- });
- },
- systemSetting: function systemSetting(save) {
- var _this3 = this;
- this.loadIng++;
- $A.apiAjax({
- url: 'system/setting?type=' + (save ? 'save' : 'get'),
- data: this.formSystem,
- complete: function complete() {
- _this3.loadIng--;
- },
- success: function success(res) {
- if (res.ret === 1) {
- var tempData = res.data;
- tempData.github = tempData.github || 'show';
- tempData.reg = tempData.reg || 'open';
- tempData.callav = tempData.callav || 'open';
- tempData.autoArchived = tempData.autoArchived || 'close';
- tempData.archivedDay = tempData.archivedDay || 7;
- _this3.formSystem = tempData;
- _this3.formSystem__reset = $A.cloneData(_this3.formSystem);
- if (save) {
- _this3.$Message.success(_this3.$L('修改成功'));
- }
- } else {
- if (save) {
- _this3.$Modal.error({ title: _this3.$L('温馨提示'), content: res.msg });
- }
- }
- }
- });
- },
- handleSubmit: function handleSubmit(name) {
- var _this4 = this;
- this.$refs[name].validate(function (valid) {
- if (valid) {
- switch (name) {
- case "formSystem":
- {
- _this4.systemSetting(true);
- break;
- }
- case "formDatum":
- {
- _this4.loadIng++;
- $A.apiAjax({
- url: 'users/editdata',
- data: _this4.formDatum,
- complete: function complete() {
- _this4.loadIng--;
- },
- success: function success(res) {
- if (res.ret === 1) {
- $A.getUserInfo(true);
- $A.getUserBasic(_this4.usrInfo.username, function () {}, 0);
- _this4.$Message.success(_this4.$L('修改成功'));
- } else {
- _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
- }
- }
- });
- break;
- }
- case "formPass":
- {
- _this4.loadIng++;
- $A.apiAjax({
- url: 'users/editpass',
- data: _this4.formPass,
- complete: function complete() {
- _this4.loadIng--;
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this4.userDrawerShow = false;
- _this4.$Message.success(_this4.$L('修改成功,请重新登录!'));
- _this4.$refs[name].resetFields();
- $A.userLogout();
- } else {
- _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
- }
- }
- });
- break;
- }
- case "formSetting":
- {
- _this4.loadIng++;
- $A.apiAjax({
- url: 'users/editdata',
- data: _this4.formSetting,
- complete: function complete() {
- _this4.loadIng--;
- },
- success: function success(res) {
- if (res.ret === 1) {
- $A.getUserInfo(true);
- _this4.$Message.success(_this4.$L('修改成功'));
- } else {
- _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
- }
- }
- });
- break;
- }
- }
- }
- });
- },
- handleReset: function handleReset(name) {
- if (typeof this[name + '__reset'] !== "undefined") {
- this[name] = $A.cloneData(this[name + '__reset']);
- return;
- }
- this.$refs[name].resetFields();
- },
- formArchived: function formArchived(value) {
- this.formSystem = _extends({}, this.formSystem, { autoArchived: value });
- }
- }
- });
- /***/ }),
- /* 87 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(88);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("3b50b398", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-55c90fc2\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ImgUpload.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-55c90fc2\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ImgUpload.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 88 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.img-upload-modal .ivu-modal-mask {\n z-index: 1001;\n}\n.img-upload-modal .ivu-modal-no-mask {\n background-color: rgba(55, 55, 55, 0.2);\n}\n.img-upload-modal .ivu-modal-wrap {\n z-index: 1001;\n}\n.imgcomp-upload-list {\n display: inline-block;\n width: 60px;\n height: 60px;\n text-align: center;\n line-height: 60px;\n border: 1px solid transparent;\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n position: relative;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n margin-right: 4px;\n vertical-align: top;\n}\n.imgcomp-upload-list .imgcomp-upload-img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-position: center;\n background-size: cover;\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover {\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, 0.6);\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover i {\n color: #fff;\n font-size: 24px;\n cursor: pointer;\n vertical-align: middle;\n margin: 0;\n -webkit-transition: all .2s;\n transition: all .2s;\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover i:hover {\n font-size: 28px;\n}\n.imgcomp-upload-list .ivu-progress-outer {\n background-color: rgba(0, 0, 0, 0.68);\n}\n.imgcomp-upload-list .ivu-progress-outer .ivu-progress-inner {\n width: 88%;\n}\n.imgcomp-upload-list:hover .imgcomp-upload-list-cover {\n display: block;\n}\n.img-upload-foot {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.img-upload-foot .img-upload-foot-input {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n text-align: left;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.img-upload-foot .img-upload-foot-input .img-upload-foot-httptitle {\n cursor: pointer;\n padding-left: 3px;\n margin-right: 22px;\n}\n.add-box {\n width: 60px;\n height: 60px;\n line-height: 60px;\n display: inline-block;\n background: #fff;\n border: 1px dashed #dddee1;\n border-radius: 4px;\n text-align: center;\n position: relative;\n overflow: hidden;\n vertical-align: top;\n}\n.add-box .add-box-icon i {\n vertical-align: middle;\n padding-bottom: 2px;\n}\n.add-box .add-box-upload {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: #ffffff;\n padding-top: 9px;\n background: rgba(0, 0, 0, 0.6);\n}\n.add-box .add-box-upload .add-box-item {\n height: 22px;\n line-height: 22px;\n cursor: pointer;\n}\n.add-box .add-box-upload .add-box-item .ivu-upload-drag, .add-box .add-box-upload .add-box-item .ivu-upload-drag:hover {\n background: transparent;\n border: 0;\n border-radius: 0;\n}\n.add-box .add-box-upload .add-box-item span {\n -webkit-transition: all .2s;\n transition: all .2s;\n font-size: 12px;\n}\n.add-box .add-box-upload .add-box-item:hover span {\n font-size: 14px;\n}\n.add-box em {\n font-style: normal;\n}\n.add-box:hover {\n border-color: rgba(0, 0, 0, 0.6);\n}\n.add-box:hover .add-box-upload {\n display: block;\n}\n.callback-add-box {\n display: block;\n width: auto;\n height: 25px;\n line-height: 25px;\n border: 0;\n background: transparent;\n}\n.callback-add-box .add-box-icon {\n display: none;\n}\n.callback-add-box .add-box-upload {\n display: block;\n width: auto;\n background: transparent;\n color: #333;\n padding: 0;\n}\n.callback-add-box .add-box-upload > div {\n display: inline-block;\n padding-right: 10px;\n}\n.browse-load {\n margin: 20px;\n text-align: center;\n}\n.browse-list {\n max-height: 540px;\n overflow: auto;\n}\n.browse-list .browse-item {\n margin: 10px 15px;\n display: inline-block;\n text-align: center;\n cursor: pointer;\n position: relative;\n}\n.browse-list .browse-item .browse-img {\n width: 64px;\n height: 64px;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAABxCAAAAABg5GeyAAACW0lEQVR4Ae3XVRLjMBAE0L3/rSwKM3OcSNPyLVYOLvM6UD0Bd03LVe9XH+RlhlRSSSWVVFJJJZVUUkkllVRSSSWVVFJJJZVUUkl9WyqppJJKKqmkkgpURP17xngOAR5NxW5wlJ9MaLQh83F4NHWmd/gZtdVBaOldfDB1bq5UpJFbFOC6LKnYrkRO209PAw+hIuzWB8Ep5es8HvYo4z4tE1X8UeRwlMM2D5Bzkc7kj6Bi3VTKDDwEeUcrMxrUvGDXTnHa6kK69SDN9sgq1clxKSbNHqqnYmdri81Q9QHf1JPt1Frncaib2XbiTKL2GkHaurnY9LOulMV0O7G6Kw+g9sw2ohhm62KezVJaaufjWC1TnOkr1exilJ7Ji0vxCCqO9V4UwV4PYr9+apouhGYLKfnahdpqegjmeoXOpXgANe70pKT6Zhu19qkY2nC0PZS527lQOyInqr8Uvc5jqfUb1X+PGh5IhW90S2quh3FQC2XRcF66TUkTXPcLKm5FtdR9RJq+2hWII7UpFtmsQLEyzsdJtkxxpr6gLotbUSlV9yeT0Trmzk2XPdUThLYarUbWOY9j04xXQ2u+pMZLYSumGmNUH3HbM9qOAwSHodN2Pks25F2j3aI7+IxqNsB+YLWb16ukSjiW4xNB0gMoMfApBS/XZQgi3p9/5RsiKNKZEOwYFVIF5VyTyD19sbyjIJiNJRZxpNbx2S8sGKvGZNHJBniBu9Wy5WxjGuQFqIAcBHiRGyt4ua5gSCWVVFJJJZVUUkkllVRSSSWVVFJJJZVUUkkllVRSSSWVVFI/AgO0SXIVYHeGAAAAAElFTkSuQmCC);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.browse-list .browse-item .browse-title {\n display: block;\n width: 64px;\n margin-top: 5px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.browse-list .browse-item .browse-icon {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 64px;\n font-size: 36px;\n padding-top: 15px;\n color: #ffffff;\n background-color: rgba(0, 0, 0, 0.5);\n}\n.browse-list-disabled {\n position: relative;\n}\n.browse-list-disabled:after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(255, 255, 255, 0.9);\n z-index: 1;\n}\n", ""]);
- // exports
- /***/ }),
- /* 89 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ImgUpload',
- props: {
- value: {},
- num: {},
- width: {},
- height: {},
- type: {},
- http: {
- type: Boolean,
- default: false
- },
- otherParams: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- uploadIng: {
- type: Number,
- default: 0
- }
- },
- data: function data() {
- return {
- actionUrl: $A.apiUrl('system/imgupload'),
- params: {
- token: $A.getToken(),
- width: this.width,
- height: this.height
- },
- multiple: this.num > 1,
- visible: false,
- browseVisible: false,
- isLoading: false,
- browseList: [],
- browseListNext: [],
- imgVisible: '',
- defaultList: this.initItems(this.value),
- uploadList: [],
- maxNum: Math.min(Math.max($A.runNum(this.num), 1), 99),
- httpValue: '',
- httpType: '',
- maxSize: 204800
- };
- },
- mounted: function mounted() {
- var _this = this;
- this.uploadList = this.$refs.upload.fileList;
- this.$emit('input', this.uploadList);
- //
- var browseBox = $A(this.$refs.browselistbox);
- browseBox.scroll(function () {
- var nHight = browseBox[0].scrollHeight;
- var nTop = browseBox[0].scrollTop;
- var boxHight = browseBox.height();
- if (nTop + boxHight >= nHight) {
- //到底了
- if (_this.browseListNext.length > 0) {
- var tmpNext = _this.browseListNext;
- _this.browseListNext = [];
- _this.browsePictureFor(tmpNext);
- }
- }
- });
- },
- watch: {
- value: function value(val) {
- if (typeof val === 'string') {
- this.$emit('input', this.initItems(val));
- return;
- }
- if (val === this.$refs.upload.fileList) {
- return;
- }
- this.$refs.upload.fileList = this.initItems(val);
- this.uploadList = this.$refs.upload.fileList;
- },
- browseVisible: function browseVisible() {
- this.httpType = '';
- this.httpValue = '';
- }
- },
- computed: {
- uploadParams: function uploadParams() {
- if (Object.keys(this.otherParams).length > 0) {
- return Object.assign(this.params, this.otherParams);
- } else {
- return this.params;
- }
- }
- },
- methods: {
- handleCallback: function handleCallback(file) {
- if (this.type === 'callback') {
- if (file === true) {
- this.$emit('on-callback', this.uploadList);
- this.$refs.upload.fileList = [];
- this.uploadList = this.$refs.upload.fileList;
- } else if ((typeof file === 'undefined' ? 'undefined' : _typeof(file)) === "object") {
- this.$emit('on-callback', [file]);
- }
- }
- this.browseVisible = false;
- },
- initItems: function initItems(items) {
- //数据初始化
- if (typeof items === 'string') {
- items = [{ 'url': items }];
- }
- var lists = [];
- $A.each(items, function (index, item) {
- if (typeof item === 'string') item = { 'url': item };
- if (item.url) {
- item.active = true;
- item.status = 'finished';
- if (typeof item.path === 'undefined') item.path = item.url;
- if (typeof item.thumb === 'undefined') item.thumb = item.url;
- lists.push(item);
- }
- });
- return lists;
- },
- handleView: function handleView(item) {
- //查看
- this.visible = true;
- this.imgVisible = item.url;
- },
- handleRemove: function handleRemove(item) {
- //删除
- var fileList = this.$refs.upload.fileList;
- this.$refs.upload.fileList.splice(fileList.indexOf(item), 1);
- this.$emit('input', this.$refs.upload.fileList);
- },
- handleProgress: function handleProgress() {
- //开始上传
- this.$emit('update:uploadIng', this.uploadIng + 1);
- },
- handleSuccess: function handleSuccess(res, file) {
- //上传完成
- this.$emit('update:uploadIng', this.uploadIng - 1);
- if (res.ret === 1) {
- file.url = res.data.url;
- file.path = res.data.path;
- file.thumb = res.data.thumb;
- this.handleCallback(file);
- } else {
- this.$Modal.warning({
- title: this.$L('上传失败'),
- content: this.$L('文件 % 上传失败 %', file.name, res.msg)
- });
- this.$refs.upload.fileList.pop();
- }
- this.$emit('input', this.$refs.upload.fileList);
- },
- handleError: function handleError() {
- //上传错误
- this.$emit('update:uploadIng', this.uploadIng - 1);
- },
- handleFormatError: function handleFormatError(file) {
- //上传类型错误
- this.$Modal.warning({
- title: this.$L('文件格式不正确'),
- content: this.$L('文件 % 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。', file.name)
- });
- },
- handleMaxSize: function handleMaxSize(file) {
- //上传大小错误
- this.$Modal.warning({
- title: this.$L('超出文件大小限制'),
- content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
- });
- },
- handleBeforeUpload: function handleBeforeUpload() {
- //上传前判断
- var check = this.uploadList.length < this.maxNum;
- if (!check && this.uploadList.length == 1) {
- this.handleRemove(this.uploadList[0]);
- check = this.uploadList.length < this.maxNum;
- }
- if (!check) {
- this.$Modal.warning({
- title: this.$L('温馨提示'),
- content: this.$L('最多只能上传 % 张图片。', this.maxNum)
- });
- }
- this.params = {
- token: $A.getToken(),
- width: this.width,
- height: this.height
- };
- return check;
- },
- handleClick: function handleClick() {
- //手动上传
- if (this.handleBeforeUpload()) {
- this.$refs.upload.handleClick();
- }
- },
- handleManual: function handleManual(file) {
- //手动传file
- if (this.handleBeforeUpload()) {
- this.$refs.upload.upload(file);
- }
- },
- browsePicture: function browsePicture(path) {
- var _this2 = this;
- //获取图片空间
- this.browseVisible = true;
- this.browseList = [];
- this.browseListNext = [];
- this.isLoading = true;
- $A.apiAjax({
- url: 'system/imgview',
- data: { path: path ? path : '' },
- beforeSend: true,
- complete: true,
- error: true,
- success: function success(res) {
- _this2.isLoading = false;
- if (res.ret === 1) {
- var dirs = res.data['dirs'];
- for (var i = 0; i < dirs.length; i++) {
- _this2.browseList.push(dirs[i]);
- }
- _this2.browsePictureFor(res.data['files']);
- } else if (res.ret === -2) {
- _this2.browseVisible = false;
- _this2.$Modal.warning({ title: _this2.$L('温馨提示'), content: res.msg });
- }
- }
- });
- },
- browsePictureFor: function browsePictureFor(files) {
- for (var o = 0; o < files.length; o++) {
- for (var j = 0; j < this.uploadList.length; j++) {
- if (this.uploadList[j]['url'] === files[o]['url'] || this.uploadList[j]['url'] === files[o]['path']) {
- files[o]['active'] = true;
- break;
- }
- }
- if (o < 100) {
- this.browseList.push(files[o]);
- } else {
- this.browseListNext.push(files[o]);
- }
- }
- },
- browseItem: function browseItem(item) {
- //点击选择图片
- if (item.type === 'dir') {
- //目录
- this.browsePicture(item.path);
- } else if (item.type === 'file') {
- //文件
- if (item.active) {
- var fileList = this.$refs.upload.fileList;
- this.$refs.upload.fileList.splice(fileList.indexOf(item), 1);
- item.active = false;
- } else {
- if (this.maxNum === 1) {
- for (var i = 0; i < this.browseList.length; i++) {
- this.browseList[i].active = false;
- }
- this.$refs.upload.fileList = [];
- this.uploadList = this.$refs.upload.fileList;
- }
- var check = this.uploadList.length < this.maxNum;
- if (!check) {
- this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('最多只能选择 % 张图片。', this.maxNum) });
- return;
- }
- item.active = true;
- item.status = 'finished';
- this.$refs.upload.fileList.push(item);
- this.uploadList = this.$refs.upload.fileList;
- }
- this.$emit('input', this.$refs.upload.fileList);
- }
- },
- __thumb: function __thumb(url) {
- if ($A.strExists(url, "?", false)) {
- return url + "&__thumb=true";
- } else {
- return url + "?__thumb=true";
- }
- },
- httpEnter: function httpEnter() {
- this.$emit('input', this.initItems(this.httpValue));
- this.browseVisible = false;
- }
- }
- });
- /***/ }),
- /* 90 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- [
- _vm._l(_vm.uploadList, function(item) {
- return _vm.type !== "callback"
- ? _c(
- "div",
- { staticClass: "imgcomp-upload-list" },
- [
- item.status === "finished"
- ? [
- _c("div", {
- staticClass: "imgcomp-upload-img",
- style: {
- "background-image":
- "url(" + _vm.__thumb(item.thumb) + ")"
- }
- }),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "imgcomp-upload-list-cover" },
- [
- _c("Icon", {
- attrs: { type: "ios-eye-outline" },
- nativeOn: {
- click: function($event) {
- return _vm.handleView(item)
- }
- }
- }),
- _vm._v(" "),
- _c("Icon", {
- attrs: { type: "ios-trash-outline" },
- nativeOn: {
- click: function($event) {
- return _vm.handleRemove(item)
- }
- }
- })
- ],
- 1
- )
- ]
- : [
- item.showProgress
- ? _c("Progress", {
- attrs: { percent: item.percentage, "hide-info": "" }
- })
- : _vm._e()
- ]
- ],
- 2
- )
- : _vm._e()
- }),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "add-box",
- class: { "callback-add-box": _vm.type === "callback" }
- },
- [
- _c(
- "div",
- { staticClass: "add-box-icon" },
- [_c("Icon", { attrs: { type: "md-add", size: "32" } })],
- 1
- ),
- _vm._v(" "),
- _c("div", { staticClass: "add-box-upload" }, [
- _c(
- "div",
- { staticClass: "add-box-item", on: { click: _vm.browsePicture } },
- [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("浏览"))),
- _vm.type === "callback"
- ? _c("em", [_vm._v(_vm._s(_vm.$L("图片")))])
- : _vm._e()
- ])
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "add-box-item" },
- [
- _c(
- "Upload",
- {
- ref: "upload",
- attrs: {
- name: "image",
- accept: "image/*",
- action: _vm.actionUrl,
- data: _vm.uploadParams,
- "show-upload-list": false,
- "max-size": _vm.maxSize,
- format: ["jpg", "jpeg", "gif", "png"],
- "default-file-list": _vm.defaultList,
- "on-progress": _vm.handleProgress,
- "on-success": _vm.handleSuccess,
- "on-error": _vm.handleError,
- "on-format-error": _vm.handleFormatError,
- "on-exceeded-size": _vm.handleMaxSize,
- "before-upload": _vm.handleBeforeUpload,
- multiple: _vm.multiple
- }
- },
- [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("上传"))),
- _vm.type === "callback"
- ? _c("em", [_vm._v(_vm._s(_vm.$L("图片")))])
- : _vm._e()
- ])
- ]
- )
- ],
- 1
- )
- ])
- ]
- ),
- _vm._v(" "),
- _c(
- "Modal",
- {
- staticClass: "img-upload-modal",
- attrs: {
- title: _vm.$L("浏览图片空间的图片"),
- "class-name": "simple-modal",
- width: "710",
- styles: { top: "35px", paddingBottom: "35px" }
- },
- model: {
- value: _vm.browseVisible,
- callback: function($$v) {
- _vm.browseVisible = $$v
- },
- expression: "browseVisible"
- }
- },
- [
- _vm.isLoading
- ? _c("div", { staticClass: "browse-load" }, [
- _vm._v(_vm._s(_vm.$L("加载中...")))
- ])
- : _vm._e(),
- _vm._v(" "),
- _c(
- "div",
- {
- ref: "browselistbox",
- staticClass: "browse-list",
- class: _vm.httpType === "input" ? "browse-list-disabled" : ""
- },
- _vm._l(_vm.browseList, function(item) {
- return _c(
- "div",
- {
- staticClass: "browse-item",
- on: {
- click: function($event) {
- return _vm.browseItem(item)
- }
- }
- },
- [
- item.active
- ? _c("Icon", {
- staticClass: "browse-icon",
- attrs: { type: "ios-checkmark-circle" }
- })
- : _vm._e(),
- _vm._v(" "),
- _c("div", {
- staticClass: "browse-img",
- style: { "background-image": "url(" + item.thumb + ")" }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "browse-title" }, [
- _vm._v(_vm._s(item.title))
- ])
- ],
- 1
- )
- }),
- 0
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "img-upload-foot",
- attrs: { slot: "footer" },
- slot: "footer"
- },
- [
- _vm.type !== "callback" && _vm.http && _vm.httpType === ""
- ? _c(
- "div",
- {
- staticClass: "img-upload-foot-input",
- on: {
- click: function($event) {
- _vm.httpType = "input"
- }
- }
- },
- [
- _c("Icon", { attrs: { type: "ios-image", size: "22" } }),
- _vm._v(" "),
- _c("div", { staticClass: "img-upload-foot-httptitle" }, [
- _vm._v(_vm._s(_vm.$L("自定义图片地址")))
- ])
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.type !== "callback" && _vm.http && _vm.httpType === "input"
- ? _c(
- "div",
- { staticClass: "img-upload-foot-input" },
- [
- _c(
- "Input",
- {
- attrs: {
- placeholder: _vm.$L("以“http://”或“https://”开头"),
- search: "",
- "enter-button": _vm.$L("确定")
- },
- on: { "on-search": _vm.httpEnter },
- model: {
- value: _vm.httpValue,
- callback: function($$v) {
- _vm.httpValue = $$v
- },
- expression: "httpValue"
- }
- },
- [
- _c(
- "span",
- {
- staticStyle: { cursor: "pointer" },
- attrs: { slot: "prepend" },
- on: {
- click: function($event) {
- _vm.httpType = ""
- }
- },
- slot: "prepend"
- },
- [_vm._v(_vm._s(_vm.$L("自定义地址")) + ": ")]
- )
- ]
- )
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.httpType === ""
- ? _c(
- "Button",
- {
- on: {
- click: function($event) {
- _vm.browseVisible = false
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("关闭")))]
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.httpType === ""
- ? _c(
- "Button",
- {
- attrs: { type: "primary" },
- on: {
- click: function($event) {
- return _vm.handleCallback(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("完成")))]
- )
- : _vm._e()
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _c(
- "Modal",
- {
- staticClass: "img-upload-modal",
- attrs: {
- title: _vm.$L("查看图片"),
- "class-name": "simple-modal",
- draggable: ""
- },
- model: {
- value: _vm.visible,
- callback: function($$v) {
- _vm.visible = $$v
- },
- expression: "visible"
- }
- },
- [
- _c(
- "div",
- { staticStyle: { "max-height": "480px", overflow: "auto" } },
- [
- _c("a", { attrs: { href: _vm.imgVisible, target: "_blank" } }, [
- _vm.visible
- ? _c("img", {
- staticStyle: {
- "max-width": "100%",
- "max-height": "900px",
- display: "block",
- margin: "0 auto"
- },
- attrs: { src: _vm.imgVisible }
- })
- : _vm._e()
- ])
- ]
- )
- ]
- )
- ],
- 2
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-55c90fc2", module.exports)
- }
- }
- /***/ }),
- /* 91 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(92)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(94)
- /* template */
- var __vue_template__ = __webpack_require__(99)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-1ae87c63"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/header/create.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-1ae87c63", Component.options)
- } else {
- hotAPI.reload("data-v-1ae87c63", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 92 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(93);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("e7232698", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1ae87c63\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./create.vue", function() {
- var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1ae87c63\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./create.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 93 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-header-create .tableFill[data-v-1ae87c63] {\n margin: 12px 12px 20px;\n}\n", ""]);
- // exports
- /***/ }),
- /* 94 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_task__ = __webpack_require__(30);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /**
- * 我创建的任务
- */
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'HeaderCreate',
- components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
- props: {
- canload: {
- type: Boolean,
- default: true
- }
- },
- mixins: [__WEBPACK_IMPORTED_MODULE_1__mixins_task__["a" /* default */]],
- data: function data() {
- return {
- loadYet: false,
- loadIng: 0,
- columns: [],
- lists: [],
- listPage: 1,
- listTotal: 0,
- noDataText: ""
- };
- },
- mounted: function mounted() {
- var _this = this;
- if (this.canload) {
- this.loadYet = true;
- this.getLists(true);
- }
- $A.setOnTaskInfoListener('components/project/header/create', function (act, detail) {
- if (detail.createuser != _this.usrName) {
- return;
- }
- //
- _this.lists.some(function (task, i) {
- if (task.id == detail.id) {
- _this.lists.splice(i, 1, detail);
- return true;
- }
- });
- //
- switch (act) {
- case "delete":
- // 删除任务
- _this.lists.some(function (task, i) {
- if (task.id == detail.id) {
- _this.lists.splice(i, 1);
- return true;
- }
- });
- break;
- }
- });
- },
- watch: {
- canload: function canload(val) {
- if (val && !this.loadYet) {
- this.loadYet = true;
- this.getLists(true);
- }
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- var _this2 = this;
- this.noDataText = this.$L("数据加载中.....");
- this.columns = [{
- "title": this.$L("任务名称"),
- "key": 'title',
- "minWidth": 120,
- render: function render(h, params) {
- return _this2.renderTaskTitle(h, params);
- }
- }, {
- "title": this.$L("负责人"),
- "key": 'username',
- "minWidth": 80,
- render: function render(h, params) {
- return h('UserView', {
- props: {
- username: params.row.username
- }
- });
- }
- }, {
- "title": this.$L("完成"),
- "minWidth": 70,
- "align": "center",
- render: function render(h, params) {
- return h('span', params.row.complete ? '√' : '-');
- }
- }, {
- "title": this.$L("归档"),
- "minWidth": 70,
- "align": "center",
- render: function render(h, params) {
- return h('span', params.row.archived ? '√' : '-');
- }
- }, {
- "title": this.$L("创建时间"),
- "width": 160,
- render: function render(h, params) {
- return h('span', $A.formatDate("Y-m-d H:i:s", params.row.indate));
- }
- }];
- },
- setPage: function setPage(page) {
- this.listPage = page;
- this.getLists();
- },
- setPageSize: function setPageSize(size) {
- if (Math.max($A.runNum(this.listPageSize), 10) != size) {
- this.listPageSize = size;
- this.getLists();
- }
- },
- getLists: function getLists(resetLoad) {
- var _this3 = this;
- if (resetLoad === true) {
- this.listPage = 1;
- }
- this.loadIng++;
- this.noDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'project/task/lists',
- data: {
- createuser: 1,
- archived: '全部',
- page: Math.max(this.listPage, 1),
- pagesize: Math.max($A.runNum(this.listPageSize), 10)
- },
- complete: function complete() {
- _this3.loadIng--;
- },
- error: function error() {
- _this3.noDataText = _this3.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this3.lists = res.data.lists;
- _this3.listTotal = res.data.total;
- _this3.noDataText = _this3.$L("没有相关的数据");
- } else {
- _this3.lists = [];
- _this3.listTotal = 0;
- _this3.noDataText = res.msg;
- }
- }
- });
- }
- }
- });
- /***/ }),
- /* 95 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(96);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("7490fac2", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-329e9aed\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DrawerTabsContainer.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-329e9aed\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DrawerTabsContainer.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 96 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.dtc-main[data-v-329e9aed] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 100%;\n overflow: hidden;\n position: relative;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.dtc-main .dtc-body[data-v-329e9aed] {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n", ""]);
- // exports
- /***/ }),
- /* 97 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'DrawerTabsContainer',
- data: function data() {
- return {
- idDrawerTabs: false,
- calculateHeight: 0
- };
- },
- mounted: function mounted() {
- var _this = this;
- var el = $A(this.$el);
- var eb = el.parents(".ivu-drawer-body");
- if (eb == 0 || eb.parents(".ivu-drawer-wrap").length == 0) {
- return;
- }
- this.idDrawerTabs = true;
- this.calculateHeight = Math.round(eb.outerHeight() - el.offset().top);
- setInterval(function () {
- _this.calculateHeight = Math.round(eb.outerHeight() - el.offset().top);
- }, 300);
- },
- computed: {
- myStyle: function myStyle() {
- var calculateHeight = this.calculateHeight,
- idDrawerTabs = this.idDrawerTabs;
- if (!idDrawerTabs) {
- return {};
- }
- return {
- height: Math.max(0, calculateHeight - 16) + 'px'
- };
- }
- }
- });
- /***/ }),
- /* 98 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { class: [_vm.idDrawerTabs ? "dtc-main" : ""], style: _vm.myStyle },
- [
- _c(
- "div",
- { class: [_vm.idDrawerTabs ? "dtc-body" : ""] },
- [_vm._t("default")],
- 2
- )
- ]
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-329e9aed", module.exports)
- }
- }
- /***/ }),
- /* 99 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("drawer-tabs-container", [
- _c(
- "div",
- { staticClass: "project-header-create" },
- [
- _c("Table", {
- ref: "tableRef",
- staticClass: "tableFill",
- attrs: {
- columns: _vm.columns,
- data: _vm.lists,
- loading: _vm.loadIng > 0,
- "no-data-text": _vm.noDataText,
- stripe: ""
- }
- }),
- _vm._v(" "),
- _c("Page", {
- staticClass: "pageBox",
- attrs: {
- total: _vm.listTotal,
- current: _vm.listPage,
- disabled: _vm.loadIng > 0,
- "page-size-opts": [10, 20, 30, 50, 100],
- placement: "top",
- "show-elevator": "",
- "show-sizer": "",
- "show-total": "",
- transfer: "",
- simple: _vm.windowMax768
- },
- on: {
- "on-change": _vm.setPage,
- "on-page-size-change": _vm.setPageSize
- }
- })
- ],
- 1
- )
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-1ae87c63", module.exports)
- }
- }
- /***/ }),
- /* 100 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(101)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(103)
- /* template */
- var __vue_template__ = __webpack_require__(104)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-fc048eee"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/header/archived.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-fc048eee", Component.options)
- } else {
- hotAPI.reload("data-v-fc048eee", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 101 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(102);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("3ff66afc", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-fc048eee\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./archived.vue", function() {
- var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-fc048eee\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./archived.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 102 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-header-archived .tableFill[data-v-fc048eee] {\n margin: 12px 12px 20px;\n}\n", ""]);
- // exports
- /***/ }),
- /* 103 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_task__ = __webpack_require__(30);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /**
- * 我归档的任务
- */
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'HeaderArchived',
- components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
- props: {
- canload: {
- type: Boolean,
- default: true
- }
- },
- mixins: [__WEBPACK_IMPORTED_MODULE_1__mixins_task__["a" /* default */]],
- data: function data() {
- return {
- loadYet: false,
- loadIng: 0,
- columns: [],
- lists: [],
- listPage: 1,
- listTotal: 0,
- noDataText: ""
- };
- },
- mounted: function mounted() {
- var _this = this;
- if (this.canload) {
- this.loadYet = true;
- this.getLists(true);
- }
- $A.setOnTaskInfoListener('components/project/header/archived', function (act, detail) {
- if (detail.username != _this.usrName) {
- _this.lists.some(function (task, i) {
- if (task.id == detail.id) {
- _this.lists.splice(i, 1);
- return true;
- }
- });
- return;
- }
- //
- _this.lists.some(function (task, i) {
- if (task.id == detail.id) {
- _this.lists.splice(i, 1, detail);
- return true;
- }
- });
- //
- switch (act) {
- case "delete": // 删除任务
- case "unarchived":
- // 取消归档
- _this.lists.some(function (task, i) {
- if (task.id == detail.id) {
- _this.lists.splice(i, 1);
- return true;
- }
- });
- break;
- case "archived":
- // 归档
- var has = false;
- _this.lists.some(function (task) {
- if (task.id == detail.id) {
- return has = true;
- }
- });
- if (!has) {
- _this.lists.unshift(detail);
- }
- break;
- }
- });
- },
- watch: {
- canload: function canload(val) {
- if (val && !this.loadYet) {
- this.loadYet = true;
- this.getLists(true);
- }
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- var _this2 = this;
- this.noDataText = this.$L("数据加载中.....");
- this.columns = [{
- "title": this.$L("任务名称"),
- "key": 'title',
- "minWidth": 120,
- render: function render(h, params) {
- return _this2.renderTaskTitle(h, params);
- }
- }, {
- "title": this.$L("创建人"),
- "key": 'createuser',
- "minWidth": 80,
- render: function render(h, params) {
- return h('UserView', {
- props: {
- username: params.row.createuser
- }
- });
- }
- }, {
- "title": this.$L("负责人"),
- "key": 'username',
- "minWidth": 80,
- render: function render(h, params) {
- return h('UserView', {
- props: {
- username: params.row.username
- }
- });
- }
- }, {
- "title": this.$L("完成"),
- "minWidth": 70,
- "align": "center",
- render: function render(h, params) {
- return h('span', params.row.complete ? '√' : '-');
- }
- }, {
- "title": this.$L("归档时间"),
- "width": 160,
- render: function render(h, params) {
- return h('span', $A.formatDate("Y-m-d H:i:s", params.row.archiveddate));
- }
- }, {
- "title": this.$L("操作"),
- "key": 'action',
- "width": 100,
- "align": 'center',
- render: function render(h, params) {
- return h('Button', {
- props: {
- type: 'primary',
- size: 'small'
- },
- style: {
- fontSize: '12px'
- },
- on: {
- click: function click() {
- _this2.$Modal.confirm({
- title: _this2.$L('取消归档'),
- content: _this2.$L('你确定要取消归档吗?'),
- loading: true,
- onOk: function onOk() {
- $A.apiAjax({
- url: 'project/task/edit',
- method: 'post',
- data: {
- act: 'unarchived',
- taskid: params.row.id
- },
- error: function error() {
- _this2.$Modal.remove();
- alert(_this2.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- _this2.$Modal.remove();
- _this2.getLists();
- setTimeout(function () {
- if (res.ret === 1) {
- _this2.$Message.success(res.msg);
- $A.triggerTaskInfoListener('unarchived', res.data);
- $A.triggerTaskInfoChange(params.row.id);
- } else {
- _this2.$Modal.error({ title: _this2.$L('温馨提示'), content: res.msg });
- }
- }, 350);
- }
- });
- }
- });
- }
- }
- }, _this2.$L('取消归档'));
- }
- }];
- },
- setPage: function setPage(page) {
- this.listPage = page;
- this.getLists();
- },
- setPageSize: function setPageSize(size) {
- if (Math.max($A.runNum(this.listPageSize), 10) != size) {
- this.listPageSize = size;
- this.getLists();
- }
- },
- getLists: function getLists(resetLoad) {
- var _this3 = this;
- if (resetLoad === true) {
- this.listPage = 1;
- }
- this.loadIng++;
- this.noDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'project/task/lists',
- data: {
- page: Math.max(this.listPage, 1),
- pagesize: Math.max($A.runNum(this.listPageSize), 10),
- archived: '已归档'
- },
- complete: function complete() {
- _this3.loadIng--;
- },
- error: function error() {
- _this3.noDataText = _this3.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this3.lists = res.data.lists;
- _this3.listTotal = res.data.total;
- _this3.noDataText = _this3.$L("没有相关的数据");
- } else {
- _this3.lists = [];
- _this3.listTotal = 0;
- _this3.noDataText = res.msg;
- }
- }
- });
- }
- }
- });
- /***/ }),
- /* 104 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("drawer-tabs-container", [
- _c(
- "div",
- { staticClass: "project-header-archived" },
- [
- _c("Table", {
- ref: "tableRef",
- staticClass: "tableFill",
- attrs: {
- columns: _vm.columns,
- data: _vm.lists,
- loading: _vm.loadIng > 0,
- "no-data-text": _vm.noDataText,
- stripe: ""
- }
- }),
- _vm._v(" "),
- _c("Page", {
- staticClass: "pageBox",
- attrs: {
- total: _vm.listTotal,
- current: _vm.listPage,
- disabled: _vm.loadIng > 0,
- "page-size-opts": [10, 20, 30, 50, 100],
- placement: "top",
- "show-elevator": "",
- "show-sizer": "",
- "show-total": "",
- transfer: "",
- simple: _vm.windowMax768
- },
- on: {
- "on-change": _vm.setPage,
- "on-page-size-change": _vm.setPageSize
- }
- })
- ],
- 1
- )
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-fc048eee", module.exports)
- }
- }
- /***/ }),
- /* 105 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(106)
- __webpack_require__(108)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(110)
- /* template */
- var __vue_template__ = __webpack_require__(124)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-3f6b8ea0"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/chat/Index.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-3f6b8ea0", Component.options)
- } else {
- hotAPI.reload("data-v-3f6b8ea0", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 106 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(107);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("75fe3a14", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Index.vue", function() {
- var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Index.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 107 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.chat-notice-box {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n}\n.chat-notice-box .chat-notice-userimg {\n width: 42px;\n height: 42px;\n font-size: 20px;\n line-height: 42px;\n border-radius: 4px;\n}\n.chat-notice-box .ivu-notice-with-desc {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n padding: 0 12px;\n}\n.chat-notice-box .chat-notice-btn-box {\n margin-top: 8px;\n margin-bottom: -4px;\n}\n.chat-notice-box .chat-notice-btn-box .ivu-btn {\n margin-right: 12px;\n font-size: 12px;\n min-width: 42px;\n}\n.chat-notice-box .ivu-notice-desc {\n font-size: 13px;\n word-break: break-all;\n line-height: 1.3;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n -webkit-box-orient: vertical;\n}\n.chat-notice-box .chat-user .user-msg-title .user-view-inline .user-view-name {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-notice-box .chat-message .manage-title .user-view-inline {\n max-width: 70%;\n}\n.chat-notice-box .chat-message .manage-title .user-view-inline .user-view-name {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n", ""]);
- // exports
- /***/ }),
- /* 108 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(109);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("035002ea", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./Index.vue", function() {
- var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./Index.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 109 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.chat-index[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.chat-index .chat-none[data-v-3f6b8ea0] {\n height: auto;\n color: #666666;\n padding: 22px 8px;\n text-align: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n margin: 0 !important;\n}\n.chat-index .chat-none[data-v-3f6b8ea0]:before {\n display: none;\n}\n.chat-index .chat-more[data-v-3f6b8ea0] {\n color: #666666;\n padding: 18px 0;\n text-align: center;\n cursor: pointer;\n margin: 0 !important;\n}\n.chat-index .chat-more[data-v-3f6b8ea0]:hover {\n color: #444444;\n}\n.chat-index .chat-menu[data-v-3f6b8ea0] {\n background-color: rgba(28, 29, 31, 0.92);\n width: 68px;\n height: 100%;\n padding-top: 20px;\n}\n.chat-index .chat-menu li[data-v-3f6b8ea0] {\n position: relative;\n padding: 12px 0;\n text-align: center;\n font-size: 28px;\n color: #919193;\n background-color: transparent;\n cursor: pointer;\n}\n.chat-index .chat-menu li.self[data-v-3f6b8ea0] {\n cursor: default;\n}\n.chat-index .chat-menu li.self .avatar[data-v-3f6b8ea0] {\n width: 36px;\n height: 36px;\n font-size: 20px;\n border-radius: 3px;\n}\n.chat-index .chat-menu li.active[data-v-3f6b8ea0] {\n color: #ffffff;\n background-color: rgba(255, 255, 255, 0.06);\n}\n.chat-index .chat-menu li:hover > i[data-v-3f6b8ea0] {\n -webkit-transform: scale(1.1);\n transform: scale(1.1);\n}\n.chat-index .chat-menu li > i[data-v-3f6b8ea0] {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.chat-index .chat-menu li .chat-num[data-v-3f6b8ea0] {\n position: absolute;\n top: 50%;\n left: 50%;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9) translate(5px, -20px);\n transform: scale(0.9) translate(5px, -20px);\n}\n.chat-index .chat-user[data-v-3f6b8ea0] {\n display: none;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 248px;\n height: 100%;\n background-color: #ffffff;\n border-right: 1px solid #ededed;\n}\n.chat-index .chat-user > li[data-v-3f6b8ea0] {\n position: relative;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 62px;\n margin: 0;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-user > li.lists[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n overflow: auto;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.chat-index .chat-user > li.lists > ul > li[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 70px;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-user > li.lists > ul > li[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-user > li.lists > ul > li.active[data-v-3f6b8ea0]:before {\n top: 0;\n height: 100%;\n}\n.chat-index .chat-user > li.lists > ul > li .avatar[data-v-3f6b8ea0] {\n -webkit-box-flex: 0;\n -ms-flex-positive: 0;\n flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n width: 42px;\n height: 42px;\n font-size: 20px;\n border-radius: 4px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n padding-left: 12px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n line-height: 24px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title span[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n max-width: 130px;\n color: #333333;\n font-size: 14px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title em[data-v-3f6b8ea0] {\n color: #999999;\n font-size: 12px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-text[data-v-3f6b8ea0] {\n max-width: 170px;\n color: #999999;\n font-size: 12px;\n line-height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-user > li .user-msg-num[data-v-3f6b8ea0] {\n position: absolute;\n top: 6px;\n left: 44px;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9);\n transform: scale(0.9);\n border: 1px solid #ffffff;\n}\n.chat-index .chat-team[data-v-3f6b8ea0] {\n display: none;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 248px;\n height: 100%;\n background-color: #ffffff;\n border-right: 1px solid #ededed;\n}\n.chat-index .chat-team > li[data-v-3f6b8ea0] {\n position: relative;\n}\n.chat-index .chat-team > li.sreach[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 62px;\n margin: 0;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-team > li.sreach[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-team > li.lists[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n overflow: auto;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.chat-index .chat-team > li.lists > ul > li[data-v-3f6b8ea0] {\n margin-left: 24px;\n position: relative;\n}\n.chat-index .chat-team > li.lists > ul > li .team-label[data-v-3f6b8ea0] {\n padding-left: 4px;\n margin-top: 6px;\n margin-bottom: 6px;\n height: 34px;\n line-height: 34px;\n border-bottom: 1px solid #efefef;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 52px;\n cursor: pointer;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li .avatar[data-v-3f6b8ea0] {\n -webkit-box-flex: 0;\n -ms-flex-positive: 0;\n flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n width: 30px;\n height: 30px;\n font-size: 16px;\n border-radius: 3px;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li .team-username[data-v-3f6b8ea0] {\n padding: 0 12px;\n font-size: 14px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-message[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n background-color: #F3F3F3;\n position: relative;\n}\n.chat-index .chat-message .manage-title[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 3;\n width: 100%;\n height: 62px;\n padding: 0 20px;\n line-height: 62px;\n font-size: 16px;\n font-weight: 500;\n text-align: left;\n background: #ffffff;\n border-bottom: 1px solid #ededed;\n}\n.chat-index .chat-message .manage-title .manage-title-right[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 9;\n width: 62px;\n height: 62px;\n line-height: 62px;\n text-align: center;\n font-size: 22px;\n color: #242424;\n}\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n top: 62px;\n z-index: 1;\n bottom: 120px;\n width: 100%;\n overflow: auto;\n padding: 8px 0;\n background-color: #E8EBF2;\n}\n.chat-index .chat-message .manage-lists .manage-more[data-v-3f6b8ea0] {\n color: #666666;\n padding: 8px 0;\n text-align: center;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-lists .manage-more[data-v-3f6b8ea0]:hover {\n color: #444444;\n}\n.chat-index .chat-message .manage-lists .manage-lists-message-new[data-v-3f6b8ea0] {\n position: fixed;\n bottom: 130px;\n right: 20px;\n color: #ffffff;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-send[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 2;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 120px;\n background-color: #ffffff;\n border-top: 1px solid #e4e4e4;\n}\n.chat-index .chat-message .manage-send .manage-input[data-v-3f6b8ea0], .chat-index .chat-message .manage-send .manage-input[data-v-3f6b8ea0]:focus {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-appearance: none;\n font-size: 14px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n margin: 38px 10px 6px;\n border: 0;\n line-height: 20px;\n -webkit-box-shadow: none;\n box-shadow: none;\n resize: none;\n outline: 0;\n}\n.chat-index .chat-message .manage-send .manage-join[data-v-3f6b8ea0],\n .chat-index .chat-message .manage-send .manage-spin[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: #ffffff;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.chat-index .chat-message .manage-quick[data-v-3f6b8ea0] {\n position: absolute;\n z-index: 2;\n left: 0;\n right: 0;\n bottom: 79px;\n padding: 8px 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 40px;\n}\n.chat-index .chat-message .manage-quick .quick-item[data-v-3f6b8ea0] {\n color: #444444;\n font-size: 24px;\n margin: 0 7px;\n}\n.chat-index .chat-message .manage-quick .quick-item.voicecam[data-v-3f6b8ea0] {\n font-size: 26px;\n height: 24px;\n line-height: 24px;\n}\n.chat-index .chat-message .manage-quick .quick-item.videocam[data-v-3f6b8ea0] {\n color: #666666;\n font-size: 30px;\n height: 24px;\n line-height: 24px;\n}\n.chat-index .chat-message .manage-quick .emoji-box[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n bottom: 40px;\n max-height: 320px;\n width: 100%;\n overflow: auto;\n background-color: #ffffff;\n padding: 12px;\n border-bottom: 1px solid #efefef;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emoji-input[data-v-3f6b8ea0] {\n margin: 6px 0;\n}\n.chat-index .chat-message .manage-quick .emoji-box h5[data-v-3f6b8ea0] {\n padding: 0;\n margin: 8px 0 0 0;\n color: #b1b1b1;\n text-transform: uppercase;\n font-size: 14px;\n cursor: default;\n font-weight: normal;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis[data-v-3f6b8ea0]:after {\n content: \"\";\n -webkit-box-flex: 1;\n -ms-flex: auto;\n flex: auto;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis span[data-v-3f6b8ea0] {\n padding: 2px 4px;\n cursor: pointer;\n font-size: 22px;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis span[data-v-3f6b8ea0]:hover {\n background: #ececec;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-quick .message-upload[data-v-3f6b8ea0] {\n display: none;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n.chat-index .chat-message .manage-drag-over[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 3;\n background-color: rgba(255, 255, 255, 0.78);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.chat-index .chat-message .manage-drag-over[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n top: 16px;\n left: 16px;\n right: 16px;\n bottom: 16px;\n border: 2px dashed #7b7b7b;\n border-radius: 12px;\n}\n.chat-index .chat-message .manage-drag-over .manage-drag-text[data-v-3f6b8ea0] {\n padding: 12px;\n font-size: 18px;\n color: #666666;\n}\n@media screen and (max-width: 768px) {\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n bottom: 96px;\n}\n.chat-index .chat-message .manage-lists .manage-lists-message-new[data-v-3f6b8ea0] {\n bottom: 106px;\n}\n.chat-index .chat-message .manage-send[data-v-3f6b8ea0] {\n height: 96px;\n}\n.chat-index .chat-message .manage-quick[data-v-3f6b8ea0] {\n bottom: 54px;\n}\n.chat-index .chat-message .manage-quick .quick-item[data-v-3f6b8ea0] {\n font-size: 24px;\n margin-right: 8px;\n}\n}\n.chat-index .chat-video[data-v-3f6b8ea0] {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: #000000;\n background-size: cover;\n background-position: center center;\n background-repeat: no-repeat;\n z-index: 9;\n}\n.chat-index .chat-video[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: -10%;\n right: -10%;\n top: -10%;\n bottom: -10%;\n background: inherit;\n -webkit-filter: blur(25px);\n filter: blur(25px);\n z-index: 1;\n}\n.chat-index .chat-video[data-v-3f6b8ea0]:after {\n content: \"\";\n position: absolute;\n left: -10%;\n right: -10%;\n top: -10%;\n bottom: -10%;\n background: rgba(0, 0, 0, 0.82);\n z-index: 2;\n}\n.chat-index .chat-video .video-opacity[data-v-3f6b8ea0] {\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n font-size: 26px;\n color: #aaaaaa;\n padding: 24px;\n z-index: 3;\n -webkit-animation: opacity-data-v-3f6b8ea0 2s infinite alternate;\n animation: opacity-data-v-3f6b8ea0 2s infinite alternate;\n}\n@-webkit-keyframes opacity-data-v-3f6b8ea0 {\n0% {\n opacity: 0.1;\n}\n100% {\n opacity: 1;\n}\n}\n@keyframes opacity-data-v-3f6b8ea0 {\n0% {\n opacity: 0.1;\n}\n100% {\n opacity: 1;\n}\n}\n.chat-index .chat-video .video-mini[data-v-3f6b8ea0],\n .chat-index .chat-video .video-active[data-v-3f6b8ea0] {\n position: absolute;\n max-width: 640px;\n max-height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-transition: opacity 1s;\n transition: opacity 1s;\n}\n.chat-index .chat-video .video-active[data-v-3f6b8ea0] {\n top: 0;\n left: 50%;\n width: 100%;\n height: 100%;\n -webkit-transform: rotateY(180deg) translateX(50%);\n transform: rotateY(180deg) translateX(50%);\n z-index: 4;\n}\n.chat-index .chat-video .video-mini[data-v-3f6b8ea0] {\n top: 0;\n right: 0;\n width: 260px;\n height: 180px;\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n z-index: 5;\n}\n.chat-index .chat-video .video-close[data-v-3f6b8ea0] {\n position: absolute;\n max-width: 720px;\n bottom: 18px;\n left: 50%;\n width: 100%;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n z-index: 6;\n}\n.chat-index .chat-video .video-close > i[data-v-3f6b8ea0] {\n font-weight: 600;\n font-size: 46px;\n color: #ffffff;\n cursor: pointer;\n}\n.chat-index .chat-video .video-close > i[data-v-3f6b8ea0]:hover {\n color: #ff0000;\n}\n.chat-index .chat-audio[data-v-3f6b8ea0] {\n width: 0;\n height: 0;\n display: none;\n}\n.chat-index .chat-flex[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n@media (max-width: 768px) {\n.chat-index .chat-menu[data-v-3f6b8ea0] {\n width: 50px;\n}\n.chat-index .chat-menu li[data-v-3f6b8ea0] {\n padding: 6px 0;\n margin: 6px 0;\n font-size: 24px;\n}\n.chat-index .chat-menu li.self .avatar[data-v-3f6b8ea0] {\n width: 32px;\n height: 32px;\n font-size: 18px;\n}\n.chat-index .chat-user[data-v-3f6b8ea0],\n .chat-index .chat-team[data-v-3f6b8ea0] {\n display: none;\n position: absolute;\n left: 50px;\n right: 0;\n z-index: 2;\n width: auto;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0],\n .chat-index .chat-team > li.sreach[data-v-3f6b8ea0] {\n height: 54px;\n}\n.chat-index .chat-user.chat-tam[data-v-3f6b8ea0],\n .chat-index .chat-team.chat-tam[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.chat-index .chat-message .manage-title[data-v-3f6b8ea0] {\n height: 54px;\n line-height: 54px;\n}\n.chat-index .chat-message .manage-title .manage-title-right[data-v-3f6b8ea0] {\n width: 54px;\n height: 54px;\n line-height: 54px;\n}\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n top: 54px;\n}\n}\n", ""]);
- // exports
- /***/ }),
- /* 110 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker__ = __webpack_require__(111);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer__ = __webpack_require__(7);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY__ = __webpack_require__(56);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__components_ScrollerY__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Message__ = __webpack_require__(116);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Message___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__Message__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ImgUpload__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__ImgUpload__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Upload__ = __webpack_require__(121);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Upload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__Upload__);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ChatIndex',
- components: { ChatLoad: __WEBPACK_IMPORTED_MODULE_5__Upload___default.a, ImgUpload: __WEBPACK_IMPORTED_MODULE_4__ImgUpload___default.a, ChatMessage: __WEBPACK_IMPORTED_MODULE_3__Message___default.a, EmojiPicker: __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker___default.a, ScrollerY: __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY___default.a, DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer___default.a },
- props: {
- value: {
- default: 0
- },
- openWindow: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- loadIng: 0,
- openAlready: false,
- chatTap: 'dialog',
- chatTam: 'dialog',
- messageAudio: window.location.origin + '/audio/',
- dialogSearch: '',
- dialogTarget: {},
- dialogLists: [],
- dialogNoDataText: '',
- dialogDragOver: false,
- teamSearch: '',
- teamReady: false,
- teamLists: {},
- teamNoDataText: '',
- teamCurrentPage: 1,
- teamHasMorePages: false,
- autoBottom: true,
- messageNew: 0,
- messageText: '',
- messageLists: [],
- messageNoDataText: '',
- messageEmojiSearch: '',
- messageCurrentPage: 1,
- messageHasMorePages: false,
- unreadTotal: 0,
- videoUserName: '', //视频对话用户名
- videoUserImg: '', //视频对话用户头像
- videoStartTime: 0, //视频开始时间
- videoInitiator: false, //是否发起人
- videoChat: false, //是否视频通话(否则音频通话)
- videoRtc: null, //视频Rtc
- videoLocalStream: null, //视频流
- systemConfig: $A.jsonParse($A.storage("systemSetting"), {
- callav: ''
- })
- };
- },
- mounted: function mounted() {
- var _this = this;
- this.formatCall();
- this.getSetting();
- //
- window.onChatOpenUserName = function (username) {
- _this.$emit("on-open-notice", username);
- _this.clickDialog(username, true);
- };
- //
- if (this.openWindow) {
- $A.WSOB.connection();
- if (!this.openAlready) {
- this.openAlready = true;
- this.getDialogLists();
- }
- }
- //
- $A.WSOB.setOnMsgListener("chat/index", function (msgDetail) {
- if (msgDetail.username == _this.usrName) {
- return;
- }
- switch (msgDetail.messageType) {
- case 'open':
- if (_this.openWindow) {
- _this.getDialogLists();
- _this.getDialogMessage();
- } else {
- _this.openAlready = false;
- _this.dialogTarget = {};
- }
- break;
- case 'info':
- if (msgDetail.body.type == 'video') {
- _this.videoMessage(msgDetail);
- }
- break;
- case 'user':
- var body = msgDetail.body;
- if (['taskA'].indexOf(body.type) !== -1) {
- return;
- }
- var lasttext = $A.WSOB.getMsgDesc(body);
- _this.unreadTotal += 1;
- _this.addDialog({
- username: body.username,
- userimg: body.userimg,
- lasttext: lasttext,
- lastdate: body.indate,
- unread: body.unread
- });
- if (msgDetail.username == _this.dialogTarget.username) {
- _this.addMessageData(body, true);
- }
- if (!_this.openWindow) {
- _this.$Notice.close('chat-notice');
- _this.$Notice.open({
- name: 'chat-notice',
- duration: 0,
- render: function render(h) {
- return h('div', {
- class: 'chat-notice-box',
- on: {
- click: function click() {
- _this.$Notice.close('chat-notice');
- _this.$emit("on-open-notice", body.username);
- _this.clickDialog(body.username);
- }
- }
- }, [h('UserImg', { class: 'chat-notice-userimg', props: { info: body } }), h('div', { class: 'ivu-notice-with-desc' }, [h('div', { class: 'ivu-notice-title' }, [h('UserView', { props: { username: body.username } })]), h('div', { class: 'ivu-notice-desc' }, lasttext)])]);
- }
- });
- }
- try {
- _this.$refs.messageAudio.play();
- } catch (e) {}
- break;
- }
- });
- $A.WSOB.setOnSpecialListener("chat/index", function (simpleMsg) {
- _this.addDialog({
- username: simpleMsg.target,
- lasttext: $A.WSOB.getMsgDesc(simpleMsg.body),
- lastdate: simpleMsg.body.indate
- });
- if (simpleMsg.target == _this.dialogTarget.username) {
- _this.addMessageData(simpleMsg.body, true);
- }
- });
- },
- watch: {
- usrName: function usrName() {
- this.formatCall();
- },
- chatTap: function chatTap(val) {
- var _this2 = this;
- if (val === 'team' && this.teamReady == false) {
- this.teamReady = true;
- this.getTeamLists();
- } else if (val === 'dialog') {
- this.autoBottom = true;
- this.$nextTick(function () {
- _this2.messageBottomGo();
- });
- }
- },
- openWindow: function openWindow(val) {
- var _this3 = this;
- if (val) {
- $A.WSOB.connection();
- if (!this.openAlready) {
- this.openAlready = true;
- this.getDialogLists();
- }
- }
- //
- var tmpRand = $A.randomString(8);
- this.__openWindowRand = tmpRand;
- setTimeout(function () {
- if (_this3.__openWindowRand !== tmpRand) {
- return;
- }
- $A.WSOB.sendTo('unread', function (res) {
- if (res.status === 1) {
- _this3.unreadTotal = $A.runNum(res.message);
- } else {
- _this3.unreadTotal = 0;
- }
- });
- }, 500);
- },
- unreadTotal: function unreadTotal(val) {
- if (val < 0) {
- this.unreadTotal = 0;
- return;
- }
- this.$emit('input', val);
- },
- dialogTarget: {
- handler: function handler() {
- var username = this.dialogTarget.username;
- if (username === this.__dialogTargetUsername) {
- return;
- }
- this.__dialogTargetUsername = username;
- this.getDialogMessage();
- },
- deep: true
- }
- },
- computed: {
- dialogListsS: function dialogListsS() {
- var _this4 = this;
- return this.dialogLists.filter(function (item) {
- return (item.username + "").indexOf(_this4.dialogSearch) > -1 || (item.lasttext + "").indexOf(_this4.dialogSearch) > -1 || (item.nickname + "").indexOf(_this4.dialogSearch) > -1;
- });
- },
- teamListsS: function teamListsS() {
- return function (lists) {
- var _this5 = this;
- return lists.filter(function (item) {
- return (item.username + "").indexOf(_this5.teamSearch) > -1 || (item.nickname + "").indexOf(_this5.teamSearch) > -1;
- });
- };
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- this.dialogNoDataText = this.$L("数据加载中.....");
- this.teamNoDataText = this.$L("数据加载中.....");
- this.messageNoDataText = this.$L("数据加载中.....");
- },
- formatCall: function formatCall() {
- var _this6 = this;
- if ($A.getToken() === false) {
- return;
- }
- $A.WSOB.sendTo('unread', function (res) {
- if (res.status === 1) {
- _this6.unreadTotal = $A.runNum(res.message);
- } else {
- _this6.unreadTotal = 0;
- }
- });
- this.getDialogLists();
- this.messageBottomAuto();
- },
- getSetting: function getSetting() {
- var _this7 = this;
- $A.apiAjax({
- url: 'system/setting',
- error: function error() {
- $A.storage("systemSetting", {});
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this7.systemConfig = res.data;
- _this7.systemConfig.callav = _this7.systemConfig.callav || 'open';
- $A.storage("systemSetting", _this7.systemConfig);
- } else {
- $A.storage("systemSetting", {});
- }
- }
- });
- },
- formatCDate: function formatCDate(v) {
- var string = '';
- if ($A.runNum(v) > 0) {
- if ($A.formatDate('Ymd') === $A.formatDate('Ymd', v)) {
- string = $A.formatDate('H:i', v);
- } else if ($A.formatDate('Y') === $A.formatDate('Y', v)) {
- string = $A.formatDate('m-d', v);
- } else {
- string = $A.formatDate('Y-m-d', v);
- }
- }
- return string || '';
- },
- getDialogLists: function getDialogLists() {
- var _this8 = this;
- if (!this.openAlready) {
- return;
- }
- this.loadIng++;
- this.dialogNoDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'chat/dialog/lists',
- complete: function complete() {
- _this8.loadIng--;
- },
- error: function error() {
- _this8.dialogNoDataText = _this8.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this8.dialogLists = res.data;
- _this8.dialogNoDataText = _this8.$L("没有相关的数据");
- _this8.scrollToActive();
- } else {
- _this8.dialogLists = [];
- _this8.dialogNoDataText = res.msg;
- }
- }
- });
- },
- getDialogMessage: function getDialogMessage() {
- var _this9 = this;
- var isNextPage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var username = this.dialogTarget.username;
- if (!username) {
- return;
- }
- //
- if (isNextPage === true) {
- if (!this.messageHasMorePages) {
- return;
- }
- this.messageCurrentPage += 1;
- } else {
- this.messageCurrentPage = 1;
- this.autoBottom = true;
- this.messageNew = 0;
- this.messageLists = [];
- }
- this.messageHasMorePages = false;
- //
- this.loadIng++;
- this.messageNoDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'chat/message/lists',
- data: {
- username: username,
- page: this.messageCurrentPage,
- pagesize: 30
- },
- complete: function complete() {
- _this9.loadIng--;
- },
- error: function error() {
- _this9.messageNoDataText = _this9.$L("数据加载失败!");
- },
- success: function success(res) {
- if (username != _this9.dialogTarget.username) {
- return;
- }
- if (res.ret === 1) {
- var tempId = "notice_" + $A.randomString(6);
- var tempLists = res.data.lists;
- if (isNextPage) {
- _this9.addMessageData({
- id: tempId,
- type: 'notice',
- notice: _this9.$L('历史消息')
- }, false, isNextPage);
- } else {
- tempLists = tempLists.reverse();
- }
- tempLists.forEach(function (item) {
- _this9.addMessageData(Object.assign(item.message, {
- id: item.id,
- username: item.username,
- userimg: item.userimg,
- indate: item.indate
- }), false, isNextPage);
- });
- if (isNextPage) {
- _this9.$nextTick(function () {
- var tempObj = $A('div[data-id="' + tempId + '"]');
- if (tempObj.length > 0) {
- _this9.$refs.manageLists.scrollTo(tempObj.offset().top - tempObj.height() - 24, false);
- }
- });
- }
- _this9.messageNoDataText = '';
- _this9.messageHasMorePages = res.data.hasMorePages;
- } else {
- _this9.messageNoDataText = res.msg;
- _this9.messageHasMorePages = false;
- }
- }
- });
- },
- getTeamLists: function getTeamLists() {
- var _this10 = this;
- var isNextPage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- if (isNextPage === true) {
- if (!this.teamHasMorePages) {
- return;
- }
- this.teamCurrentPage += 1;
- } else {
- this.teamCurrentPage = 1;
- }
- this.teamHasMorePages = false;
- //
- this.loadIng++;
- this.teamNoDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'users/team/lists',
- data: {
- sorts: {
- key: 'az',
- order: 'asc'
- },
- page: this.teamCurrentPage,
- pagesize: 100
- },
- complete: function complete() {
- _this10.loadIng--;
- },
- error: function error() {
- _this10.teamNoDataText = _this10.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1) {
- res.data.lists.forEach(function (item) {
- if (typeof _this10.teamLists[item.az] === "undefined") {
- _this10.$set(_this10.teamLists, item.az, []);
- }
- _this10.teamLists[item.az].push(item);
- });
- _this10.teamNoDataText = _this10.$L("没有相关的数据");
- _this10.teamHasMorePages = res.data.hasMorePages;
- //
- if (_this10.teamHasMorePages && res.data.currentPage < 5) {
- _this10.getTeamLists(true);
- }
- } else {
- _this10.teamLists = {};
- _this10.teamNoDataText = res.msg;
- _this10.teamHasMorePages = false;
- }
- }
- });
- },
- addDialog: function addDialog(data) {
- if (!data.username) {
- return;
- }
- var lists = this.dialogLists.filter(function (item) {
- return item.username == data.username;
- });
- var unread = 0;
- if (lists.length > 0) {
- if (typeof data.userimg === "undefined") {
- data.userimg = lists[0].userimg;
- }
- unread = $A.runNum(lists[0].unread);
- this.dialogLists = this.dialogLists.filter(function (item) {
- return item.username != data.username;
- });
- }
- if (typeof data.unread === "undefined") {
- data.unread = unread;
- }
- this.dialogLists.unshift(data);
- },
- openDialog: function openDialog(user) {
- var autoAddDialog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (autoAddDialog === true) {
- var lists = this.dialogLists.filter(function (item) {
- return item.username == user.username;
- });
- if (lists.length === 0) {
- this.addDialog(user);
- }
- }
- this.chatTap = 'dialog';
- this.chatTam = '';
- this.dialogTarget = user;
- if (typeof user.unread === "number" && user.unread > 0) {
- this.unreadTotal -= user.unread;
- this.$set(user, 'unread', 0);
- $A.WSOB.sendTo('read', user.username);
- }
- if (autoAddDialog === true) {
- this.scrollToActive();
- }
- },
- scrollToActive: function scrollToActive() {
- var _this11 = this;
- //自动滚到焦点
- this.$nextTick(function () {
- var dialogObj = $A(_this11.$refs.dialogLists);
- var activeObj = dialogObj.find("li.active");
- if (activeObj.length > 0) {
- var offsetTop = activeObj.offset().top;
- if (offsetTop < 0) {
- dialogObj.stop().scrollTop(activeObj[0].offsetTop - 50);
- } else if (offsetTop > dialogObj.height()) {
- dialogObj.stop().scrollTop(activeObj[0].offsetTop + 50 + activeObj.height() - dialogObj.height());
- }
- }
- });
- },
- clickDialog: function clickDialog(username) {
- var _this12 = this;
- var autoPush = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var lists = this.dialogLists.filter(function (item) {
- return item.username == username;
- });
- if (lists.length > 0) {
- this.openDialog(lists[0]);
- if (autoPush === true) {
- this.scrollToActive();
- }
- } else if (autoPush === true) {
- $A.apiAjax({
- url: 'users/team/lists',
- data: {
- username: username
- },
- success: function success(res) {
- if (res.ret === 1 && $A.isPlainObject(res.data)) {
- _this12.$nextTick(function () {
- typeof _this12.dialogTarget.username === "undefined" && _this12.openDialog(res.data, true);
- });
- }
- }
- });
- }
- },
- dialogDropdown: function dialogDropdown(type) {
- var _this13 = this;
- switch (type) {
- case 'clear':
- case 'delete':
- this.$Modal.confirm({
- title: this.$L('确认操作'),
- content: type === 'delete' ? this.$L('你确定要删除此对话吗?') : this.$L('你确定要清除聊天记录吗?'),
- loading: true,
- onOk: function onOk() {
- var username = _this13.dialogTarget.username;
- $A.apiAjax({
- url: 'chat/dialog/clear',
- data: {
- username: username,
- delete: type === 'delete' ? 1 : 0
- },
- error: function error() {
- _this13.$Modal.remove();
- alert(_this13.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- _this13.$Modal.remove();
- if (res.ret === 1) {
- if (type === 'delete') {
- _this13.dialogLists = _this13.dialogLists.filter(function (item) {
- return item.username != username;
- });
- _this13.dialogTarget = {};
- } else {
- _this13.$set(_this13.dialogTarget, 'lasttext', '');
- _this13.getDialogMessage();
- }
- }
- setTimeout(function () {
- if (res.ret === 1) {
- _this13.$Message.success(res.msg);
- } else {
- _this13.$Modal.error({ title: _this13.$L('温馨提示'), content: res.msg });
- }
- }, 350);
- }
- });
- }
- });
- break;
- }
- },
- messageListsScroll: function messageListsScroll(res) {
- if (res.directionreal === 'up') {
- if (res.scrollE < 10) {
- this.autoBottom = true;
- }
- } else if (res.directionreal === 'down') {
- this.autoBottom = false;
- }
- },
- messageBottomAuto: function messageBottomAuto() {
- var _this14 = this;
- var randString = $A.randomString(8);
- window.__messageBottomAuto = randString;
- setTimeout(function () {
- if (randString === window.__messageBottomAuto) {
- window.__messageBottomAuto = null;
- if (_this14.autoBottom) {
- _this14.messageBottomGo();
- }
- _this14.messageBottomAuto();
- }
- }, 1000);
- },
- messageBottomGo: function messageBottomGo() {
- var _this15 = this;
- var animation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- this.$nextTick(function () {
- _this15.messageNew = 0;
- if (typeof _this15.$refs.manageLists !== "undefined") {
- _this15.$refs.manageLists.scrollTo(_this15.$refs.manageBody.clientHeight, animation);
- _this15.autoBottom = true;
- }
- });
- },
- messageInsertText: function messageInsertText(emoji) {
- this.messageText += emoji;
- },
- messageInsertFile: function messageInsertFile(item) {
- var _this16 = this;
- if ((typeof item === "undefined" ? "undefined" : _typeof(item)) === 'object' && typeof item.url === "string") {
- var data = {
- type: ['jpg', 'jpeg', 'png', 'gif'].indexOf(item.ext) !== -1 ? 'image' : 'file',
- filename: item.name,
- filesize: item.size,
- filethumb: item.thumb,
- username: this.usrInfo.username,
- userimg: this.usrInfo.userimg,
- indate: Math.round(new Date().getTime() / 1000),
- url: item.url,
- width: $A.getObject(item, 'response.data.width'),
- height: $A.getObject(item, 'response.data.height'),
- replaceId: item.tempId
- };
- $A.WSOB.sendTo('user', this.dialogTarget.username, data, function (res) {
- _this16.$set(data, res.status === 1 ? 'id' : 'error', res.message);
- });
- //
- this.addDialog(Object.assign(this.dialogTarget, {
- lasttext: this.$L(data.type == 'image' ? '[图片]' : '[文件]'),
- lastdate: data.indate
- }));
- this.openDialog(this.dialogTarget);
- this.addMessageData(data, true);
- }
- },
- addMessageData: function addMessageData(data) {
- var _this17 = this;
- var animation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var isUnshift = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- data.self = data.username === this.usrInfo.username;
- var sikp = false;
- if (data.id || data.replaceId) {
- this.messageLists.some(function (item, index) {
- if (item.id == data.id || item.id == data.replaceId) {
- data.nickname = data.nickname || item.nickname;
- _this17.messageLists.splice(index, 1, data);
- return sikp = true;
- }
- });
- if (sikp) {
- return;
- }
- }
- if (isUnshift) {
- this.messageLists.unshift(data);
- } else {
- this.messageLists.push(data);
- if (this.autoBottom) {
- this.messageBottomGo(animation);
- } else {
- this.messageNew++;
- }
- }
- },
- messageSend: function messageSend(e) {
- if (e.keyCode == 13) {
- if (e.shiftKey) {
- return;
- }
- e.preventDefault();
- this.messageSubmit();
- }
- },
- messageDragOver: function messageDragOver(show) {
- var _this18 = this;
- var random = this.__dialogDragOver = $A.randomString(8);
- if (!show) {
- setTimeout(function () {
- if (random === _this18.__dialogDragOver) {
- _this18.dialogDragOver = show;
- }
- }, 150);
- } else {
- this.dialogDragOver = show;
- }
- },
- messagePasteDrag: function messagePasteDrag(e, type) {
- var _this19 = this;
- this.dialogDragOver = false;
- var files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
- var postFiles = Array.prototype.slice.call(files);
- if (postFiles.length > 0) {
- e.preventDefault();
- postFiles.forEach(function (file) {
- _this19.$refs.messageUpload.upload(file);
- });
- }
- },
- messageFile: function messageFile(type, file) {
- var _this20 = this;
- switch (type) {
- case 'progress':
- this.addMessageData({
- id: file.tempId,
- type: 'image',
- username: this.usrInfo.username,
- userimg: this.usrInfo.userimg,
- indate: Math.round(new Date().getTime() / 1000),
- url: 'loading'
- }, true);
- break;
- case 'error':
- this.messageLists.some(function (item, index) {
- if (item.id == file.tempId) {
- _this20.messageLists.splice(index, 1);
- return true;
- }
- });
- break;
- case 'success':
- this.messageInsertFile(file);
- break;
- }
- },
- messageSubmit: function messageSubmit() {
- var _this21 = this;
- var dialogUser = this.dialogLists.filter(function (item) {
- return item.username == _this21.dialogTarget.username;
- });
- if (dialogUser.length > 0) {
- var user = dialogUser[0];
- if (typeof user.unread === "number" && user.unread > 0) {
- this.unreadTotal -= user.unread;
- this.$set(user, 'unread', 0);
- $A.WSOB.sendTo('read', user.username);
- }
- }
- //
- this.autoBottom = true;
- var text = this.messageText.trim();
- if ($A.count(text) > 0) {
- var data = {
- type: 'text',
- username: this.usrInfo.username,
- userimg: this.usrInfo.userimg,
- indate: Math.round(new Date().getTime() / 1000),
- text: text
- };
- $A.WSOB.sendTo('user', this.dialogTarget.username, data, function (res) {
- _this21.$set(data, res.status === 1 ? 'id' : 'error', res.message);
- });
- //
- this.addDialog(Object.assign(this.dialogTarget, {
- lasttext: text,
- lastdate: data.indate
- }));
- this.openDialog(this.dialogTarget);
- this.addMessageData(data, true);
- }
- this.$nextTick(function () {
- _this21.messageText = "";
- });
- },
- userViewResult: function userViewResult(user, data) {
- this.$set(user, 'nickname', data.nickname);
- this.$set(user, 'userimg', data.userimg);
- },
- videoConnect: function videoConnect(username, videoChat) {
- var _this22 = this;
- if (!$A.leftExists(window.location.protocol, "https")) {
- this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('浏览器阻止音视频访问不是https的网站,所以尝试安装SSL!') });
- return;
- }
- this.videoChat = videoChat;
- navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
- try {
- navigator.mediaDevices.getUserMedia({
- audio: true,
- video: this.videoChat
- }).then(function (stream) {
- _this22.videoLocalStream = stream;
- _this22.$refs.localVideo.srcObject = stream;
- _this22.$refs.localVideo.removeEventListener('loadedmetadata', _this22.videoListener);
- //
- if (username === null) {
- // 发起者
- _this22.videoUserName = _this22.dialogTarget.username;
- _this22.videoUserImg = _this22.dialogTarget.userimg;
- _this22.videoStartTime = 0;
- _this22.videoInitiator = true;
- _this22.$refs.localVideo.addEventListener('loadedmetadata', _this22.videoListener);
- } else {
- // 接受者
- _this22.videoIcecandidate(_this22.videoLocalStream, username);
- _this22.videoRtc.createOffer({
- offerToReceiveAudio: true,
- offerToReceiveVideo: _this22.videoChat
- }).then(function (desc) {
- _this22.videoRtc.setLocalDescription(desc).then(function () {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'offer',
- 'data': _this22.videoRtc.localDescription
- });
- }).catch(function (e) {
- _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
- _this22.videoClose(username, _this22.$L('对方:') + e);
- });
- }).catch(function (e) {
- _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
- _this22.videoClose(username, _this22.$L('对方:') + e);
- });
- }
- }).catch(function (e) {
- _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
- username && _this22.videoClose(username, _this22.$L('对方:') + e);
- });
- } catch (e) {
- this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('当前浏览器不支持音视频通话!') });
- username && this.videoClose(username, this.$L('对方:') + this.$L('浏览器不支持音视频通话!'));
- }
- },
- videoListener: function videoListener() {
- var _this23 = this;
- $A.WSOB.sendTo('info', this.videoUserName, {
- 'type': 'video',
- 'subtype': 'call',
- 'username': this.usrInfo.username,
- 'userimg': this.usrInfo.userimg,
- 'video': this.videoChat
- }, function (res) {
- if (res.status !== 1) {
- _this23.videoClose(_this23.videoUserName, _this23.$L('呼叫失败!'));
- }
- });
- },
- videoIcecandidate: function videoIcecandidate(localStream, username) {
- var _this24 = this;
- this.videoRtc = new RTCPeerConnection({ "iceServers": [{ "urls": ["turn:business.swoole.com:3478?transport=udp", "turn:business.swoole.com:3478?transport=tcp"], "username": "ceshi", "credential": "ceshi" }] });
- this.videoRtc.onicecandidate = function (event) {
- if (event.candidate) {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'candidate',
- 'data': event.candidate
- });
- }
- };
- try {
- this.videoRtc.addStream(localStream);
- } catch (e) {
- var tracks = localStream.getTracks();
- for (var i = 0; i < tracks.length; i++) {
- this.videoRtc.addTrack(tracks[i], localStream);
- }
- }
- this.videoRtc.onaddstream = function (e) {
- _this24.$refs.remoteVideo.srcObject = e.stream;
- };
- },
- videoClose: function videoClose(username, reason) {
- if (username && reason !== false) {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'close',
- 'reason': reason
- });
- }
- if (this.videoInitiator) {
- this.videoInitiator = false;
- if (this.videoStartTime > 0) {
- var second = Math.round(new Date().getTime() / 1000) - this.videoStartTime;
- if (second >= 2) {
- $A.WSOB.sendTo('user', this.videoUserName, {
- type: this.videoChat ? 'video' : 'voice',
- username: this.usrInfo.username,
- userimg: this.usrInfo.userimg,
- indate: Math.round(new Date().getTime() / 1000),
- text: this.videoChat ? '视频通话' : '语音通话',
- other: {
- second: second
- }
- }, 'special');
- }
- }
- }
- if (username == this.videoUserName) {
- this.videoUserName = '';
- this.videoUserImg = '';
- this.videoStartTime = 0;
- if (this.videoLocalStream !== null) {
- this.videoLocalStream.getTracks().forEach(function (track) {
- track.stop();
- });
- this.videoLocalStream = null;
- }
- this.$refs.localVideo.srcObject = null;
- this.$refs.remoteVideo.srcObject = null;
- }
- },
- videoMessage: function videoMessage(msgDetail) {
- var _this25 = this;
- var body = msgDetail.body;
- var username = msgDetail.username;
- if (['offer', 'candidate', 'answer'].indexOf(body.subtype) !== -1) {
- if (!this.videoLocalStream) {
- this.videoClose(username);
- return;
- }
- }
- //
- switch (body.subtype) {
- case 'call':
- var callIng = true;
- var callAudio = this.$refs.callAudio;
- if (callAudio.getAttribute("data-listener") !== 'yes') {
- callAudio.setAttribute("data-listener", "yes");
- callAudio.addEventListener('ended', function () {
- if (callIng) {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'judge'
- });
- callAudio.play();
- }
- }, false);
- }
- callAudio.currentTime = 0;
- callAudio.play();
- //
- this.$Notice.close('chat-call');
- this.$Notice.open({
- name: 'chat-call',
- duration: 0,
- onClose: function onClose() {
- callIng = false;
- callAudio.pause();
- _this25.videoClose(username, _this25.$L('对方:拒绝接听'));
- },
- render: function render(h) {
- return h('div', {
- class: 'chat-notice-box'
- }, [h('UserImg', { class: 'chat-notice-userimg', props: { info: body } }), h('div', { class: 'ivu-notice-with-desc' }, [h('div', { class: 'ivu-notice-title' }, [h('UserView', { props: { username: username } })]), h('div', { class: 'ivu-notice-desc' }, _this25.$L(body.video ? "邀请视频通话..." : "邀请语音通话...")), h('div', { class: 'chat-notice-btn-box' }, [h('Button', {
- props: { type: 'success', size: 'small' },
- on: {
- click: function click() {
- callIng = false;
- callAudio.pause();
- _this25.$Notice.close('chat-call');
- _this25.$emit("on-open-notice", username);
- _this25.clickDialog(username);
- _this25.videoConnect(username, body.video);
- _this25.videoUserName = username;
- _this25.videoUserImg = body.userimg;
- _this25.videoStartTime = 0;
- _this25.videoInitiator = false;
- }
- }
- }, _this25.$L("接受")), h('Button', {
- props: { type: 'error', size: 'small' },
- on: {
- click: function click() {
- callIng = false;
- callAudio.pause();
- _this25.$Notice.close('chat-call');
- _this25.videoClose(username, _this25.$L('对方:拒绝接听'));
- }
- }
- }, _this25.$L("拒绝"))])])]);
- }
- });
- break;
- case 'judge':
- if (username != this.videoUserName) {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'close'
- });
- }
- break;
- case 'close':
- this.$refs.callAudio.pause();
- this.$Notice.close('chat-call');
- this.videoClose(username, false);
- body.reason && this.$Message.warning(body.reason);
- break;
- case 'offer':
- this.videoIcecandidate(this.videoLocalStream, username);
- this.videoRtc.setRemoteDescription(new RTCSessionDescription(body.data)).then(function () {
- if (_this25.videoStartTime === 0) {
- _this25.videoRtc.createAnswer().then(function (desc) {
- _this25.videoRtc.setLocalDescription(desc).then(function () {
- $A.WSOB.sendTo('info', username, {
- 'type': 'video',
- 'subtype': 'answer',
- 'data': _this25.videoRtc.localDescription
- });
- }).catch(function (e) {
- _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
- });
- }).catch(function (e) {
- _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
- });
- _this25.videoStartTime = Math.round(new Date().getTime() / 1000);
- }
- }).catch(function (e) {
- _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
- });
- break;
- case 'answer':
- if (this.videoRtc) {
- this.videoRtc.setRemoteDescription(new RTCSessionDescription(body.data)).then(function () {}).catch(function (e) {
- _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
- });
- }
- break;
- case 'candidate':
- if (this.videoRtc) {
- this.videoRtc.addIceCandidate(new RTCIceCandidate(body.data)).then(function () {}).catch(function (e) {
- _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
- });
- }
- break;
- }
- }
- }
- });
- /***/ }),
- /* 111 */
- /***/ (function(module, exports, __webpack_require__) {
- !function(e,o){ true?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.es6Module=o():e.es6Module=o()}(this,function(){return function(e){function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var t={};return o.m=e,o.c=t,o.i=function(e){return e},o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="/dist-module/",o(o.s=3)}([function(e,o,t){var a=t(4)(t(1),t(5),null,null,null);e.exports=a.exports},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=t(2),n=function(e){return e&&e.__esModule?e:{default:e}}(a),i=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};o.default={props:{search:{type:String,required:!1,default:""},emojiTable:{type:Object,required:!1,default:function(){return n.default}}},data:function(){return{display:{x:0,y:0,visible:!1}}},computed:{emojis:function(){if(this.search){var e={};for(var o in this.emojiTable){e[o]={};for(var t in this.emojiTable[o])new RegExp(".*"+i(this.search)+".*").test(t)&&(e[o][t]=this.emojiTable[o][t]);0===Object.keys(e[o]).length&&delete e[o]}return e}return this.emojiTable}},methods:{insert:function(e){this.$emit("emoji",e)},toggle:function(e){this.display.visible=!this.display.visible,this.display.x=e.clientX,this.display.y=e.clientY},hide:function(){this.display.visible=!1},escape:function(e){!0===this.display.visible&&27===e.keyCode&&(this.display.visible=!1)}},directives:{"click-outside":{bind:function(e,o,t){if("function"==typeof o.value){var a=o.modifiers.bubble,n=function(t){(a||!e.contains(t.target)&&e!==t.target)&&o.value(t)};e.__vueClickOutside__=n,document.addEventListener("click",n)}},unbind:function(e,o){document.removeEventListener("click",e.__vueClickOutside__),e.__vueClickOutside__=null}}},mounted:function(){document.addEventListener("keyup",this.escape)},destroyed:function(){document.removeEventListener("keyup",this.escape)}}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={"Frequently used":{thumbs_up:"👍","-1":"👎",sob:"😭",confused:"😕",neutral_face:"😐",blush:"😊",heart_eyes:"😍"},People:{smile:"😄",smiley:"😃",grinning:"😀",blush:"😊",wink:"😉",heart_eyes:"😍",kissing_heart:"😘",kissing_closed_eyes:"😚",kissing:"😗",kissing_smiling_eyes:"😙",stuck_out_tongue_winking_eye:"😜",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue:"😛",flushed:"😳",grin:"😁",pensive:"😔",relieved:"😌",unamused:"😒",disappointed:"😞",persevere:"😣",cry:"😢",joy:"😂",sob:"😭",sleepy:"😪",disappointed_relieved:"😥",cold_sweat:"😰",sweat_smile:"😅",sweat:"😓",weary:"😩",tired_face:"😫",fearful:"😨",scream:"😱",angry:"😠",rage:"😡",triumph:"😤",confounded:"😖",laughing:"😆",yum:"😋",mask:"😷",sunglasses:"😎",sleeping:"😴",dizzy_face:"😵",astonished:"😲",worried:"😟",frowning:"😦",anguished:"😧",imp:"👿",open_mouth:"😮",grimacing:"😬",neutral_face:"😐",confused:"😕",hushed:"😯",smirk:"😏",expressionless:"😑",man_with_gua_pi_mao:"👲",man_with_turban:"👳",cop:"👮",construction_worker:"👷",guardsman:"💂",baby:"👶",boy:"👦",girl:"👧",man:"👨",woman:"👩",older_man:"👴",older_woman:"👵",person_with_blond_hair:"👱",angel:"👼",princess:"👸",smiley_cat:"😺",smile_cat:"😸",heart_eyes_cat:"😻",kissing_cat:"😽",smirk_cat:"😼",scream_cat:"🙀",crying_cat_face:"😿",joy_cat:"😹",pouting_cat:"😾",japanese_ogre:"👹",japanese_goblin:"👺",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",skull:"💀",alien:"👽",hankey:"💩",fire:"🔥",sparkles:"✨",star2:"🌟",dizzy:"💫",boom:"💥",anger:"💢",sweat_drops:"💦",droplet:"💧",zzz:"💤",dash:"💨",ear:"👂",eyes:"👀",nose:"👃",tongue:"👅",lips:"👄",thumbs_up:"👍","-1":"👎",ok_hand:"👌",facepunch:"👊",fist:"✊",wave:"👋",hand:"✋",open_hands:"👐",point_up_2:"👆",point_down:"👇",point_right:"👉",point_left:"👈",raised_hands:"🙌",pray:"🙏",clap:"👏",muscle:"💪",walking:"🚶",runner:"🏃",dancer:"💃",couple:"👫",family:"👪",couplekiss:"💏",couple_with_heart:"💑",dancers:"👯",ok_woman:"🙆",no_good:"🙅",information_desk_person:"💁",raising_hand:"🙋",massage:"💆",haircut:"💇",nail_care:"💅",bride_with_veil:"👰",person_with_pouting_face:"🙎",person_frowning:"🙍",bow:"🙇",tophat:"🎩",crown:"👑",womans_hat:"👒",athletic_shoe:"👟",mans_shoe:"👞",sandal:"👡",high_heel:"👠",boot:"👢",shirt:"👕",necktie:"👔",womans_clothes:"👚",dress:"👗",running_shirt_with_sash:"🎽",jeans:"👖",kimono:"👘",bikini:"👙",briefcase:"💼",handbag:"👜",pouch:"👝",purse:"👛",eyeglasses:"👓",ribbon:"🎀",closed_umbrella:"🌂",lipstick:"💄",yellow_heart:"💛",blue_heart:"💙",purple_heart:"💜",green_heart:"💚",broken_heart:"💔",heartpulse:"💗",heartbeat:"💓",two_hearts:"💕",sparkling_heart:"💖",revolving_hearts:"💞",cupid:"💘",love_letter:"💌",kiss:"💋",ring:"💍",gem:"💎",bust_in_silhouette:"👤",speech_balloon:"💬",footprints:"👣"},Nature:{dog:"🐶",wolf:"🐺",cat:"🐱",mouse:"🐭",hamster:"🐹",rabbit:"🐰",frog:"🐸",tiger:"🐯",koala:"🐨",bear:"🐻",pig:"🐷",pig_nose:"🐽",cow:"🐮",boar:"🐗",monkey_face:"🐵",monkey:"🐒",horse:"🐴",sheep:"🐑",elephant:"🐘",panda_face:"🐼",penguin:"🐧",bird:"🐦",baby_chick:"🐤",hatched_chick:"🐥",hatching_chick:"🐣",chicken:"🐔",snake:"🐍",turtle:"🐢",bug:"🐛",bee:"🐝",ant:"🐜",beetle:"🐞",snail:"🐌",octopus:"🐙",shell:"🐚",tropical_fish:"🐠",fish:"🐟",dolphin:"🐬",whale:"🐳",racehorse:"🐎",dragon_face:"🐲",blowfish:"🐡",camel:"🐫",poodle:"🐩",feet:"🐾",bouquet:"💐",cherry_blossom:"🌸",tulip:"🌷",four_leaf_clover:"🍀",rose:"🌹",sunflower:"🌻",hibiscus:"🌺",maple_leaf:"🍁",leaves:"🍃",fallen_leaf:"🍂",herb:"🌿",ear_of_rice:"🌾",mushroom:"🍄",cactus:"🌵",palm_tree:"🌴",chestnut:"🌰",seedling:"🌱",blossom:"🌼",new_moon:"🌑",first_quarter_moon:"🌓",moon:"🌔",full_moon:"🌕",first_quarter_moon_with_face:"🌛",crescent_moon:"🌙",earth_asia:"🌏",volcano:"🌋",milky_way:"🌌",stars:"🌠",partly_sunny:"⛅",snowman:"⛄",cyclone:"🌀",foggy:"🌁",rainbow:"🌈",ocean:"🌊"},Objects:{bamboo:"🎍",gift_heart:"💝",dolls:"🎎",school_satchel:"🎒",mortar_board:"🎓",flags:"🎏",fireworks:"🎆",sparkler:"🎇",wind_chime:"🎐",rice_scene:"🎑",jack_o_lantern:"🎃",ghost:"👻",santa:"🎅",christmas_tree:"🎄",gift:"🎁",tanabata_tree:"🎋",tada:"🎉",confetti_ball:"🎊",balloon:"🎈",crossed_flags:"🎌",crystal_ball:"🔮",movie_camera:"🎥",camera:"📷",video_camera:"📹",vhs:"📼",cd:"💿",dvd:"📀",minidisc:"💽",floppy_disk:"💾",computer:"💻",iphone:"📱",telephone_receiver:"📞",pager:"📟",fax:"📠",satellite:"📡",tv:"📺",radio:"📻",loud_sound:"🔊",bell:"🔔",loudspeaker:"📢",mega:"📣",hourglass_flowing_sand:"⏳",hourglass:"⌛",alarm_clock:"⏰",watch:"⌚",unlock:"🔓",lock:"🔒",lock_with_ink_pen:"🔏",closed_lock_with_key:"🔐",key:"🔑",mag_right:"🔎",bulb:"💡",flashlight:"🔦",electric_plug:"🔌",battery:"🔋",mag:"🔍",bath:"🛀",toilet:"🚽",wrench:"🔧",nut_and_bolt:"🔩",hammer:"🔨",door:"🚪",smoking:"🚬",bomb:"💣",gun:"🔫",hocho:"🔪",pill:"💊",syringe:"💉",moneybag:"💰",yen:"💴",dollar:"💵",credit_card:"💳",money_with_wings:"💸",calling:"📲","e-mail":"📧",inbox_tray:"📥",outbox_tray:"📤",envelope_with_arrow:"📩",incoming_envelope:"📨",mailbox:"📫",mailbox_closed:"📪",postbox:"📮",package:"📦",memo:"📝",page_facing_up:"📄",page_with_curl:"📃",bookmark_tabs:"📑",bar_chart:"📊",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",scroll:"📜",clipboard:"📋",date:"📅",calendar:"📆",card_index:"📇",file_folder:"📁",open_file_folder:"📂",pushpin:"📌",paperclip:"📎",straight_ruler:"📏",triangular_ruler:"📐",closed_book:"📕",green_book:"📗",blue_book:"📘",orange_book:"📙",notebook:"📓",notebook_with_decorative_cover:"📔",ledger:"📒",books:"📚",book:"📖",bookmark:"🔖",name_badge:"📛",newspaper:"📰",art:"🎨",clapper:"🎬",microphone:"🎤",headphones:"🎧",musical_score:"🎼",musical_note:"🎵",notes:"🎶",musical_keyboard:"🎹",violin:"🎻",trumpet:"🎺",saxophone:"🎷",guitar:"🎸",space_invader:"👾",video_game:"🎮",black_joker:"🃏",flower_playing_cards:"🎴",mahjong:"🀄",game_die:"🎲",dart:"🎯",football:"🏈",basketball:"🏀",soccer:"⚽",baseball:"⚾",tennis:"🎾","8ball":"🎱",bowling:"🎳",golf:"⛳",checkered_flag:"🏁",trophy:"🏆",ski:"🎿",snowboarder:"🏂",swimmer:"🏊",surfer:"🏄",fishing_pole_and_fish:"🎣",tea:"🍵",sake:"🍶",beer:"🍺",beers:"🍻",cocktail:"🍸",tropical_drink:"🍹",wine_glass:"🍷",fork_and_knife:"🍴",pizza:"🍕",hamburger:"🍔",fries:"🍟",poultry_leg:"🍗",meat_on_bone:"🍖",spaghetti:"🍝",curry:"🍛",fried_shrimp:"🍤",bento:"🍱",sushi:"🍣",fish_cake:"🍥",rice_ball:"🍙",rice_cracker:"🍘",rice:"🍚",ramen:"🍜",stew:"🍲",oden:"🍢",dango:"🍡",egg:"🍳",bread:"🍞",doughnut:"🍩",custard:"🍮",icecream:"🍦",ice_cream:"🍨",shaved_ice:"🍧",birthday:"🎂",cake:"🍰",cookie:"🍪",chocolate_bar:"🍫",candy:"🍬",lollipop:"🍭",honey_pot:"🍯",apple:"🍎",green_apple:"🍏",tangerine:"🍊",cherries:"🍒",grapes:"🍇",watermelon:"🍉",strawberry:"🍓",peach:"🍑",melon:"🍈",banana:"🍌",pineapple:"🍍",sweet_potato:"🍠",eggplant:"🍆",tomato:"🍅",corn:"🌽"},Places:{house:"🏠",house_with_garden:"🏡",school:"🏫",office:"🏢",post_office:"🏣",hospital:"🏥",bank:"🏦",convenience_store:"🏪",love_hotel:"🏩",hotel:"🏨",wedding:"💒",church:"⛪",department_store:"🏬",city_sunrise:"🌇",city_sunset:"🌆",japanese_castle:"🏯",european_castle:"🏰",tent:"⛺",factory:"🏭",tokyo_tower:"🗼",japan:"🗾",mount_fuji:"🗻",sunrise_over_mountains:"🌄",sunrise:"🌅",night_with_stars:"🌃",statue_of_liberty:"🗽",bridge_at_night:"🌉",carousel_horse:"🎠",ferris_wheel:"🎡",fountain:"⛲",roller_coaster:"🎢",ship:"🚢",boat:"⛵",speedboat:"🚤",rocket:"🚀",seat:"💺",station:"🚉",bullettrain_side:"🚄",bullettrain_front:"🚅",metro:"🚇",railway_car:"🚃",bus:"🚌",blue_car:"🚙",car:"🚗",taxi:"🚕",truck:"🚚",rotating_light:"🚨",police_car:"🚓",fire_engine:"🚒",ambulance:"🚑",bike:"🚲",barber:"💈",busstop:"🚏",ticket:"🎫",traffic_light:"🚥",construction:"🚧",beginner:"🔰",fuelpump:"⛽",izakaya_lantern:"🏮",slot_machine:"🎰",moyai:"🗿",circus_tent:"🎪",performing_arts:"🎭",round_pushpin:"📍",triangular_flag_on_post:"🚩"},Symbols:{keycap_ten:"🔟",1234:"🔢",symbols:"🔣",capital_abcd:"🔠",abcd:"🔡",abc:"🔤",arrow_up_small:"🔼",arrow_down_small:"🔽",rewind:"⏪",fast_forward:"⏩",arrow_double_up:"⏫",arrow_double_down:"⏬",ok:"🆗",new:"🆕",up:"🆙",cool:"🆒",free:"🆓",ng:"🆖",signal_strength:"📶",cinema:"🎦",koko:"🈁",u6307:"🈯",u7a7a:"🈳",u6e80:"🈵",u5408:"🈴",u7981:"🈲",ideograph_advantage:"🉐",u5272:"🈹",u55b6:"🈺",u6709:"🈶",u7121:"🈚",restroom:"🚻",mens:"🚹",womens:"🚺",baby_symbol:"🚼",wc:"🚾",no_smoking:"🚭",u7533:"🈸",accept:"🉑",cl:"🆑",sos:"🆘",id:"🆔",no_entry_sign:"🚫",underage:"🔞",no_entry:"⛔",negative_squared_cross_mark:"❎",white_check_mark:"✅",heart_decoration:"💟",vs:"🆚",vibration_mode:"📳",mobile_phone_off:"📴",ab:"🆎",diamond_shape_with_a_dot_inside:"💠",ophiuchus:"⛎",six_pointed_star:"🔯",atm:"🏧",chart:"💹",heavy_dollar_sign:"💲",currency_exchange:"💱",x:"❌",exclamation:"❗",question:"❓",grey_exclamation:"❕",grey_question:"❔",o:"⭕",top:"🔝",end:"🔚",back:"🔙",on:"🔛",soon:"🔜",arrows_clockwise:"🔃",clock12:"🕛",clock1:"🕐",clock2:"🕑",clock3:"🕒",clock4:"🕓",clock5:"🕔",clock6:"🕕",clock7:"🕖",clock8:"🕗",clock9:"🕘",clock10:"🕙",clock11:"🕚",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",white_flower:"💮",100:"💯",radio_button:"🔘",link:"🔗",curly_loop:"➰",trident:"🔱",small_red_triangle:"🔺",black_square_button:"🔲",white_square_button:"🔳",red_circle:"🔴",large_blue_circle:"🔵",small_red_triangle_down:"🔻",white_large_square:"⬜",black_large_square:"⬛",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_orange_diamond:"🔸",small_blue_diamond:"🔹"}}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.EmojiPickerPlugin=o.EmojiPicker=void 0;var a=t(0),n=function(e){return e&&e.__esModule?e:{default:e}}(a),i={install:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.component("emoji-picker",n.default)}};"undefined"!=typeof window&&(window.EmojiPicker=i),o.EmojiPicker=n.default,o.EmojiPickerPlugin=i,o.default=n.default},function(e,o){e.exports=function(e,o,t,a,n){var i,r=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(i=e,r=e.default);var l="function"==typeof r?r.options:r;o&&(l.render=o.render,l.staticRenderFns=o.staticRenderFns),a&&(l._scopeId=a);var _;if(n?(_=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},l._ssrRegister=_):t&&(_=t),_){var c=l.functional,u=c?l.render:l.beforeCreate;c?l.render=function(e,o){return _.call(o),u(e,o)}:l.beforeCreate=u?[].concat(u,_):[_]}return{esModule:i,exports:r,options:l}}},function(e,o){e.exports={render:function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",[e._t("emoji-invoker",null,{events:{click:function(o){return e.toggle(o)}}}),e._v(" "),e.display.visible?t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hide,expression:"hide"}]},[e._t("emoji-picker",null,{emojis:e.emojis,insert:e.insert,display:e.display})],2):e._e()],2)},staticRenderFns:[]}}])});
- //# sourceMappingURL=main.js.map
- /***/ }),
- /* 112 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(113);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("ea5947be", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-5eba4923\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/sass-loader/lib/loader.js!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ScrollerY.vue", function() {
- var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-5eba4923\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/sass-loader/lib/loader.js!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ScrollerY.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 113 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.app-scroller[data-v-5eba4923] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow-x: hidden;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n.app-scroller-static[data-v-5eba4923] {\n position: static;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n", ""]);
- // exports
- /***/ }),
- /* 114 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ScrollerY',
- props: {
- static: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- scrollY: 0,
- scrollDiff: 0,
- scrollInfo: {}
- };
- },
- mounted: function mounted() {
- var _this = this;
- this.$nextTick(function () {
- var scrollListener = typeof _this.$listeners['on-scroll'] === "function";
- var scrollerView = $A(_this.$refs.scrollerView);
- scrollerView.scroll(function () {
- var wInnerH = Math.round(scrollerView.innerHeight());
- var wScrollY = scrollerView.scrollTop();
- var bScrollH = _this.$refs.scrollerView.scrollHeight;
- _this.scrollY = wScrollY;
- if (scrollListener) {
- var direction = 'static';
- var directionreal = 'static';
- if (_this.scrollDiff - wScrollY > 50) {
- _this.scrollDiff = wScrollY;
- direction = 'down';
- } else if (_this.scrollDiff - wScrollY < -100) {
- _this.scrollDiff = wScrollY;
- direction = 'up';
- }
- if (_this.scrollDiff - wScrollY > 1) {
- _this.scrollDiff = wScrollY;
- directionreal = 'down';
- } else if (_this.scrollDiff - wScrollY < -1) {
- _this.scrollDiff = wScrollY;
- directionreal = 'up';
- }
- _this.$emit('on-scroll', {
- scale: wScrollY / (bScrollH - wInnerH), //已滚动比例
- scrollY: wScrollY, //滚动的距离
- scrollE: bScrollH - wInnerH - wScrollY, //与底部距离
- direction: direction, //滚动方向
- directionreal: directionreal //滚动方向(即时)
- });
- }
- });
- });
- },
- activated: function activated() {
- var _this2 = this;
- if (this.scrollY > 0) {
- this.$nextTick(function () {
- _this2.scrollTo(_this2.scrollY);
- });
- }
- },
- methods: {
- scrollTo: function scrollTo(top, animate) {
- if (animate === false) {
- $A(this.$refs.scrollerView).stop().scrollTop(top);
- } else {
- $A(this.$refs.scrollerView).stop().animate({ "scrollTop": top });
- }
- },
- scrollToBottom: function scrollToBottom(animate) {
- this.scrollTo(this.$refs.scrollerView.scrollHeight, animate);
- }
- }
- });
- /***/ }),
- /* 115 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- {
- ref: "scrollerView",
- staticClass: "app-scroller",
- class: [_vm.static ? "app-scroller-static" : ""]
- },
- [_vm._t("default")],
- 2
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-5eba4923", module.exports)
- }
- }
- /***/ }),
- /* 116 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(117)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(119)
- /* template */
- var __vue_template__ = __webpack_require__(120)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-9d161836"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/chat/Message.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-9d161836", Component.options)
- } else {
- hotAPI.reload("data-v-9d161836", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 117 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(118);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("4cbc0aec", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-9d161836\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Message.vue", function() {
- var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-9d161836\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Message.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 118 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n@charset \"UTF-8\";\n/*通用*/\n.list-item[data-v-9d161836], .list-right[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n padding-top: 7px;\n padding-bottom: 7px;\n background-color: #E8EBF2;\n}\n.list-item .item-left[data-v-9d161836], .list-item .item-right[data-v-9d161836], .list-right .item-left[data-v-9d161836], .list-right .item-right[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n max-width: 80%;\n}\n.list-item .item-left .item-username[data-v-9d161836], .list-item .item-right .item-username[data-v-9d161836], .list-right .item-left .item-username[data-v-9d161836], .list-right .item-right .item-username[data-v-9d161836] {\n font-size: 12px;\n padding-top: 1px;\n padding-bottom: 4px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.list-item .item-left .item-username em[data-v-9d161836], .list-item .item-right .item-username em[data-v-9d161836], .list-right .item-left .item-username em[data-v-9d161836], .list-right .item-right .item-username em[data-v-9d161836] {\n display: inline-block;\n font-style: normal;\n}\n.list-item .item-left .item-username em.item-name[data-v-9d161836], .list-item .item-right .item-username em.item-name[data-v-9d161836], .list-right .item-left .item-username em.item-name[data-v-9d161836], .list-right .item-right .item-username em.item-name[data-v-9d161836] {\n color: #888888;\n}\n.list-item .item-left .item-username em.item-tag[data-v-9d161836], .list-item .item-right .item-username em.item-tag[data-v-9d161836], .list-right .item-left .item-username em.item-tag[data-v-9d161836], .list-right .item-right .item-username em.item-tag[data-v-9d161836] {\n color: #ffffff;\n background-color: #ff0000;\n line-height: 16px;\n padding: 2px 4px;\n margin-left: 3px;\n border-radius: 2px;\n font-size: 12px;\n -webkit-transform: scale(0.8);\n transform: scale(0.8);\n font-weight: 600;\n}\n.list-item .item-left .item-username em.item-date[data-v-9d161836], .list-item .item-right .item-username em.item-date[data-v-9d161836], .list-right .item-left .item-username em.item-date[data-v-9d161836], .list-right .item-right .item-username em.item-date[data-v-9d161836] {\n margin-left: 4px;\n color: #aaaaaa;\n}\n.list-item .item-left[data-v-9d161836], .list-right .item-left[data-v-9d161836] {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.list-item .item-right[data-v-9d161836], .list-right .item-right[data-v-9d161836] {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.list-item .item-right .item-username[data-v-9d161836], .list-right .item-right .item-username[data-v-9d161836] {\n text-align: right;\n}\n.list-item .item-right .item-link[data-v-9d161836], .list-right .item-right .item-link[data-v-9d161836] {\n -webkit-transform-origin: right center;\n transform-origin: right center;\n}\n.list-item .item-userimg[data-v-9d161836], .list-right .item-userimg[data-v-9d161836] {\n width: 38px;\n height: 38px;\n margin-left: 8px;\n margin-right: 8px;\n border-radius: 3px;\n font-size: 20px;\n}\n.list-item .item-error[data-v-9d161836], .list-right .item-error[data-v-9d161836] {\n cursor: pointer;\n width: 48px;\n position: relative;\n}\n.list-item .item-error > i[data-v-9d161836], .list-right .item-error > i[data-v-9d161836] {\n color: #ff0000;\n font-size: 18px;\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n}\n.list-right[data-v-9d161836] {\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n/*文本*/\n.item-text[data-v-9d161836] {\n display: inline-block;\n border-radius: 6px;\n padding: 8px;\n background-color: #ffffff;\n max-height: 580px;\n overflow: auto;\n}\n.item-text.text-emoji[data-v-9d161836] {\n background-color: transparent;\n}\n.item-text.text-emoji .item-text-view[data-v-9d161836] {\n font-size: 52px;\n line-height: normal;\n}\n.item-text.text-error[data-v-9d161836] {\n -webkit-box-shadow: 0 0 4px 0 #ffa1a1;\n box-shadow: 0 0 4px 0 #ffa1a1;\n}\n.item-text .item-text-view[data-v-9d161836] {\n max-width: 520px;\n color: #242424;\n font-size: 14px;\n line-height: 18px;\n word-break: break-all;\n}\n\n/*信息底标*/\n.item-link[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n max-width: 100%;\n font-size: 12px;\n color: #ffffff;\n background-color: #cacaca;\n margin-top: 6px;\n margin-bottom: -2px;\n height: 20px;\n line-height: 20px;\n padding: 0 5px;\n border-radius: 4px;\n -webkit-transform: scale(0.96);\n transform: scale(0.96);\n -webkit-transform-origin: left center;\n transform-origin: left center;\n}\n.item-link > i[data-v-9d161836] {\n font-size: 14px;\n padding-right: 2px;\n}\n.item-link > span[data-v-9d161836] {\n white-space: nowrap;\n}\n.item-link > a[data-v-9d161836] {\n color: #3D90E2;\n padding-left: 3px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n}\n\n/*加载中*/\n.item-loading[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: 28px;\n height: 28px;\n margin: 24px;\n}\n\n/*文件、图片*/\n.item-file[data-v-9d161836] {\n display: inline-block;\n text-decoration: none;\n}\n.item-file .item-file-box[data-v-9d161836] {\n background: #ffffff;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 10px 14px;\n border-radius: 3px;\n width: 220px;\n}\n.item-file .item-file-box .item-file-thumb[data-v-9d161836] {\n width: 36px;\n}\n.item-file .item-file-box .item-file-info[data-v-9d161836] {\n margin-left: 12px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.item-file .item-file-box .item-file-info .item-file-name[data-v-9d161836] {\n color: #333333;\n font-size: 14px;\n line-height: 18px;\n word-break: break-all;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.item-file .item-file-box .item-file-info .item-file-size[data-v-9d161836] {\n padding-top: 4px;\n color: #666666;\n font-size: 14px;\n}\n.item-file .item-file-img[data-v-9d161836] {\n max-width: 220px;\n max-height: 220px;\n border-radius: 6px;\n}\n\n/*通知*/\n.item-notice[data-v-9d161836] {\n color: #777777;\n font-size: 12px;\n text-align: center;\n padding: 12px 24px;\n}\n", ""]);
- // exports
- /***/ }),
- /* 119 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ChatMessage',
- props: {
- info: {
- type: Object,
- default: {}
- }
- },
- mounted: function mounted() {},
- computed: {
- userName: function userName() {
- return this.info.send_username || this.info.username;
- },
- userImg: function userImg() {
- return this.info.send_userimg || this.info.userimg;
- },
- imageStyle: function imageStyle() {
- return function (info) {
- var width = info.width,
- height = info.height;
- if (width && height) {
- var maxWidth = 220,
- maxHeight = 220,
- tempWidth = width,
- tempHeight = height;
- if (width > maxWidth || height > maxHeight) {
- if (width > height) {
- tempWidth = maxWidth;
- tempHeight = height * (maxWidth / width);
- } else {
- tempWidth = width * (maxHeight / height);
- tempHeight = maxHeight;
- }
- }
- return {
- width: tempWidth + 'px',
- height: tempHeight + 'px'
- };
- }
- return {};
- };
- }
- },
- methods: {
- textMsg: function textMsg(text) {
- return (text + "").replace(/\n/, '<br/>');
- },
- textIsEmoji: function textIsEmoji(text) {
- return text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_") === "_";
- },
- formatCDate: function formatCDate(v) {
- var string = '';
- if ($A.runNum(v) > 0) {
- if ($A.formatDate('Ymd') === $A.formatDate('Ymd', v)) {
- string = $A.formatDate('H:i', v);
- } else if ($A.formatDate('Y') === $A.formatDate('Y', v)) {
- string = $A.formatDate('m-d', v);
- } else {
- string = $A.formatDate('Y-m-d', v);
- }
- }
- return string ? '(' + string + ')' : '';
- },
- clickError: function clickError(err) {
- this.$Modal.error({
- title: this.$L("错误详情"),
- content: err
- });
- },
- clickUser: function clickUser(e) {
- this.$emit('clickUser', this.info, e);
- },
- fileDownUrl: function fileDownUrl(id) {
- return $A.apiUrl('project/files/download?fileid=' + id);
- },
- formatSecond: function formatSecond(d) {
- if (d > 3600) {
- return Math.ceil(d / 3600) + '小时';
- } else if (d > 60) {
- return Math.ceil(d / 60) + '分钟';
- } else {
- return d + '秒';
- }
- }
- }
- });
- /***/ }),
- /* 120 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("div", { attrs: { "data-id": _vm.info.id } }, [
- _vm.info.type === "text" ||
- _vm.info.type === "taskB" ||
- _vm.info.type === "report" ||
- _vm.info.type === "video" ||
- _vm.info.type === "voice"
- ? _c("div", [
- _vm.info.self === true
- ? _c(
- "div",
- { staticClass: "list-right" },
- [
- _vm.info.error
- ? _c(
- "div",
- {
- staticClass: "item-error",
- on: {
- click: function($event) {
- return _vm.clickError(_vm.info.error)
- }
- }
- },
- [_c("Icon", { attrs: { type: "md-alert" } })],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item-right" },
- [
- _c(
- "div",
- {
- staticClass: "item-username",
- on: { click: _vm.clickUser }
- },
- [
- _c(
- "em",
- { staticClass: "item-name" },
- [
- _c("UserView", {
- attrs: {
- username: _vm.userName,
- info: _vm.info,
- placement: "left"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.info.indate
- ? _c("em", { staticClass: "item-date" }, [
- _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
- ])
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "item-text",
- class: {
- "text-emoji": _vm.textIsEmoji(_vm.info.text),
- "text-error": _vm.info.error
- }
- },
- [
- _c("div", { staticClass: "item-text-view" }, [
- _vm._v(_vm._s(_vm.textMsg(_vm.info.text)))
- ])
- ]
- ),
- _vm._v(" "),
- _vm.info.type === "taskB"
- ? [
- _vm.info.other.type === "task"
- ? _c(
- "div",
- {
- staticClass: "item-link",
- on: {
- click: function($event) {
- return _vm.taskDetail(_vm.info.other.id)
- }
- }
- },
- [
- _c("span", [
- _vm._v(
- _vm._s(_vm.$L("来自关注任务")) + ":"
- )
- ]),
- _c(
- "a",
- { attrs: { href: "javascript:void(0)" } },
- [_vm._v(_vm._s(_vm.info.other.title))]
- )
- ]
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.info.other.type === "file"
- ? _c("div", { staticClass: "item-link" }, [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("来自关注任务")) + ":")
- ]),
- _c(
- "a",
- {
- attrs: {
- target: "_blank",
- href: _vm.fileDownUrl(_vm.info.other.id)
- }
- },
- [_vm._v(_vm._s(_vm.info.other.name))]
- )
- ])
- : _vm._e()
- ]
- : _vm.info.type === "report"
- ? _c(
- "div",
- {
- staticClass: "item-link",
- on: {
- click: function($event) {
- return _vm.reportDetail(
- _vm.info.other.id,
- _vm.info.other.title
- )
- }
- }
- },
- [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("来自工作报告")) + ":")
- ]),
- _c(
- "a",
- { attrs: { href: "javascript:void(0)" } },
- [_vm._v(_vm._s(_vm.info.other.title))]
- )
- ]
- )
- : _vm.info.type === "video" || _vm.info.type === "voice"
- ? _c(
- "div",
- { staticClass: "item-link" },
- [
- _vm.info.type === "voice"
- ? _c("Icon", {
- attrs: { type: "ios-call-outline" }
- })
- : _c("Icon", {
- attrs: { type: "ios-videocam-outline" }
- }),
- _vm._v(" "),
- _c("span", [
- _vm._v(
- _vm._s(
- _vm.$L(
- "通话时长:%",
- _vm.formatSecond(_vm.info.other.second)
- )
- )
- )
- ])
- ],
- 1
- )
- : _vm._e()
- ],
- 2
- ),
- _vm._v(" "),
- _c("UserImg", {
- staticClass: "item-userimg",
- attrs: { info: _vm.info },
- on: { click: _vm.clickUser }
- })
- ],
- 1
- )
- : _vm.info.self === false
- ? _c(
- "div",
- { staticClass: "list-item" },
- [
- _c("UserImg", {
- staticClass: "item-userimg",
- attrs: { info: _vm.info },
- on: { click: _vm.clickUser }
- }),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item-left" },
- [
- _c(
- "div",
- {
- staticClass: "item-username",
- on: { click: _vm.clickUser }
- },
- [
- _c(
- "em",
- { staticClass: "item-name" },
- [
- _c("UserView", {
- attrs: {
- username: _vm.userName,
- info: _vm.info,
- placement: "right"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.info.__usertag
- ? _c("em", { staticClass: "item-tag" }, [
- _vm._v(_vm._s(_vm.info.__usertag))
- ])
- : _vm._e(),
- _vm._v(" "),
- _vm.info.indate
- ? _c("em", { staticClass: "item-date" }, [
- _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
- ])
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "item-text",
- class: {
- "text-emoji": _vm.textIsEmoji(_vm.info.text),
- "text-error": _vm.info.error
- }
- },
- [
- _c("div", { staticClass: "item-text-view" }, [
- _vm._v(_vm._s(_vm.textMsg(_vm.info.text)))
- ])
- ]
- ),
- _vm._v(" "),
- _vm.info.type === "taskB"
- ? [
- _vm.info.other.type === "task"
- ? _c(
- "div",
- {
- staticClass: "item-link",
- on: {
- click: function($event) {
- return _vm.taskDetail(_vm.info.other.id)
- }
- }
- },
- [
- _c("span", [
- _vm._v(
- _vm._s(_vm.$L("来自关注任务")) + ":"
- )
- ]),
- _c(
- "a",
- { attrs: { href: "javascript:void(0)" } },
- [_vm._v(_vm._s(_vm.info.other.title))]
- )
- ]
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.info.other.type === "file"
- ? _c("div", { staticClass: "item-link" }, [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("来自关注任务")) + ":")
- ]),
- _c(
- "a",
- {
- attrs: {
- target: "_blank",
- href: _vm.fileDownUrl(_vm.info.other.id)
- }
- },
- [_vm._v(_vm._s(_vm.info.other.name))]
- )
- ])
- : _vm._e()
- ]
- : _vm.info.type === "report"
- ? _c(
- "div",
- {
- staticClass: "item-link",
- on: {
- click: function($event) {
- return _vm.reportDetail(
- _vm.info.other.id,
- _vm.info.other.title
- )
- }
- }
- },
- [
- _c("span", [
- _vm._v(_vm._s(_vm.$L("来自工作报告")) + ":")
- ]),
- _c(
- "a",
- { attrs: { href: "javascript:void(0)" } },
- [_vm._v(_vm._s(_vm.info.other.title))]
- )
- ]
- )
- : _vm.info.type === "video" || _vm.info.type === "voice"
- ? _c(
- "div",
- { staticClass: "item-link" },
- [
- _vm.info.type === "voice"
- ? _c("Icon", {
- attrs: { type: "ios-call-outline" }
- })
- : _c("Icon", {
- attrs: { type: "ios-videocam-outline" }
- }),
- _vm._v(" "),
- _c("span", [
- _vm._v(
- _vm._s(
- _vm.$L(
- "通话时长:%",
- _vm.formatSecond(_vm.info.other.second)
- )
- )
- )
- ])
- ],
- 1
- )
- : _vm._e()
- ],
- 2
- )
- ],
- 1
- )
- : _vm._e()
- ])
- : _vm.info.type === "image" || _vm.info.type === "file"
- ? _c("div", [
- _vm.info.self === true
- ? _c(
- "div",
- { staticClass: "list-right" },
- [
- _vm.info.error
- ? _c(
- "div",
- {
- staticClass: "item-error",
- on: {
- click: function($event) {
- return _vm.clickError(_vm.info.error)
- }
- }
- },
- [_c("Icon", { attrs: { type: "md-alert" } })],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _c("div", { staticClass: "item-right" }, [
- _c(
- "div",
- {
- staticClass: "item-username",
- on: { click: _vm.clickUser }
- },
- [
- _c(
- "em",
- { staticClass: "item-name" },
- [
- _c("UserView", {
- attrs: {
- username: _vm.userName,
- info: _vm.info,
- placement: "left"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.info.indate
- ? _c("em", { staticClass: "item-date" }, [
- _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
- ])
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _vm.info.url === "loading"
- ? _c(
- "div",
- { staticClass: "item-loading" },
- [_c("WLoading")],
- 1
- )
- : _c(
- "a",
- {
- staticClass: "item-file",
- attrs: { href: _vm.info.url, target: "_blank" }
- },
- [
- _vm.info.type === "file"
- ? _c("div", { staticClass: "item-file-box" }, [
- _c("img", {
- staticClass: "item-file-thumb",
- attrs: { src: _vm.info.filethumb }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "item-file-info" }, [
- _c(
- "div",
- { staticClass: "item-file-name" },
- [_vm._v(_vm._s(_vm.info.filename))]
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item-file-size" },
- [
- _vm._v(
- _vm._s(
- _vm.$A.bytesToSize(
- _vm.$A.runNum(_vm.info.filesize) *
- 1024
- )
- )
- )
- ]
- )
- ])
- ])
- : _c("img", {
- staticClass: "item-file-img",
- style: _vm.imageStyle(_vm.info),
- attrs: { src: _vm.info.url }
- })
- ]
- )
- ]),
- _vm._v(" "),
- _c("UserImg", {
- staticClass: "item-userimg",
- attrs: { info: _vm.info },
- on: { click: _vm.clickUser }
- })
- ],
- 1
- )
- : _vm.info.self === false
- ? _c(
- "div",
- { staticClass: "list-item" },
- [
- _c("UserImg", {
- staticClass: "item-userimg",
- attrs: { info: _vm.info },
- on: { click: _vm.clickUser }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "item-left" }, [
- _c(
- "div",
- {
- staticClass: "item-username",
- on: { click: _vm.clickUser }
- },
- [
- _c(
- "em",
- { staticClass: "item-name" },
- [
- _c("UserView", {
- attrs: {
- username: _vm.userName,
- info: _vm.info,
- placement: "right"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.info.__usertag
- ? _c("em", { staticClass: "item-tag" }, [
- _vm._v(_vm._s(_vm.info.__usertag))
- ])
- : _vm._e(),
- _vm._v(" "),
- _vm.info.indate
- ? _c("em", { staticClass: "item-date" }, [
- _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
- ])
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _vm.info.url === "loading"
- ? _c(
- "div",
- { staticClass: "item-loading" },
- [_c("WLoading")],
- 1
- )
- : _c(
- "a",
- {
- staticClass: "item-file",
- attrs: { href: _vm.info.url, target: "_blank" }
- },
- [
- _vm.info.type === "file"
- ? _c("div", { staticClass: "item-file-box" }, [
- _c("img", {
- staticClass: "item-file-thumb",
- attrs: { src: _vm.info.filethumb }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "item-file-info" }, [
- _c(
- "div",
- { staticClass: "item-file-name" },
- [_vm._v(_vm._s(_vm.info.filename))]
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item-file-size" },
- [
- _vm._v(
- _vm._s(
- _vm.$A.bytesToSize(
- _vm.$A.runNum(_vm.info.filesize) *
- 1024
- )
- )
- )
- ]
- )
- ])
- ])
- : _c("img", {
- staticClass: "item-file-img",
- style: _vm.imageStyle(_vm.info),
- attrs: { src: _vm.info.url }
- })
- ]
- )
- ])
- ],
- 1
- )
- : _vm._e()
- ])
- : _vm.info.type === "notice"
- ? _c("div", [
- _c("div", { staticClass: "item-notice" }, [
- _vm._v(_vm._s(_vm.info.notice))
- ])
- ])
- : _vm._e()
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-9d161836", module.exports)
- }
- }
- /***/ }),
- /* 121 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(122)
- /* template */
- var __vue_template__ = __webpack_require__(123)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/chat/Upload.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-1ed0eada", Component.options)
- } else {
- hotAPI.reload("data-v-1ed0eada", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 122 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ChatLoad',
- props: {
- target: {
- default: ''
- },
- maxSize: {
- type: Number,
- default: 204800
- }
- },
- data: function data() {
- return {
- uploadFormat: ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'],
- actionUrl: $A.apiUrl('chat/files/upload'),
- params: {
- username: this.target,
- token: $A.getToken()
- }
- };
- },
- watch: {
- target: function target(val) {
- this.$set(this.params, 'username', val);
- }
- },
- methods: {
- handleProgress: function handleProgress(event, file) {
- //上传时
- if (typeof file.tempId === "undefined") {
- file.tempId = $A.randomString(8);
- this.$emit('on-progress', file);
- }
- },
- handleSuccess: function handleSuccess(res, file) {
- //上传完成
- if (res.ret === 1) {
- for (var key in res.data) {
- if (res.data.hasOwnProperty(key)) {
- file[key] = res.data[key];
- }
- }
- this.$emit('on-success', file);
- } else {
- this.$Modal.warning({
- title: this.$L('上传失败'),
- content: this.$L('文件 % 上传失败,%', file.name, res.msg)
- });
- this.$emit('on-error', file);
- this.$refs.upload.fileList.pop();
- }
- },
- handleFormatError: function handleFormatError(file) {
- //上传类型错误
- this.$Modal.warning({
- title: this.$L('文件格式不正确'),
- content: this.$L('文件 % 格式不正确,仅支持上传:%', file.name, this.uploadFormat.join(','))
- });
- },
- handleMaxSize: function handleMaxSize(file) {
- //上传大小错误
- this.$Modal.warning({
- title: this.$L('超出文件大小限制'),
- content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
- });
- },
- handleBeforeUpload: function handleBeforeUpload() {
- //上传前判断
- this.params = {
- username: this.target,
- token: $A.getToken()
- };
- return true;
- },
- handleClick: function handleClick() {
- //手动上传
- if (this.handleBeforeUpload()) {
- this.$refs.upload.handleClick();
- }
- },
- upload: function upload(file) {
- //手动传file
- if (this.handleBeforeUpload()) {
- this.$refs.upload.upload(file);
- }
- }
- }
- });
- /***/ }),
- /* 123 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("Upload", {
- ref: "upload",
- attrs: {
- name: "files",
- action: _vm.actionUrl,
- data: _vm.params,
- multiple: "",
- format: _vm.uploadFormat,
- "show-upload-list": false,
- "max-size": _vm.maxSize,
- "on-progress": _vm.handleProgress,
- "on-success": _vm.handleSuccess,
- "on-format-error": _vm.handleFormatError,
- "on-exceeded-size": _vm.handleMaxSize,
- "before-upload": _vm.handleBeforeUpload
- }
- })
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-1ed0eada", module.exports)
- }
- }
- /***/ }),
- /* 124 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("div", { staticClass: "chat-index" }, [
- _c("ul", { staticClass: "chat-menu" }, [
- _c(
- "li",
- { staticClass: "self" },
- [
- _c("UserImg", { staticClass: "avatar", attrs: { info: _vm.usrInfo } })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "li",
- {
- class: { active: _vm.chatTap == "dialog" },
- on: {
- click: function($event) {
- ;[(_vm.chatTap = "dialog"), (_vm.chatTam = "dialog")]
- }
- }
- },
- [
- _c("Icon", { attrs: { type: "md-text" } }),
- _vm._v(" "),
- _vm.unreadTotal > 0
- ? _c("em", { staticClass: "chat-num" }, [
- _vm._v(_vm._s(_vm.unreadTotal > 99 ? "99+" : _vm.unreadTotal))
- ])
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "li",
- {
- class: { active: _vm.chatTap == "team" },
- on: {
- click: function($event) {
- ;[(_vm.chatTap = "team"), (_vm.chatTam = "team")]
- }
- }
- },
- [_c("Icon", { attrs: { type: "md-person" } })],
- 1
- )
- ]),
- _vm._v(" "),
- _c(
- "ul",
- {
- staticClass: "chat-user",
- class: {
- "chat-flex": _vm.chatTap == "dialog",
- "chat-tam": _vm.chatTam == "dialog"
- }
- },
- [
- _c(
- "li",
- { staticClass: "sreach" },
- [
- _c("Input", {
- attrs: { placeholder: _vm.$L("搜索"), prefix: "ios-search" },
- model: {
- value: _vm.dialogSearch,
- callback: function($$v) {
- _vm.dialogSearch = $$v
- },
- expression: "dialogSearch"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("li", { ref: "dialogLists", staticClass: "lists" }, [
- _c(
- "ul",
- [
- _vm._l(_vm.dialogListsS, function(dialog, index) {
- return _c(
- "li",
- {
- key: index,
- class: {
- active: dialog.username == _vm.dialogTarget.username
- },
- attrs: { "data-id": dialog.id },
- on: {
- click: function($event) {
- return _vm.openDialog(dialog)
- }
- }
- },
- [
- _c("UserImg", {
- staticClass: "avatar",
- attrs: { info: dialog }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "user-msg-box" }, [
- _c("div", { staticClass: "user-msg-title" }, [
- _c(
- "span",
- [
- _c("UserView", {
- attrs: {
- username: dialog.username,
- placement: "right"
- },
- on: {
- "on-result": function($event) {
- return _vm.userViewResult(dialog, $event)
- }
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("em", [
- _vm._v(_vm._s(_vm.formatCDate(dialog.lastdate)))
- ])
- ]),
- _vm._v(" "),
- _c("div", { staticClass: "user-msg-text" }, [
- _vm._v(_vm._s(dialog.lasttext))
- ])
- ]),
- _vm._v(" "),
- dialog.unread > 0
- ? _c("em", { staticClass: "user-msg-num" }, [
- _vm._v(_vm._s(dialog.unread))
- ])
- : _vm._e()
- ],
- 1
- )
- }),
- _vm._v(" "),
- _vm.dialogNoDataText == _vm.$L("数据加载中.....")
- ? _c("li", { staticClass: "chat-none" }, [_c("w-loading")], 1)
- : _vm.dialogLists.length == 0
- ? _c("li", { staticClass: "chat-none" }, [
- _vm._v(_vm._s(_vm.dialogNoDataText))
- ])
- : _vm._e()
- ],
- 2
- )
- ])
- ]
- ),
- _vm._v(" "),
- _c(
- "ul",
- {
- staticClass: "chat-team",
- class: {
- "chat-flex": _vm.chatTap == "team",
- "chat-tam": _vm.chatTam == "team"
- }
- },
- [
- _c(
- "li",
- { staticClass: "sreach" },
- [
- _c("Input", {
- attrs: { placeholder: _vm.$L("搜索"), prefix: "ios-search" },
- model: {
- value: _vm.teamSearch,
- callback: function($$v) {
- _vm.teamSearch = $$v
- },
- expression: "teamSearch"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("li", { staticClass: "lists" }, [
- _c(
- "ul",
- [
- _vm._l(_vm.teamLists, function(lists, key) {
- return _vm.teamListsS(lists).length > 0
- ? _c("li", { key: key }, [
- _c("div", { staticClass: "team-label" }, [
- _vm._v(_vm._s(key))
- ]),
- _vm._v(" "),
- _c(
- "ul",
- _vm._l(_vm.teamListsS(lists), function(item, index) {
- return _c(
- "li",
- {
- key: index,
- on: {
- click: function($event) {
- return _vm.openDialog(item, true)
- }
- }
- },
- [
- _c("UserImg", {
- staticClass: "avatar",
- attrs: { info: item }
- }),
- _vm._v(" "),
- _c("div", { staticClass: "team-username" }, [
- _vm._v(_vm._s(item.nickname || item.username))
- ])
- ],
- 1
- )
- }),
- 0
- )
- ])
- : _vm._e()
- }),
- _vm._v(" "),
- _vm.teamNoDataText == _vm.$L("数据加载中.....")
- ? _c("li", { staticClass: "chat-none" }, [_c("w-loading")], 1)
- : Object.keys(_vm.teamLists).length == 0
- ? _c("li", { staticClass: "chat-none" }, [
- _vm._v(_vm._s(_vm.teamNoDataText))
- ])
- : _vm._e(),
- _vm._v(" "),
- _vm.teamHasMorePages
- ? _c(
- "li",
- {
- staticClass: "chat-more",
- on: {
- click: function($event) {
- return _vm.getTeamLists(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("加载更多...")))]
- )
- : _vm._e()
- ],
- 2
- )
- ])
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "chat-message",
- style: {
- display:
- _vm.chatTap == "dialog" && _vm.dialogTarget.username
- ? "block"
- : "none"
- },
- on: {
- drop: function($event) {
- $event.preventDefault()
- return _vm.messagePasteDrag($event, "drag")
- },
- dragover: function($event) {
- $event.preventDefault()
- return _vm.messageDragOver(true)
- },
- dragleave: function($event) {
- $event.preventDefault()
- return _vm.messageDragOver(false)
- }
- }
- },
- [
- _c(
- "div",
- { staticClass: "manage-title" },
- [
- _c("UserView", { attrs: { username: _vm.dialogTarget.username } }),
- _vm._v(" "),
- _c(
- "Dropdown",
- {
- staticClass: "manage-title-right",
- attrs: {
- placement: "bottom-end",
- trigger: "click",
- transfer: ""
- },
- on: { "on-click": _vm.dialogDropdown }
- },
- [
- _c("Icon", { attrs: { type: "ios-more" } }),
- _vm._v(" "),
- _c(
- "DropdownMenu",
- { attrs: { slot: "list" }, slot: "list" },
- [
- _c("DropdownItem", { attrs: { name: "delete" } }, [
- _vm._v(_vm._s(_vm.$L("删除对话")))
- ]),
- _vm._v(" "),
- _c("DropdownItem", { attrs: { name: "clear" } }, [
- _vm._v(_vm._s(_vm.$L("清除聊天记录")))
- ])
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "ScrollerY",
- {
- ref: "manageLists",
- staticClass: "manage-lists",
- on: { "on-scroll": _vm.messageListsScroll }
- },
- [
- _c(
- "div",
- { ref: "manageBody", staticClass: "manage-body" },
- [
- _vm.messageHasMorePages
- ? _c(
- "div",
- {
- staticClass: "manage-more",
- on: {
- click: function($event) {
- return _vm.getDialogMessage(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("加载更多...")))]
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.messageNoDataText == _vm.$L("数据加载中.....")
- ? _c(
- "div",
- { staticClass: "manage-more" },
- [_c("w-loading")],
- 1
- )
- : _vm.messageNoDataText
- ? _c("div", { staticClass: "manage-more" }, [
- _vm._v(_vm._s(_vm.messageNoDataText))
- ])
- : _vm._e(),
- _vm._v(" "),
- _vm._l(_vm.messageLists, function(info, index) {
- return _c("chat-message", {
- key: index,
- attrs: { info: info }
- })
- })
- ],
- 2
- ),
- _vm._v(" "),
- _vm.messageNew > 0
- ? _c(
- "div",
- {
- staticClass: "manage-lists-message-new",
- on: {
- click: function($event) {
- return _vm.messageBottomGo(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("有%条新消息", _vm.messageNew)))]
- )
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "manage-send",
- on: {
- click: function($event) {
- return _vm.clickDialog(_vm.dialogTarget.username)
- }
- }
- },
- [
- _c("textarea", {
- directives: [
- {
- name: "model",
- rawName: "v-model",
- value: _vm.messageText,
- expression: "messageText"
- }
- ],
- ref: "textarea",
- staticClass: "manage-input",
- attrs: {
- maxlength: "20000",
- placeholder: _vm.$L("请输入要发送的消息")
- },
- domProps: { value: _vm.messageText },
- on: {
- keydown: function($event) {
- return _vm.messageSend($event)
- },
- paste: _vm.messagePasteDrag,
- input: function($event) {
- if ($event.target.composing) {
- return
- }
- _vm.messageText = $event.target.value
- }
- }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "manage-quick" },
- [
- _c("emoji-picker", {
- attrs: { search: _vm.messageEmojiSearch },
- on: { emoji: _vm.messageInsertText },
- scopedSlots: _vm._u([
- {
- key: "emoji-invoker",
- fn: function(ref) {
- var clickEvent = ref.events.click
- return _c(
- "div",
- {
- on: {
- click: function($event) {
- $event.stopPropagation()
- return function(event) {
- clickEvent(event)
- }.apply(null, arguments)
- }
- }
- },
- [
- _c(
- "Tooltip",
- {
- attrs: { content: _vm.$L("表情"), placement: "top" }
- },
- [
- _c("Icon", {
- staticClass: "quick-item",
- attrs: { type: "ios-happy-outline" }
- })
- ],
- 1
- )
- ],
- 1
- )
- }
- },
- {
- key: "emoji-picker",
- fn: function(ref) {
- var emojis = ref.emojis
- var insert = ref.insert
- var display = ref.display
- return _c("div", {}, [
- _c(
- "div",
- { staticClass: "emoji-box" },
- [
- _c("Input", {
- staticClass: "emoji-input",
- attrs: {
- placeholder: _vm.$L("搜索"),
- prefix: "ios-search"
- },
- model: {
- value: _vm.messageEmojiSearch,
- callback: function($$v) {
- _vm.messageEmojiSearch = $$v
- },
- expression: "messageEmojiSearch"
- }
- }),
- _vm._v(" "),
- _c(
- "div",
- _vm._l(emojis, function(emojiGroup, category) {
- return _c("div", { key: category }, [
- _c("h5", [_vm._v(_vm._s(category))]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "emojis" },
- _vm._l(emojiGroup, function(
- emoji,
- emojiName
- ) {
- return _c(
- "span",
- {
- key: emojiName,
- attrs: { title: emojiName },
- on: {
- click: function($event) {
- return insert(emoji)
- }
- }
- },
- [_vm._v(_vm._s(emoji))]
- )
- }),
- 0
- )
- ])
- }),
- 0
- )
- ],
- 1
- )
- ])
- }
- }
- ])
- }),
- _vm._v(" "),
- _c(
- "Tooltip",
- { attrs: { content: _vm.$L("文件/图片"), placement: "top" } },
- [
- _c("Icon", {
- staticClass: "quick-item",
- attrs: { type: "ios-photos-outline" },
- on: {
- click: function($event) {
- return _vm.$refs.messageUpload.handleClick()
- }
- }
- }),
- _vm._v(" "),
- _c("ChatLoad", {
- ref: "messageUpload",
- staticClass: "message-upload",
- attrs: { target: _vm.dialogTarget.username },
- on: {
- "on-progress": function($event) {
- return _vm.messageFile("progress", $event)
- },
- "on-success": function($event) {
- return _vm.messageFile("success", $event)
- },
- "on-error": function($event) {
- return _vm.messageFile("error", $event)
- }
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.systemConfig.callav == "open"
- ? [
- _c(
- "Tooltip",
- {
- attrs: { content: _vm.$L("语音聊天"), placement: "top" }
- },
- [
- _c("Icon", {
- staticClass: "quick-item voicecam",
- attrs: { type: "ios-call-outline" },
- on: {
- click: function($event) {
- return _vm.videoConnect(null, false)
- }
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Tooltip",
- {
- attrs: { content: _vm.$L("视频聊天"), placement: "top" }
- },
- [
- _c("Icon", {
- staticClass: "quick-item videocam",
- attrs: { type: "ios-videocam-outline" },
- on: {
- click: function($event) {
- return _vm.videoConnect(null, true)
- }
- }
- })
- ],
- 1
- )
- ]
- : _vm._e()
- ],
- 2
- ),
- _vm._v(" "),
- _vm.dialogDragOver
- ? _c("div", { staticClass: "manage-drag-over" }, [
- _c("div", { staticClass: "manage-drag-text" }, [
- _vm._v(
- _vm._s(
- _vm.$L(
- "拖动到这里发送给 %",
- _vm.dialogTarget.nickname || _vm.dialogTarget.username
- )
- )
- )
- ])
- ])
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "chat-video",
- style: {
- display: _vm.videoUserName ? "block" : "none",
- backgroundImage: "url(" + _vm.videoUserImg + ")"
- }
- },
- [
- _vm.videoChat
- ? _c("div", { staticClass: "video-opacity" }, [
- _vm._v(_vm._s(_vm.$L("正在视频通话...")))
- ])
- : _c("div", { staticClass: "video-opacity" }, [
- _vm._v(_vm._s(_vm.$L("正在语音通话...")))
- ]),
- _vm._v(" "),
- _c("video", {
- ref: "remoteVideo",
- staticClass: "video-active",
- attrs: { autoplay: "" }
- }),
- _vm._v(" "),
- _c("video", {
- ref: "localVideo",
- staticClass: "video-mini",
- attrs: { autoplay: "", muted: "true" },
- domProps: { muted: true }
- }),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "video-close" },
- [
- _c("Icon", {
- attrs: { type: "ios-close-circle-outline" },
- on: {
- click: function($event) {
- return _vm.videoClose(_vm.videoUserName)
- }
- }
- })
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _c(
- "audio",
- {
- ref: "messageAudio",
- staticClass: "chat-audio",
- attrs: { preload: "none" }
- },
- [
- _c("source", {
- attrs: { src: _vm.messageAudio + "message.mp3", type: "audio/mpeg" }
- }),
- _vm._v(" "),
- _c("source", {
- attrs: { src: _vm.messageAudio + "message.wav", type: "audio/wav" }
- })
- ]
- ),
- _vm._v(" "),
- _c(
- "audio",
- {
- ref: "callAudio",
- staticClass: "chat-audio",
- attrs: { preload: "none" }
- },
- [
- _c("source", {
- attrs: { src: _vm.messageAudio + "call.mp3", type: "audio/mpeg" }
- }),
- _vm._v(" "),
- _c("source", {
- attrs: { src: _vm.messageAudio + "call.wav", type: "audio/wav" }
- })
- ]
- )
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-3f6b8ea0", module.exports)
- }
- }
- /***/ }),
- /* 125 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_view_design_src_components_icon__ = __webpack_require__(126);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__ = __webpack_require__(22);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_view_design_src_directives_transfer_dom__ = __webpack_require__(130);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_emitter__ = __webpack_require__(36);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design_src_components_modal_mixins_scrollbar__ = __webpack_require__(131);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__ = __webpack_require__(132);
- 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; }
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- var prefixCls = 'ivu-drawer';
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'WDrawer',
- mixins: [__WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_emitter__["a" /* default */], __WEBPACK_IMPORTED_MODULE_4_view_design_src_components_modal_mixins_scrollbar__["a" /* default */]],
- components: { Icon: __WEBPACK_IMPORTED_MODULE_0_view_design_src_components_icon__["a" /* default */] },
- directives: { TransferDom: __WEBPACK_IMPORTED_MODULE_2_view_design_src_directives_transfer_dom__["a" /* default */] },
- props: {
- value: {
- type: Boolean,
- default: false
- },
- title: {
- type: String
- },
- width: {
- type: [Number, String],
- default: '100%'
- },
- minWidth: {
- type: [Number, String],
- default: 0
- },
- maxWidth: {
- type: [Number, String],
- default: 0
- },
- closable: {
- type: Boolean,
- default: true
- },
- maskClosable: {
- type: Boolean,
- default: true
- },
- mask: {
- type: Boolean,
- default: true
- },
- maskStyle: {
- type: Object
- },
- styles: {
- type: Object
- },
- scrollable: {
- type: Boolean,
- default: false
- },
- placement: {
- validator: function validator(value) {
- return Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["e" /* oneOf */])(value, ['left', 'right']);
- },
- default: 'right'
- },
- zIndex: {
- type: Number,
- default: 1000
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
- }
- },
- className: {
- type: String
- },
- inner: {
- type: Boolean,
- default: false
- },
- // Whether drag and drop is allowed to adjust width
- draggable: {
- type: Boolean,
- default: false
- },
- beforeClose: Function
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- visible: this.value,
- wrapShow: false,
- showHead: true,
- canMove: false,
- dragWidth: this.width,
- wrapperWidth: this.width,
- wrapperLeft: 0,
- minHandleWidth: 256
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrap', (_ref = {}, _defineProperty(_ref, prefixCls + '-hidden', !this.wrapShow), _defineProperty(_ref, '' + this.className, !!this.className), _defineProperty(_ref, prefixCls + '-no-mask', !this.mask), _defineProperty(_ref, prefixCls + '-wrap-inner', this.inner), _defineProperty(_ref, prefixCls + '-wrap-dragging', this.canMove), _ref)];
- },
- mainStyles: function mainStyles() {
- var style = {};
- var minWidth = parseInt(this.minWidth);
- if (minWidth > 0) {
- style.minWidth = minWidth <= 100 ? minWidth + '%' : minWidth + 'px';
- }
- var maxWidth = parseInt(this.maxWidth);
- if (maxWidth > 0) {
- style.maxWidth = maxWidth <= 100 ? maxWidth + '%' : maxWidth + 'px';
- }
- var width = parseInt(this.dragWidth);
- var styleWidth = {
- width: width <= 100 ? width + '%' : width + 'px'
- };
- Object.assign(style, styleWidth);
- return style;
- },
- contentClasses: function contentClasses() {
- return [prefixCls + '-content', _defineProperty({}, prefixCls + '-content-no-mask', !this.mask)];
- },
- classes: function classes() {
- var _ref3;
- return ['' + prefixCls, prefixCls + '-' + this.placement, (_ref3 = {}, _defineProperty(_ref3, prefixCls + '-no-header', !this.showHead), _defineProperty(_ref3, prefixCls + '-inner', this.inner), _ref3)];
- },
- maskClasses: function maskClasses() {
- return [prefixCls + '-mask', _defineProperty({}, prefixCls + '-mask-inner', this.inner)];
- }
- },
- methods: {
- close: function close() {
- var _this = this;
- if (!this.beforeClose) {
- return this.handleClose();
- }
- var before = this.beforeClose();
- if (before && before.then) {
- before.then(function () {
- _this.handleClose();
- });
- } else {
- this.handleClose();
- }
- },
- handleClose: function handleClose() {
- this.visible = false;
- this.$emit('input', false);
- this.$emit('on-close');
- },
- handleMask: function handleMask() {
- if (this.maskClosable && this.mask) {
- this.close();
- }
- },
- handleWrapClick: function handleWrapClick(event) {
- // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className
- var className = event.target.getAttribute('class');
- if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
- },
- handleMousemove: function handleMousemove(event) {
- if (!this.canMove || !this.draggable) return;
- // 更新容器宽度和距离左侧页面距离,如果是window则距左侧距离为0
- this.handleSetWrapperWidth();
- var left = event.pageX - this.wrapperLeft;
- // 如果抽屉方向为右边,宽度计算需用容器宽度减去left
- var width = this.placement === 'right' ? this.wrapperWidth - left : left;
- // 限定最小宽度
- width = Math.max(width, parseFloat(this.minHandleWidth));
- event.atMin = width === parseFloat(this.minHandleWidth);
- // 如果当前width不大于100,视为百分比
- if (width <= 100) width = width / this.wrapperWidth * 100;
- this.dragWidth = width;
- this.$emit('on-resize-width', parseInt(this.dragWidth));
- },
- handleSetWrapperWidth: function handleSetWrapperWidth() {
- var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
- width = _$el$getBoundingClien.width,
- left = _$el$getBoundingClien.left;
- this.wrapperWidth = width;
- this.wrapperLeft = left;
- },
- handleMouseup: function handleMouseup() {
- if (!this.draggable) return;
- this.canMove = false;
- },
- handleTriggerMousedown: function handleTriggerMousedown() {
- this.canMove = true;
- // 防止鼠标选中抽屉中文字,造成拖动trigger触发浏览器原生拖动行为
- window.getSelection().removeAllRanges();
- }
- },
- mounted: function mounted() {
- if (this.visible) {
- this.wrapShow = true;
- }
- var showHead = true;
- if (this.$slots.header === undefined && !this.title) {
- showHead = false;
- }
- this.showHead = showHead;
- Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["b" /* on */])(document, 'mousemove', this.handleMousemove);
- Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["b" /* on */])(document, 'mouseup', this.handleMouseup);
- this.handleSetWrapperWidth();
- },
- beforeDestroy: function beforeDestroy() {
- Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["a" /* off */])(document, 'mousemove', this.handleMousemove);
- Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["a" /* off */])(document, 'mouseup', this.handleMouseup);
- this.removeScrollEffect();
- },
- watch: {
- value: function value(val) {
- this.visible = val;
- },
- visible: function visible(val) {
- var _this2 = this;
- if (val === false) {
- this.timer = setTimeout(function () {
- _this2.wrapShow = false;
- // #4831 Check if there are any drawers left at the parent level
- var brotherDrawers = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["a" /* findBrothersComponents */])(_this2, 'Drawer') || [];
- var parentDrawers = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["c" /* findComponentsUpward */])(_this2, 'Drawer') || [];
- var otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
- var isScrollDrawer = otherDrawers.some(function (item) {
- return item.visible && !item.scrollable;
- });
- if (!isScrollDrawer) {
- _this2.removeScrollEffect();
- }
- }, 300);
- } else {
- if (this.timer) clearTimeout(this.timer);
- this.wrapShow = true;
- if (!this.scrollable) {
- this.addScrollEffect();
- }
- }
- this.broadcast('Table', 'on-visible-change', val);
- this.broadcast('Slider', 'on-visible-change', val); // #2852
- this.$emit('on-visible-change', val);
- },
- scrollable: function scrollable(val) {
- if (!val) {
- this.addScrollEffect();
- } else {
- this.removeScrollEffect();
- }
- },
- title: function title(val) {
- if (this.$slots.header === undefined) {
- this.showHead = !!val;
- }
- },
- width: function width(val) {
- this.dragWidth = val;
- }
- }
- });
- /***/ }),
- /* 126 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_vue__ = __webpack_require__(127);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__icon_vue__);
- /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__icon_vue___default.a);
- /***/ }),
- /* 127 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(128)
- /* template */
- var __vue_template__ = __webpack_require__(129)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "node_modules/view-design/src/components/icon/icon.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-1c71251e", Component.options)
- } else {
- hotAPI.reload("data-v-1c71251e", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 128 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- 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; }
- //
- //
- //
- var prefixCls = 'ivu-icon';
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'Icon',
- props: {
- type: {
- type: String,
- default: ''
- },
- size: [Number, String],
- color: String,
- custom: {
- type: String,
- default: ''
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, _defineProperty(_ref, prefixCls + '-' + this.type, this.type !== ''), _defineProperty(_ref, '' + this.custom, this.custom !== ''), _ref)];
- },
- styles: function styles() {
- var style = {};
- if (this.size) {
- style['font-size'] = this.size + 'px';
- }
- if (this.color) {
- style.color = this.color;
- }
- return style;
- }
- },
- methods: {
- handleClick: function handleClick(event) {
- this.$emit('click', event);
- }
- }
- });
- /***/ }),
- /* 129 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("i", {
- class: _vm.classes,
- style: _vm.styles,
- on: { click: _vm.handleClick }
- })
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-1c71251e", module.exports)
- }
- }
- /***/ }),
- /* 130 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // Thanks to: https://github.com/airyland/vux/blob/v2/src/directives/transfer-dom/index.js
- // Thanks to: https://github.com/calebroseland/vue-dom-portal
- /**
- * Get target DOM Node
- * @param {(Node|string|Boolean)} [node=document.body] DOM Node, CSS selector, or Boolean
- * @return {Node} The target that the el will be appended to
- */
- function getTarget (node) {
- if (node === void 0) {
- node = document.body
- }
- if (node === true) { return document.body }
- return node instanceof window.Node ? node : document.querySelector(node)
- }
- const directive = {
- inserted (el, { value }, vnode) {
- if ( el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
- const parentNode = el.parentNode;
- if (!parentNode) return;
- const home = document.createComment('');
- let hasMovedOut = false;
- if (value !== false) {
- parentNode.replaceChild(home, el); // moving out, el is no longer in the document
- getTarget(value).appendChild(el); // moving into new place
- hasMovedOut = true
- }
- if (!el.__transferDomData) {
- el.__transferDomData = {
- parentNode: parentNode,
- home: home,
- target: getTarget(value),
- hasMovedOut: hasMovedOut
- }
- }
- },
- componentUpdated (el, { value }) {
- if ( el.dataset && el.dataset.transfer !== 'true') return false;
- // need to make sure children are done updating (vs. `update`)
- const ref$1 = el.__transferDomData;
- if (!ref$1) return;
- // homes.get(el)
- const parentNode = ref$1.parentNode;
- const home = ref$1.home;
- const hasMovedOut = ref$1.hasMovedOut; // recall where home is
- if (!hasMovedOut && value) {
- // remove from document and leave placeholder
- parentNode.replaceChild(home, el);
- // append to target
- getTarget(value).appendChild(el);
- el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
- } else if (hasMovedOut && value === false) {
- // previously moved, coming back home
- parentNode.replaceChild(el, home);
- el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
- } else if (value) {
- // already moved, going somewhere else
- getTarget(value).appendChild(el);
- }
- },
- unbind (el) {
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className.replace('v-transfer-dom', '');
- const ref$1 = el.__transferDomData;
- if (!ref$1) return;
- if (el.__transferDomData.hasMovedOut === true) {
- el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el)
- }
- el.__transferDomData = null
- }
- };
- /* harmony default export */ __webpack_exports__["a"] = (directive);
- /***/ }),
- /* 131 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_assist__ = __webpack_require__(22);
- // used for Modal & $Spin & Drawer
- /* harmony default export */ __webpack_exports__["a"] = ({
- props: {
- lockScroll: {
- type: Boolean,
- default: true
- }
- },
- methods: {
- checkScrollBar () {
- let fullWindowWidth = window.innerWidth;
- if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
- const documentElementRect = document.documentElement.getBoundingClientRect();
- fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
- }
- this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
- if (this.bodyIsOverflowing) {
- this.scrollBarWidth = Object(__WEBPACK_IMPORTED_MODULE_0__utils_assist__["d" /* getScrollBarSize */])();
- }
- },
- checkMaskInVisible () {
- let masks = document.getElementsByClassName('ivu-modal-mask') || [];
- return Array.from(masks).every(m => m.style.display === 'none' || m.classList.contains('fade-leave-to'));
- },
- setScrollBar () {
- if (this.bodyIsOverflowing && this.scrollBarWidth !== undefined) {
- document.body.style.paddingRight = `${this.scrollBarWidth}px`;
- }
- },
- resetScrollBar () {
- document.body.style.paddingRight = '';
- },
- addScrollEffect () {
- if (!this.lockScroll) return;
- this.checkScrollBar();
- this.setScrollBar();
- document.body.style.overflow = 'hidden';
- },
- removeScrollEffect() {
- if (!this.lockScroll) return;
- if (this.checkMaskInVisible()) {
- document.body.style.overflow = '';
- this.resetScrollBar();
- }
- }
- }
- });
- /***/ }),
- /* 132 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- const isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
- /* istanbul ignore next */
- const on = (function() {
- if (!isServer && document.addEventListener) {
- return function(element, event, handler, useCapture = false) {
- if (element && event && handler) {
- element.addEventListener(event, handler, useCapture);
- }
- };
- } else {
- return function(element, event, handler) {
- if (element && event && handler) {
- element.attachEvent('on' + event, handler);
- }
- };
- }
- })();
- /* harmony export (immutable) */ __webpack_exports__["b"] = on;
- /* istanbul ignore next */
- const off = (function() {
- if (!isServer && document.removeEventListener) {
- return function(element, event, handler, useCapture = false) {
- if (element && event) {
- element.removeEventListener(event, handler, useCapture);
- }
- };
- } else {
- return function(element, event, handler) {
- if (element && event) {
- element.detachEvent('on' + event, handler);
- }
- };
- }
- })();
- /* harmony export (immutable) */ __webpack_exports__["a"] = off;
- /***/ }),
- /* 133 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- {
- directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }],
- attrs: { "data-transfer": _vm.transfer }
- },
- [
- _c("transition", { attrs: { name: "fade" } }, [
- _vm.mask
- ? _c("div", {
- directives: [
- {
- name: "show",
- rawName: "v-show",
- value: _vm.visible,
- expression: "visible"
- }
- ],
- class: _vm.maskClasses,
- style: _vm.maskStyle,
- on: { click: _vm.handleMask }
- })
- : _vm._e()
- ]),
- _vm._v(" "),
- _c(
- "div",
- { class: _vm.wrapClasses, on: { click: _vm.handleWrapClick } },
- [
- _c("transition", { attrs: { name: "move-" + _vm.placement } }, [
- _c(
- "div",
- {
- directives: [
- {
- name: "show",
- rawName: "v-show",
- value: _vm.visible,
- expression: "visible"
- }
- ],
- class: _vm.classes,
- style: _vm.mainStyles
- },
- [
- _c("div", { ref: "content", class: _vm.contentClasses }, [
- _vm.closable
- ? _c(
- "a",
- {
- staticClass: "ivu-drawer-close",
- on: { click: _vm.close }
- },
- [
- _vm._t("close", function() {
- return [
- _c("Icon", { attrs: { type: "ios-close" } })
- ]
- })
- ],
- 2
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.showHead
- ? _c(
- "div",
- { class: [_vm.prefixCls + "-header"] },
- [
- _vm._t("header", function() {
- return [
- _c(
- "div",
- { class: [_vm.prefixCls + "-header-inner"] },
- [_vm._v(_vm._s(_vm.title))]
- )
- ]
- })
- ],
- 2
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "div",
- { class: [_vm.prefixCls + "-body"], style: _vm.styles },
- [_vm._t("default")],
- 2
- )
- ]),
- _vm._v(" "),
- _vm.draggable
- ? _c(
- "div",
- {
- staticClass: "ivu-drawer-drag",
- class: {
- "ivu-drawer-drag-left": _vm.placement === "left"
- },
- on: { mousedown: _vm.handleTriggerMousedown }
- },
- [
- _vm._t("trigger", function() {
- return [
- _c(
- "div",
- { staticClass: "ivu-drawer-drag-move-trigger" },
- [
- _c(
- "div",
- {
- staticClass:
- "ivu-drawer-drag-move-trigger-point"
- },
- [_c("i"), _c("i"), _c("i"), _c("i"), _c("i")]
- )
- ]
- )
- ]
- })
- ],
- 2
- )
- : _vm._e()
- ]
- )
- ])
- ],
- 1
- )
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-37c31742", module.exports)
- }
- }
- /***/ }),
- /* 134 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { staticClass: "w-header" },
- [
- _vm.tabActive
- ? _c("div", { staticClass: "w-header-row" }, [
- _c(
- "div",
- { staticClass: "w-header-row-left" },
- [
- _c(
- "Dropdown",
- {
- staticClass: "m768-show",
- attrs: { trigger: "click", transfer: "" },
- on: { "on-click": _vm.tabPage }
- },
- [
- _c("Icon", {
- staticClass: "dropdown-menu",
- attrs: { type: "md-menu" }
- }),
- _vm._v(" "),
- _c(
- "DropdownMenu",
- { attrs: { slot: "list" }, slot: "list" },
- [
- _c("DropdownItem", { attrs: { name: "todo" } }, [
- _vm._v(_vm._s(_vm.$L("待办")))
- ]),
- _vm._v(" "),
- _c("DropdownItem", { attrs: { name: "project" } }, [
- _vm._v(_vm._s(_vm.$L("项目")))
- ]),
- _vm._v(" "),
- _c("DropdownItem", { attrs: { name: "docs" } }, [
- _vm._v(_vm._s(_vm.$L("知识库")))
- ]),
- _vm._v(" "),
- _c("DropdownItem", { attrs: { name: "team" } }, [
- _vm._v(_vm._s(_vm.$L("团队")))
- ])
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c("ul", { staticClass: "m768-hide" }, [
- _c(
- "li",
- { class: _vm.tabActive === "todo" ? "active" : "" },
- [
- _c(
- "a",
- {
- attrs: { href: "javascript:void(0)" },
- on: {
- click: function($event) {
- return _vm.tabPage("todo")
- }
- }
- },
- [
- _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
- _vm._v(_vm._s(_vm.$L("待办")))
- ]
- )
- ]
- ),
- _c(
- "li",
- { class: _vm.tabActive === "project" ? "active" : "" },
- [
- _c(
- "a",
- {
- attrs: { href: "javascript:void(0)" },
- on: {
- click: function($event) {
- return _vm.tabPage("project")
- }
- }
- },
- [
- _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
- _vm._v(_vm._s(_vm.$L("项目")))
- ]
- )
- ]
- ),
- _c(
- "li",
- { class: _vm.tabActive === "docs" ? "active" : "" },
- [
- _c(
- "a",
- {
- attrs: { href: "javascript:void(0)" },
- on: {
- click: function($event) {
- return _vm.tabPage("docs")
- }
- }
- },
- [
- _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
- _vm._v(_vm._s(_vm.$L("知识库")))
- ]
- )
- ]
- ),
- _c(
- "li",
- { class: _vm.tabActive === "team" ? "active" : "" },
- [
- _c(
- "a",
- {
- attrs: { href: "javascript:void(0)" },
- on: {
- click: function($event) {
- return _vm.tabPage("team")
- }
- }
- },
- [
- _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
- _vm._v(_vm._s(_vm.$L("团队")))
- ]
- )
- ]
- )
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "w-header-row-right" },
- [
- _c(
- "Dropdown",
- {
- staticClass: "right-info",
- attrs: {
- trigger: "click",
- placement: "bottom-end",
- transfer: ""
- },
- on: { "on-click": _vm.setRightSelect }
- },
- [
- _c(
- "div",
- [
- _c("UserImg", {
- staticClass: "userimg",
- attrs: { info: _vm.usrInfo }
- }),
- _vm._v(" "),
- _c("span", { staticClass: "username" }, [
- _vm._v(
- _vm._s(_vm.$L("欢迎您")) +
- ", " +
- _vm._s(
- _vm.usrInfo.nickname ||
- _vm.usrInfo.username ||
- _vm.$L("尊敬的会员")
- )
- )
- ]),
- _vm._v(" "),
- _c("Icon", { attrs: { type: "md-arrow-dropdown" } })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Dropdown-menu",
- { attrs: { slot: "list" }, slot: "list" },
- [
- _vm.isAdmin
- ? _c("Dropdown-item", { attrs: { name: "system" } }, [
- _vm._v(_vm._s(_vm.$L("系统设置")))
- ])
- : _vm._e(),
- _vm._v(" "),
- _c("Dropdown-item", { attrs: { name: "user" } }, [
- _vm._v(_vm._s(_vm.$L("个人中心")))
- ]),
- _vm._v(" "),
- _c("Dropdown-item", { attrs: { name: "out" } }, [
- _vm._v(_vm._s(_vm.$L("退出登录")))
- ])
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "right-info",
- on: {
- click: function($event) {
- _vm.chatDrawerShow = true
- }
- }
- },
- [
- _c("Icon", {
- staticClass: "right-mticon-9",
- attrs: { type: "md-text", size: "24" }
- }),
- _vm._v(" "),
- _vm.chatUnreadTotal > 0
- ? _c("em", { staticClass: "right-info-num" }, [
- _vm._v(
- _vm._s(
- _vm.chatUnreadTotal > 99
- ? "99+"
- : _vm.chatUnreadTotal
- )
- )
- ])
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Dropdown",
- {
- staticClass: "right-info",
- attrs: { trigger: "click", transfer: "" },
- on: { "on-click": _vm.setLanguage }
- },
- [
- _c(
- "div",
- [
- _c("Icon", {
- staticClass: "right-mticon",
- attrs: { type: "md-globe", size: "24" }
- }),
- _vm._v(" "),
- _c("Icon", { attrs: { type: "md-arrow-dropdown" } })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Dropdown-menu",
- { attrs: { slot: "list" }, slot: "list" },
- [
- _c(
- "Dropdown-item",
- {
- attrs: {
- name: "zh",
- selected: _vm.getLanguage() === "zh"
- }
- },
- [_vm._v("中文")]
- ),
- _vm._v(" "),
- _c(
- "Dropdown-item",
- {
- attrs: {
- name: "en",
- selected: _vm.getLanguage() === "en"
- }
- },
- [_vm._v("English")]
- )
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- )
- ])
- : _vm._e(),
- _vm._v(" "),
- _c(
- "WDrawer",
- {
- attrs: { maxWidth: "640", title: _vm.$L("系统设置") },
- model: {
- value: _vm.systemDrawerShow,
- callback: function($$v) {
- _vm.systemDrawerShow = $$v
- },
- expression: "systemDrawerShow"
- }
- },
- [
- _c(
- "Form",
- {
- ref: "formSystem",
- attrs: { model: _vm.formSystem, "label-width": 150 },
- nativeOn: {
- submit: function($event) {
- $event.preventDefault()
- }
- }
- },
- [
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("首页Logo") } },
- [
- _c("ImgUpload", {
- attrs: { num: 1 },
- model: {
- value: _vm.formSystem.logo,
- callback: function($$v) {
- _vm.$set(_vm.formSystem, "logo", $$v)
- },
- expression: "formSystem.logo"
- }
- }),
- _vm._v(" "),
- _c("span", { staticStyle: { color: "#777" } }, [
- _vm._v(_vm._s(_vm.$L("建议尺寸:%", "300x52")))
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("Github/Gitee图标") } },
- [
- _c(
- "RadioGroup",
- {
- model: {
- value: _vm.formSystem.github,
- callback: function($$v) {
- _vm.$set(_vm.formSystem, "github", $$v)
- },
- expression: "formSystem.github"
- }
- },
- [
- _c("Radio", { attrs: { label: "show" } }, [
- _vm._v(_vm._s(_vm.$L("显示")))
- ]),
- _vm._v(" "),
- _c("Radio", { attrs: { label: "hidden" } }, [
- _vm._v(_vm._s(_vm.$L("隐藏")))
- ])
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("允许注册") } },
- [
- _c(
- "RadioGroup",
- {
- model: {
- value: _vm.formSystem.reg,
- callback: function($$v) {
- _vm.$set(_vm.formSystem, "reg", $$v)
- },
- expression: "formSystem.reg"
- }
- },
- [
- _c("Radio", { attrs: { label: "open" } }, [
- _vm._v(_vm._s(_vm.$L("允许")))
- ]),
- _vm._v(" "),
- _c("Radio", { attrs: { label: "close" } }, [
- _vm._v(_vm._s(_vm.$L("禁止")))
- ])
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("音视频通话") } },
- [
- _c(
- "RadioGroup",
- {
- model: {
- value: _vm.formSystem.callav,
- callback: function($$v) {
- _vm.$set(_vm.formSystem, "callav", $$v)
- },
- expression: "formSystem.callav"
- }
- },
- [
- _c("Radio", { attrs: { label: "open" } }, [
- _vm._v(_vm._s(_vm.$L("开启")))
- ]),
- _vm._v(" "),
- _c("Radio", { attrs: { label: "close" } }, [
- _vm._v(_vm._s(_vm.$L("关闭")))
- ])
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("完成自动归档") } },
- [
- _c(
- "RadioGroup",
- {
- attrs: { value: _vm.formSystem.autoArchived },
- on: { "on-change": _vm.formArchived }
- },
- [
- _c("Radio", { attrs: { label: "open" } }, [
- _vm._v(_vm._s(_vm.$L("开启")))
- ]),
- _vm._v(" "),
- _c("Radio", { attrs: { label: "close" } }, [
- _vm._v(_vm._s(_vm.$L("关闭")))
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _vm.formSystem.autoArchived == "open"
- ? _c(
- "Tooltip",
- {
- staticClass: "setting-auto-day",
- attrs: { placement: "right" }
- },
- [
- _c(
- "Input",
- {
- attrs: { type: "number" },
- model: {
- value: _vm.formSystem.archivedDay,
- callback: function($$v) {
- _vm.$set(_vm.formSystem, "archivedDay", $$v)
- },
- expression: "formSystem.archivedDay"
- }
- },
- [
- _c(
- "span",
- { attrs: { slot: "append" }, slot: "append" },
- [_vm._v(_vm._s(_vm.$L("天")))]
- )
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- { attrs: { slot: "content" }, slot: "content" },
- [
- _vm._v(
- _vm._s(
- _vm.$L(
- "任务完成 % 天后自动归档。",
- _vm.formSystem.archivedDay
- )
- )
- )
- ]
- )
- ],
- 1
- )
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- [
- _c(
- "Button",
- {
- attrs: { loading: _vm.loadIng > 0, type: "primary" },
- on: {
- click: function($event) {
- return _vm.handleSubmit("formSystem")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("提交")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticStyle: { "margin-left": "8px" },
- attrs: { loading: _vm.loadIng > 0 },
- on: {
- click: function($event) {
- return _vm.handleReset("formSystem")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("重置")))]
- )
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "WDrawer",
- {
- attrs: { maxWidth: "1000" },
- model: {
- value: _vm.userDrawerShow,
- callback: function($$v) {
- _vm.userDrawerShow = $$v
- },
- expression: "userDrawerShow"
- }
- },
- [
- _c(
- "Tabs",
- {
- model: {
- value: _vm.userDrawerTab,
- callback: function($$v) {
- _vm.userDrawerTab = $$v
- },
- expression: "userDrawerTab"
- }
- },
- [
- _c(
- "TabPane",
- { attrs: { label: _vm.$L("个人资料"), name: "personal" } },
- [
- _c(
- "Form",
- {
- ref: "formDatum",
- attrs: {
- model: _vm.formDatum,
- rules: _vm.ruleDatum,
- "label-width": 80
- },
- nativeOn: {
- submit: function($event) {
- $event.preventDefault()
- }
- }
- },
- [
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("头像"), prop: "userimg" } },
- [
- _c("ImgUpload", {
- attrs: { num: 1 },
- model: {
- value: _vm.formDatum.userimg,
- callback: function($$v) {
- _vm.$set(_vm.formDatum, "userimg", $$v)
- },
- expression: "formDatum.userimg"
- }
- }),
- _vm._v(" "),
- _c("span", { staticStyle: { color: "#777" } }, [
- _vm._v(_vm._s(_vm.$L("建议尺寸:%", "200x200")))
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("账号") } },
- [
- _c("Input", {
- attrs: { disabled: true },
- model: {
- value: _vm.usrInfo.username,
- callback: function($$v) {
- _vm.$set(_vm.usrInfo, "username", $$v)
- },
- expression: "usrInfo.username"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("昵称"), prop: "nickname" } },
- [
- _c("Input", {
- model: {
- value: _vm.formDatum.nickname,
- callback: function($$v) {
- _vm.$set(_vm.formDatum, "nickname", $$v)
- },
- expression: "formDatum.nickname"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- {
- attrs: {
- label: _vm.$L("职位/职称"),
- prop: "profession"
- }
- },
- [
- _c("Input", {
- model: {
- value: _vm.formDatum.profession,
- callback: function($$v) {
- _vm.$set(_vm.formDatum, "profession", $$v)
- },
- expression: "formDatum.profession"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- [
- _c(
- "Button",
- {
- attrs: {
- loading: _vm.loadIng > 0,
- type: "primary"
- },
- on: {
- click: function($event) {
- return _vm.handleSubmit("formDatum")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("提交")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticStyle: { "margin-left": "8px" },
- attrs: { loading: _vm.loadIng > 0 },
- on: {
- click: function($event) {
- return _vm.handleReset("formDatum")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("重置")))]
- )
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "TabPane",
- { attrs: { label: _vm.$L("偏好设置"), name: "setting" } },
- [
- _c(
- "Form",
- {
- ref: "formSetting",
- attrs: { model: _vm.formSetting, "label-width": 100 },
- nativeOn: {
- submit: function($event) {
- $event.preventDefault()
- }
- }
- },
- [
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("系统皮肤"), prop: "bgid" } },
- [
- _c(
- "ul",
- { staticClass: "setting-bg" },
- _vm._l(
- [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
- function(i) {
- return _c("li", {
- key: i,
- class: { active: _vm.formSetting.bgid == i },
- style:
- "background-image:" + _vm.getBgUrl(i, true),
- on: {
- click: function($event) {
- _vm.formSetting.bgid = i
- }
- }
- })
- }
- ),
- 0
- )
- ]
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- [
- _c(
- "Button",
- {
- attrs: {
- loading: _vm.loadIng > 0,
- type: "primary"
- },
- on: {
- click: function($event) {
- return _vm.handleSubmit("formSetting")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("提交")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticStyle: { "margin-left": "8px" },
- attrs: { loading: _vm.loadIng > 0 },
- on: {
- click: function($event) {
- return _vm.handleReset("formSetting")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("重置")))]
- )
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "TabPane",
- { attrs: { label: _vm.$L("账号密码"), name: "account" } },
- [
- _vm.usrInfo.changepass
- ? _c(
- "Alert",
- { attrs: { type: "warning", showIcon: "" } },
- [_vm._v(_vm._s(_vm.$L("请先修改登录密码!")))]
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "Form",
- {
- ref: "formPass",
- attrs: {
- model: _vm.formPass,
- rules: _vm.rulePass,
- "label-width": 100
- },
- nativeOn: {
- submit: function($event) {
- $event.preventDefault()
- }
- }
- },
- [
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("旧密码"), prop: "oldpass" } },
- [
- _c("Input", {
- attrs: { type: "password" },
- model: {
- value: _vm.formPass.oldpass,
- callback: function($$v) {
- _vm.$set(_vm.formPass, "oldpass", $$v)
- },
- expression: "formPass.oldpass"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- { attrs: { label: _vm.$L("新密码"), prop: "newpass" } },
- [
- _c("Input", {
- attrs: { type: "password" },
- model: {
- value: _vm.formPass.newpass,
- callback: function($$v) {
- _vm.$set(_vm.formPass, "newpass", $$v)
- },
- expression: "formPass.newpass"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- {
- attrs: {
- label: _vm.$L("确认新密码"),
- prop: "checkpass"
- }
- },
- [
- _c("Input", {
- attrs: { type: "password" },
- model: {
- value: _vm.formPass.checkpass,
- callback: function($$v) {
- _vm.$set(_vm.formPass, "checkpass", $$v)
- },
- expression: "formPass.checkpass"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "FormItem",
- [
- _c(
- "Button",
- {
- attrs: {
- loading: _vm.loadIng > 0,
- type: "primary"
- },
- on: {
- click: function($event) {
- return _vm.handleSubmit("formPass")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("提交")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticStyle: { "margin-left": "8px" },
- attrs: { loading: _vm.loadIng > 0 },
- on: {
- click: function($event) {
- return _vm.handleReset("formPass")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("重置")))]
- )
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "TabPane",
- {
- attrs: { label: _vm.$L("我创建的任务"), name: "createtask" }
- },
- [
- _c("header-create", {
- attrs: {
- canload:
- _vm.userDrawerShow && _vm.userDrawerTab == "createtask"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "TabPane",
- {
- attrs: { label: _vm.$L("我归档的任务"), name: "archivedtask" }
- },
- [
- _c("header-archived", {
- attrs: {
- canload:
- _vm.userDrawerShow &&
- _vm.userDrawerTab == "archivedtask"
- }
- })
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "WDrawer",
- {
- staticClass: "w-header-chat-draver",
- attrs: { closable: false, maxWidth: "1080" },
- model: {
- value: _vm.chatDrawerShow,
- callback: function($$v) {
- _vm.chatDrawerShow = $$v
- },
- expression: "chatDrawerShow"
- }
- },
- [
- _c("chat-index", {
- attrs: { openWindow: _vm.chatDrawerShow },
- on: {
- "on-open-notice": function($event) {
- _vm.chatDrawerShow = true
- }
- },
- model: {
- value: _vm.chatUnreadTotal,
- callback: function($$v) {
- _vm.chatUnreadTotal = $$v
- },
- expression: "chatUnreadTotal"
- }
- }),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "w-header-chat-close",
- on: {
- click: function($event) {
- _vm.chatDrawerShow = false
- }
- }
- },
- [_c("Icon", { attrs: { type: "ios-close" } })],
- 1
- )
- ],
- 1
- )
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-2df6db1f", module.exports)
- }
- }
- /***/ }),
- /* 135 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { attrs: { id: "app" } },
- [
- _c("w-header"),
- _vm._v(" "),
- _c(
- "transition",
- { attrs: { name: _vm.transitionName } },
- [
- _c(
- "keep-alive",
- [_c("router-view", { staticClass: "child-view" })],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c("w-spinner")
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-0fbb5d46", module.exports)
- }
- }
- /***/ }),
- /* 136 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony default export */ __webpack_exports__["a"] = ([{
- path: '/',
- name: 'index',
- component: function component(resolve) {
- return __webpack_require__.e/* require */(8).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(287)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/ding',
- name: 'ding',
- component: function component(resolve) {
- return __webpack_require__.e/* require */(0).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(288)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/todo',
- name: 'todo',
- meta: { slide: false, tabActive: 'todo' },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(2).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(289)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/project',
- name: 'project',
- meta: { slide: false, tabActive: 'project' },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(5).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(290)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/project/panel/:projectid',
- name: 'project-panel',
- meta: { slide: false, tabActive: 'project' },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(1).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(291)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/docs',
- name: 'docs',
- meta: { slide: false, tabActive: 'docs' },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(6).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(292)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/docs/edit/:sid',
- name: 'docs-edit',
- meta: { slide: false },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(4).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(293)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/docs/view/:sid',
- name: 'docs-view',
- meta: { slide: false },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(3).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(294)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '/team',
- name: 'team',
- meta: { slide: false, tabActive: 'team' },
- component: function component(resolve) {
- return __webpack_require__.e/* require */(7).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(295)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }, {
- path: '*',
- name: '404',
- component: function component(resolve) {
- return __webpack_require__.e/* require */(9).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(296)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
- }
- }]);
- /***/ }),
- /* 137 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDrag", function() { return MultiDragPlugin; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return Sortable; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Swap", function() { return SwapPlugin; });
- /**!
- * Sortable 1.10.2
- * @author RubaXa <trash@rubaxa.org>
- * @author owenm <owen23355@gmail.com>
- * @license MIT
- */
- function _typeof(obj) {
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
- _typeof = function (obj) {
- return typeof obj;
- };
- } else {
- _typeof = function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- }
- return _typeof(obj);
- }
- 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;
- }
- function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- return _extends.apply(this, arguments);
- }
- function _objectSpread(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- var ownKeys = Object.keys(source);
- if (typeof Object.getOwnPropertySymbols === 'function') {
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
- }));
- }
- ownKeys.forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- }
- return target;
- }
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
- return target;
- }
- function _objectWithoutProperties(source, excluded) {
- if (source == null) return {};
- var target = _objectWithoutPropertiesLoose(source, excluded);
- var key, i;
- if (Object.getOwnPropertySymbols) {
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
- for (i = 0; i < sourceSymbolKeys.length; i++) {
- key = sourceSymbolKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
- target[key] = source[key];
- }
- }
- return target;
- }
- function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
- return arr2;
- }
- }
- function _iterableToArray(iter) {
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
- }
- function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance");
- }
- var version = "1.10.2";
- function userAgent(pattern) {
- if (typeof window !== 'undefined' && window.navigator) {
- return !!
- /*@__PURE__*/
- navigator.userAgent.match(pattern);
- }
- }
- var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
- var Edge = userAgent(/Edge/i);
- var FireFox = userAgent(/firefox/i);
- var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
- var IOS = userAgent(/iP(ad|od|hone)/i);
- var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
- var captureMode = {
- capture: false,
- passive: false
- };
- function on(el, event, fn) {
- el.addEventListener(event, fn, !IE11OrLess && captureMode);
- }
- function off(el, event, fn) {
- el.removeEventListener(event, fn, !IE11OrLess && captureMode);
- }
- function matches(
- /**HTMLElement*/
- el,
- /**String*/
- selector) {
- if (!selector) return;
- selector[0] === '>' && (selector = selector.substring(1));
- if (el) {
- try {
- if (el.matches) {
- return el.matches(selector);
- } else if (el.msMatchesSelector) {
- return el.msMatchesSelector(selector);
- } else if (el.webkitMatchesSelector) {
- return el.webkitMatchesSelector(selector);
- }
- } catch (_) {
- return false;
- }
- }
- return false;
- }
- function getParentOrHost(el) {
- return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
- }
- function closest(
- /**HTMLElement*/
- el,
- /**String*/
- selector,
- /**HTMLElement*/
- ctx, includeCTX) {
- if (el) {
- ctx = ctx || document;
- do {
- if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
- return el;
- }
- if (el === ctx) break;
- /* jshint boss:true */
- } while (el = getParentOrHost(el));
- }
- return null;
- }
- var R_SPACE = /\s+/g;
- function toggleClass(el, name, state) {
- if (el && name) {
- if (el.classList) {
- el.classList[state ? 'add' : 'remove'](name);
- } else {
- var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
- el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
- }
- }
- }
- function css(el, prop, val) {
- var style = el && el.style;
- if (style) {
- if (val === void 0) {
- if (document.defaultView && document.defaultView.getComputedStyle) {
- val = document.defaultView.getComputedStyle(el, '');
- } else if (el.currentStyle) {
- val = el.currentStyle;
- }
- return prop === void 0 ? val : val[prop];
- } else {
- if (!(prop in style) && prop.indexOf('webkit') === -1) {
- prop = '-webkit-' + prop;
- }
- style[prop] = val + (typeof val === 'string' ? '' : 'px');
- }
- }
- }
- function matrix(el, selfOnly) {
- var appliedTransforms = '';
- if (typeof el === 'string') {
- appliedTransforms = el;
- } else {
- do {
- var transform = css(el, 'transform');
- if (transform && transform !== 'none') {
- appliedTransforms = transform + ' ' + appliedTransforms;
- }
- /* jshint boss:true */
- } while (!selfOnly && (el = el.parentNode));
- }
- var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
- /*jshint -W056 */
- return matrixFn && new matrixFn(appliedTransforms);
- }
- function find(ctx, tagName, iterator) {
- if (ctx) {
- var list = ctx.getElementsByTagName(tagName),
- i = 0,
- n = list.length;
- if (iterator) {
- for (; i < n; i++) {
- iterator(list[i], i);
- }
- }
- return list;
- }
- return [];
- }
- function getWindowScrollingElement() {
- var scrollingElement = document.scrollingElement;
- if (scrollingElement) {
- return scrollingElement;
- } else {
- return document.documentElement;
- }
- }
- /**
- * Returns the "bounding client rect" of given element
- * @param {HTMLElement} el The element whose boundingClientRect is wanted
- * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
- * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
- * @param {[Boolean]} undoScale Whether the container's scale() should be undone
- * @param {[HTMLElement]} container The parent the element will be placed in
- * @return {Object} The boundingClientRect of el, with specified adjustments
- */
- function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
- if (!el.getBoundingClientRect && el !== window) return;
- var elRect, top, left, bottom, right, height, width;
- if (el !== window && el !== getWindowScrollingElement()) {
- elRect = el.getBoundingClientRect();
- top = elRect.top;
- left = elRect.left;
- bottom = elRect.bottom;
- right = elRect.right;
- height = elRect.height;
- width = elRect.width;
- } else {
- top = 0;
- left = 0;
- bottom = window.innerHeight;
- right = window.innerWidth;
- height = window.innerHeight;
- width = window.innerWidth;
- }
- if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
- // Adjust for translate()
- container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
- // Not needed on <= IE11
- if (!IE11OrLess) {
- do {
- if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
- var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
- top -= containerRect.top + parseInt(css(container, 'border-top-width'));
- left -= containerRect.left + parseInt(css(container, 'border-left-width'));
- bottom = top + elRect.height;
- right = left + elRect.width;
- break;
- }
- /* jshint boss:true */
- } while (container = container.parentNode);
- }
- }
- if (undoScale && el !== window) {
- // Adjust for scale()
- var elMatrix = matrix(container || el),
- scaleX = elMatrix && elMatrix.a,
- scaleY = elMatrix && elMatrix.d;
- if (elMatrix) {
- top /= scaleY;
- left /= scaleX;
- width /= scaleX;
- height /= scaleY;
- bottom = top + height;
- right = left + width;
- }
- }
- return {
- top: top,
- left: left,
- bottom: bottom,
- right: right,
- width: width,
- height: height
- };
- }
- /**
- * Checks if a side of an element is scrolled past a side of its parents
- * @param {HTMLElement} el The element who's side being scrolled out of view is in question
- * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
- * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
- * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
- */
- function isScrolledPast(el, elSide, parentSide) {
- var parent = getParentAutoScrollElement(el, true),
- elSideVal = getRect(el)[elSide];
- /* jshint boss:true */
- while (parent) {
- var parentSideVal = getRect(parent)[parentSide],
- visible = void 0;
- if (parentSide === 'top' || parentSide === 'left') {
- visible = elSideVal >= parentSideVal;
- } else {
- visible = elSideVal <= parentSideVal;
- }
- if (!visible) return parent;
- if (parent === getWindowScrollingElement()) break;
- parent = getParentAutoScrollElement(parent, false);
- }
- return false;
- }
- /**
- * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
- * and non-draggable elements
- * @param {HTMLElement} el The parent element
- * @param {Number} childNum The index of the child
- * @param {Object} options Parent Sortable's options
- * @return {HTMLElement} The child at index childNum, or null if not found
- */
- function getChild(el, childNum, options) {
- var currentChild = 0,
- i = 0,
- children = el.children;
- while (i < children.length) {
- if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {
- if (currentChild === childNum) {
- return children[i];
- }
- currentChild++;
- }
- i++;
- }
- return null;
- }
- /**
- * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
- * @param {HTMLElement} el Parent element
- * @param {selector} selector Any other elements that should be ignored
- * @return {HTMLElement} The last child, ignoring ghostEl
- */
- function lastChild(el, selector) {
- var last = el.lastElementChild;
- while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
- last = last.previousElementSibling;
- }
- return last || null;
- }
- /**
- * Returns the index of an element within its parent for a selected set of
- * elements
- * @param {HTMLElement} el
- * @param {selector} selector
- * @return {number}
- */
- function index(el, selector) {
- var index = 0;
- if (!el || !el.parentNode) {
- return -1;
- }
- /* jshint boss:true */
- while (el = el.previousElementSibling) {
- if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
- index++;
- }
- }
- return index;
- }
- /**
- * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
- * The value is returned in real pixels.
- * @param {HTMLElement} el
- * @return {Array} Offsets in the format of [left, top]
- */
- function getRelativeScrollOffset(el) {
- var offsetLeft = 0,
- offsetTop = 0,
- winScroller = getWindowScrollingElement();
- if (el) {
- do {
- var elMatrix = matrix(el),
- scaleX = elMatrix.a,
- scaleY = elMatrix.d;
- offsetLeft += el.scrollLeft * scaleX;
- offsetTop += el.scrollTop * scaleY;
- } while (el !== winScroller && (el = el.parentNode));
- }
- return [offsetLeft, offsetTop];
- }
- /**
- * Returns the index of the object within the given array
- * @param {Array} arr Array that may or may not hold the object
- * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
- * @return {Number} The index of the object in the array, or -1
- */
- function indexOfObject(arr, obj) {
- for (var i in arr) {
- if (!arr.hasOwnProperty(i)) continue;
- for (var key in obj) {
- if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
- }
- }
- return -1;
- }
- function getParentAutoScrollElement(el, includeSelf) {
- // skip to window
- if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
- var elem = el;
- var gotSelf = false;
- do {
- // we don't need to get elem css if it isn't even overflowing in the first place (performance)
- if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
- var elemCSS = css(elem);
- if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
- if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
- if (gotSelf || includeSelf) return elem;
- gotSelf = true;
- }
- }
- /* jshint boss:true */
- } while (elem = elem.parentNode);
- return getWindowScrollingElement();
- }
- function extend(dst, src) {
- if (dst && src) {
- for (var key in src) {
- if (src.hasOwnProperty(key)) {
- dst[key] = src[key];
- }
- }
- }
- return dst;
- }
- function isRectEqual(rect1, rect2) {
- return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
- }
- var _throttleTimeout;
- function throttle(callback, ms) {
- return function () {
- if (!_throttleTimeout) {
- var args = arguments,
- _this = this;
- if (args.length === 1) {
- callback.call(_this, args[0]);
- } else {
- callback.apply(_this, args);
- }
- _throttleTimeout = setTimeout(function () {
- _throttleTimeout = void 0;
- }, ms);
- }
- };
- }
- function cancelThrottle() {
- clearTimeout(_throttleTimeout);
- _throttleTimeout = void 0;
- }
- function scrollBy(el, x, y) {
- el.scrollLeft += x;
- el.scrollTop += y;
- }
- function clone(el) {
- var Polymer = window.Polymer;
- var $ = window.jQuery || window.Zepto;
- if (Polymer && Polymer.dom) {
- return Polymer.dom(el).cloneNode(true);
- } else if ($) {
- return $(el).clone(true)[0];
- } else {
- return el.cloneNode(true);
- }
- }
- function setRect(el, rect) {
- css(el, 'position', 'absolute');
- css(el, 'top', rect.top);
- css(el, 'left', rect.left);
- css(el, 'width', rect.width);
- css(el, 'height', rect.height);
- }
- function unsetRect(el) {
- css(el, 'position', '');
- css(el, 'top', '');
- css(el, 'left', '');
- css(el, 'width', '');
- css(el, 'height', '');
- }
- var expando = 'Sortable' + new Date().getTime();
- function AnimationStateManager() {
- var animationStates = [],
- animationCallbackId;
- return {
- captureAnimationState: function captureAnimationState() {
- animationStates = [];
- if (!this.options.animation) return;
- var children = [].slice.call(this.el.children);
- children.forEach(function (child) {
- if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
- animationStates.push({
- target: child,
- rect: getRect(child)
- });
- var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
- if (child.thisAnimationDuration) {
- var childMatrix = matrix(child, true);
- if (childMatrix) {
- fromRect.top -= childMatrix.f;
- fromRect.left -= childMatrix.e;
- }
- }
- child.fromRect = fromRect;
- });
- },
- addAnimationState: function addAnimationState(state) {
- animationStates.push(state);
- },
- removeAnimationState: function removeAnimationState(target) {
- animationStates.splice(indexOfObject(animationStates, {
- target: target
- }), 1);
- },
- animateAll: function animateAll(callback) {
- var _this = this;
- if (!this.options.animation) {
- clearTimeout(animationCallbackId);
- if (typeof callback === 'function') callback();
- return;
- }
- var animating = false,
- animationTime = 0;
- animationStates.forEach(function (state) {
- var time = 0,
- target = state.target,
- fromRect = target.fromRect,
- toRect = getRect(target),
- prevFromRect = target.prevFromRect,
- prevToRect = target.prevToRect,
- animatingRect = state.rect,
- targetMatrix = matrix(target, true);
- if (targetMatrix) {
- // Compensate for current animation
- toRect.top -= targetMatrix.f;
- toRect.left -= targetMatrix.e;
- }
- target.toRect = toRect;
- if (target.thisAnimationDuration) {
- // Could also check if animatingRect is between fromRect and toRect
- if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
- (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
- // If returning to same place as started from animation and on same axis
- time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
- }
- } // if fromRect != toRect: animate
- if (!isRectEqual(toRect, fromRect)) {
- target.prevFromRect = fromRect;
- target.prevToRect = toRect;
- if (!time) {
- time = _this.options.animation;
- }
- _this.animate(target, animatingRect, toRect, time);
- }
- if (time) {
- animating = true;
- animationTime = Math.max(animationTime, time);
- clearTimeout(target.animationResetTimer);
- target.animationResetTimer = setTimeout(function () {
- target.animationTime = 0;
- target.prevFromRect = null;
- target.fromRect = null;
- target.prevToRect = null;
- target.thisAnimationDuration = null;
- }, time);
- target.thisAnimationDuration = time;
- }
- });
- clearTimeout(animationCallbackId);
- if (!animating) {
- if (typeof callback === 'function') callback();
- } else {
- animationCallbackId = setTimeout(function () {
- if (typeof callback === 'function') callback();
- }, animationTime);
- }
- animationStates = [];
- },
- animate: function animate(target, currentRect, toRect, duration) {
- if (duration) {
- css(target, 'transition', '');
- css(target, 'transform', '');
- var elMatrix = matrix(this.el),
- scaleX = elMatrix && elMatrix.a,
- scaleY = elMatrix && elMatrix.d,
- translateX = (currentRect.left - toRect.left) / (scaleX || 1),
- translateY = (currentRect.top - toRect.top) / (scaleY || 1);
- target.animatingX = !!translateX;
- target.animatingY = !!translateY;
- css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
- repaint(target); // repaint
- css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
- css(target, 'transform', 'translate3d(0,0,0)');
- typeof target.animated === 'number' && clearTimeout(target.animated);
- target.animated = setTimeout(function () {
- css(target, 'transition', '');
- css(target, 'transform', '');
- target.animated = false;
- target.animatingX = false;
- target.animatingY = false;
- }, duration);
- }
- }
- };
- }
- function repaint(target) {
- return target.offsetWidth;
- }
- function calculateRealTime(animatingRect, fromRect, toRect, options) {
- return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
- }
- var plugins = [];
- var defaults = {
- initializeByDefault: true
- };
- var PluginManager = {
- mount: function mount(plugin) {
- // Set default static properties
- for (var option in defaults) {
- if (defaults.hasOwnProperty(option) && !(option in plugin)) {
- plugin[option] = defaults[option];
- }
- }
- plugins.push(plugin);
- },
- pluginEvent: function pluginEvent(eventName, sortable, evt) {
- var _this = this;
- this.eventCanceled = false;
- evt.cancel = function () {
- _this.eventCanceled = true;
- };
- var eventNameGlobal = eventName + 'Global';
- plugins.forEach(function (plugin) {
- if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
- if (sortable[plugin.pluginName][eventNameGlobal]) {
- sortable[plugin.pluginName][eventNameGlobal](_objectSpread({
- sortable: sortable
- }, evt));
- } // Only fire plugin event if plugin is enabled in this sortable,
- // and plugin has event defined
- if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
- sortable[plugin.pluginName][eventName](_objectSpread({
- sortable: sortable
- }, evt));
- }
- });
- },
- initializePlugins: function initializePlugins(sortable, el, defaults, options) {
- plugins.forEach(function (plugin) {
- var pluginName = plugin.pluginName;
- if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
- var initialized = new plugin(sortable, el, sortable.options);
- initialized.sortable = sortable;
- initialized.options = sortable.options;
- sortable[pluginName] = initialized; // Add default options from plugin
- _extends(defaults, initialized.defaults);
- });
- for (var option in sortable.options) {
- if (!sortable.options.hasOwnProperty(option)) continue;
- var modified = this.modifyOption(sortable, option, sortable.options[option]);
- if (typeof modified !== 'undefined') {
- sortable.options[option] = modified;
- }
- }
- },
- getEventProperties: function getEventProperties(name, sortable) {
- var eventProperties = {};
- plugins.forEach(function (plugin) {
- if (typeof plugin.eventProperties !== 'function') return;
- _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
- });
- return eventProperties;
- },
- modifyOption: function modifyOption(sortable, name, value) {
- var modifiedValue;
- plugins.forEach(function (plugin) {
- // Plugin must exist on the Sortable
- if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
- if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
- modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
- }
- });
- return modifiedValue;
- }
- };
- function dispatchEvent(_ref) {
- var sortable = _ref.sortable,
- rootEl = _ref.rootEl,
- name = _ref.name,
- targetEl = _ref.targetEl,
- cloneEl = _ref.cloneEl,
- toEl = _ref.toEl,
- fromEl = _ref.fromEl,
- oldIndex = _ref.oldIndex,
- newIndex = _ref.newIndex,
- oldDraggableIndex = _ref.oldDraggableIndex,
- newDraggableIndex = _ref.newDraggableIndex,
- originalEvent = _ref.originalEvent,
- putSortable = _ref.putSortable,
- extraEventProperties = _ref.extraEventProperties;
- sortable = sortable || rootEl && rootEl[expando];
- if (!sortable) return;
- var evt,
- options = sortable.options,
- onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
- if (window.CustomEvent && !IE11OrLess && !Edge) {
- evt = new CustomEvent(name, {
- bubbles: true,
- cancelable: true
- });
- } else {
- evt = document.createEvent('Event');
- evt.initEvent(name, true, true);
- }
- evt.to = toEl || rootEl;
- evt.from = fromEl || rootEl;
- evt.item = targetEl || rootEl;
- evt.clone = cloneEl;
- evt.oldIndex = oldIndex;
- evt.newIndex = newIndex;
- evt.oldDraggableIndex = oldDraggableIndex;
- evt.newDraggableIndex = newDraggableIndex;
- evt.originalEvent = originalEvent;
- evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
- var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable));
- for (var option in allEventProperties) {
- evt[option] = allEventProperties[option];
- }
- if (rootEl) {
- rootEl.dispatchEvent(evt);
- }
- if (options[onName]) {
- options[onName].call(sortable, evt);
- }
- }
- var pluginEvent = function pluginEvent(eventName, sortable) {
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- originalEvent = _ref.evt,
- data = _objectWithoutProperties(_ref, ["evt"]);
- PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({
- dragEl: dragEl,
- parentEl: parentEl,
- ghostEl: ghostEl,
- rootEl: rootEl,
- nextEl: nextEl,
- lastDownEl: lastDownEl,
- cloneEl: cloneEl,
- cloneHidden: cloneHidden,
- dragStarted: moved,
- putSortable: putSortable,
- activeSortable: Sortable.active,
- originalEvent: originalEvent,
- oldIndex: oldIndex,
- oldDraggableIndex: oldDraggableIndex,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex,
- hideGhostForTarget: _hideGhostForTarget,
- unhideGhostForTarget: _unhideGhostForTarget,
- cloneNowHidden: function cloneNowHidden() {
- cloneHidden = true;
- },
- cloneNowShown: function cloneNowShown() {
- cloneHidden = false;
- },
- dispatchSortableEvent: function dispatchSortableEvent(name) {
- _dispatchEvent({
- sortable: sortable,
- name: name,
- originalEvent: originalEvent
- });
- }
- }, data));
- };
- function _dispatchEvent(info) {
- dispatchEvent(_objectSpread({
- putSortable: putSortable,
- cloneEl: cloneEl,
- targetEl: dragEl,
- rootEl: rootEl,
- oldIndex: oldIndex,
- oldDraggableIndex: oldDraggableIndex,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex
- }, info));
- }
- var dragEl,
- parentEl,
- ghostEl,
- rootEl,
- nextEl,
- lastDownEl,
- cloneEl,
- cloneHidden,
- oldIndex,
- newIndex,
- oldDraggableIndex,
- newDraggableIndex,
- activeGroup,
- putSortable,
- awaitingDragStarted = false,
- ignoreNextClick = false,
- sortables = [],
- tapEvt,
- touchEvt,
- lastDx,
- lastDy,
- tapDistanceLeft,
- tapDistanceTop,
- moved,
- lastTarget,
- lastDirection,
- pastFirstInvertThresh = false,
- isCircumstantialInvert = false,
- targetMoveDistance,
- // For positioning ghost absolutely
- ghostRelativeParent,
- ghostRelativeParentInitialScroll = [],
- // (left, top)
- _silent = false,
- savedInputChecked = [];
- /** @const */
- var documentExists = typeof document !== 'undefined',
- PositionGhostAbsolutely = IOS,
- CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
- // This will not pass for IE9, because IE9 DnD only works on anchors
- supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
- supportCssPointerEvents = function () {
- if (!documentExists) return; // false when <= IE11
- if (IE11OrLess) {
- return false;
- }
- var el = document.createElement('x');
- el.style.cssText = 'pointer-events:auto';
- return el.style.pointerEvents === 'auto';
- }(),
- _detectDirection = function _detectDirection(el, options) {
- var elCSS = css(el),
- elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
- child1 = getChild(el, 0, options),
- child2 = getChild(el, 1, options),
- firstChildCSS = child1 && css(child1),
- secondChildCSS = child2 && css(child2),
- firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
- secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
- if (elCSS.display === 'flex') {
- return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
- }
- if (elCSS.display === 'grid') {
- return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
- }
- if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
- var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
- return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
- }
- return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
- },
- _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
- var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
- dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
- dragElOppLength = vertical ? dragRect.width : dragRect.height,
- targetS1Opp = vertical ? targetRect.left : targetRect.top,
- targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
- targetOppLength = vertical ? targetRect.width : targetRect.height;
- return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
- },
- /**
- * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
- * @param {Number} x X position
- * @param {Number} y Y position
- * @return {HTMLElement} Element of the first found nearest Sortable
- */
- _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
- var ret;
- sortables.some(function (sortable) {
- if (lastChild(sortable)) return;
- var rect = getRect(sortable),
- threshold = sortable[expando].options.emptyInsertThreshold,
- insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
- insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
- if (threshold && insideHorizontally && insideVertically) {
- return ret = sortable;
- }
- });
- return ret;
- },
- _prepareGroup = function _prepareGroup(options) {
- function toFn(value, pull) {
- return function (to, from, dragEl, evt) {
- var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
- if (value == null && (pull || sameGroup)) {
- // Default pull value
- // Default pull and put value if same group
- return true;
- } else if (value == null || value === false) {
- return false;
- } else if (pull && value === 'clone') {
- return value;
- } else if (typeof value === 'function') {
- return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
- } else {
- var otherGroup = (pull ? to : from).options.group.name;
- return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
- }
- };
- }
- var group = {};
- var originalGroup = options.group;
- if (!originalGroup || _typeof(originalGroup) != 'object') {
- originalGroup = {
- name: originalGroup
- };
- }
- group.name = originalGroup.name;
- group.checkPull = toFn(originalGroup.pull, true);
- group.checkPut = toFn(originalGroup.put);
- group.revertClone = originalGroup.revertClone;
- options.group = group;
- },
- _hideGhostForTarget = function _hideGhostForTarget() {
- if (!supportCssPointerEvents && ghostEl) {
- css(ghostEl, 'display', 'none');
- }
- },
- _unhideGhostForTarget = function _unhideGhostForTarget() {
- if (!supportCssPointerEvents && ghostEl) {
- css(ghostEl, 'display', '');
- }
- }; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
- if (documentExists) {
- document.addEventListener('click', function (evt) {
- if (ignoreNextClick) {
- evt.preventDefault();
- evt.stopPropagation && evt.stopPropagation();
- evt.stopImmediatePropagation && evt.stopImmediatePropagation();
- ignoreNextClick = false;
- return false;
- }
- }, true);
- }
- var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
- if (dragEl) {
- evt = evt.touches ? evt.touches[0] : evt;
- var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
- if (nearest) {
- // Create imitation event
- var event = {};
- for (var i in evt) {
- if (evt.hasOwnProperty(i)) {
- event[i] = evt[i];
- }
- }
- event.target = event.rootEl = nearest;
- event.preventDefault = void 0;
- event.stopPropagation = void 0;
- nearest[expando]._onDragOver(event);
- }
- }
- };
- var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
- if (dragEl) {
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
- }
- };
- /**
- * @class Sortable
- * @param {HTMLElement} el
- * @param {Object} [options]
- */
- function Sortable(el, options) {
- if (!(el && el.nodeType && el.nodeType === 1)) {
- throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
- }
- this.el = el; // root element
- this.options = options = _extends({}, options); // Export instance
- el[expando] = this;
- var defaults = {
- group: null,
- sort: true,
- disabled: false,
- store: null,
- handle: null,
- draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
- swapThreshold: 1,
- // percentage; 0 <= x <= 1
- invertSwap: false,
- // invert always
- invertedSwapThreshold: null,
- // will be set to same as swapThreshold if default
- removeCloneOnHide: true,
- direction: function direction() {
- return _detectDirection(el, this.options);
- },
- ghostClass: 'sortable-ghost',
- chosenClass: 'sortable-chosen',
- dragClass: 'sortable-drag',
- ignore: 'a, img',
- filter: null,
- preventOnFilter: true,
- animation: 0,
- easing: null,
- setData: function setData(dataTransfer, dragEl) {
- dataTransfer.setData('Text', dragEl.textContent);
- },
- dropBubble: false,
- dragoverBubble: false,
- dataIdAttr: 'data-id',
- delay: 0,
- delayOnTouchOnly: false,
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
- forceFallback: false,
- fallbackClass: 'sortable-fallback',
- fallbackOnBody: false,
- fallbackTolerance: 0,
- fallbackOffset: {
- x: 0,
- y: 0
- },
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window,
- emptyInsertThreshold: 5
- };
- PluginManager.initializePlugins(this, el, defaults); // Set default options
- for (var name in defaults) {
- !(name in options) && (options[name] = defaults[name]);
- }
- _prepareGroup(options); // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- } // Setup drag mode
- this.nativeDraggable = options.forceFallback ? false : supportDraggable;
- if (this.nativeDraggable) {
- // Touch start threshold cannot be greater than the native dragstart threshold
- this.options.touchStartThreshold = 1;
- } // Bind events
- if (options.supportPointer) {
- on(el, 'pointerdown', this._onTapStart);
- } else {
- on(el, 'mousedown', this._onTapStart);
- on(el, 'touchstart', this._onTapStart);
- }
- if (this.nativeDraggable) {
- on(el, 'dragover', this);
- on(el, 'dragenter', this);
- }
- sortables.push(this.el); // Restore sorting
- options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
- _extends(this, AnimationStateManager());
- }
- Sortable.prototype =
- /** @lends Sortable.prototype */
- {
- constructor: Sortable,
- _isOutsideThisEl: function _isOutsideThisEl(target) {
- if (!this.el.contains(target) && target !== this.el) {
- lastTarget = null;
- }
- },
- _getDirection: function _getDirection(evt, target) {
- return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
- },
- _onTapStart: function _onTapStart(
- /** Event|TouchEvent */
- evt) {
- if (!evt.cancelable) return;
- var _this = this,
- el = this.el,
- options = this.options,
- preventOnFilter = options.preventOnFilter,
- type = evt.type,
- touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
- target = (touch || evt).target,
- originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
- filter = options.filter;
- _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
- if (dragEl) {
- return;
- }
- if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
- return; // only left button and enabled
- } // cancel dnd if original target is content editable
- if (originalTarget.isContentEditable) {
- return;
- }
- target = closest(target, options.draggable, el, false);
- if (target && target.animated) {
- return;
- }
- if (lastDownEl === target) {
- // Ignoring duplicate `down`
- return;
- } // Get the index of the dragged element within its parent
- oldIndex = index(target);
- oldDraggableIndex = index(target, options.draggable); // Check filter
- if (typeof filter === 'function') {
- if (filter.call(this, evt, target, this)) {
- _dispatchEvent({
- sortable: _this,
- rootEl: originalTarget,
- name: 'filter',
- targetEl: target,
- toEl: el,
- fromEl: el
- });
- pluginEvent('filter', _this, {
- evt: evt
- });
- preventOnFilter && evt.cancelable && evt.preventDefault();
- return; // cancel dnd
- }
- } else if (filter) {
- filter = filter.split(',').some(function (criteria) {
- criteria = closest(originalTarget, criteria.trim(), el, false);
- if (criteria) {
- _dispatchEvent({
- sortable: _this,
- rootEl: criteria,
- name: 'filter',
- targetEl: target,
- fromEl: el,
- toEl: el
- });
- pluginEvent('filter', _this, {
- evt: evt
- });
- return true;
- }
- });
- if (filter) {
- preventOnFilter && evt.cancelable && evt.preventDefault();
- return; // cancel dnd
- }
- }
- if (options.handle && !closest(originalTarget, options.handle, el, false)) {
- return;
- } // Prepare `dragstart`
- this._prepareDragStart(evt, touch, target);
- },
- _prepareDragStart: function _prepareDragStart(
- /** Event */
- evt,
- /** Touch */
- touch,
- /** HTMLElement */
- target) {
- var _this = this,
- el = _this.el,
- options = _this.options,
- ownerDocument = el.ownerDocument,
- dragStartFn;
- if (target && !dragEl && target.parentNode === el) {
- var dragRect = getRect(target);
- rootEl = el;
- dragEl = target;
- parentEl = dragEl.parentNode;
- nextEl = dragEl.nextSibling;
- lastDownEl = target;
- activeGroup = options.group;
- Sortable.dragged = dragEl;
- tapEvt = {
- target: dragEl,
- clientX: (touch || evt).clientX,
- clientY: (touch || evt).clientY
- };
- tapDistanceLeft = tapEvt.clientX - dragRect.left;
- tapDistanceTop = tapEvt.clientY - dragRect.top;
- this._lastX = (touch || evt).clientX;
- this._lastY = (touch || evt).clientY;
- dragEl.style['will-change'] = 'all';
- dragStartFn = function dragStartFn() {
- pluginEvent('delayEnded', _this, {
- evt: evt
- });
- if (Sortable.eventCanceled) {
- _this._onDrop();
- return;
- } // Delayed drag has been triggered
- // we can re-enable the events: touchmove/mousemove
- _this._disableDelayedDragEvents();
- if (!FireFox && _this.nativeDraggable) {
- dragEl.draggable = true;
- } // Bind the events: dragstart/dragend
- _this._triggerDragStart(evt, touch); // Drag start event
- _dispatchEvent({
- sortable: _this,
- name: 'choose',
- originalEvent: evt
- }); // Chosen item
- toggleClass(dragEl, options.chosenClass, true);
- }; // Disable "draggable"
- options.ignore.split(',').forEach(function (criteria) {
- find(dragEl, criteria.trim(), _disableDraggable);
- });
- on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
- on(ownerDocument, 'mouseup', _this._onDrop);
- on(ownerDocument, 'touchend', _this._onDrop);
- on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
- if (FireFox && this.nativeDraggable) {
- this.options.touchStartThreshold = 4;
- dragEl.draggable = true;
- }
- pluginEvent('delayStart', this, {
- evt: evt
- }); // Delay is impossible for native DnD in Edge or IE
- if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
- if (Sortable.eventCanceled) {
- this._onDrop();
- return;
- } // If the user moves the pointer or let go the click or touch
- // before the delay has been reached:
- // disable the delayed drag
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
- on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
- on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
- options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
- _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
- } else {
- dragStartFn();
- }
- }
- },
- _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
- /** TouchEvent|PointerEvent **/
- e) {
- var touch = e.touches ? e.touches[0] : e;
- if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
- this._disableDelayedDrag();
- }
- },
- _disableDelayedDrag: function _disableDelayedDrag() {
- dragEl && _disableDraggable(dragEl);
- clearTimeout(this._dragStartTimer);
- this._disableDelayedDragEvents();
- },
- _disableDelayedDragEvents: function _disableDelayedDragEvents() {
- var ownerDocument = this.el.ownerDocument;
- off(ownerDocument, 'mouseup', this._disableDelayedDrag);
- off(ownerDocument, 'touchend', this._disableDelayedDrag);
- off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
- off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
- off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
- off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
- },
- _triggerDragStart: function _triggerDragStart(
- /** Event */
- evt,
- /** Touch */
- touch) {
- touch = touch || evt.pointerType == 'touch' && evt;
- if (!this.nativeDraggable || touch) {
- if (this.options.supportPointer) {
- on(document, 'pointermove', this._onTouchMove);
- } else if (touch) {
- on(document, 'touchmove', this._onTouchMove);
- } else {
- on(document, 'mousemove', this._onTouchMove);
- }
- } else {
- on(dragEl, 'dragend', this);
- on(rootEl, 'dragstart', this._onDragStart);
- }
- try {
- if (document.selection) {
- // Timeout neccessary for IE9
- _nextTick(function () {
- document.selection.empty();
- });
- } else {
- window.getSelection().removeAllRanges();
- }
- } catch (err) {}
- },
- _dragStarted: function _dragStarted(fallback, evt) {
- awaitingDragStarted = false;
- if (rootEl && dragEl) {
- pluginEvent('dragStarted', this, {
- evt: evt
- });
- if (this.nativeDraggable) {
- on(document, 'dragover', _checkOutsideTargetEl);
- }
- var options = this.options; // Apply effect
- !fallback && toggleClass(dragEl, options.dragClass, false);
- toggleClass(dragEl, options.ghostClass, true);
- Sortable.active = this;
- fallback && this._appendGhost(); // Drag start event
- _dispatchEvent({
- sortable: this,
- name: 'start',
- originalEvent: evt
- });
- } else {
- this._nulling();
- }
- },
- _emulateDragOver: function _emulateDragOver() {
- if (touchEvt) {
- this._lastX = touchEvt.clientX;
- this._lastY = touchEvt.clientY;
- _hideGhostForTarget();
- var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
- var parent = target;
- while (target && target.shadowRoot) {
- target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
- if (target === parent) break;
- parent = target;
- }
- dragEl.parentNode[expando]._isOutsideThisEl(target);
- if (parent) {
- do {
- if (parent[expando]) {
- var inserted = void 0;
- inserted = parent[expando]._onDragOver({
- clientX: touchEvt.clientX,
- clientY: touchEvt.clientY,
- target: target,
- rootEl: parent
- });
- if (inserted && !this.options.dragoverBubble) {
- break;
- }
- }
- target = parent; // store last element
- }
- /* jshint boss:true */
- while (parent = parent.parentNode);
- }
- _unhideGhostForTarget();
- }
- },
- _onTouchMove: function _onTouchMove(
- /**TouchEvent*/
- evt) {
- if (tapEvt) {
- var options = this.options,
- fallbackTolerance = options.fallbackTolerance,
- fallbackOffset = options.fallbackOffset,
- touch = evt.touches ? evt.touches[0] : evt,
- ghostMatrix = ghostEl && matrix(ghostEl, true),
- scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
- scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
- relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
- dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
- dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging
- if (!Sortable.active && !awaitingDragStarted) {
- if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
- return;
- }
- this._onDragStart(evt, true);
- }
- if (ghostEl) {
- if (ghostMatrix) {
- ghostMatrix.e += dx - (lastDx || 0);
- ghostMatrix.f += dy - (lastDy || 0);
- } else {
- ghostMatrix = {
- a: 1,
- b: 0,
- c: 0,
- d: 1,
- e: dx,
- f: dy
- };
- }
- var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
- css(ghostEl, 'webkitTransform', cssMatrix);
- css(ghostEl, 'mozTransform', cssMatrix);
- css(ghostEl, 'msTransform', cssMatrix);
- css(ghostEl, 'transform', cssMatrix);
- lastDx = dx;
- lastDy = dy;
- touchEvt = touch;
- }
- evt.cancelable && evt.preventDefault();
- }
- },
- _appendGhost: function _appendGhost() {
- // Bug if using scale(): https://stackoverflow.com/questions/2637058
- // Not being adjusted for
- if (!ghostEl) {
- var container = this.options.fallbackOnBody ? document.body : rootEl,
- rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
- options = this.options; // Position absolutely
- if (PositionGhostAbsolutely) {
- // Get relatively positioned parent
- ghostRelativeParent = container;
- while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
- ghostRelativeParent = ghostRelativeParent.parentNode;
- }
- if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
- if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
- rect.top += ghostRelativeParent.scrollTop;
- rect.left += ghostRelativeParent.scrollLeft;
- } else {
- ghostRelativeParent = getWindowScrollingElement();
- }
- ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
- }
- ghostEl = dragEl.cloneNode(true);
- toggleClass(ghostEl, options.ghostClass, false);
- toggleClass(ghostEl, options.fallbackClass, true);
- toggleClass(ghostEl, options.dragClass, true);
- css(ghostEl, 'transition', '');
- css(ghostEl, 'transform', '');
- css(ghostEl, 'box-sizing', 'border-box');
- css(ghostEl, 'margin', 0);
- css(ghostEl, 'top', rect.top);
- css(ghostEl, 'left', rect.left);
- css(ghostEl, 'width', rect.width);
- css(ghostEl, 'height', rect.height);
- css(ghostEl, 'opacity', '0.8');
- css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
- css(ghostEl, 'zIndex', '100000');
- css(ghostEl, 'pointerEvents', 'none');
- Sortable.ghost = ghostEl;
- container.appendChild(ghostEl); // Set transform-origin
- css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
- }
- },
- _onDragStart: function _onDragStart(
- /**Event*/
- evt,
- /**boolean*/
- fallback) {
- var _this = this;
- var dataTransfer = evt.dataTransfer;
- var options = _this.options;
- pluginEvent('dragStart', this, {
- evt: evt
- });
- if (Sortable.eventCanceled) {
- this._onDrop();
- return;
- }
- pluginEvent('setupClone', this);
- if (!Sortable.eventCanceled) {
- cloneEl = clone(dragEl);
- cloneEl.draggable = false;
- cloneEl.style['will-change'] = '';
- this._hideClone();
- toggleClass(cloneEl, this.options.chosenClass, false);
- Sortable.clone = cloneEl;
- } // #1143: IFrame support workaround
- _this.cloneId = _nextTick(function () {
- pluginEvent('clone', _this);
- if (Sortable.eventCanceled) return;
- if (!_this.options.removeCloneOnHide) {
- rootEl.insertBefore(cloneEl, dragEl);
- }
- _this._hideClone();
- _dispatchEvent({
- sortable: _this,
- name: 'clone'
- });
- });
- !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events
- if (fallback) {
- ignoreNextClick = true;
- _this._loopId = setInterval(_this._emulateDragOver, 50);
- } else {
- // Undo what was set in _prepareDragStart before drag started
- off(document, 'mouseup', _this._onDrop);
- off(document, 'touchend', _this._onDrop);
- off(document, 'touchcancel', _this._onDrop);
- if (dataTransfer) {
- dataTransfer.effectAllowed = 'move';
- options.setData && options.setData.call(_this, dataTransfer, dragEl);
- }
- on(document, 'drop', _this); // #1276 fix:
- css(dragEl, 'transform', 'translateZ(0)');
- }
- awaitingDragStarted = true;
- _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
- on(document, 'selectstart', _this);
- moved = true;
- if (Safari) {
- css(document.body, 'user-select', 'none');
- }
- },
- // Returns true - if no further action is needed (either inserted or another condition)
- _onDragOver: function _onDragOver(
- /**Event*/
- evt) {
- var el = this.el,
- target = evt.target,
- dragRect,
- targetRect,
- revert,
- options = this.options,
- group = options.group,
- activeSortable = Sortable.active,
- isOwner = activeGroup === group,
- canSort = options.sort,
- fromSortable = putSortable || activeSortable,
- vertical,
- _this = this,
- completedFired = false;
- if (_silent) return;
- function dragOverEvent(name, extra) {
- pluginEvent(name, _this, _objectSpread({
- evt: evt,
- isOwner: isOwner,
- axis: vertical ? 'vertical' : 'horizontal',
- revert: revert,
- dragRect: dragRect,
- targetRect: targetRect,
- canSort: canSort,
- fromSortable: fromSortable,
- target: target,
- completed: completed,
- onMove: function onMove(target, after) {
- return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
- },
- changed: changed
- }, extra));
- } // Capture animation state
- function capture() {
- dragOverEvent('dragOverAnimationCapture');
- _this.captureAnimationState();
- if (_this !== fromSortable) {
- fromSortable.captureAnimationState();
- }
- } // Return invocation when dragEl is inserted (or completed)
- function completed(insertion) {
- dragOverEvent('dragOverCompleted', {
- insertion: insertion
- });
- if (insertion) {
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
- if (isOwner) {
- activeSortable._hideClone();
- } else {
- activeSortable._showClone(_this);
- }
- if (_this !== fromSortable) {
- // Set ghost class to new sortable's ghost class
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
- toggleClass(dragEl, options.ghostClass, true);
- }
- if (putSortable !== _this && _this !== Sortable.active) {
- putSortable = _this;
- } else if (_this === Sortable.active && putSortable) {
- putSortable = null;
- } // Animation
- if (fromSortable === _this) {
- _this._ignoreWhileAnimating = target;
- }
- _this.animateAll(function () {
- dragOverEvent('dragOverAnimationComplete');
- _this._ignoreWhileAnimating = null;
- });
- if (_this !== fromSortable) {
- fromSortable.animateAll();
- fromSortable._ignoreWhileAnimating = null;
- }
- } // Null lastTarget if it is not inside a previously swapped element
- if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
- lastTarget = null;
- } // no bubbling and not fallback
- if (!options.dragoverBubble && !evt.rootEl && target !== document) {
- dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
- !insertion && nearestEmptyInsertDetectEvent(evt);
- }
- !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
- return completedFired = true;
- } // Call when dragEl has been inserted
- function changed() {
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- _dispatchEvent({
- sortable: _this,
- name: 'change',
- toEl: el,
- newIndex: newIndex,
- newDraggableIndex: newDraggableIndex,
- originalEvent: evt
- });
- }
- if (evt.preventDefault !== void 0) {
- evt.cancelable && evt.preventDefault();
- }
- target = closest(target, options.draggable, el, true);
- dragOverEvent('dragOver');
- if (Sortable.eventCanceled) return completedFired;
- if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
- return completed(false);
- }
- ignoreNextClick = false;
- if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
- : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
- vertical = this._getDirection(evt, target) === 'vertical';
- dragRect = getRect(dragEl);
- dragOverEvent('dragOverValid');
- if (Sortable.eventCanceled) return completedFired;
- if (revert) {
- parentEl = rootEl; // actualization
- capture();
- this._hideClone();
- dragOverEvent('revert');
- if (!Sortable.eventCanceled) {
- if (nextEl) {
- rootEl.insertBefore(dragEl, nextEl);
- } else {
- rootEl.appendChild(dragEl);
- }
- }
- return completed(true);
- }
- var elLastChild = lastChild(el, options.draggable);
- if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
- // If already at end of list: Do not insert
- if (elLastChild === dragEl) {
- return completed(false);
- } // assign target only if condition is true
- if (elLastChild && el === evt.target) {
- target = elLastChild;
- }
- if (target) {
- targetRect = getRect(target);
- }
- if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
- capture();
- el.appendChild(dragEl);
- parentEl = el; // actualization
- changed();
- return completed(true);
- }
- } else if (target.parentNode === el) {
- targetRect = getRect(target);
- var direction = 0,
- targetBeforeFirstSwap,
- differentLevel = dragEl.parentNode !== el,
- differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
- side1 = vertical ? 'top' : 'left',
- scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
- scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
- if (lastTarget !== target) {
- targetBeforeFirstSwap = targetRect[side1];
- pastFirstInvertThresh = false;
- isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
- }
- direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
- var sibling;
- if (direction !== 0) {
- // Check if target is beside dragEl in respective direction (ignoring hidden elements)
- var dragIndex = index(dragEl);
- do {
- dragIndex -= direction;
- sibling = parentEl.children[dragIndex];
- } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
- } // If dragEl is already beside target: Do not insert
- if (direction === 0 || sibling === target) {
- return completed(false);
- }
- lastTarget = target;
- lastDirection = direction;
- var nextSibling = target.nextElementSibling,
- after = false;
- after = direction === 1;
- var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
- if (moveVector !== false) {
- if (moveVector === 1 || moveVector === -1) {
- after = moveVector === 1;
- }
- _silent = true;
- setTimeout(_unsilent, 30);
- capture();
- if (after && !nextSibling) {
- el.appendChild(dragEl);
- } else {
- target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
- } // Undo chrome's scroll adjustment (has no effect on other browsers)
- if (scrolledPastTop) {
- scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
- }
- parentEl = dragEl.parentNode; // actualization
- // must be done before animation
- if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
- targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
- }
- changed();
- return completed(true);
- }
- }
- if (el.contains(dragEl)) {
- return completed(false);
- }
- }
- return false;
- },
- _ignoreWhileAnimating: null,
- _offMoveEvents: function _offMoveEvents() {
- off(document, 'mousemove', this._onTouchMove);
- off(document, 'touchmove', this._onTouchMove);
- off(document, 'pointermove', this._onTouchMove);
- off(document, 'dragover', nearestEmptyInsertDetectEvent);
- off(document, 'mousemove', nearestEmptyInsertDetectEvent);
- off(document, 'touchmove', nearestEmptyInsertDetectEvent);
- },
- _offUpEvents: function _offUpEvents() {
- var ownerDocument = this.el.ownerDocument;
- off(ownerDocument, 'mouseup', this._onDrop);
- off(ownerDocument, 'touchend', this._onDrop);
- off(ownerDocument, 'pointerup', this._onDrop);
- off(ownerDocument, 'touchcancel', this._onDrop);
- off(document, 'selectstart', this);
- },
- _onDrop: function _onDrop(
- /**Event*/
- evt) {
- var el = this.el,
- options = this.options; // Get the index of the dragged element within its parent
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- pluginEvent('drop', this, {
- evt: evt
- });
- parentEl = dragEl && dragEl.parentNode; // Get again after plugin event
- newIndex = index(dragEl);
- newDraggableIndex = index(dragEl, options.draggable);
- if (Sortable.eventCanceled) {
- this._nulling();
- return;
- }
- awaitingDragStarted = false;
- isCircumstantialInvert = false;
- pastFirstInvertThresh = false;
- clearInterval(this._loopId);
- clearTimeout(this._dragStartTimer);
- _cancelNextTick(this.cloneId);
- _cancelNextTick(this._dragStartId); // Unbind events
- if (this.nativeDraggable) {
- off(document, 'drop', this);
- off(el, 'dragstart', this._onDragStart);
- }
- this._offMoveEvents();
- this._offUpEvents();
- if (Safari) {
- css(document.body, 'user-select', '');
- }
- css(dragEl, 'transform', '');
- if (evt) {
- if (moved) {
- evt.cancelable && evt.preventDefault();
- !options.dropBubble && evt.stopPropagation();
- }
- ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
- // Remove clone(s)
- cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
- }
- if (dragEl) {
- if (this.nativeDraggable) {
- off(dragEl, 'dragend', this);
- }
- _disableDraggable(dragEl);
- dragEl.style['will-change'] = ''; // Remove classes
- // ghostClass is added in dragStarted
- if (moved && !awaitingDragStarted) {
- toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
- }
- toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event
- _dispatchEvent({
- sortable: this,
- name: 'unchoose',
- toEl: parentEl,
- newIndex: null,
- newDraggableIndex: null,
- originalEvent: evt
- });
- if (rootEl !== parentEl) {
- if (newIndex >= 0) {
- // Add event
- _dispatchEvent({
- rootEl: parentEl,
- name: 'add',
- toEl: parentEl,
- fromEl: rootEl,
- originalEvent: evt
- }); // Remove event
- _dispatchEvent({
- sortable: this,
- name: 'remove',
- toEl: parentEl,
- originalEvent: evt
- }); // drag from one list and drop into another
- _dispatchEvent({
- rootEl: parentEl,
- name: 'sort',
- toEl: parentEl,
- fromEl: rootEl,
- originalEvent: evt
- });
- _dispatchEvent({
- sortable: this,
- name: 'sort',
- toEl: parentEl,
- originalEvent: evt
- });
- }
- putSortable && putSortable.save();
- } else {
- if (newIndex !== oldIndex) {
- if (newIndex >= 0) {
- // drag & drop within the same list
- _dispatchEvent({
- sortable: this,
- name: 'update',
- toEl: parentEl,
- originalEvent: evt
- });
- _dispatchEvent({
- sortable: this,
- name: 'sort',
- toEl: parentEl,
- originalEvent: evt
- });
- }
- }
- }
- if (Sortable.active) {
- /* jshint eqnull:true */
- if (newIndex == null || newIndex === -1) {
- newIndex = oldIndex;
- newDraggableIndex = oldDraggableIndex;
- }
- _dispatchEvent({
- sortable: this,
- name: 'end',
- toEl: parentEl,
- originalEvent: evt
- }); // Save sorting
- this.save();
- }
- }
- }
- this._nulling();
- },
- _nulling: function _nulling() {
- pluginEvent('nulling', this);
- rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
- savedInputChecked.forEach(function (el) {
- el.checked = true;
- });
- savedInputChecked.length = lastDx = lastDy = 0;
- },
- handleEvent: function handleEvent(
- /**Event*/
- evt) {
- switch (evt.type) {
- case 'drop':
- case 'dragend':
- this._onDrop(evt);
- break;
- case 'dragenter':
- case 'dragover':
- if (dragEl) {
- this._onDragOver(evt);
- _globalDragOver(evt);
- }
- break;
- case 'selectstart':
- evt.preventDefault();
- break;
- }
- },
- /**
- * Serializes the item into an array of string.
- * @returns {String[]}
- */
- toArray: function toArray() {
- var order = [],
- el,
- children = this.el.children,
- i = 0,
- n = children.length,
- options = this.options;
- for (; i < n; i++) {
- el = children[i];
- if (closest(el, options.draggable, this.el, false)) {
- order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
- }
- }
- return order;
- },
- /**
- * Sorts the elements according to the array.
- * @param {String[]} order order of the items
- */
- sort: function sort(order) {
- var items = {},
- rootEl = this.el;
- this.toArray().forEach(function (id, i) {
- var el = rootEl.children[i];
- if (closest(el, this.options.draggable, rootEl, false)) {
- items[id] = el;
- }
- }, this);
- order.forEach(function (id) {
- if (items[id]) {
- rootEl.removeChild(items[id]);
- rootEl.appendChild(items[id]);
- }
- });
- },
- /**
- * Save the current sorting
- */
- save: function save() {
- var store = this.options.store;
- store && store.set && store.set(this);
- },
- /**
- * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
- * @param {HTMLElement} el
- * @param {String} [selector] default: `options.draggable`
- * @returns {HTMLElement|null}
- */
- closest: function closest$1(el, selector) {
- return closest(el, selector || this.options.draggable, this.el, false);
- },
- /**
- * Set/get option
- * @param {string} name
- * @param {*} [value]
- * @returns {*}
- */
- option: function option(name, value) {
- var options = this.options;
- if (value === void 0) {
- return options[name];
- } else {
- var modifiedValue = PluginManager.modifyOption(this, name, value);
- if (typeof modifiedValue !== 'undefined') {
- options[name] = modifiedValue;
- } else {
- options[name] = value;
- }
- if (name === 'group') {
- _prepareGroup(options);
- }
- }
- },
- /**
- * Destroy
- */
- destroy: function destroy() {
- pluginEvent('destroy', this);
- var el = this.el;
- el[expando] = null;
- off(el, 'mousedown', this._onTapStart);
- off(el, 'touchstart', this._onTapStart);
- off(el, 'pointerdown', this._onTapStart);
- if (this.nativeDraggable) {
- off(el, 'dragover', this);
- off(el, 'dragenter', this);
- } // Remove draggable attributes
- Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
- el.removeAttribute('draggable');
- });
- this._onDrop();
- this._disableDelayedDragEvents();
- sortables.splice(sortables.indexOf(this.el), 1);
- this.el = el = null;
- },
- _hideClone: function _hideClone() {
- if (!cloneHidden) {
- pluginEvent('hideClone', this);
- if (Sortable.eventCanceled) return;
- css(cloneEl, 'display', 'none');
- if (this.options.removeCloneOnHide && cloneEl.parentNode) {
- cloneEl.parentNode.removeChild(cloneEl);
- }
- cloneHidden = true;
- }
- },
- _showClone: function _showClone(putSortable) {
- if (putSortable.lastPutMode !== 'clone') {
- this._hideClone();
- return;
- }
- if (cloneHidden) {
- pluginEvent('showClone', this);
- if (Sortable.eventCanceled) return; // show clone at dragEl or original position
- if (rootEl.contains(dragEl) && !this.options.group.revertClone) {
- rootEl.insertBefore(cloneEl, dragEl);
- } else if (nextEl) {
- rootEl.insertBefore(cloneEl, nextEl);
- } else {
- rootEl.appendChild(cloneEl);
- }
- if (this.options.group.revertClone) {
- this.animate(dragEl, cloneEl);
- }
- css(cloneEl, 'display', '');
- cloneHidden = false;
- }
- }
- };
- function _globalDragOver(
- /**Event*/
- evt) {
- if (evt.dataTransfer) {
- evt.dataTransfer.dropEffect = 'move';
- }
- evt.cancelable && evt.preventDefault();
- }
- function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
- var evt,
- sortable = fromEl[expando],
- onMoveFn = sortable.options.onMove,
- retVal; // Support for new CustomEvent feature
- if (window.CustomEvent && !IE11OrLess && !Edge) {
- evt = new CustomEvent('move', {
- bubbles: true,
- cancelable: true
- });
- } else {
- evt = document.createEvent('Event');
- evt.initEvent('move', true, true);
- }
- evt.to = toEl;
- evt.from = fromEl;
- evt.dragged = dragEl;
- evt.draggedRect = dragRect;
- evt.related = targetEl || toEl;
- evt.relatedRect = targetRect || getRect(toEl);
- evt.willInsertAfter = willInsertAfter;
- evt.originalEvent = originalEvent;
- fromEl.dispatchEvent(evt);
- if (onMoveFn) {
- retVal = onMoveFn.call(sortable, evt, originalEvent);
- }
- return retVal;
- }
- function _disableDraggable(el) {
- el.draggable = false;
- }
- function _unsilent() {
- _silent = false;
- }
- function _ghostIsLast(evt, vertical, sortable) {
- var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
- var spacer = 10;
- return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
- }
- function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
- var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
- targetLength = vertical ? targetRect.height : targetRect.width,
- targetS1 = vertical ? targetRect.top : targetRect.left,
- targetS2 = vertical ? targetRect.bottom : targetRect.right,
- invert = false;
- if (!invertSwap) {
- // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
- if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
- // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
- // check if past first invert threshold on side opposite of lastDirection
- if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
- // past first invert threshold, do not restrict inverted threshold to dragEl shadow
- pastFirstInvertThresh = true;
- }
- if (!pastFirstInvertThresh) {
- // dragEl shadow (target move distance shadow)
- if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
- : mouseOnAxis > targetS2 - targetMoveDistance) {
- return -lastDirection;
- }
- } else {
- invert = true;
- }
- } else {
- // Regular
- if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
- return _getInsertDirection(target);
- }
- }
- }
- invert = invert || invertSwap;
- if (invert) {
- // Invert of regular
- if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
- return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
- }
- }
- return 0;
- }
- /**
- * Gets the direction dragEl must be swapped relative to target in order to make it
- * seem that dragEl has been "inserted" into that element's position
- * @param {HTMLElement} target The target whose position dragEl is being inserted at
- * @return {Number} Direction dragEl must be swapped
- */
- function _getInsertDirection(target) {
- if (index(dragEl) < index(target)) {
- return 1;
- } else {
- return -1;
- }
- }
- /**
- * Generate id
- * @param {HTMLElement} el
- * @returns {String}
- * @private
- */
- function _generateId(el) {
- var str = el.tagName + el.className + el.src + el.href + el.textContent,
- i = str.length,
- sum = 0;
- while (i--) {
- sum += str.charCodeAt(i);
- }
- return sum.toString(36);
- }
- function _saveInputCheckedState(root) {
- savedInputChecked.length = 0;
- var inputs = root.getElementsByTagName('input');
- var idx = inputs.length;
- while (idx--) {
- var el = inputs[idx];
- el.checked && savedInputChecked.push(el);
- }
- }
- function _nextTick(fn) {
- return setTimeout(fn, 0);
- }
- function _cancelNextTick(id) {
- return clearTimeout(id);
- } // Fixed #973:
- if (documentExists) {
- on(document, 'touchmove', function (evt) {
- if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
- evt.preventDefault();
- }
- });
- } // Export utils
- Sortable.utils = {
- on: on,
- off: off,
- css: css,
- find: find,
- is: function is(el, selector) {
- return !!closest(el, selector, el, false);
- },
- extend: extend,
- throttle: throttle,
- closest: closest,
- toggleClass: toggleClass,
- clone: clone,
- index: index,
- nextTick: _nextTick,
- cancelNextTick: _cancelNextTick,
- detectDirection: _detectDirection,
- getChild: getChild
- };
- /**
- * Get the Sortable instance of an element
- * @param {HTMLElement} element The element
- * @return {Sortable|undefined} The instance of Sortable
- */
- Sortable.get = function (element) {
- return element[expando];
- };
- /**
- * Mount a plugin to Sortable
- * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
- */
- Sortable.mount = function () {
- for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
- plugins[_key] = arguments[_key];
- }
- if (plugins[0].constructor === Array) plugins = plugins[0];
- plugins.forEach(function (plugin) {
- if (!plugin.prototype || !plugin.prototype.constructor) {
- throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
- }
- if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);
- PluginManager.mount(plugin);
- });
- };
- /**
- * Create sortable instance
- * @param {HTMLElement} el
- * @param {Object} [options]
- */
- Sortable.create = function (el, options) {
- return new Sortable(el, options);
- }; // Export
- Sortable.version = version;
- var autoScrolls = [],
- scrollEl,
- scrollRootEl,
- scrolling = false,
- lastAutoScrollX,
- lastAutoScrollY,
- touchEvt$1,
- pointerElemChangedInterval;
- function AutoScrollPlugin() {
- function AutoScroll() {
- this.defaults = {
- scroll: true,
- scrollSensitivity: 30,
- scrollSpeed: 10,
- bubbleScroll: true
- }; // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- }
- }
- AutoScroll.prototype = {
- dragStarted: function dragStarted(_ref) {
- var originalEvent = _ref.originalEvent;
- if (this.sortable.nativeDraggable) {
- on(document, 'dragover', this._handleAutoScroll);
- } else {
- if (this.options.supportPointer) {
- on(document, 'pointermove', this._handleFallbackAutoScroll);
- } else if (originalEvent.touches) {
- on(document, 'touchmove', this._handleFallbackAutoScroll);
- } else {
- on(document, 'mousemove', this._handleFallbackAutoScroll);
- }
- }
- },
- dragOverCompleted: function dragOverCompleted(_ref2) {
- var originalEvent = _ref2.originalEvent;
- // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
- if (!this.options.dragOverBubble && !originalEvent.rootEl) {
- this._handleAutoScroll(originalEvent);
- }
- },
- drop: function drop() {
- if (this.sortable.nativeDraggable) {
- off(document, 'dragover', this._handleAutoScroll);
- } else {
- off(document, 'pointermove', this._handleFallbackAutoScroll);
- off(document, 'touchmove', this._handleFallbackAutoScroll);
- off(document, 'mousemove', this._handleFallbackAutoScroll);
- }
- clearPointerElemChangedInterval();
- clearAutoScrolls();
- cancelThrottle();
- },
- nulling: function nulling() {
- touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
- autoScrolls.length = 0;
- },
- _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
- this._handleAutoScroll(evt, true);
- },
- _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
- var _this = this;
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
- y = (evt.touches ? evt.touches[0] : evt).clientY,
- elem = document.elementFromPoint(x, y);
- touchEvt$1 = evt; // IE does not seem to have native autoscroll,
- // Edge's autoscroll seems too conditional,
- // MACOS Safari does not have autoscroll,
- // Firefox and Chrome are good
- if (fallback || Edge || IE11OrLess || Safari) {
- autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
- var ogElemScroller = getParentAutoScrollElement(elem, true);
- if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
- pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
- pointerElemChangedInterval = setInterval(function () {
- var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
- if (newElem !== ogElemScroller) {
- ogElemScroller = newElem;
- clearAutoScrolls();
- }
- autoScroll(evt, _this.options, newElem, fallback);
- }, 10);
- lastAutoScrollX = x;
- lastAutoScrollY = y;
- }
- } else {
- // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
- if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
- clearAutoScrolls();
- return;
- }
- autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
- }
- }
- };
- return _extends(AutoScroll, {
- pluginName: 'scroll',
- initializeByDefault: true
- });
- }
- function clearAutoScrolls() {
- autoScrolls.forEach(function (autoScroll) {
- clearInterval(autoScroll.pid);
- });
- autoScrolls = [];
- }
- function clearPointerElemChangedInterval() {
- clearInterval(pointerElemChangedInterval);
- }
- var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
- // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
- if (!options.scroll) return;
- var x = (evt.touches ? evt.touches[0] : evt).clientX,
- y = (evt.touches ? evt.touches[0] : evt).clientY,
- sens = options.scrollSensitivity,
- speed = options.scrollSpeed,
- winScroller = getWindowScrollingElement();
- var scrollThisInstance = false,
- scrollCustomFn; // New scroll root, set scrollEl
- if (scrollRootEl !== rootEl) {
- scrollRootEl = rootEl;
- clearAutoScrolls();
- scrollEl = options.scroll;
- scrollCustomFn = options.scrollFn;
- if (scrollEl === true) {
- scrollEl = getParentAutoScrollElement(rootEl, true);
- }
- }
- var layersOut = 0;
- var currentParent = scrollEl;
- do {
- var el = currentParent,
- rect = getRect(el),
- top = rect.top,
- bottom = rect.bottom,
- left = rect.left,
- right = rect.right,
- width = rect.width,
- height = rect.height,
- canScrollX = void 0,
- canScrollY = void 0,
- scrollWidth = el.scrollWidth,
- scrollHeight = el.scrollHeight,
- elCSS = css(el),
- scrollPosX = el.scrollLeft,
- scrollPosY = el.scrollTop;
- if (el === winScroller) {
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
- } else {
- canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
- canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
- }
- var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
- var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
- if (!autoScrolls[layersOut]) {
- for (var i = 0; i <= layersOut; i++) {
- if (!autoScrolls[i]) {
- autoScrolls[i] = {};
- }
- }
- }
- if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
- autoScrolls[layersOut].el = el;
- autoScrolls[layersOut].vx = vx;
- autoScrolls[layersOut].vy = vy;
- clearInterval(autoScrolls[layersOut].pid);
- if (vx != 0 || vy != 0) {
- scrollThisInstance = true;
- /* jshint loopfunc:true */
- autoScrolls[layersOut].pid = setInterval(function () {
- // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
- if (isFallback && this.layer === 0) {
- Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
- }
- var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
- var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
- if (typeof scrollCustomFn === 'function') {
- if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
- return;
- }
- }
- scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
- }.bind({
- layer: layersOut
- }), 24);
- }
- }
- layersOut++;
- } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
- scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
- }, 30);
- var drop = function drop(_ref) {
- var originalEvent = _ref.originalEvent,
- putSortable = _ref.putSortable,
- dragEl = _ref.dragEl,
- activeSortable = _ref.activeSortable,
- dispatchSortableEvent = _ref.dispatchSortableEvent,
- hideGhostForTarget = _ref.hideGhostForTarget,
- unhideGhostForTarget = _ref.unhideGhostForTarget;
- if (!originalEvent) return;
- var toSortable = putSortable || activeSortable;
- hideGhostForTarget();
- var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
- var target = document.elementFromPoint(touch.clientX, touch.clientY);
- unhideGhostForTarget();
- if (toSortable && !toSortable.el.contains(target)) {
- dispatchSortableEvent('spill');
- this.onSpill({
- dragEl: dragEl,
- putSortable: putSortable
- });
- }
- };
- function Revert() {}
- Revert.prototype = {
- startIndex: null,
- dragStart: function dragStart(_ref2) {
- var oldDraggableIndex = _ref2.oldDraggableIndex;
- this.startIndex = oldDraggableIndex;
- },
- onSpill: function onSpill(_ref3) {
- var dragEl = _ref3.dragEl,
- putSortable = _ref3.putSortable;
- this.sortable.captureAnimationState();
- if (putSortable) {
- putSortable.captureAnimationState();
- }
- var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
- if (nextSibling) {
- this.sortable.el.insertBefore(dragEl, nextSibling);
- } else {
- this.sortable.el.appendChild(dragEl);
- }
- this.sortable.animateAll();
- if (putSortable) {
- putSortable.animateAll();
- }
- },
- drop: drop
- };
- _extends(Revert, {
- pluginName: 'revertOnSpill'
- });
- function Remove() {}
- Remove.prototype = {
- onSpill: function onSpill(_ref4) {
- var dragEl = _ref4.dragEl,
- putSortable = _ref4.putSortable;
- var parentSortable = putSortable || this.sortable;
- parentSortable.captureAnimationState();
- dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
- parentSortable.animateAll();
- },
- drop: drop
- };
- _extends(Remove, {
- pluginName: 'removeOnSpill'
- });
- var lastSwapEl;
- function SwapPlugin() {
- function Swap() {
- this.defaults = {
- swapClass: 'sortable-swap-highlight'
- };
- }
- Swap.prototype = {
- dragStart: function dragStart(_ref) {
- var dragEl = _ref.dragEl;
- lastSwapEl = dragEl;
- },
- dragOverValid: function dragOverValid(_ref2) {
- var completed = _ref2.completed,
- target = _ref2.target,
- onMove = _ref2.onMove,
- activeSortable = _ref2.activeSortable,
- changed = _ref2.changed,
- cancel = _ref2.cancel;
- if (!activeSortable.options.swap) return;
- var el = this.sortable.el,
- options = this.options;
- if (target && target !== el) {
- var prevSwapEl = lastSwapEl;
- if (onMove(target) !== false) {
- toggleClass(target, options.swapClass, true);
- lastSwapEl = target;
- } else {
- lastSwapEl = null;
- }
- if (prevSwapEl && prevSwapEl !== lastSwapEl) {
- toggleClass(prevSwapEl, options.swapClass, false);
- }
- }
- changed();
- completed(true);
- cancel();
- },
- drop: function drop(_ref3) {
- var activeSortable = _ref3.activeSortable,
- putSortable = _ref3.putSortable,
- dragEl = _ref3.dragEl;
- var toSortable = putSortable || this.sortable;
- var options = this.options;
- lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);
- if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {
- if (dragEl !== lastSwapEl) {
- toSortable.captureAnimationState();
- if (toSortable !== activeSortable) activeSortable.captureAnimationState();
- swapNodes(dragEl, lastSwapEl);
- toSortable.animateAll();
- if (toSortable !== activeSortable) activeSortable.animateAll();
- }
- }
- },
- nulling: function nulling() {
- lastSwapEl = null;
- }
- };
- return _extends(Swap, {
- pluginName: 'swap',
- eventProperties: function eventProperties() {
- return {
- swapItem: lastSwapEl
- };
- }
- });
- }
- function swapNodes(n1, n2) {
- var p1 = n1.parentNode,
- p2 = n2.parentNode,
- i1,
- i2;
- if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
- i1 = index(n1);
- i2 = index(n2);
- if (p1.isEqualNode(p2) && i1 < i2) {
- i2++;
- }
- p1.insertBefore(n2, p1.children[i1]);
- p2.insertBefore(n1, p2.children[i2]);
- }
- var multiDragElements = [],
- multiDragClones = [],
- lastMultiDragSelect,
- // for selection with modifier key down (SHIFT)
- multiDragSortable,
- initialFolding = false,
- // Initial multi-drag fold when drag started
- folding = false,
- // Folding any other time
- dragStarted = false,
- dragEl$1,
- clonesFromRect,
- clonesHidden;
- function MultiDragPlugin() {
- function MultiDrag(sortable) {
- // Bind all private methods
- for (var fn in this) {
- if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
- this[fn] = this[fn].bind(this);
- }
- }
- if (sortable.options.supportPointer) {
- on(document, 'pointerup', this._deselectMultiDrag);
- } else {
- on(document, 'mouseup', this._deselectMultiDrag);
- on(document, 'touchend', this._deselectMultiDrag);
- }
- on(document, 'keydown', this._checkKeyDown);
- on(document, 'keyup', this._checkKeyUp);
- this.defaults = {
- selectedClass: 'sortable-selected',
- multiDragKey: null,
- setData: function setData(dataTransfer, dragEl) {
- var data = '';
- if (multiDragElements.length && multiDragSortable === sortable) {
- multiDragElements.forEach(function (multiDragElement, i) {
- data += (!i ? '' : ', ') + multiDragElement.textContent;
- });
- } else {
- data = dragEl.textContent;
- }
- dataTransfer.setData('Text', data);
- }
- };
- }
- MultiDrag.prototype = {
- multiDragKeyDown: false,
- isMultiDrag: false,
- delayStartGlobal: function delayStartGlobal(_ref) {
- var dragged = _ref.dragEl;
- dragEl$1 = dragged;
- },
- delayEnded: function delayEnded() {
- this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);
- },
- setupClone: function setupClone(_ref2) {
- var sortable = _ref2.sortable,
- cancel = _ref2.cancel;
- if (!this.isMultiDrag) return;
- for (var i = 0; i < multiDragElements.length; i++) {
- multiDragClones.push(clone(multiDragElements[i]));
- multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;
- multiDragClones[i].draggable = false;
- multiDragClones[i].style['will-change'] = '';
- toggleClass(multiDragClones[i], this.options.selectedClass, false);
- multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);
- }
- sortable._hideClone();
- cancel();
- },
- clone: function clone(_ref3) {
- var sortable = _ref3.sortable,
- rootEl = _ref3.rootEl,
- dispatchSortableEvent = _ref3.dispatchSortableEvent,
- cancel = _ref3.cancel;
- if (!this.isMultiDrag) return;
- if (!this.options.removeCloneOnHide) {
- if (multiDragElements.length && multiDragSortable === sortable) {
- insertMultiDragClones(true, rootEl);
- dispatchSortableEvent('clone');
- cancel();
- }
- }
- },
- showClone: function showClone(_ref4) {
- var cloneNowShown = _ref4.cloneNowShown,
- rootEl = _ref4.rootEl,
- cancel = _ref4.cancel;
- if (!this.isMultiDrag) return;
- insertMultiDragClones(false, rootEl);
- multiDragClones.forEach(function (clone) {
- css(clone, 'display', '');
- });
- cloneNowShown();
- clonesHidden = false;
- cancel();
- },
- hideClone: function hideClone(_ref5) {
- var _this = this;
- var sortable = _ref5.sortable,
- cloneNowHidden = _ref5.cloneNowHidden,
- cancel = _ref5.cancel;
- if (!this.isMultiDrag) return;
- multiDragClones.forEach(function (clone) {
- css(clone, 'display', 'none');
- if (_this.options.removeCloneOnHide && clone.parentNode) {
- clone.parentNode.removeChild(clone);
- }
- });
- cloneNowHidden();
- clonesHidden = true;
- cancel();
- },
- dragStartGlobal: function dragStartGlobal(_ref6) {
- var sortable = _ref6.sortable;
- if (!this.isMultiDrag && multiDragSortable) {
- multiDragSortable.multiDrag._deselectMultiDrag();
- }
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.sortableIndex = index(multiDragElement);
- }); // Sort multi-drag elements
- multiDragElements = multiDragElements.sort(function (a, b) {
- return a.sortableIndex - b.sortableIndex;
- });
- dragStarted = true;
- },
- dragStarted: function dragStarted(_ref7) {
- var _this2 = this;
- var sortable = _ref7.sortable;
- if (!this.isMultiDrag) return;
- if (this.options.sort) {
- // Capture rects,
- // hide multi drag elements (by positioning them absolute),
- // set multi drag elements rects to dragRect,
- // show multi drag elements,
- // animate to rects,
- // unset rects & remove from DOM
- sortable.captureAnimationState();
- if (this.options.animation) {
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- css(multiDragElement, 'position', 'absolute');
- });
- var dragRect = getRect(dragEl$1, false, true, true);
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- setRect(multiDragElement, dragRect);
- });
- folding = true;
- initialFolding = true;
- }
- }
- sortable.animateAll(function () {
- folding = false;
- initialFolding = false;
- if (_this2.options.animation) {
- multiDragElements.forEach(function (multiDragElement) {
- unsetRect(multiDragElement);
- });
- } // Remove all auxiliary multidrag items from el, if sorting enabled
- if (_this2.options.sort) {
- removeMultiDragElements();
- }
- });
- },
- dragOver: function dragOver(_ref8) {
- var target = _ref8.target,
- completed = _ref8.completed,
- cancel = _ref8.cancel;
- if (folding && ~multiDragElements.indexOf(target)) {
- completed(false);
- cancel();
- }
- },
- revert: function revert(_ref9) {
- var fromSortable = _ref9.fromSortable,
- rootEl = _ref9.rootEl,
- sortable = _ref9.sortable,
- dragRect = _ref9.dragRect;
- if (multiDragElements.length > 1) {
- // Setup unfold animation
- multiDragElements.forEach(function (multiDragElement) {
- sortable.addAnimationState({
- target: multiDragElement,
- rect: folding ? getRect(multiDragElement) : dragRect
- });
- unsetRect(multiDragElement);
- multiDragElement.fromRect = dragRect;
- fromSortable.removeAnimationState(multiDragElement);
- });
- folding = false;
- insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);
- }
- },
- dragOverCompleted: function dragOverCompleted(_ref10) {
- var sortable = _ref10.sortable,
- isOwner = _ref10.isOwner,
- insertion = _ref10.insertion,
- activeSortable = _ref10.activeSortable,
- parentEl = _ref10.parentEl,
- putSortable = _ref10.putSortable;
- var options = this.options;
- if (insertion) {
- // Clones must be hidden before folding animation to capture dragRectAbsolute properly
- if (isOwner) {
- activeSortable._hideClone();
- }
- initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location
- if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {
- // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible
- var dragRectAbsolute = getRect(dragEl$1, false, true, true);
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted
- // while folding, and so that we can capture them again because old sortable will no longer be fromSortable
- parentEl.appendChild(multiDragElement);
- });
- folding = true;
- } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out
- if (!isOwner) {
- // Only remove if not folding (folding will remove them anyways)
- if (!folding) {
- removeMultiDragElements();
- }
- if (multiDragElements.length > 1) {
- var clonesHiddenBefore = clonesHidden;
- activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden
- if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {
- multiDragClones.forEach(function (clone) {
- activeSortable.addAnimationState({
- target: clone,
- rect: clonesFromRect
- });
- clone.fromRect = clonesFromRect;
- clone.thisAnimationDuration = null;
- });
- }
- } else {
- activeSortable._showClone(sortable);
- }
- }
- }
- },
- dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {
- var dragRect = _ref11.dragRect,
- isOwner = _ref11.isOwner,
- activeSortable = _ref11.activeSortable;
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.thisAnimationDuration = null;
- });
- if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {
- clonesFromRect = _extends({}, dragRect);
- var dragMatrix = matrix(dragEl$1, true);
- clonesFromRect.top -= dragMatrix.f;
- clonesFromRect.left -= dragMatrix.e;
- }
- },
- dragOverAnimationComplete: function dragOverAnimationComplete() {
- if (folding) {
- folding = false;
- removeMultiDragElements();
- }
- },
- drop: function drop(_ref12) {
- var evt = _ref12.originalEvent,
- rootEl = _ref12.rootEl,
- parentEl = _ref12.parentEl,
- sortable = _ref12.sortable,
- dispatchSortableEvent = _ref12.dispatchSortableEvent,
- oldIndex = _ref12.oldIndex,
- putSortable = _ref12.putSortable;
- var toSortable = putSortable || this.sortable;
- if (!evt) return;
- var options = this.options,
- children = parentEl.children; // Multi-drag selection
- if (!dragStarted) {
- if (options.multiDragKey && !this.multiDragKeyDown) {
- this._deselectMultiDrag();
- }
- toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));
- if (!~multiDragElements.indexOf(dragEl$1)) {
- multiDragElements.push(dragEl$1);
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'select',
- targetEl: dragEl$1,
- originalEvt: evt
- }); // Modifier activated, select from last to dragEl
- if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {
- var lastIndex = index(lastMultiDragSelect),
- currentIndex = index(dragEl$1);
- if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
- // Must include lastMultiDragSelect (select it), in case modified selection from no selection
- // (but previous selection existed)
- var n, i;
- if (currentIndex > lastIndex) {
- i = lastIndex;
- n = currentIndex;
- } else {
- i = currentIndex;
- n = lastIndex + 1;
- }
- for (; i < n; i++) {
- if (~multiDragElements.indexOf(children[i])) continue;
- toggleClass(children[i], options.selectedClass, true);
- multiDragElements.push(children[i]);
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'select',
- targetEl: children[i],
- originalEvt: evt
- });
- }
- }
- } else {
- lastMultiDragSelect = dragEl$1;
- }
- multiDragSortable = toSortable;
- } else {
- multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);
- lastMultiDragSelect = null;
- dispatchEvent({
- sortable: sortable,
- rootEl: rootEl,
- name: 'deselect',
- targetEl: dragEl$1,
- originalEvt: evt
- });
- }
- } // Multi-drag drop
- if (dragStarted && this.isMultiDrag) {
- // Do not "unfold" after around dragEl if reverted
- if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
- var dragRect = getRect(dragEl$1),
- multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');
- if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;
- toSortable.captureAnimationState();
- if (!initialFolding) {
- if (options.animation) {
- dragEl$1.fromRect = dragRect;
- multiDragElements.forEach(function (multiDragElement) {
- multiDragElement.thisAnimationDuration = null;
- if (multiDragElement !== dragEl$1) {
- var rect = folding ? getRect(multiDragElement) : dragRect;
- multiDragElement.fromRect = rect; // Prepare unfold animation
- toSortable.addAnimationState({
- target: multiDragElement,
- rect: rect
- });
- }
- });
- } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert
- // properly they must all be removed
- removeMultiDragElements();
- multiDragElements.forEach(function (multiDragElement) {
- if (children[multiDragIndex]) {
- parentEl.insertBefore(multiDragElement, children[multiDragIndex]);
- } else {
- parentEl.appendChild(multiDragElement);
- }
- multiDragIndex++;
- }); // If initial folding is done, the elements may have changed position because they are now
- // unfolding around dragEl, even though dragEl may not have his index changed, so update event
- // must be fired here as Sortable will not.
- if (oldIndex === index(dragEl$1)) {
- var update = false;
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement.sortableIndex !== index(multiDragElement)) {
- update = true;
- return;
- }
- });
- if (update) {
- dispatchSortableEvent('update');
- }
- }
- } // Must be done after capturing individual rects (scroll bar)
- multiDragElements.forEach(function (multiDragElement) {
- unsetRect(multiDragElement);
- });
- toSortable.animateAll();
- }
- multiDragSortable = toSortable;
- } // Remove clones if necessary
- if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
- multiDragClones.forEach(function (clone) {
- clone.parentNode && clone.parentNode.removeChild(clone);
- });
- }
- },
- nullingGlobal: function nullingGlobal() {
- this.isMultiDrag = dragStarted = false;
- multiDragClones.length = 0;
- },
- destroyGlobal: function destroyGlobal() {
- this._deselectMultiDrag();
- off(document, 'pointerup', this._deselectMultiDrag);
- off(document, 'mouseup', this._deselectMultiDrag);
- off(document, 'touchend', this._deselectMultiDrag);
- off(document, 'keydown', this._checkKeyDown);
- off(document, 'keyup', this._checkKeyUp);
- },
- _deselectMultiDrag: function _deselectMultiDrag(evt) {
- if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable
- if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable
- if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click
- if (evt && evt.button !== 0) return;
- while (multiDragElements.length) {
- var el = multiDragElements[0];
- toggleClass(el, this.options.selectedClass, false);
- multiDragElements.shift();
- dispatchEvent({
- sortable: this.sortable,
- rootEl: this.sortable.el,
- name: 'deselect',
- targetEl: el,
- originalEvt: evt
- });
- }
- },
- _checkKeyDown: function _checkKeyDown(evt) {
- if (evt.key === this.options.multiDragKey) {
- this.multiDragKeyDown = true;
- }
- },
- _checkKeyUp: function _checkKeyUp(evt) {
- if (evt.key === this.options.multiDragKey) {
- this.multiDragKeyDown = false;
- }
- }
- };
- return _extends(MultiDrag, {
- // Static methods & properties
- pluginName: 'multiDrag',
- utils: {
- /**
- * Selects the provided multi-drag item
- * @param {HTMLElement} el The element to be selected
- */
- select: function select(el) {
- var sortable = el.parentNode[expando];
- if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;
- if (multiDragSortable && multiDragSortable !== sortable) {
- multiDragSortable.multiDrag._deselectMultiDrag();
- multiDragSortable = sortable;
- }
- toggleClass(el, sortable.options.selectedClass, true);
- multiDragElements.push(el);
- },
- /**
- * Deselects the provided multi-drag item
- * @param {HTMLElement} el The element to be deselected
- */
- deselect: function deselect(el) {
- var sortable = el.parentNode[expando],
- index = multiDragElements.indexOf(el);
- if (!sortable || !sortable.options.multiDrag || !~index) return;
- toggleClass(el, sortable.options.selectedClass, false);
- multiDragElements.splice(index, 1);
- }
- },
- eventProperties: function eventProperties() {
- var _this3 = this;
- var oldIndicies = [],
- newIndicies = [];
- multiDragElements.forEach(function (multiDragElement) {
- oldIndicies.push({
- multiDragElement: multiDragElement,
- index: multiDragElement.sortableIndex
- }); // multiDragElements will already be sorted if folding
- var newIndex;
- if (folding && multiDragElement !== dragEl$1) {
- newIndex = -1;
- } else if (folding) {
- newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');
- } else {
- newIndex = index(multiDragElement);
- }
- newIndicies.push({
- multiDragElement: multiDragElement,
- index: newIndex
- });
- });
- return {
- items: _toConsumableArray(multiDragElements),
- clones: [].concat(multiDragClones),
- oldIndicies: oldIndicies,
- newIndicies: newIndicies
- };
- },
- optionListeners: {
- multiDragKey: function multiDragKey(key) {
- key = key.toLowerCase();
- if (key === 'ctrl') {
- key = 'Control';
- } else if (key.length > 1) {
- key = key.charAt(0).toUpperCase() + key.substr(1);
- }
- return key;
- }
- }
- });
- }
- function insertMultiDragElements(clonesInserted, rootEl) {
- multiDragElements.forEach(function (multiDragElement, i) {
- var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];
- if (target) {
- rootEl.insertBefore(multiDragElement, target);
- } else {
- rootEl.appendChild(multiDragElement);
- }
- });
- }
- /**
- * Insert multi-drag clones
- * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
- * @param {HTMLElement} rootEl
- */
- function insertMultiDragClones(elementsInserted, rootEl) {
- multiDragClones.forEach(function (clone, i) {
- var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];
- if (target) {
- rootEl.insertBefore(clone, target);
- } else {
- rootEl.appendChild(clone);
- }
- });
- }
- function removeMultiDragElements() {
- multiDragElements.forEach(function (multiDragElement) {
- if (multiDragElement === dragEl$1) return;
- multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);
- });
- }
- Sortable.mount(new AutoScrollPlugin());
- Sortable.mount(Remove, Revert);
- /* harmony default export */ __webpack_exports__["default"] = (Sortable);
- /***/ }),
- /* 138 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(139);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("f2cb592e", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0c50b298\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./files.vue", function() {
- var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0c50b298\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./files.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 139 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-task-file[data-v-0c50b298] {\n margin: 0 12px;\n}\n.project-task-file .tableFill[data-v-0c50b298] {\n margin: 12px 0 20px;\n}\n", ""]);
- // exports
- /***/ }),
- /* 140 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_clipboard2__ = __webpack_require__(141);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_clipboard2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_clipboard2__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer__ = __webpack_require__(7);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer__);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_1_vue_clipboard2___default.a);
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ProjectTaskFiles',
- components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer___default.a },
- props: {
- projectid: {
- default: 0
- },
- taskid: {
- default: 0
- },
- canload: {
- type: Boolean,
- default: true
- },
- simple: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- keys: {},
- sorts: { key: '', order: '' },
- loadYet: false,
- loadIng: 0,
- columns: [],
- lists: [],
- listPage: 1,
- listTotal: 0,
- lastPage: 0,
- noDataText: "",
- uploadFormat: ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'],
- actionUrl: $A.apiUrl('project/files/upload'),
- params: {
- token: $A.getToken(),
- taskid: this.taskid,
- projectid: this.projectid
- },
- uploadList: [],
- maxSize: 204800
- };
- },
- mounted: function mounted() {
- if (this.canload) {
- this.loadYet = true;
- this.getLists(true);
- }
- this.uploadList = this.$refs.upload.fileList;
- },
- watch: {
- projectid: function projectid(val) {
- if (this.loadYet) {
- this.getLists(true);
- }
- this.$set(this.params, 'projectid', val);
- },
- taskid: function taskid(val) {
- if (this.loadYet) {
- this.getLists(true);
- }
- this.$set(this.params, 'taskid', val);
- },
- canload: function canload(val) {
- if (val && !this.loadYet) {
- this.loadYet = true;
- this.getLists(true);
- }
- },
- uploadList: function uploadList(files) {
- var _this = this;
- files.forEach(function (file) {
- if (typeof file.username === "undefined") {
- file.username = _this.usrName;
- file.indate = Math.round(new Date().getTime() / 1000);
- _this.lists.unshift(file);
- _this.$emit('change', 'up');
- }
- });
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- var _this2 = this;
- this.noDataText = this.$L("数据加载中.....");
- var columns = [];
- columns.push({
- "title": "",
- "width": 60,
- render: function render(h, params) {
- if (!params.row.thumb) {
- return h('WLoading', {
- style: {
- width: "24px",
- height: "24px",
- verticalAlign: "middle"
- }
- });
- }
- var imgRender = h('img', {
- style: {
- width: "28px",
- height: "28px",
- display: "table"
- },
- attrs: {
- src: params.row.thumb
- }
- });
- if (['jpg', 'jpeg', 'png', 'gif'].indexOf(params.row.ext) !== -1) {
- return h('Tooltip', {
- props: {
- transfer: true,
- delay: 600,
- maxWidth: 600
- }
- }, [imgRender, h('div', { slot: 'content' }, [h('img', {
- style: {
- maxWidth: "360px",
- maxHeight: "360px",
- display: "table",
- margin: "3px 0"
- },
- attrs: {
- src: params.row.path
- }
- })])]);
- } else {
- return imgRender;
- }
- }
- });
- columns.push({
- "title": this.$L("文件名"),
- "key": 'name',
- "minWidth": 100,
- "tooltip": true,
- "sortable": true,
- render: function render(h, params) {
- var arr = [h('span', params.row.name)];
- if (params.row.showProgress === true) {
- arr.push(h('Progress', {
- style: {
- display: 'block',
- marginTop: '-3px'
- },
- props: {
- percent: parseFloat($A.runNum(params.row.percentage || 100, 2))
- }
- }));
- }
- return h('div', arr);
- }
- });
- columns.push({
- "title": this.$L("大小"),
- "key": 'size',
- "minWidth": 90,
- "maxWidth": 120,
- "align": "right",
- "sortable": true,
- render: function render(h, params) {
- return h('span', $A.bytesToSize(params.row.size));
- }
- });
- if (!this.simple) {
- columns.push({
- "title": this.$L("下载次数"),
- "key": 'download',
- "align": "center",
- "sortable": true,
- "width": 100
- });
- columns.push({
- "title": this.$L("上传者"),
- "key": 'username',
- "minWidth": 90,
- "maxWidth": 130,
- "sortable": true,
- render: function render(h, params) {
- return h('UserView', {
- props: {
- username: params.row.username
- }
- });
- }
- });
- columns.push({
- "title": this.$L("上传时间"),
- "key": 'indate',
- "width": 160,
- "sortable": true,
- render: function render(h, params) {
- return h('span', $A.formatDate("Y-m-d H:i:s", params.row.indate));
- }
- });
- }
- columns.push({
- "title": " ",
- "key": 'action',
- "align": 'right',
- "width": 120,
- render: function render(h, params) {
- if (!params.row.id) {
- return null;
- }
- return h('div', [h('Tooltip', {
- props: { content: _this2.$L('下载'), transfer: true, delay: 600 },
- style: { position: 'relative' }
- }, [h('Icon', {
- props: { type: 'md-arrow-down', size: 16 },
- style: { margin: '0 3px', cursor: 'pointer' }
- }), h('a', {
- style: { position: 'absolute', top: '0', left: '0', right: '0', bottom: '0', 'zIndex': 1 },
- attrs: { href: $A.apiUrl('project/files/download?fileid=' + params.row.id), target: '_blank' },
- on: {
- click: function click() {
- if (params.row.yetdown) {
- return;
- }
- params.row.yetdown = 1;
- _this2.$set(params.row, 'download', params.row.download + 1);
- }
- }
- })]), h('Tooltip', {
- props: { content: _this2.$L('重命名'), transfer: true, delay: 600 }
- }, [h('Icon', {
- props: { type: 'md-create', size: 16 },
- style: { margin: '0 3px', cursor: 'pointer' },
- on: {
- click: function click() {
- _this2.renameFile(params.row);
- }
- }
- })]), h('Tooltip', {
- props: { content: _this2.$L('复制链接'), transfer: true, delay: 600 }
- }, [h('Icon', {
- props: { type: 'md-link', size: 16 },
- style: { margin: '0 3px', cursor: 'pointer', transform: 'rotate(-45deg)' },
- on: {
- click: function click() {
- _this2.$copyText($A.apiUrl('project/files/download?fileid=' + params.row.id)).then(function () {
- _this2.$Message.success(_this2.$L('复制成功!'));
- }, function () {
- _this2.$Message.error(_this2.$L('复制失败!'));
- });
- }
- }
- })]), h('Tooltip', {
- props: { content: _this2.$L('删除'), transfer: true, delay: 600 }
- }, [h('Icon', {
- props: { type: 'md-trash', size: 16 },
- style: { margin: '0 3px', cursor: 'pointer' },
- on: {
- click: function click() {
- _this2.deleteFile(params.row);
- }
- }
- })])]);
- }
- });
- this.columns = columns;
- },
- sreachTab: function sreachTab(clear) {
- if (clear === true) {
- this.keys = {};
- }
- this.getLists(true);
- },
- sortChange: function sortChange(info) {
- this.sorts = { key: info.key, order: info.order };
- this.getLists(true);
- },
- setPage: function setPage(page) {
- this.listPage = page;
- this.getLists();
- },
- setPageSize: function setPageSize(size) {
- if (Math.max($A.runNum(this.listPageSize), 10) != size) {
- this.listPageSize = size;
- this.getLists();
- }
- },
- getLists: function getLists(resetLoad) {
- var _this3 = this;
- if (resetLoad === true) {
- this.listPage = 1;
- }
- if (this.projectid == 0 && this.taskid == 0) {
- this.lists = [];
- this.listTotal = 0;
- this.noDataText = this.$L("没有相关的文件");
- return;
- }
- this.loadIng++;
- var whereData = $A.cloneData(this.keys);
- whereData.page = Math.max(this.listPage, 1);
- whereData.pagesize = Math.max($A.runNum(this.listPageSize), 10);
- whereData.projectid = this.projectid;
- whereData.taskid = this.taskid;
- whereData.sorts = this.sorts;
- this.noDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'project/files/lists',
- data: whereData,
- complete: function complete() {
- _this3.loadIng--;
- },
- error: function error() {
- _this3.noDataText = _this3.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this3.lists = res.data.lists;
- _this3.listTotal = res.data.total;
- _this3.lastPage = res.data.lastPage;
- _this3.noDataText = _this3.$L("没有相关的文件");
- } else {
- _this3.lists = [];
- _this3.listTotal = 0;
- _this3.lastPage = 0;
- _this3.noDataText = res.msg;
- }
- }
- });
- },
- renameFile: function renameFile(item) {
- var _this4 = this;
- this.renameValue = "";
- this.$Modal.confirm({
- render: function render(h) {
- return h('div', [h('div', {
- style: {
- fontSize: '16px',
- fontWeight: '500',
- marginBottom: '20px'
- }
- }, _this4.$L('重命名文件名')), h('Input', {
- props: {
- value: _this4.renameValue,
- autofocus: true,
- placeholder: item.name || _this4.$L('请输入新的文件名称')
- },
- on: {
- input: function input(val) {
- _this4.renameValue = val;
- }
- }
- })]);
- },
- loading: true,
- onOk: function onOk() {
- if (_this4.renameValue) {
- var oldName = item.name;
- var newName = _this4.renameValue;
- if (!$A.rightExists(newName, '.' + item.ext)) {
- newName += '.' + item.ext;
- }
- _this4.$set(item, 'name', newName);
- $A.apiAjax({
- url: 'project/files/rename',
- data: {
- fileid: item.id,
- name: newName
- },
- error: function error() {
- _this4.$Modal.remove();
- _this4.$set(item, 'name', oldName);
- alert(_this4.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- _this4.$Modal.remove();
- if (res.ret === 1) {
- _this4.$set(item, 'name', res.data.name);
- } else {
- _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
- _this4.$set(item, 'name', oldName);
- }
- }
- });
- } else {
- _this4.$Modal.remove();
- }
- }
- });
- },
- deleteFile: function deleteFile(item) {
- var _this5 = this;
- this.$Modal.confirm({
- title: this.$L('删除文件'),
- content: this.$L('你确定要删除此文件吗?'),
- loading: true,
- onOk: function onOk() {
- $A.apiAjax({
- url: 'project/files/delete',
- data: {
- fileid: item.id
- },
- error: function error() {
- _this5.$Modal.remove();
- alert(_this5.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- _this5.$Modal.remove();
- _this5.lists.some(function (temp, index) {
- if (temp.id == item.id) {
- _this5.lists.splice(index, 1);
- return true;
- }
- });
- setTimeout(function () {
- if (res.ret === 1) {
- _this5.$Message.success(res.msg);
- _this5.$emit('change', 'delete');
- } else {
- _this5.$Modal.error({ title: _this5.$L('温馨提示'), content: res.msg });
- }
- }, 350);
- }
- });
- }
- });
- },
- uploadHandleClick: function uploadHandleClick() {
- this.$refs.upload.handleClick();
- },
- handleError: function handleError(error, html, file) {
- var _this6 = this;
- //上传失败
- this.$Modal.warning({
- title: this.$L('上传失败'),
- content: this.$L('文件 % 上传失败,%', file.name, error)
- });
- this.$refs.upload.fileList.pop();
- this.lists.some(function (item, index) {
- if (item.uid == file.uid) {
- _this6.lists.splice(index, 1);
- return true;
- }
- });
- this.$emit('change', 'error');
- },
- handleSuccess: function handleSuccess(res, file) {
- var _this7 = this;
- //上传完成
- if (res.ret === 1) {
- for (var key in res.data) {
- if (res.data.hasOwnProperty(key)) {
- file[key] = res.data[key];
- }
- }
- this.$emit('change', 'add');
- } else {
- this.$Modal.warning({
- title: this.$L('上传失败'),
- content: this.$L('文件 % 上传失败,%', file.name, res.msg)
- });
- this.$refs.upload.fileList.pop();
- this.lists.some(function (item, index) {
- if (item.id == res.id) {
- _this7.lists.splice(index, 1);
- return true;
- }
- });
- this.$emit('change', 'error');
- }
- this.uploadList = this.$refs.upload.fileList;
- },
- handleFormatError: function handleFormatError(file) {
- //上传类型错误
- this.$Modal.warning({
- title: this.$L('文件格式不正确'),
- content: this.$L('文件 % 格式不正确,仅支持上传:%', file.name, this.uploadFormat.join(','))
- });
- },
- handleMaxSize: function handleMaxSize(file) {
- //上传大小错误
- this.$Modal.warning({
- title: this.$L('超出文件大小限制'),
- content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
- });
- },
- handleBeforeUpload: function handleBeforeUpload() {
- //上传前判断
- this.params = {
- token: $A.getToken(),
- taskid: this.taskid,
- projectid: this.projectid
- };
- return true;
- },
- upload: function upload(file) {
- //手动传file
- if (this.handleBeforeUpload()) {
- this.$refs.upload.upload(file);
- }
- }
- }
- });
- /***/ }),
- /* 141 */
- /***/ (function(module, exports, __webpack_require__) {
- var Clipboard = __webpack_require__(142) // FIXME: workaround for browserify
- var VueClipboardConfig = {
- autoSetContainer: false,
- appendToBody: true // This fixes IE, see #50
- }
- var VueClipboard = {
- install: function (Vue) {
- var globalPrototype = Vue.version.slice(0, 2) === '3.' ? Vue.config.globalProperties : Vue.prototype
- globalPrototype.$clipboardConfig = VueClipboardConfig
- globalPrototype.$copyText = function (text, container) {
- return new Promise(function (resolve, reject) {
- var fakeElement = document.createElement('button')
- var clipboard = new Clipboard(fakeElement, {
- text: function () { return text },
- action: function () { return 'copy' },
- container: typeof container === 'object' ? container : document.body
- })
- clipboard.on('success', function (e) {
- clipboard.destroy()
- resolve(e)
- })
- clipboard.on('error', function (e) {
- clipboard.destroy()
- reject(e)
- })
- if (VueClipboardConfig.appendToBody) document.body.appendChild(fakeElement)
- fakeElement.click()
- if (VueClipboardConfig.appendToBody) document.body.removeChild(fakeElement)
- })
- }
- Vue.directive('clipboard', {
- bind: function (el, binding, vnode) {
- if (binding.arg === 'success') {
- el._vClipboard_success = binding.value
- } else if (binding.arg === 'error') {
- el._vClipboard_error = binding.value
- } else {
- var clipboard = new Clipboard(el, {
- text: function () { return binding.value },
- action: function () { return binding.arg === 'cut' ? 'cut' : 'copy' },
- container: VueClipboardConfig.autoSetContainer ? el : undefined
- })
- clipboard.on('success', function (e) {
- var callback = el._vClipboard_success
- callback && callback(e)
- })
- clipboard.on('error', function (e) {
- var callback = el._vClipboard_error
- callback && callback(e)
- })
- el._vClipboard = clipboard
- }
- },
- update: function (el, binding) {
- if (binding.arg === 'success') {
- el._vClipboard_success = binding.value
- } else if (binding.arg === 'error') {
- el._vClipboard_error = binding.value
- } else {
- el._vClipboard.text = function () { return binding.value }
- el._vClipboard.action = function () { return binding.arg === 'cut' ? 'cut' : 'copy' }
- }
- },
- unbind: function (el, binding) {
- // FIXME: investigate why $element._vClipboard was missing
- if (!el._vClipboard) return
- if (binding.arg === 'success') {
- delete el._vClipboard_success
- } else if (binding.arg === 'error') {
- delete el._vClipboard_error
- } else {
- el._vClipboard.destroy()
- delete el._vClipboard
- }
- }
- })
- },
- config: VueClipboardConfig
- }
- if (true) {
- module.exports = VueClipboard
- } else if (typeof define === 'function' && define.amd) {
- define([], function () {
- return VueClipboard
- })
- }
- /***/ }),
- /* 142 */
- /***/ (function(module, exports, __webpack_require__) {
- /*!
- * clipboard.js v2.0.10
- * https://clipboardjs.com/
- *
- * Licensed MIT © Zeno Rocha
- */
- !function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof t?(e=t,n="rtl"===document.documentElement.getAttribute("dir"),(o=document.createElement("textarea")).style.fontSize="12pt",o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[n?"right":"left"]="-9999px",n=window.pageYOffset||document.documentElement.scrollTop,o.style.top="".concat(n,"px"),o.setAttribute("readonly",""),o.value=e,o=o,r.container.appendChild(o),i=c()(o),a("copy"),o.remove()):(i=c()(t),a("copy")),i};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==r(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?l(t,{container:o}):e?"cut"===n?f(e):l(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=m(n);return t=o?(t=m(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var o=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return l(t,e)}},{key:"cut",value:function(t){return f(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return v("action",t)}},{key:"defaultTarget",value:function(t){t=v("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return v("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
- /***/ }),
- /* 143 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("drawer-tabs-container", [
- _c(
- "div",
- { staticClass: "project-task-file" },
- [
- !_vm.simple
- ? _c("Row", { staticClass: "sreachBox" }, [
- _c("div", { staticClass: "item" }, [
- _c(
- "div",
- { staticClass: "item-2" },
- [
- _c("sreachTitle", { attrs: { val: _vm.keys.name } }, [
- _vm._v(_vm._s(_vm.$L("文件名")))
- ]),
- _vm._v(" "),
- _c("Input", {
- attrs: { placeholder: _vm.$L("关键词") },
- model: {
- value: _vm.keys.name,
- callback: function($$v) {
- _vm.$set(_vm.keys, "name", $$v)
- },
- expression: "keys.name"
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item-2" },
- [
- _c("sreachTitle", { attrs: { val: _vm.keys.username } }, [
- _vm._v(_vm._s(_vm.$L("上传者")))
- ]),
- _vm._v(" "),
- _c("Input", {
- attrs: { placeholder: _vm.$L("用户名") },
- model: {
- value: _vm.keys.username,
- callback: function($$v) {
- _vm.$set(_vm.keys, "username", $$v)
- },
- expression: "keys.username"
- }
- })
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "item item-button" },
- [
- _vm.$A.objImplode(_vm.keys) != ""
- ? _c(
- "Button",
- {
- attrs: { type: "text" },
- on: {
- click: function($event) {
- return _vm.sreachTab(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("取消筛选")))]
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "Button",
- {
- attrs: {
- type: "primary",
- icon: "md-search",
- loading: _vm.loadIng > 0
- },
- on: { click: _vm.sreachTab }
- },
- [_vm._v(_vm._s(_vm.$L("搜索")))]
- )
- ],
- 1
- )
- ])
- : _vm._e(),
- _vm._v(" "),
- _c(
- "Row",
- {
- staticClass: "butBox",
- style:
- "float:left;margin-top:-32px;" +
- (_vm.simple ? "display:none" : "")
- },
- [
- _c(
- "Upload",
- {
- ref: "upload",
- attrs: {
- name: "files",
- action: _vm.actionUrl,
- data: _vm.params,
- multiple: "",
- format: _vm.uploadFormat,
- "show-upload-list": false,
- "max-size": _vm.maxSize,
- "on-success": _vm.handleSuccess,
- "on-error": _vm.handleError,
- "on-format-error": _vm.handleFormatError,
- "on-exceeded-size": _vm.handleMaxSize,
- "before-upload": _vm.handleBeforeUpload
- }
- },
- [
- _c(
- "Button",
- {
- attrs: {
- loading: _vm.loadIng > 0,
- type: "primary",
- icon: "ios-cloud-upload-outline"
- },
- on: { click: function($event) {} }
- },
- [_vm._v(_vm._s(_vm.$L("上传文件")))]
- )
- ],
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c("Table", {
- ref: "tableRef",
- staticClass: "tableFill",
- attrs: {
- size: !_vm.simple ? "default" : "small",
- columns: _vm.columns,
- data: _vm.lists,
- loading: _vm.loadIng > 0,
- "no-data-text": _vm.noDataText,
- stripe: ""
- },
- on: { "on-sort-change": _vm.sortChange }
- }),
- _vm._v(" "),
- _vm.lastPage > 1 || !_vm.simple
- ? _c("Page", {
- staticClass: "pageBox",
- attrs: {
- simple: _vm.simple || _vm.windowMax768,
- total: _vm.listTotal,
- current: _vm.listPage,
- disabled: _vm.loadIng > 0,
- "page-size-opts": [10, 20, 30, 50, 100],
- placement: "top",
- "show-elevator": "",
- "show-sizer": "",
- "show-total": "",
- transfer: ""
- },
- on: {
- "on-change": _vm.setPage,
- "on-page-size-change": _vm.setPageSize
- }
- })
- : _vm._e()
- ],
- 1
- )
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-0c50b298", module.exports)
- }
- }
- /***/ }),
- /* 144 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(145);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("2afd1fe1", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2951ea9e\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./logs.vue", function() {
- var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2951ea9e\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./logs.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 145 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-task-logs[data-v-2951ea9e] {\n margin: 0 12px;\n}\n.project-task-logs .logs-activity[data-v-2951ea9e] {\n position: relative;\n word-break: break-all;\n padding: 12px 12px;\n}\n.project-task-logs .logs-activity.istaskid > li[data-v-2951ea9e] {\n padding-top: 0;\n}\n.project-task-logs .logs-activity > li[data-v-2951ea9e] {\n padding-top: 22px;\n}\n.project-task-logs .logs-activity > li.logs-loading[data-v-2951ea9e] {\n margin: 4px 0;\n width: 18px;\n height: 18px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.project-task-logs .logs-activity > li.logs-more[data-v-2951ea9e] {\n cursor: pointer;\n}\n.project-task-logs .logs-activity > li.logs-more[data-v-2951ea9e]:hover {\n color: #048be0;\n}\n.project-task-logs .logs-activity > li.logs-none[data-v-2951ea9e] {\n cursor: pointer;\n color: #666666;\n line-height: 26px;\n}\n.project-task-logs .logs-activity > li[data-v-2951ea9e]:first-child {\n padding-top: 0;\n}\n.project-task-logs .logs-activity > li:last-child .logs-section[data-v-2951ea9e] {\n margin-bottom: -8px;\n}\n.project-task-logs .logs-activity > li .logs-date[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.36);\n padding-bottom: 14px;\n}\n.project-task-logs .logs-activity > li .logs-section .ivu-timeline-item[data-v-2951ea9e] {\n padding-bottom: 2px;\n}\n.project-task-logs .logs-activity > li .logs-dot[data-v-2951ea9e] {\n width: 18px;\n height: 18px;\n margin-left: 10px;\n}\n.project-task-logs .logs-activity > li .logs-dot .avatar[data-v-2951ea9e] {\n width: 18px;\n height: 18px;\n font-size: 12px;\n line-height: 18px;\n border-radius: 14px;\n overflow: hidden;\n}\n.project-task-logs .logs-activity > li .log-summary > span[data-v-2951ea9e],\n .project-task-logs .logs-activity > li .log-summary > a[data-v-2951ea9e] {\n padding-right: 6px;\n word-wrap: break-word;\n word-break: break-word;\n}\n.project-task-logs .logs-activity > li .log-summary .log-creator[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.85);\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-secondary[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.54);\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-link[data-v-2951ea9e] {\n color: #048be0;\n cursor: pointer;\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-info[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.36);\n}\n", ""]);
- // exports
- /***/ }),
- /* 146 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ProjectTaskLogs',
- components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
- props: {
- projectid: {
- default: 0
- },
- taskid: {
- default: 0
- },
- pagesize: {
- default: 100
- },
- logtype: {
- default: '全部'
- },
- canload: {
- type: Boolean,
- default: true
- }
- },
- data: function data() {
- return {
- loadYet: false,
- loadIng: 0,
- lists: {},
- listPage: 1,
- hasMorePages: false,
- totalNum: -1
- };
- },
- mounted: function mounted() {
- if (this.canload) {
- this.loadYet = true;
- this.getLists(true);
- }
- },
- watch: {
- projectid: function projectid() {
- if (this.loadYet) {
- this.lists = {};
- this.getLists(true);
- }
- },
- taskid: function taskid() {
- if (this.loadYet) {
- this.lists = {};
- this.getLists(true);
- }
- },
- logtype: function logtype() {
- if (this.loadYet) {
- this.lists = {};
- this.getLists(true);
- }
- },
- canload: function canload(val) {
- if (val && !this.loadYet) {
- this.loadYet = true;
- this.getLists(true);
- }
- }
- },
- methods: {
- logDate: function logDate(items) {
- var md = $A.formatDate("m-d");
- return md == items.ymd ? items.ymd + ' ' + this.$L('今天') : items.key;
- },
- getLists: function getLists(resetLoad, noLoading) {
- var _this = this;
- if (resetLoad === true) {
- this.listPage = 1;
- }
- if (noLoading !== true) {
- this.loadIng++;
- }
- $A.apiAjax({
- url: 'project/log/lists',
- data: {
- projectid: this.projectid,
- taskid: this.taskid,
- type: this.logtype,
- page: Math.max(this.listPage, 1),
- pagesize: this.pagesize
- },
- complete: function complete() {
- if (noLoading !== true) {
- _this.loadIng--;
- }
- },
- success: function success(res) {
- if (res.ret === 1) {
- var timeData = void 0,
- key = void 0;
- if (resetLoad === true) {
- _this.lists = {};
- }
- _this.$nextTick(function () {
- res.data.lists.forEach(function (item) {
- timeData = item.timeData;
- key = timeData.ymd + " " + timeData.week;
- if (_typeof(_this.lists[key]) !== "object") {
- _this.$set(_this.lists, key, {
- key: key,
- ymd: timeData.ymd,
- lists: []
- });
- }
- _this.lists[key].lists.push(item);
- });
- _this.hasMorePages = res.data.hasMorePages;
- _this.totalNum = res.data.total;
- });
- } else {
- _this.lists = {};
- _this.hasMorePages = false;
- _this.totalNum = 0;
- }
- }
- });
- },
- getMore: function getMore() {
- if (!this.hasMorePages) {
- return;
- }
- this.hasMorePages = false;
- this.listPage++;
- this.getLists();
- },
- openChat: function openChat(username) {
- if (typeof window.onChatOpenUserName === "function") {
- window.onChatOpenUserName(username);
- }
- },
- fileDownUrl: function fileDownUrl(id) {
- return $A.apiUrl('project/files/download?fileid=' + id);
- }
- }
- });
- /***/ }),
- /* 147 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("drawer-tabs-container", [
- _c("div", { staticClass: "project-task-logs" }, [
- _c(
- "ul",
- {
- staticClass: "logs-activity",
- class: "" + (_vm.taskid > 0 ? "istaskid" : "")
- },
- [
- _vm._l(_vm.lists, function(items) {
- return _c("li", [
- _c("div", { staticClass: "logs-date" }, [
- _vm._v(_vm._s(_vm.logDate(items)))
- ]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "logs-section" },
- [
- _c(
- "Timeline",
- _vm._l(items.lists, function(item, index) {
- return _c("TimelineItem", { key: index }, [
- _c(
- "div",
- {
- staticClass: "logs-dot",
- attrs: { slot: "dot" },
- slot: "dot"
- },
- [
- _c("UserImg", {
- staticClass: "avatar",
- attrs: { info: item }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("div", { staticClass: "log-summary" }, [
- _c(
- "span",
- {
- staticClass: "log-creator",
- on: {
- click: function($event) {
- return _vm.openChat(item.username)
- }
- }
- },
- [
- _c("UserView", {
- attrs: { username: item.username }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("span", { staticClass: "log-text-secondary" }, [
- _vm._v(_vm._s(item.detail))
- ]),
- _vm._v(" "),
- item.other.type == "task" && _vm.taskid == 0
- ? _c(
- "span",
- {
- staticClass: "log-text-link",
- on: {
- click: function($event) {
- return _vm.taskDetail(item.other.id)
- }
- }
- },
- [_vm._v(_vm._s(item.other.title))]
- )
- : _vm._e(),
- _vm._v(" "),
- item.other.type == "username"
- ? _c(
- "span",
- {
- staticClass: "log-text-link",
- on: {
- click: function($event) {
- return _vm.openChat(item.other.username)
- }
- }
- },
- [
- _c("UserView", {
- attrs: { username: item.other.username }
- })
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- item.other.type == "file"
- ? _c(
- "a",
- {
- staticClass: "log-text-link",
- attrs: {
- target: "_blank",
- href: _vm.fileDownUrl(item.other.id)
- }
- },
- [_vm._v(_vm._s(item.other.name))]
- )
- : _vm._e(),
- _vm._v(" "),
- _c("span", { staticClass: "log-text-info" }, [
- _vm._v(
- _vm._s(item.timeData.ymd) +
- " " +
- _vm._s(item.timeData.segment) +
- " " +
- _vm._s(item.timeData.hi)
- )
- ])
- ])
- ])
- }),
- 1
- )
- ],
- 1
- )
- ])
- }),
- _vm._v(" "),
- _vm.loadIng > 0
- ? _c("li", { staticClass: "logs-loading" }, [_c("w-loading")], 1)
- : _vm.hasMorePages
- ? _c(
- "li",
- { staticClass: "logs-more", on: { click: _vm.getMore } },
- [_vm._v(_vm._s(_vm.$L("加载更多")))]
- )
- : _vm.totalNum == 0
- ? _c(
- "li",
- {
- staticClass: "logs-none",
- on: {
- click: function($event) {
- return _vm.getLists(true)
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("没有相关内容")))]
- )
- : _vm._e()
- ],
- 2
- )
- ])
- ])
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-2951ea9e", module.exports)
- }
- }
- /***/ }),
- /* 148 */
- /***/ (function(module, exports, __webpack_require__) {
- var Symbol = __webpack_require__(18);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /** Built-in value references. */
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
- module.exports = getRawTag;
- /***/ }),
- /* 149 */
- /***/ (function(module, exports) {
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
- module.exports = objectToString;
- /***/ }),
- /* 150 */
- /***/ (function(module, exports, __webpack_require__) {
- var Hash = __webpack_require__(151),
- ListCache = __webpack_require__(12),
- Map = __webpack_require__(23);
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
- }
- module.exports = mapCacheClear;
- /***/ }),
- /* 151 */
- /***/ (function(module, exports, __webpack_require__) {
- var hashClear = __webpack_require__(152),
- hashDelete = __webpack_require__(157),
- hashGet = __webpack_require__(158),
- hashHas = __webpack_require__(159),
- hashSet = __webpack_require__(160);
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- // Add methods to `Hash`.
- Hash.prototype.clear = hashClear;
- Hash.prototype['delete'] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- module.exports = Hash;
- /***/ }),
- /* 152 */
- /***/ (function(module, exports, __webpack_require__) {
- var nativeCreate = __webpack_require__(11);
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- module.exports = hashClear;
- /***/ }),
- /* 153 */
- /***/ (function(module, exports, __webpack_require__) {
- var isFunction = __webpack_require__(38),
- isMasked = __webpack_require__(154),
- isObject = __webpack_require__(9),
- toSource = __webpack_require__(39);
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- /** Used for built-in method references. */
- var funcProto = Function.prototype,
- objectProto = Object.prototype;
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- module.exports = baseIsNative;
- /***/ }),
- /* 154 */
- /***/ (function(module, exports, __webpack_require__) {
- var coreJsData = __webpack_require__(155);
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
- module.exports = isMasked;
- /***/ }),
- /* 155 */
- /***/ (function(module, exports, __webpack_require__) {
- var root = __webpack_require__(3);
- /** Used to detect overreaching core-js shims. */
- var coreJsData = root['__core-js_shared__'];
- module.exports = coreJsData;
- /***/ }),
- /* 156 */
- /***/ (function(module, exports) {
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
- module.exports = getValue;
- /***/ }),
- /* 157 */
- /***/ (function(module, exports) {
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
- module.exports = hashDelete;
- /***/ }),
- /* 158 */
- /***/ (function(module, exports, __webpack_require__) {
- var nativeCreate = __webpack_require__(11);
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
- module.exports = hashGet;
- /***/ }),
- /* 159 */
- /***/ (function(module, exports, __webpack_require__) {
- var nativeCreate = __webpack_require__(11);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
- }
- module.exports = hashHas;
- /***/ }),
- /* 160 */
- /***/ (function(module, exports, __webpack_require__) {
- var nativeCreate = __webpack_require__(11);
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
- module.exports = hashSet;
- /***/ }),
- /* 161 */
- /***/ (function(module, exports) {
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- module.exports = listCacheClear;
- /***/ }),
- /* 162 */
- /***/ (function(module, exports, __webpack_require__) {
- var assocIndexOf = __webpack_require__(13);
- /** Used for built-in method references. */
- var arrayProto = Array.prototype;
- /** Built-in value references. */
- var splice = arrayProto.splice;
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- module.exports = listCacheDelete;
- /***/ }),
- /* 163 */
- /***/ (function(module, exports, __webpack_require__) {
- var assocIndexOf = __webpack_require__(13);
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
- return index < 0 ? undefined : data[index][1];
- }
- module.exports = listCacheGet;
- /***/ }),
- /* 164 */
- /***/ (function(module, exports, __webpack_require__) {
- var assocIndexOf = __webpack_require__(13);
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- module.exports = listCacheHas;
- /***/ }),
- /* 165 */
- /***/ (function(module, exports, __webpack_require__) {
- var assocIndexOf = __webpack_require__(13);
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- module.exports = listCacheSet;
- /***/ }),
- /* 166 */
- /***/ (function(module, exports, __webpack_require__) {
- var getMapData = __webpack_require__(14);
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- var result = getMapData(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
- module.exports = mapCacheDelete;
- /***/ }),
- /* 167 */
- /***/ (function(module, exports) {
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
- module.exports = isKeyable;
- /***/ }),
- /* 168 */
- /***/ (function(module, exports, __webpack_require__) {
- var getMapData = __webpack_require__(14);
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- module.exports = mapCacheGet;
- /***/ }),
- /* 169 */
- /***/ (function(module, exports, __webpack_require__) {
- var getMapData = __webpack_require__(14);
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- module.exports = mapCacheHas;
- /***/ }),
- /* 170 */
- /***/ (function(module, exports, __webpack_require__) {
- var getMapData = __webpack_require__(14);
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- var data = getMapData(this, key),
- size = data.size;
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
- module.exports = mapCacheSet;
- /***/ }),
- /* 171 */
- /***/ (function(module, exports, __webpack_require__) {
- var ListCache = __webpack_require__(12);
- /**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
- function stackClear() {
- this.__data__ = new ListCache;
- this.size = 0;
- }
- module.exports = stackClear;
- /***/ }),
- /* 172 */
- /***/ (function(module, exports) {
- /**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
- this.size = data.size;
- return result;
- }
- module.exports = stackDelete;
- /***/ }),
- /* 173 */
- /***/ (function(module, exports) {
- /**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function stackGet(key) {
- return this.__data__.get(key);
- }
- module.exports = stackGet;
- /***/ }),
- /* 174 */
- /***/ (function(module, exports) {
- /**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function stackHas(key) {
- return this.__data__.has(key);
- }
- module.exports = stackHas;
- /***/ }),
- /* 175 */
- /***/ (function(module, exports, __webpack_require__) {
- var ListCache = __webpack_require__(12),
- Map = __webpack_require__(23),
- MapCache = __webpack_require__(54);
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
- /**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- module.exports = stackSet;
- /***/ }),
- /* 176 */
- /***/ (function(module, exports) {
- /**
- * A specialized version of `_.filter` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- module.exports = arrayFilter;
- /***/ }),
- /* 177 */
- /***/ (function(module, exports) {
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- module.exports = baseTimes;
- /***/ }),
- /* 178 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseGetTag = __webpack_require__(10),
- isObjectLike = __webpack_require__(8);
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]';
- /**
- * The base implementation of `_.isArguments`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- */
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- module.exports = baseIsArguments;
- /***/ }),
- /* 179 */
- /***/ (function(module, exports) {
- /**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
- function stubFalse() {
- return false;
- }
- module.exports = stubFalse;
- /***/ }),
- /* 180 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseGetTag = __webpack_require__(10),
- isLength = __webpack_require__(35),
- isObjectLike = __webpack_require__(8);
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
- typedArrayTags[weakMapTag] = false;
- /**
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- */
- function baseIsTypedArray(value) {
- return isObjectLike(value) &&
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- module.exports = baseIsTypedArray;
- /***/ }),
- /* 181 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototype = __webpack_require__(27),
- nativeKeys = __webpack_require__(182);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
- module.exports = baseKeys;
- /***/ }),
- /* 182 */
- /***/ (function(module, exports, __webpack_require__) {
- var overArg = __webpack_require__(44);
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeKeys = overArg(Object.keys, Object);
- module.exports = nativeKeys;
- /***/ }),
- /* 183 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5),
- root = __webpack_require__(3);
- /* Built-in method references that are verified to be native. */
- var DataView = getNative(root, 'DataView');
- module.exports = DataView;
- /***/ }),
- /* 184 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5),
- root = __webpack_require__(3);
- /* Built-in method references that are verified to be native. */
- var Promise = getNative(root, 'Promise');
- module.exports = Promise;
- /***/ }),
- /* 185 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5),
- root = __webpack_require__(3);
- /* Built-in method references that are verified to be native. */
- var Set = getNative(root, 'Set');
- module.exports = Set;
- /***/ }),
- /* 186 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5),
- root = __webpack_require__(3);
- /* Built-in method references that are verified to be native. */
- var WeakMap = getNative(root, 'WeakMap');
- module.exports = WeakMap;
- /***/ }),
- /* 187 */
- /***/ (function(module, exports) {
- /**
- * When source maps are enabled, `style-loader` uses a link element with a data-uri to
- * embed the css on the page. This breaks all relative urls because now they are relative to a
- * bundle instead of the current page.
- *
- * One solution is to only use full urls, but that may be impossible.
- *
- * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
- *
- * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
- *
- */
- module.exports = function (css) {
- // get current location
- var location = typeof window !== "undefined" && window.location;
- if (!location) {
- throw new Error("fixUrls requires window.location");
- }
- // blank or null?
- if (!css || typeof css !== "string") {
- return css;
- }
- var baseUrl = location.protocol + "//" + location.host;
- var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
- // convert each url(...)
- /*
- This regular expression is just a way to recursively match brackets within
- a string.
- /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
- ( = Start a capturing group
- (?: = Start a non-capturing group
- [^)(] = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- (?: = Start another non-capturing groups
- [^)(]+ = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- [^)(]* = Match anything that isn't a parentheses
- \) = Match a end parentheses
- ) = End Group
- *\) = Match anything and then a close parens
- ) = Close non-capturing group
- * = Match anything
- ) = Close capturing group
- \) = Match a close parens
- /gi = Get all matches, not the first. Be case insensitive.
- */
- var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
- // strip quotes (if they exist)
- var unquotedOrigUrl = origUrl
- .trim()
- .replace(/^"(.*)"$/, function(o, $1){ return $1; })
- .replace(/^'(.*)'$/, function(o, $1){ return $1; });
- // already a full url? no change
- if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
- return fullMatch;
- }
- // convert the url to a full url
- var newUrl;
- if (unquotedOrigUrl.indexOf("//") === 0) {
- //TODO: should we add protocol?
- newUrl = unquotedOrigUrl;
- } else if (unquotedOrigUrl.indexOf("/") === 0) {
- // path should be relative to the base url
- newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
- } else {
- // path should be relative to current directory
- newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
- }
- // send back the fixed url(...)
- return "url(" + JSON.stringify(newUrl) + ")";
- });
- // send back the fixed css
- return fixedCss;
- };
- /***/ }),
- /* 188 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(189);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("6a9f6baf", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1fd3fc13\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./content.vue", function() {
- var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1fd3fc13\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./content.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 189 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.report-content[data-v-1fd3fc13] {\n background: 0 0;\n border: 0;\n float: none;\n margin: 6px 0;\n max-width: none;\n outline: 0;\n padding: 0;\n position: static;\n width: 100%;\n}\n", ""]);
- // exports
- /***/ }),
- /* 190 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /**
- * 预览内容
- */
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'ReportContent',
- props: {
- content: {
- default: ''
- }
- },
- data: function data() {
- return {
- contentHeight: 50
- };
- },
- mounted: function mounted() {
- this.setContent(this.content);
- },
- watch: {
- content: function content(val) {
- this.setContent(val);
- }
- },
- methods: {
- setContent: function setContent(val) {
- var _this = this;
- if (!this.$el.contentWindow) {
- return;
- }
- var $d = this.$el.contentWindow.document;
- $A("body", $d).html('<link type="text/css" rel="stylesheet" href="' + window.location.origin + '/js/build/skins/ui/oxide/content.min.css"><style>html,body{padding:0;margin:0}</style><div id="content">' + val + '</div>');
- this.$nextTick(function () {
- _this.contentHeight = $d.getElementById("content").scrollHeight;
- });
- }
- }
- });
- /***/ }),
- /* 191 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c("iframe", {
- staticClass: "report-content",
- style: { height: _vm.contentHeight + "px" }
- })
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-1fd3fc13", module.exports)
- }
- }
- /***/ }),
- /* 192 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /*!
- * vue-router v3.5.3
- * (c) 2021 Evan You
- * @license MIT
- */
- /* */
- function assert (condition, message) {
- if (!condition) {
- throw new Error(("[vue-router] " + message))
- }
- }
- function warn (condition, message) {
- if (!condition) {
- typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
- }
- }
- function extend (a, b) {
- for (var key in b) {
- a[key] = b[key];
- }
- return a
- }
- /* */
- var encodeReserveRE = /[!'()*]/g;
- var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
- var commaRE = /%2C/g;
- // fixed encodeURIComponent which is more conformant to RFC3986:
- // - escapes [!'()*]
- // - preserve commas
- var encode = function (str) { return encodeURIComponent(str)
- .replace(encodeReserveRE, encodeReserveReplacer)
- .replace(commaRE, ','); };
- function decode (str) {
- try {
- return decodeURIComponent(str)
- } catch (err) {
- if (true) {
- warn(false, ("Error decoding \"" + str + "\". Leaving it intact."));
- }
- }
- return str
- }
- function resolveQuery (
- query,
- extraQuery,
- _parseQuery
- ) {
- if ( extraQuery === void 0 ) extraQuery = {};
- var parse = _parseQuery || parseQuery;
- var parsedQuery;
- try {
- parsedQuery = parse(query || '');
- } catch (e) {
- "development" !== 'production' && warn(false, e.message);
- parsedQuery = {};
- }
- for (var key in extraQuery) {
- var value = extraQuery[key];
- parsedQuery[key] = Array.isArray(value)
- ? value.map(castQueryParamValue)
- : castQueryParamValue(value);
- }
- return parsedQuery
- }
- var castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };
- function parseQuery (query) {
- var res = {};
- query = query.trim().replace(/^(\?|#|&)/, '');
- if (!query) {
- return res
- }
- query.split('&').forEach(function (param) {
- var parts = param.replace(/\+/g, ' ').split('=');
- var key = decode(parts.shift());
- var val = parts.length > 0 ? decode(parts.join('=')) : null;
- if (res[key] === undefined) {
- res[key] = val;
- } else if (Array.isArray(res[key])) {
- res[key].push(val);
- } else {
- res[key] = [res[key], val];
- }
- });
- return res
- }
- function stringifyQuery (obj) {
- var res = obj
- ? Object.keys(obj)
- .map(function (key) {
- var val = obj[key];
- if (val === undefined) {
- return ''
- }
- if (val === null) {
- return encode(key)
- }
- if (Array.isArray(val)) {
- var result = [];
- val.forEach(function (val2) {
- if (val2 === undefined) {
- return
- }
- if (val2 === null) {
- result.push(encode(key));
- } else {
- result.push(encode(key) + '=' + encode(val2));
- }
- });
- return result.join('&')
- }
- return encode(key) + '=' + encode(val)
- })
- .filter(function (x) { return x.length > 0; })
- .join('&')
- : null;
- return res ? ("?" + res) : ''
- }
- /* */
- var trailingSlashRE = /\/?$/;
- function createRoute (
- record,
- location,
- redirectedFrom,
- router
- ) {
- var stringifyQuery = router && router.options.stringifyQuery;
- var query = location.query || {};
- try {
- query = clone(query);
- } catch (e) {}
- var route = {
- name: location.name || (record && record.name),
- meta: (record && record.meta) || {},
- path: location.path || '/',
- hash: location.hash || '',
- query: query,
- params: location.params || {},
- fullPath: getFullPath(location, stringifyQuery),
- matched: record ? formatMatch(record) : []
- };
- if (redirectedFrom) {
- route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);
- }
- return Object.freeze(route)
- }
- function clone (value) {
- if (Array.isArray(value)) {
- return value.map(clone)
- } else if (value && typeof value === 'object') {
- var res = {};
- for (var key in value) {
- res[key] = clone(value[key]);
- }
- return res
- } else {
- return value
- }
- }
- // the starting route that represents the initial state
- var START = createRoute(null, {
- path: '/'
- });
- function formatMatch (record) {
- var res = [];
- while (record) {
- res.unshift(record);
- record = record.parent;
- }
- return res
- }
- function getFullPath (
- ref,
- _stringifyQuery
- ) {
- var path = ref.path;
- var query = ref.query; if ( query === void 0 ) query = {};
- var hash = ref.hash; if ( hash === void 0 ) hash = '';
- var stringify = _stringifyQuery || stringifyQuery;
- return (path || '/') + stringify(query) + hash
- }
- function isSameRoute (a, b, onlyPath) {
- if (b === START) {
- return a === b
- } else if (!b) {
- return false
- } else if (a.path && b.path) {
- return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||
- a.hash === b.hash &&
- isObjectEqual(a.query, b.query))
- } else if (a.name && b.name) {
- return (
- a.name === b.name &&
- (onlyPath || (
- a.hash === b.hash &&
- isObjectEqual(a.query, b.query) &&
- isObjectEqual(a.params, b.params))
- )
- )
- } else {
- return false
- }
- }
- function isObjectEqual (a, b) {
- if ( a === void 0 ) a = {};
- if ( b === void 0 ) b = {};
- // handle null value #1566
- if (!a || !b) { return a === b }
- var aKeys = Object.keys(a).sort();
- var bKeys = Object.keys(b).sort();
- if (aKeys.length !== bKeys.length) {
- return false
- }
- return aKeys.every(function (key, i) {
- var aVal = a[key];
- var bKey = bKeys[i];
- if (bKey !== key) { return false }
- var bVal = b[key];
- // query values can be null and undefined
- if (aVal == null || bVal == null) { return aVal === bVal }
- // check nested equality
- if (typeof aVal === 'object' && typeof bVal === 'object') {
- return isObjectEqual(aVal, bVal)
- }
- return String(aVal) === String(bVal)
- })
- }
- function isIncludedRoute (current, target) {
- return (
- current.path.replace(trailingSlashRE, '/').indexOf(
- target.path.replace(trailingSlashRE, '/')
- ) === 0 &&
- (!target.hash || current.hash === target.hash) &&
- queryIncludes(current.query, target.query)
- )
- }
- function queryIncludes (current, target) {
- for (var key in target) {
- if (!(key in current)) {
- return false
- }
- }
- return true
- }
- function handleRouteEntered (route) {
- for (var i = 0; i < route.matched.length; i++) {
- var record = route.matched[i];
- for (var name in record.instances) {
- var instance = record.instances[name];
- var cbs = record.enteredCbs[name];
- if (!instance || !cbs) { continue }
- delete record.enteredCbs[name];
- for (var i$1 = 0; i$1 < cbs.length; i$1++) {
- if (!instance._isBeingDestroyed) { cbs[i$1](instance); }
- }
- }
- }
- }
- var View = {
- name: 'RouterView',
- functional: true,
- props: {
- name: {
- type: String,
- default: 'default'
- }
- },
- render: function render (_, ref) {
- var props = ref.props;
- var children = ref.children;
- var parent = ref.parent;
- var data = ref.data;
- // used by devtools to display a router-view badge
- data.routerView = true;
- // directly use parent context's createElement() function
- // so that components rendered by router-view can resolve named slots
- var h = parent.$createElement;
- var name = props.name;
- var route = parent.$route;
- var cache = parent._routerViewCache || (parent._routerViewCache = {});
- // determine current view depth, also check to see if the tree
- // has been toggled inactive but kept-alive.
- var depth = 0;
- var inactive = false;
- while (parent && parent._routerRoot !== parent) {
- var vnodeData = parent.$vnode ? parent.$vnode.data : {};
- if (vnodeData.routerView) {
- depth++;
- }
- if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
- inactive = true;
- }
- parent = parent.$parent;
- }
- data.routerViewDepth = depth;
- // render previous view if the tree is inactive and kept-alive
- if (inactive) {
- var cachedData = cache[name];
- var cachedComponent = cachedData && cachedData.component;
- if (cachedComponent) {
- // #2301
- // pass props
- if (cachedData.configProps) {
- fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);
- }
- return h(cachedComponent, data, children)
- } else {
- // render previous empty view
- return h()
- }
- }
- var matched = route.matched[depth];
- var component = matched && matched.components[name];
- // render empty node if no matched route or no config component
- if (!matched || !component) {
- cache[name] = null;
- return h()
- }
- // cache component
- cache[name] = { component: component };
- // attach instance registration hook
- // this will be called in the instance's injected lifecycle hooks
- data.registerRouteInstance = function (vm, val) {
- // val could be undefined for unregistration
- var current = matched.instances[name];
- if (
- (val && current !== vm) ||
- (!val && current === vm)
- ) {
- matched.instances[name] = val;
- }
- }
- // also register instance in prepatch hook
- // in case the same component instance is reused across different routes
- ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {
- matched.instances[name] = vnode.componentInstance;
- };
- // register instance in init hook
- // in case kept-alive component be actived when routes changed
- data.hook.init = function (vnode) {
- if (vnode.data.keepAlive &&
- vnode.componentInstance &&
- vnode.componentInstance !== matched.instances[name]
- ) {
- matched.instances[name] = vnode.componentInstance;
- }
- // if the route transition has already been confirmed then we weren't
- // able to call the cbs during confirmation as the component was not
- // registered yet, so we call it here.
- handleRouteEntered(route);
- };
- var configProps = matched.props && matched.props[name];
- // save route and configProps in cache
- if (configProps) {
- extend(cache[name], {
- route: route,
- configProps: configProps
- });
- fillPropsinData(component, data, route, configProps);
- }
- return h(component, data, children)
- }
- };
- function fillPropsinData (component, data, route, configProps) {
- // resolve props
- var propsToPass = data.props = resolveProps(route, configProps);
- if (propsToPass) {
- // clone to prevent mutation
- propsToPass = data.props = extend({}, propsToPass);
- // pass non-declared props as attrs
- var attrs = data.attrs = data.attrs || {};
- for (var key in propsToPass) {
- if (!component.props || !(key in component.props)) {
- attrs[key] = propsToPass[key];
- delete propsToPass[key];
- }
- }
- }
- }
- function resolveProps (route, config) {
- switch (typeof config) {
- case 'undefined':
- return
- case 'object':
- return config
- case 'function':
- return config(route)
- case 'boolean':
- return config ? route.params : undefined
- default:
- if (true) {
- warn(
- false,
- "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " +
- "expecting an object, function or boolean."
- );
- }
- }
- }
- /* */
- function resolvePath (
- relative,
- base,
- append
- ) {
- var firstChar = relative.charAt(0);
- if (firstChar === '/') {
- return relative
- }
- if (firstChar === '?' || firstChar === '#') {
- return base + relative
- }
- var stack = base.split('/');
- // remove trailing segment if:
- // - not appending
- // - appending to trailing slash (last segment is empty)
- if (!append || !stack[stack.length - 1]) {
- stack.pop();
- }
- // resolve relative path
- var segments = relative.replace(/^\//, '').split('/');
- for (var i = 0; i < segments.length; i++) {
- var segment = segments[i];
- if (segment === '..') {
- stack.pop();
- } else if (segment !== '.') {
- stack.push(segment);
- }
- }
- // ensure leading slash
- if (stack[0] !== '') {
- stack.unshift('');
- }
- return stack.join('/')
- }
- function parsePath (path) {
- var hash = '';
- var query = '';
- var hashIndex = path.indexOf('#');
- if (hashIndex >= 0) {
- hash = path.slice(hashIndex);
- path = path.slice(0, hashIndex);
- }
- var queryIndex = path.indexOf('?');
- if (queryIndex >= 0) {
- query = path.slice(queryIndex + 1);
- path = path.slice(0, queryIndex);
- }
- return {
- path: path,
- query: query,
- hash: hash
- }
- }
- function cleanPath (path) {
- return path.replace(/\/+/g, '/')
- }
- var isarray = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
- };
- /**
- * Expose `pathToRegexp`.
- */
- var pathToRegexp_1 = pathToRegexp;
- var parse_1 = parse;
- var compile_1 = compile;
- var tokensToFunction_1 = tokensToFunction;
- var tokensToRegExp_1 = tokensToRegExp;
- /**
- * The main path matching regexp utility.
- *
- * @type {RegExp}
- */
- var PATH_REGEXP = new RegExp([
- // Match escaped characters that would otherwise appear in future matches.
- // This allows the user to escape special characters that won't transform.
- '(\\\\.)',
- // Match Express-style parameters and un-named parameters with a prefix
- // and optional suffixes. Matches appear as:
- //
- // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
- // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
- // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
- '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
- ].join('|'), 'g');
- /**
- * Parse a string for the raw tokens.
- *
- * @param {string} str
- * @param {Object=} options
- * @return {!Array}
- */
- function parse (str, options) {
- var tokens = [];
- var key = 0;
- var index = 0;
- var path = '';
- var defaultDelimiter = options && options.delimiter || '/';
- var res;
- while ((res = PATH_REGEXP.exec(str)) != null) {
- var m = res[0];
- var escaped = res[1];
- var offset = res.index;
- path += str.slice(index, offset);
- index = offset + m.length;
- // Ignore already escaped sequences.
- if (escaped) {
- path += escaped[1];
- continue
- }
- var next = str[index];
- var prefix = res[2];
- var name = res[3];
- var capture = res[4];
- var group = res[5];
- var modifier = res[6];
- var asterisk = res[7];
- // Push the current path onto the tokens.
- if (path) {
- tokens.push(path);
- path = '';
- }
- var partial = prefix != null && next != null && next !== prefix;
- var repeat = modifier === '+' || modifier === '*';
- var optional = modifier === '?' || modifier === '*';
- var delimiter = res[2] || defaultDelimiter;
- var pattern = capture || group;
- tokens.push({
- name: name || key++,
- prefix: prefix || '',
- delimiter: delimiter,
- optional: optional,
- repeat: repeat,
- partial: partial,
- asterisk: !!asterisk,
- pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
- });
- }
- // Match any characters still remaining.
- if (index < str.length) {
- path += str.substr(index);
- }
- // If the path exists, push it onto the end.
- if (path) {
- tokens.push(path);
- }
- return tokens
- }
- /**
- * Compile a string to a template function for the path.
- *
- * @param {string} str
- * @param {Object=} options
- * @return {!function(Object=, Object=)}
- */
- function compile (str, options) {
- return tokensToFunction(parse(str, options), options)
- }
- /**
- * Prettier encoding of URI path segments.
- *
- * @param {string}
- * @return {string}
- */
- function encodeURIComponentPretty (str) {
- return encodeURI(str).replace(/[\/?#]/g, function (c) {
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
- })
- }
- /**
- * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
- *
- * @param {string}
- * @return {string}
- */
- function encodeAsterisk (str) {
- return encodeURI(str).replace(/[?#]/g, function (c) {
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
- })
- }
- /**
- * Expose a method for transforming tokens into the path function.
- */
- function tokensToFunction (tokens, options) {
- // Compile all the tokens into regexps.
- var matches = new Array(tokens.length);
- // Compile all the patterns before compilation.
- for (var i = 0; i < tokens.length; i++) {
- if (typeof tokens[i] === 'object') {
- matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
- }
- }
- return function (obj, opts) {
- var path = '';
- var data = obj || {};
- var options = opts || {};
- var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (typeof token === 'string') {
- path += token;
- continue
- }
- var value = data[token.name];
- var segment;
- if (value == null) {
- if (token.optional) {
- // Prepend partial segment prefixes.
- if (token.partial) {
- path += token.prefix;
- }
- continue
- } else {
- throw new TypeError('Expected "' + token.name + '" to be defined')
- }
- }
- if (isarray(value)) {
- if (!token.repeat) {
- throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
- }
- if (value.length === 0) {
- if (token.optional) {
- continue
- } else {
- throw new TypeError('Expected "' + token.name + '" to not be empty')
- }
- }
- for (var j = 0; j < value.length; j++) {
- segment = encode(value[j]);
- if (!matches[i].test(segment)) {
- throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
- }
- path += (j === 0 ? token.prefix : token.delimiter) + segment;
- }
- continue
- }
- segment = token.asterisk ? encodeAsterisk(value) : encode(value);
- if (!matches[i].test(segment)) {
- throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
- }
- path += token.prefix + segment;
- }
- return path
- }
- }
- /**
- * Escape a regular expression string.
- *
- * @param {string} str
- * @return {string}
- */
- function escapeString (str) {
- return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
- }
- /**
- * Escape the capturing group by escaping special characters and meaning.
- *
- * @param {string} group
- * @return {string}
- */
- function escapeGroup (group) {
- return group.replace(/([=!:$\/()])/g, '\\$1')
- }
- /**
- * Attach the keys as a property of the regexp.
- *
- * @param {!RegExp} re
- * @param {Array} keys
- * @return {!RegExp}
- */
- function attachKeys (re, keys) {
- re.keys = keys;
- return re
- }
- /**
- * Get the flags for a regexp from the options.
- *
- * @param {Object} options
- * @return {string}
- */
- function flags (options) {
- return options && options.sensitive ? '' : 'i'
- }
- /**
- * Pull out keys from a regexp.
- *
- * @param {!RegExp} path
- * @param {!Array} keys
- * @return {!RegExp}
- */
- function regexpToRegexp (path, keys) {
- // Use a negative lookahead to match only capturing groups.
- var groups = path.source.match(/\((?!\?)/g);
- if (groups) {
- for (var i = 0; i < groups.length; i++) {
- keys.push({
- name: i,
- prefix: null,
- delimiter: null,
- optional: false,
- repeat: false,
- partial: false,
- asterisk: false,
- pattern: null
- });
- }
- }
- return attachKeys(path, keys)
- }
- /**
- * Transform an array into a regexp.
- *
- * @param {!Array} path
- * @param {Array} keys
- * @param {!Object} options
- * @return {!RegExp}
- */
- function arrayToRegexp (path, keys, options) {
- var parts = [];
- for (var i = 0; i < path.length; i++) {
- parts.push(pathToRegexp(path[i], keys, options).source);
- }
- var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
- return attachKeys(regexp, keys)
- }
- /**
- * Create a path regexp from string input.
- *
- * @param {string} path
- * @param {!Array} keys
- * @param {!Object} options
- * @return {!RegExp}
- */
- function stringToRegexp (path, keys, options) {
- return tokensToRegExp(parse(path, options), keys, options)
- }
- /**
- * Expose a function for taking tokens and returning a RegExp.
- *
- * @param {!Array} tokens
- * @param {(Array|Object)=} keys
- * @param {Object=} options
- * @return {!RegExp}
- */
- function tokensToRegExp (tokens, keys, options) {
- if (!isarray(keys)) {
- options = /** @type {!Object} */ (keys || options);
- keys = [];
- }
- options = options || {};
- var strict = options.strict;
- var end = options.end !== false;
- var route = '';
- // Iterate over the tokens and create our regexp string.
- for (var i = 0; i < tokens.length; i++) {
- var token = tokens[i];
- if (typeof token === 'string') {
- route += escapeString(token);
- } else {
- var prefix = escapeString(token.prefix);
- var capture = '(?:' + token.pattern + ')';
- keys.push(token);
- if (token.repeat) {
- capture += '(?:' + prefix + capture + ')*';
- }
- if (token.optional) {
- if (!token.partial) {
- capture = '(?:' + prefix + '(' + capture + '))?';
- } else {
- capture = prefix + '(' + capture + ')?';
- }
- } else {
- capture = prefix + '(' + capture + ')';
- }
- route += capture;
- }
- }
- var delimiter = escapeString(options.delimiter || '/');
- var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
- // In non-strict mode we allow a slash at the end of match. If the path to
- // match already ends with a slash, we remove it for consistency. The slash
- // is valid at the end of a path match, not in the middle. This is important
- // in non-ending mode, where "/test/" shouldn't match "/test//route".
- if (!strict) {
- route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
- }
- if (end) {
- route += '$';
- } else {
- // In non-ending mode, we need the capturing groups to match as much as
- // possible by using a positive lookahead to the end or next path segment.
- route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
- }
- return attachKeys(new RegExp('^' + route, flags(options)), keys)
- }
- /**
- * Normalize the given path string, returning a regular expression.
- *
- * An empty array can be passed in for the keys, which will hold the
- * placeholder key descriptions. For example, using `/user/:id`, `keys` will
- * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
- *
- * @param {(string|RegExp|Array)} path
- * @param {(Array|Object)=} keys
- * @param {Object=} options
- * @return {!RegExp}
- */
- function pathToRegexp (path, keys, options) {
- if (!isarray(keys)) {
- options = /** @type {!Object} */ (keys || options);
- keys = [];
- }
- options = options || {};
- if (path instanceof RegExp) {
- return regexpToRegexp(path, /** @type {!Array} */ (keys))
- }
- if (isarray(path)) {
- return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
- }
- return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
- }
- pathToRegexp_1.parse = parse_1;
- pathToRegexp_1.compile = compile_1;
- pathToRegexp_1.tokensToFunction = tokensToFunction_1;
- pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
- /* */
- // $flow-disable-line
- var regexpCompileCache = Object.create(null);
- function fillParams (
- path,
- params,
- routeMsg
- ) {
- params = params || {};
- try {
- var filler =
- regexpCompileCache[path] ||
- (regexpCompileCache[path] = pathToRegexp_1.compile(path));
- // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
- // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string
- if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }
- return filler(params, { pretty: true })
- } catch (e) {
- if (true) {
- // Fix #3072 no warn if `pathMatch` is string
- warn(typeof params.pathMatch === 'string', ("missing param for " + routeMsg + ": " + (e.message)));
- }
- return ''
- } finally {
- // delete the 0 if it was added
- delete params[0];
- }
- }
- /* */
- function normalizeLocation (
- raw,
- current,
- append,
- router
- ) {
- var next = typeof raw === 'string' ? { path: raw } : raw;
- // named target
- if (next._normalized) {
- return next
- } else if (next.name) {
- next = extend({}, raw);
- var params = next.params;
- if (params && typeof params === 'object') {
- next.params = extend({}, params);
- }
- return next
- }
- // relative params
- if (!next.path && next.params && current) {
- next = extend({}, next);
- next._normalized = true;
- var params$1 = extend(extend({}, current.params), next.params);
- if (current.name) {
- next.name = current.name;
- next.params = params$1;
- } else if (current.matched.length) {
- var rawPath = current.matched[current.matched.length - 1].path;
- next.path = fillParams(rawPath, params$1, ("path " + (current.path)));
- } else if (true) {
- warn(false, "relative params navigation requires a current route.");
- }
- return next
- }
- var parsedPath = parsePath(next.path || '');
- var basePath = (current && current.path) || '/';
- var path = parsedPath.path
- ? resolvePath(parsedPath.path, basePath, append || next.append)
- : basePath;
- var query = resolveQuery(
- parsedPath.query,
- next.query,
- router && router.options.parseQuery
- );
- var hash = next.hash || parsedPath.hash;
- if (hash && hash.charAt(0) !== '#') {
- hash = "#" + hash;
- }
- return {
- _normalized: true,
- path: path,
- query: query,
- hash: hash
- }
- }
- /* */
- // work around weird flow bug
- var toTypes = [String, Object];
- var eventTypes = [String, Array];
- var noop = function () {};
- var warnedCustomSlot;
- var warnedTagProp;
- var warnedEventProp;
- var Link = {
- name: 'RouterLink',
- props: {
- to: {
- type: toTypes,
- required: true
- },
- tag: {
- type: String,
- default: 'a'
- },
- custom: Boolean,
- exact: Boolean,
- exactPath: Boolean,
- append: Boolean,
- replace: Boolean,
- activeClass: String,
- exactActiveClass: String,
- ariaCurrentValue: {
- type: String,
- default: 'page'
- },
- event: {
- type: eventTypes,
- default: 'click'
- }
- },
- render: function render (h) {
- var this$1 = this;
- var router = this.$router;
- var current = this.$route;
- var ref = router.resolve(
- this.to,
- current,
- this.append
- );
- var location = ref.location;
- var route = ref.route;
- var href = ref.href;
- var classes = {};
- var globalActiveClass = router.options.linkActiveClass;
- var globalExactActiveClass = router.options.linkExactActiveClass;
- // Support global empty active class
- var activeClassFallback =
- globalActiveClass == null ? 'router-link-active' : globalActiveClass;
- var exactActiveClassFallback =
- globalExactActiveClass == null
- ? 'router-link-exact-active'
- : globalExactActiveClass;
- var activeClass =
- this.activeClass == null ? activeClassFallback : this.activeClass;
- var exactActiveClass =
- this.exactActiveClass == null
- ? exactActiveClassFallback
- : this.exactActiveClass;
- var compareTarget = route.redirectedFrom
- ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)
- : route;
- classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);
- classes[activeClass] = this.exact || this.exactPath
- ? classes[exactActiveClass]
- : isIncludedRoute(current, compareTarget);
- var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;
- var handler = function (e) {
- if (guardEvent(e)) {
- if (this$1.replace) {
- router.replace(location, noop);
- } else {
- router.push(location, noop);
- }
- }
- };
- var on = { click: guardEvent };
- if (Array.isArray(this.event)) {
- this.event.forEach(function (e) {
- on[e] = handler;
- });
- } else {
- on[this.event] = handler;
- }
- var data = { class: classes };
- var scopedSlot =
- !this.$scopedSlots.$hasNormal &&
- this.$scopedSlots.default &&
- this.$scopedSlots.default({
- href: href,
- route: route,
- navigate: handler,
- isActive: classes[activeClass],
- isExactActive: classes[exactActiveClass]
- });
- if (scopedSlot) {
- if ("development" !== 'production' && !this.custom) {
- !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an <a> element. Use the custom prop to remove this warning:\n<router-link v-slot="{ navigate, href }" custom></router-link>\n');
- warnedCustomSlot = true;
- }
- if (scopedSlot.length === 1) {
- return scopedSlot[0]
- } else if (scopedSlot.length > 1 || !scopedSlot.length) {
- if (true) {
- warn(
- false,
- ("<router-link> with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.")
- );
- }
- return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)
- }
- }
- if (true) {
- if ('tag' in this.$options.propsData && !warnedTagProp) {
- warn(
- false,
- "<router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link."
- );
- warnedTagProp = true;
- }
- if ('event' in this.$options.propsData && !warnedEventProp) {
- warn(
- false,
- "<router-link>'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link."
- );
- warnedEventProp = true;
- }
- }
- if (this.tag === 'a') {
- data.on = on;
- data.attrs = { href: href, 'aria-current': ariaCurrentValue };
- } else {
- // find the first <a> child and apply listener and href
- var a = findAnchor(this.$slots.default);
- if (a) {
- // in case the <a> is a static node
- a.isStatic = false;
- var aData = (a.data = extend({}, a.data));
- aData.on = aData.on || {};
- // transform existing events in both objects into arrays so we can push later
- for (var event in aData.on) {
- var handler$1 = aData.on[event];
- if (event in on) {
- aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];
- }
- }
- // append new listeners for router-link
- for (var event$1 in on) {
- if (event$1 in aData.on) {
- // on[event] is always a function
- aData.on[event$1].push(on[event$1]);
- } else {
- aData.on[event$1] = handler;
- }
- }
- var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
- aAttrs.href = href;
- aAttrs['aria-current'] = ariaCurrentValue;
- } else {
- // doesn't have <a> child, apply listener to self
- data.on = on;
- }
- }
- return h(this.tag, data, this.$slots.default)
- }
- };
- function guardEvent (e) {
- // don't redirect with control keys
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }
- // don't redirect when preventDefault called
- if (e.defaultPrevented) { return }
- // don't redirect on right click
- if (e.button !== undefined && e.button !== 0) { return }
- // don't redirect if `target="_blank"`
- if (e.currentTarget && e.currentTarget.getAttribute) {
- var target = e.currentTarget.getAttribute('target');
- if (/\b_blank\b/i.test(target)) { return }
- }
- // this may be a Weex event which doesn't have this method
- if (e.preventDefault) {
- e.preventDefault();
- }
- return true
- }
- function findAnchor (children) {
- if (children) {
- var child;
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- if (child.tag === 'a') {
- return child
- }
- if (child.children && (child = findAnchor(child.children))) {
- return child
- }
- }
- }
- }
- var _Vue;
- function install (Vue) {
- if (install.installed && _Vue === Vue) { return }
- install.installed = true;
- _Vue = Vue;
- var isDef = function (v) { return v !== undefined; };
- var registerInstance = function (vm, callVal) {
- var i = vm.$options._parentVnode;
- if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
- i(vm, callVal);
- }
- };
- Vue.mixin({
- beforeCreate: function beforeCreate () {
- if (isDef(this.$options.router)) {
- this._routerRoot = this;
- this._router = this.$options.router;
- this._router.init(this);
- Vue.util.defineReactive(this, '_route', this._router.history.current);
- } else {
- this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;
- }
- registerInstance(this, this);
- },
- destroyed: function destroyed () {
- registerInstance(this);
- }
- });
- Object.defineProperty(Vue.prototype, '$router', {
- get: function get () { return this._routerRoot._router }
- });
- Object.defineProperty(Vue.prototype, '$route', {
- get: function get () { return this._routerRoot._route }
- });
- Vue.component('RouterView', View);
- Vue.component('RouterLink', Link);
- var strats = Vue.config.optionMergeStrategies;
- // use the same hook merging strategy for route hooks
- strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;
- }
- /* */
- var inBrowser = typeof window !== 'undefined';
- /* */
- function createRouteMap (
- routes,
- oldPathList,
- oldPathMap,
- oldNameMap,
- parentRoute
- ) {
- // the path list is used to control path matching priority
- var pathList = oldPathList || [];
- // $flow-disable-line
- var pathMap = oldPathMap || Object.create(null);
- // $flow-disable-line
- var nameMap = oldNameMap || Object.create(null);
- routes.forEach(function (route) {
- addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);
- });
- // ensure wildcard routes are always at the end
- for (var i = 0, l = pathList.length; i < l; i++) {
- if (pathList[i] === '*') {
- pathList.push(pathList.splice(i, 1)[0]);
- l--;
- i--;
- }
- }
- if (true) {
- // warn if routes do not include leading slashes
- var found = pathList
- // check for missing leading slash
- .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });
- if (found.length > 0) {
- var pathNames = found.map(function (path) { return ("- " + path); }).join('\n');
- warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames));
- }
- }
- return {
- pathList: pathList,
- pathMap: pathMap,
- nameMap: nameMap
- }
- }
- function addRouteRecord (
- pathList,
- pathMap,
- nameMap,
- route,
- parent,
- matchAs
- ) {
- var path = route.path;
- var name = route.name;
- if (true) {
- assert(path != null, "\"path\" is required in a route configuration.");
- assert(
- typeof route.component !== 'string',
- "route config \"component\" for path: " + (String(
- path || name
- )) + " cannot be a " + "string id. Use an actual component instead."
- );
- warn(
- // eslint-disable-next-line no-control-regex
- !/[^\u0000-\u007F]+/.test(path),
- "Route with path \"" + path + "\" contains unencoded characters, make sure " +
- "your path is correctly encoded before passing it to the router. Use " +
- "encodeURI to encode static segments of your path."
- );
- }
- var pathToRegexpOptions =
- route.pathToRegexpOptions || {};
- var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);
- if (typeof route.caseSensitive === 'boolean') {
- pathToRegexpOptions.sensitive = route.caseSensitive;
- }
- var record = {
- path: normalizedPath,
- regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
- components: route.components || { default: route.component },
- alias: route.alias
- ? typeof route.alias === 'string'
- ? [route.alias]
- : route.alias
- : [],
- instances: {},
- enteredCbs: {},
- name: name,
- parent: parent,
- matchAs: matchAs,
- redirect: route.redirect,
- beforeEnter: route.beforeEnter,
- meta: route.meta || {},
- props:
- route.props == null
- ? {}
- : route.components
- ? route.props
- : { default: route.props }
- };
- if (route.children) {
- // Warn if route is named, does not redirect and has a default child route.
- // If users navigate to this route by name, the default child will
- // not be rendered (GH Issue #629)
- if (true) {
- if (
- route.name &&
- !route.redirect &&
- route.children.some(function (child) { return /^\/?$/.test(child.path); })
- ) {
- warn(
- false,
- "Named Route '" + (route.name) + "' has a default child route. " +
- "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
- "the default child route will not be rendered. Remove the name from " +
- "this route and use the name of the default child route for named " +
- "links instead."
- );
- }
- }
- route.children.forEach(function (child) {
- var childMatchAs = matchAs
- ? cleanPath((matchAs + "/" + (child.path)))
- : undefined;
- addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);
- });
- }
- if (!pathMap[record.path]) {
- pathList.push(record.path);
- pathMap[record.path] = record;
- }
- if (route.alias !== undefined) {
- var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];
- for (var i = 0; i < aliases.length; ++i) {
- var alias = aliases[i];
- if ("development" !== 'production' && alias === path) {
- warn(
- false,
- ("Found an alias with the same value as the path: \"" + path + "\". You have to remove that alias. It will be ignored in development.")
- );
- // skip in dev to make it work
- continue
- }
- var aliasRoute = {
- path: alias,
- children: route.children
- };
- addRouteRecord(
- pathList,
- pathMap,
- nameMap,
- aliasRoute,
- parent,
- record.path || '/' // matchAs
- );
- }
- }
- if (name) {
- if (!nameMap[name]) {
- nameMap[name] = record;
- } else if ("development" !== 'production' && !matchAs) {
- warn(
- false,
- "Duplicate named routes definition: " +
- "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
- );
- }
- }
- }
- function compileRouteRegex (
- path,
- pathToRegexpOptions
- ) {
- var regex = pathToRegexp_1(path, [], pathToRegexpOptions);
- if (true) {
- var keys = Object.create(null);
- regex.keys.forEach(function (key) {
- warn(
- !keys[key.name],
- ("Duplicate param keys in route with path: \"" + path + "\"")
- );
- keys[key.name] = true;
- });
- }
- return regex
- }
- function normalizePath (
- path,
- parent,
- strict
- ) {
- if (!strict) { path = path.replace(/\/$/, ''); }
- if (path[0] === '/') { return path }
- if (parent == null) { return path }
- return cleanPath(((parent.path) + "/" + path))
- }
- /* */
- function createMatcher (
- routes,
- router
- ) {
- var ref = createRouteMap(routes);
- var pathList = ref.pathList;
- var pathMap = ref.pathMap;
- var nameMap = ref.nameMap;
- function addRoutes (routes) {
- createRouteMap(routes, pathList, pathMap, nameMap);
- }
- function addRoute (parentOrRoute, route) {
- var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;
- // $flow-disable-line
- createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);
- // add aliases of parent
- if (parent && parent.alias.length) {
- createRouteMap(
- // $flow-disable-line route is defined if parent is
- parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),
- pathList,
- pathMap,
- nameMap,
- parent
- );
- }
- }
- function getRoutes () {
- return pathList.map(function (path) { return pathMap[path]; })
- }
- function match (
- raw,
- currentRoute,
- redirectedFrom
- ) {
- var location = normalizeLocation(raw, currentRoute, false, router);
- var name = location.name;
- if (name) {
- var record = nameMap[name];
- if (true) {
- warn(record, ("Route with name '" + name + "' does not exist"));
- }
- if (!record) { return _createRoute(null, location) }
- var paramNames = record.regex.keys
- .filter(function (key) { return !key.optional; })
- .map(function (key) { return key.name; });
- if (typeof location.params !== 'object') {
- location.params = {};
- }
- if (currentRoute && typeof currentRoute.params === 'object') {
- for (var key in currentRoute.params) {
- if (!(key in location.params) && paramNames.indexOf(key) > -1) {
- location.params[key] = currentRoute.params[key];
- }
- }
- }
- location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
- return _createRoute(record, location, redirectedFrom)
- } else if (location.path) {
- location.params = {};
- for (var i = 0; i < pathList.length; i++) {
- var path = pathList[i];
- var record$1 = pathMap[path];
- if (matchRoute(record$1.regex, location.path, location.params)) {
- return _createRoute(record$1, location, redirectedFrom)
- }
- }
- }
- // no match
- return _createRoute(null, location)
- }
- function redirect (
- record,
- location
- ) {
- var originalRedirect = record.redirect;
- var redirect = typeof originalRedirect === 'function'
- ? originalRedirect(createRoute(record, location, null, router))
- : originalRedirect;
- if (typeof redirect === 'string') {
- redirect = { path: redirect };
- }
- if (!redirect || typeof redirect !== 'object') {
- if (true) {
- warn(
- false, ("invalid redirect option: " + (JSON.stringify(redirect)))
- );
- }
- return _createRoute(null, location)
- }
- var re = redirect;
- var name = re.name;
- var path = re.path;
- var query = location.query;
- var hash = location.hash;
- var params = location.params;
- query = re.hasOwnProperty('query') ? re.query : query;
- hash = re.hasOwnProperty('hash') ? re.hash : hash;
- params = re.hasOwnProperty('params') ? re.params : params;
- if (name) {
- // resolved named direct
- var targetRecord = nameMap[name];
- if (true) {
- assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
- }
- return match({
- _normalized: true,
- name: name,
- query: query,
- hash: hash,
- params: params
- }, undefined, location)
- } else if (path) {
- // 1. resolve relative redirect
- var rawPath = resolveRecordPath(path, record);
- // 2. resolve params
- var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
- // 3. rematch with existing query and hash
- return match({
- _normalized: true,
- path: resolvedPath,
- query: query,
- hash: hash
- }, undefined, location)
- } else {
- if (true) {
- warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
- }
- return _createRoute(null, location)
- }
- }
- function alias (
- record,
- location,
- matchAs
- ) {
- var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
- var aliasedMatch = match({
- _normalized: true,
- path: aliasedPath
- });
- if (aliasedMatch) {
- var matched = aliasedMatch.matched;
- var aliasedRecord = matched[matched.length - 1];
- location.params = aliasedMatch.params;
- return _createRoute(aliasedRecord, location)
- }
- return _createRoute(null, location)
- }
- function _createRoute (
- record,
- location,
- redirectedFrom
- ) {
- if (record && record.redirect) {
- return redirect(record, redirectedFrom || location)
- }
- if (record && record.matchAs) {
- return alias(record, location, record.matchAs)
- }
- return createRoute(record, location, redirectedFrom, router)
- }
- return {
- match: match,
- addRoute: addRoute,
- getRoutes: getRoutes,
- addRoutes: addRoutes
- }
- }
- function matchRoute (
- regex,
- path,
- params
- ) {
- var m = path.match(regex);
- if (!m) {
- return false
- } else if (!params) {
- return true
- }
- for (var i = 1, len = m.length; i < len; ++i) {
- var key = regex.keys[i - 1];
- if (key) {
- // Fix #1994: using * with props: true generates a param named 0
- params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];
- }
- }
- return true
- }
- function resolveRecordPath (path, record) {
- return resolvePath(path, record.parent ? record.parent.path : '/', true)
- }
- /* */
- // use User Timing api (if present) for more accurate key precision
- var Time =
- inBrowser && window.performance && window.performance.now
- ? window.performance
- : Date;
- function genStateKey () {
- return Time.now().toFixed(3)
- }
- var _key = genStateKey();
- function getStateKey () {
- return _key
- }
- function setStateKey (key) {
- return (_key = key)
- }
- /* */
- var positionStore = Object.create(null);
- function setupScroll () {
- // Prevent browser scroll behavior on History popstate
- if ('scrollRestoration' in window.history) {
- window.history.scrollRestoration = 'manual';
- }
- // Fix for #1585 for Firefox
- // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
- // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
- // window.location.protocol + '//' + window.location.host
- // location.host contains the port and location.hostname doesn't
- var protocolAndPath = window.location.protocol + '//' + window.location.host;
- var absolutePath = window.location.href.replace(protocolAndPath, '');
- // preserve existing history state as it could be overriden by the user
- var stateCopy = extend({}, window.history.state);
- stateCopy.key = getStateKey();
- window.history.replaceState(stateCopy, '', absolutePath);
- window.addEventListener('popstate', handlePopState);
- return function () {
- window.removeEventListener('popstate', handlePopState);
- }
- }
- function handleScroll (
- router,
- to,
- from,
- isPop
- ) {
- if (!router.app) {
- return
- }
- var behavior = router.options.scrollBehavior;
- if (!behavior) {
- return
- }
- if (true) {
- assert(typeof behavior === 'function', "scrollBehavior must be a function");
- }
- // wait until re-render finishes before scrolling
- router.app.$nextTick(function () {
- var position = getScrollPosition();
- var shouldScroll = behavior.call(
- router,
- to,
- from,
- isPop ? position : null
- );
- if (!shouldScroll) {
- return
- }
- if (typeof shouldScroll.then === 'function') {
- shouldScroll
- .then(function (shouldScroll) {
- scrollToPosition((shouldScroll), position);
- })
- .catch(function (err) {
- if (true) {
- assert(false, err.toString());
- }
- });
- } else {
- scrollToPosition(shouldScroll, position);
- }
- });
- }
- function saveScrollPosition () {
- var key = getStateKey();
- if (key) {
- positionStore[key] = {
- x: window.pageXOffset,
- y: window.pageYOffset
- };
- }
- }
- function handlePopState (e) {
- saveScrollPosition();
- if (e.state && e.state.key) {
- setStateKey(e.state.key);
- }
- }
- function getScrollPosition () {
- var key = getStateKey();
- if (key) {
- return positionStore[key]
- }
- }
- function getElementPosition (el, offset) {
- var docEl = document.documentElement;
- var docRect = docEl.getBoundingClientRect();
- var elRect = el.getBoundingClientRect();
- return {
- x: elRect.left - docRect.left - offset.x,
- y: elRect.top - docRect.top - offset.y
- }
- }
- function isValidPosition (obj) {
- return isNumber(obj.x) || isNumber(obj.y)
- }
- function normalizePosition (obj) {
- return {
- x: isNumber(obj.x) ? obj.x : window.pageXOffset,
- y: isNumber(obj.y) ? obj.y : window.pageYOffset
- }
- }
- function normalizeOffset (obj) {
- return {
- x: isNumber(obj.x) ? obj.x : 0,
- y: isNumber(obj.y) ? obj.y : 0
- }
- }
- function isNumber (v) {
- return typeof v === 'number'
- }
- var hashStartsWithNumberRE = /^#\d/;
- function scrollToPosition (shouldScroll, position) {
- var isObject = typeof shouldScroll === 'object';
- if (isObject && typeof shouldScroll.selector === 'string') {
- // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]
- // but at the same time, it doesn't make much sense to select an element with an id and an extra selector
- var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line
- ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line
- : document.querySelector(shouldScroll.selector);
- if (el) {
- var offset =
- shouldScroll.offset && typeof shouldScroll.offset === 'object'
- ? shouldScroll.offset
- : {};
- offset = normalizeOffset(offset);
- position = getElementPosition(el, offset);
- } else if (isValidPosition(shouldScroll)) {
- position = normalizePosition(shouldScroll);
- }
- } else if (isObject && isValidPosition(shouldScroll)) {
- position = normalizePosition(shouldScroll);
- }
- if (position) {
- // $flow-disable-line
- if ('scrollBehavior' in document.documentElement.style) {
- window.scrollTo({
- left: position.x,
- top: position.y,
- // $flow-disable-line
- behavior: shouldScroll.behavior
- });
- } else {
- window.scrollTo(position.x, position.y);
- }
- }
- }
- /* */
- var supportsPushState =
- inBrowser &&
- (function () {
- var ua = window.navigator.userAgent;
- if (
- (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
- ua.indexOf('Mobile Safari') !== -1 &&
- ua.indexOf('Chrome') === -1 &&
- ua.indexOf('Windows Phone') === -1
- ) {
- return false
- }
- return window.history && typeof window.history.pushState === 'function'
- })();
- function pushState (url, replace) {
- saveScrollPosition();
- // try...catch the pushState call to get around Safari
- // DOM Exception 18 where it limits to 100 pushState calls
- var history = window.history;
- try {
- if (replace) {
- // preserve existing history state as it could be overriden by the user
- var stateCopy = extend({}, history.state);
- stateCopy.key = getStateKey();
- history.replaceState(stateCopy, '', url);
- } else {
- history.pushState({ key: setStateKey(genStateKey()) }, '', url);
- }
- } catch (e) {
- window.location[replace ? 'replace' : 'assign'](url);
- }
- }
- function replaceState (url) {
- pushState(url, true);
- }
- /* */
- function runQueue (queue, fn, cb) {
- var step = function (index) {
- if (index >= queue.length) {
- cb();
- } else {
- if (queue[index]) {
- fn(queue[index], function () {
- step(index + 1);
- });
- } else {
- step(index + 1);
- }
- }
- };
- step(0);
- }
- // When changing thing, also edit router.d.ts
- var NavigationFailureType = {
- redirected: 2,
- aborted: 4,
- cancelled: 8,
- duplicated: 16
- };
- function createNavigationRedirectedError (from, to) {
- return createRouterError(
- from,
- to,
- NavigationFailureType.redirected,
- ("Redirected when going from \"" + (from.fullPath) + "\" to \"" + (stringifyRoute(
- to
- )) + "\" via a navigation guard.")
- )
- }
- function createNavigationDuplicatedError (from, to) {
- var error = createRouterError(
- from,
- to,
- NavigationFailureType.duplicated,
- ("Avoided redundant navigation to current location: \"" + (from.fullPath) + "\".")
- );
- // backwards compatible with the first introduction of Errors
- error.name = 'NavigationDuplicated';
- return error
- }
- function createNavigationCancelledError (from, to) {
- return createRouterError(
- from,
- to,
- NavigationFailureType.cancelled,
- ("Navigation cancelled from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" with a new navigation.")
- )
- }
- function createNavigationAbortedError (from, to) {
- return createRouterError(
- from,
- to,
- NavigationFailureType.aborted,
- ("Navigation aborted from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" via a navigation guard.")
- )
- }
- function createRouterError (from, to, type, message) {
- var error = new Error(message);
- error._isRouter = true;
- error.from = from;
- error.to = to;
- error.type = type;
- return error
- }
- var propertiesToLog = ['params', 'query', 'hash'];
- function stringifyRoute (to) {
- if (typeof to === 'string') { return to }
- if ('path' in to) { return to.path }
- var location = {};
- propertiesToLog.forEach(function (key) {
- if (key in to) { location[key] = to[key]; }
- });
- return JSON.stringify(location, null, 2)
- }
- function isError (err) {
- return Object.prototype.toString.call(err).indexOf('Error') > -1
- }
- function isNavigationFailure (err, errorType) {
- return (
- isError(err) &&
- err._isRouter &&
- (errorType == null || err.type === errorType)
- )
- }
- /* */
- function resolveAsyncComponents (matched) {
- return function (to, from, next) {
- var hasAsync = false;
- var pending = 0;
- var error = null;
- flatMapComponents(matched, function (def, _, match, key) {
- // if it's a function and doesn't have cid attached,
- // assume it's an async component resolve function.
- // we are not using Vue's default async resolving mechanism because
- // we want to halt the navigation until the incoming component has been
- // resolved.
- if (typeof def === 'function' && def.cid === undefined) {
- hasAsync = true;
- pending++;
- var resolve = once(function (resolvedDef) {
- if (isESModule(resolvedDef)) {
- resolvedDef = resolvedDef.default;
- }
- // save resolved on async factory in case it's used elsewhere
- def.resolved = typeof resolvedDef === 'function'
- ? resolvedDef
- : _Vue.extend(resolvedDef);
- match.components[key] = resolvedDef;
- pending--;
- if (pending <= 0) {
- next();
- }
- });
- var reject = once(function (reason) {
- var msg = "Failed to resolve async component " + key + ": " + reason;
- "development" !== 'production' && warn(false, msg);
- if (!error) {
- error = isError(reason)
- ? reason
- : new Error(msg);
- next(error);
- }
- });
- var res;
- try {
- res = def(resolve, reject);
- } catch (e) {
- reject(e);
- }
- if (res) {
- if (typeof res.then === 'function') {
- res.then(resolve, reject);
- } else {
- // new syntax in Vue 2.3
- var comp = res.component;
- if (comp && typeof comp.then === 'function') {
- comp.then(resolve, reject);
- }
- }
- }
- }
- });
- if (!hasAsync) { next(); }
- }
- }
- function flatMapComponents (
- matched,
- fn
- ) {
- return flatten(matched.map(function (m) {
- return Object.keys(m.components).map(function (key) { return fn(
- m.components[key],
- m.instances[key],
- m, key
- ); })
- }))
- }
- function flatten (arr) {
- return Array.prototype.concat.apply([], arr)
- }
- var hasSymbol =
- typeof Symbol === 'function' &&
- typeof Symbol.toStringTag === 'symbol';
- function isESModule (obj) {
- return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')
- }
- // in Webpack 2, require.ensure now also returns a Promise
- // so the resolve/reject functions may get called an extra time
- // if the user uses an arrow function shorthand that happens to
- // return that Promise.
- function once (fn) {
- var called = false;
- return function () {
- var args = [], len = arguments.length;
- while ( len-- ) args[ len ] = arguments[ len ];
- if (called) { return }
- called = true;
- return fn.apply(this, args)
- }
- }
- /* */
- var History = function History (router, base) {
- this.router = router;
- this.base = normalizeBase(base);
- // start with a route object that stands for "nowhere"
- this.current = START;
- this.pending = null;
- this.ready = false;
- this.readyCbs = [];
- this.readyErrorCbs = [];
- this.errorCbs = [];
- this.listeners = [];
- };
- History.prototype.listen = function listen (cb) {
- this.cb = cb;
- };
- History.prototype.onReady = function onReady (cb, errorCb) {
- if (this.ready) {
- cb();
- } else {
- this.readyCbs.push(cb);
- if (errorCb) {
- this.readyErrorCbs.push(errorCb);
- }
- }
- };
- History.prototype.onError = function onError (errorCb) {
- this.errorCbs.push(errorCb);
- };
- History.prototype.transitionTo = function transitionTo (
- location,
- onComplete,
- onAbort
- ) {
- var this$1 = this;
- var route;
- // catch redirect option https://github.com/vuejs/vue-router/issues/3201
- try {
- route = this.router.match(location, this.current);
- } catch (e) {
- this.errorCbs.forEach(function (cb) {
- cb(e);
- });
- // Exception should still be thrown
- throw e
- }
- var prev = this.current;
- this.confirmTransition(
- route,
- function () {
- this$1.updateRoute(route);
- onComplete && onComplete(route);
- this$1.ensureURL();
- this$1.router.afterHooks.forEach(function (hook) {
- hook && hook(route, prev);
- });
- // fire ready cbs once
- if (!this$1.ready) {
- this$1.ready = true;
- this$1.readyCbs.forEach(function (cb) {
- cb(route);
- });
- }
- },
- function (err) {
- if (onAbort) {
- onAbort(err);
- }
- if (err && !this$1.ready) {
- // Initial redirection should not mark the history as ready yet
- // because it's triggered by the redirection instead
- // https://github.com/vuejs/vue-router/issues/3225
- // https://github.com/vuejs/vue-router/issues/3331
- if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {
- this$1.ready = true;
- this$1.readyErrorCbs.forEach(function (cb) {
- cb(err);
- });
- }
- }
- }
- );
- };
- History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
- var this$1 = this;
- var current = this.current;
- this.pending = route;
- var abort = function (err) {
- // changed after adding errors with
- // https://github.com/vuejs/vue-router/pull/3047 before that change,
- // redirect and aborted navigation would produce an err == null
- if (!isNavigationFailure(err) && isError(err)) {
- if (this$1.errorCbs.length) {
- this$1.errorCbs.forEach(function (cb) {
- cb(err);
- });
- } else {
- if (true) {
- warn(false, 'uncaught error during route navigation:');
- }
- console.error(err);
- }
- }
- onAbort && onAbort(err);
- };
- var lastRouteIndex = route.matched.length - 1;
- var lastCurrentIndex = current.matched.length - 1;
- if (
- isSameRoute(route, current) &&
- // in the case the route map has been dynamically appended to
- lastRouteIndex === lastCurrentIndex &&
- route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]
- ) {
- this.ensureURL();
- if (route.hash) {
- handleScroll(this.router, current, route, false);
- }
- return abort(createNavigationDuplicatedError(current, route))
- }
- var ref = resolveQueue(
- this.current.matched,
- route.matched
- );
- var updated = ref.updated;
- var deactivated = ref.deactivated;
- var activated = ref.activated;
- var queue = [].concat(
- // in-component leave guards
- extractLeaveGuards(deactivated),
- // global before hooks
- this.router.beforeHooks,
- // in-component update hooks
- extractUpdateHooks(updated),
- // in-config enter guards
- activated.map(function (m) { return m.beforeEnter; }),
- // async components
- resolveAsyncComponents(activated)
- );
- var iterator = function (hook, next) {
- if (this$1.pending !== route) {
- return abort(createNavigationCancelledError(current, route))
- }
- try {
- hook(route, current, function (to) {
- if (to === false) {
- // next(false) -> abort navigation, ensure current URL
- this$1.ensureURL(true);
- abort(createNavigationAbortedError(current, route));
- } else if (isError(to)) {
- this$1.ensureURL(true);
- abort(to);
- } else if (
- typeof to === 'string' ||
- (typeof to === 'object' &&
- (typeof to.path === 'string' || typeof to.name === 'string'))
- ) {
- // next('/') or next({ path: '/' }) -> redirect
- abort(createNavigationRedirectedError(current, route));
- if (typeof to === 'object' && to.replace) {
- this$1.replace(to);
- } else {
- this$1.push(to);
- }
- } else {
- // confirm transition and pass on the value
- next(to);
- }
- });
- } catch (e) {
- abort(e);
- }
- };
- runQueue(queue, iterator, function () {
- // wait until async components are resolved before
- // extracting in-component enter guards
- var enterGuards = extractEnterGuards(activated);
- var queue = enterGuards.concat(this$1.router.resolveHooks);
- runQueue(queue, iterator, function () {
- if (this$1.pending !== route) {
- return abort(createNavigationCancelledError(current, route))
- }
- this$1.pending = null;
- onComplete(route);
- if (this$1.router.app) {
- this$1.router.app.$nextTick(function () {
- handleRouteEntered(route);
- });
- }
- });
- });
- };
- History.prototype.updateRoute = function updateRoute (route) {
- this.current = route;
- this.cb && this.cb(route);
- };
- History.prototype.setupListeners = function setupListeners () {
- // Default implementation is empty
- };
- History.prototype.teardown = function teardown () {
- // clean up event listeners
- // https://github.com/vuejs/vue-router/issues/2341
- this.listeners.forEach(function (cleanupListener) {
- cleanupListener();
- });
- this.listeners = [];
- // reset current history route
- // https://github.com/vuejs/vue-router/issues/3294
- this.current = START;
- this.pending = null;
- };
- function normalizeBase (base) {
- if (!base) {
- if (inBrowser) {
- // respect <base> tag
- var baseEl = document.querySelector('base');
- base = (baseEl && baseEl.getAttribute('href')) || '/';
- // strip full URL origin
- base = base.replace(/^https?:\/\/[^\/]+/, '');
- } else {
- base = '/';
- }
- }
- // make sure there's the starting slash
- if (base.charAt(0) !== '/') {
- base = '/' + base;
- }
- // remove trailing slash
- return base.replace(/\/$/, '')
- }
- function resolveQueue (
- current,
- next
- ) {
- var i;
- var max = Math.max(current.length, next.length);
- for (i = 0; i < max; i++) {
- if (current[i] !== next[i]) {
- break
- }
- }
- return {
- updated: next.slice(0, i),
- activated: next.slice(i),
- deactivated: current.slice(i)
- }
- }
- function extractGuards (
- records,
- name,
- bind,
- reverse
- ) {
- var guards = flatMapComponents(records, function (def, instance, match, key) {
- var guard = extractGuard(def, name);
- if (guard) {
- return Array.isArray(guard)
- ? guard.map(function (guard) { return bind(guard, instance, match, key); })
- : bind(guard, instance, match, key)
- }
- });
- return flatten(reverse ? guards.reverse() : guards)
- }
- function extractGuard (
- def,
- key
- ) {
- if (typeof def !== 'function') {
- // extend now so that global mixins are applied.
- def = _Vue.extend(def);
- }
- return def.options[key]
- }
- function extractLeaveGuards (deactivated) {
- return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
- }
- function extractUpdateHooks (updated) {
- return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
- }
- function bindGuard (guard, instance) {
- if (instance) {
- return function boundRouteGuard () {
- return guard.apply(instance, arguments)
- }
- }
- }
- function extractEnterGuards (
- activated
- ) {
- return extractGuards(
- activated,
- 'beforeRouteEnter',
- function (guard, _, match, key) {
- return bindEnterGuard(guard, match, key)
- }
- )
- }
- function bindEnterGuard (
- guard,
- match,
- key
- ) {
- return function routeEnterGuard (to, from, next) {
- return guard(to, from, function (cb) {
- if (typeof cb === 'function') {
- if (!match.enteredCbs[key]) {
- match.enteredCbs[key] = [];
- }
- match.enteredCbs[key].push(cb);
- }
- next(cb);
- })
- }
- }
- /* */
- var HTML5History = /*@__PURE__*/(function (History) {
- function HTML5History (router, base) {
- History.call(this, router, base);
- this._startLocation = getLocation(this.base);
- }
- if ( History ) HTML5History.__proto__ = History;
- HTML5History.prototype = Object.create( History && History.prototype );
- HTML5History.prototype.constructor = HTML5History;
- HTML5History.prototype.setupListeners = function setupListeners () {
- var this$1 = this;
- if (this.listeners.length > 0) {
- return
- }
- var router = this.router;
- var expectScroll = router.options.scrollBehavior;
- var supportsScroll = supportsPushState && expectScroll;
- if (supportsScroll) {
- this.listeners.push(setupScroll());
- }
- var handleRoutingEvent = function () {
- var current = this$1.current;
- // Avoiding first `popstate` event dispatched in some browsers but first
- // history route not updated since async guard at the same time.
- var location = getLocation(this$1.base);
- if (this$1.current === START && location === this$1._startLocation) {
- return
- }
- this$1.transitionTo(location, function (route) {
- if (supportsScroll) {
- handleScroll(router, route, current, true);
- }
- });
- };
- window.addEventListener('popstate', handleRoutingEvent);
- this.listeners.push(function () {
- window.removeEventListener('popstate', handleRoutingEvent);
- });
- };
- HTML5History.prototype.go = function go (n) {
- window.history.go(n);
- };
- HTML5History.prototype.push = function push (location, onComplete, onAbort) {
- var this$1 = this;
- var ref = this;
- var fromRoute = ref.current;
- this.transitionTo(location, function (route) {
- pushState(cleanPath(this$1.base + route.fullPath));
- handleScroll(this$1.router, route, fromRoute, false);
- onComplete && onComplete(route);
- }, onAbort);
- };
- HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
- var this$1 = this;
- var ref = this;
- var fromRoute = ref.current;
- this.transitionTo(location, function (route) {
- replaceState(cleanPath(this$1.base + route.fullPath));
- handleScroll(this$1.router, route, fromRoute, false);
- onComplete && onComplete(route);
- }, onAbort);
- };
- HTML5History.prototype.ensureURL = function ensureURL (push) {
- if (getLocation(this.base) !== this.current.fullPath) {
- var current = cleanPath(this.base + this.current.fullPath);
- push ? pushState(current) : replaceState(current);
- }
- };
- HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
- return getLocation(this.base)
- };
- return HTML5History;
- }(History));
- function getLocation (base) {
- var path = window.location.pathname;
- var pathLowerCase = path.toLowerCase();
- var baseLowerCase = base.toLowerCase();
- // base="/a" shouldn't turn path="/app" into "/a/pp"
- // https://github.com/vuejs/vue-router/issues/3555
- // so we ensure the trailing slash in the base
- if (base && ((pathLowerCase === baseLowerCase) ||
- (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {
- path = path.slice(base.length);
- }
- return (path || '/') + window.location.search + window.location.hash
- }
- /* */
- var HashHistory = /*@__PURE__*/(function (History) {
- function HashHistory (router, base, fallback) {
- History.call(this, router, base);
- // check history fallback deeplinking
- if (fallback && checkFallback(this.base)) {
- return
- }
- ensureSlash();
- }
- if ( History ) HashHistory.__proto__ = History;
- HashHistory.prototype = Object.create( History && History.prototype );
- HashHistory.prototype.constructor = HashHistory;
- // this is delayed until the app mounts
- // to avoid the hashchange listener being fired too early
- HashHistory.prototype.setupListeners = function setupListeners () {
- var this$1 = this;
- if (this.listeners.length > 0) {
- return
- }
- var router = this.router;
- var expectScroll = router.options.scrollBehavior;
- var supportsScroll = supportsPushState && expectScroll;
- if (supportsScroll) {
- this.listeners.push(setupScroll());
- }
- var handleRoutingEvent = function () {
- var current = this$1.current;
- if (!ensureSlash()) {
- return
- }
- this$1.transitionTo(getHash(), function (route) {
- if (supportsScroll) {
- handleScroll(this$1.router, route, current, true);
- }
- if (!supportsPushState) {
- replaceHash(route.fullPath);
- }
- });
- };
- var eventType = supportsPushState ? 'popstate' : 'hashchange';
- window.addEventListener(
- eventType,
- handleRoutingEvent
- );
- this.listeners.push(function () {
- window.removeEventListener(eventType, handleRoutingEvent);
- });
- };
- HashHistory.prototype.push = function push (location, onComplete, onAbort) {
- var this$1 = this;
- var ref = this;
- var fromRoute = ref.current;
- this.transitionTo(
- location,
- function (route) {
- pushHash(route.fullPath);
- handleScroll(this$1.router, route, fromRoute, false);
- onComplete && onComplete(route);
- },
- onAbort
- );
- };
- HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
- var this$1 = this;
- var ref = this;
- var fromRoute = ref.current;
- this.transitionTo(
- location,
- function (route) {
- replaceHash(route.fullPath);
- handleScroll(this$1.router, route, fromRoute, false);
- onComplete && onComplete(route);
- },
- onAbort
- );
- };
- HashHistory.prototype.go = function go (n) {
- window.history.go(n);
- };
- HashHistory.prototype.ensureURL = function ensureURL (push) {
- var current = this.current.fullPath;
- if (getHash() !== current) {
- push ? pushHash(current) : replaceHash(current);
- }
- };
- HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
- return getHash()
- };
- return HashHistory;
- }(History));
- function checkFallback (base) {
- var location = getLocation(base);
- if (!/^\/#/.test(location)) {
- window.location.replace(cleanPath(base + '/#' + location));
- return true
- }
- }
- function ensureSlash () {
- var path = getHash();
- if (path.charAt(0) === '/') {
- return true
- }
- replaceHash('/' + path);
- return false
- }
- function getHash () {
- // We can't use window.location.hash here because it's not
- // consistent across browsers - Firefox will pre-decode it!
- var href = window.location.href;
- var index = href.indexOf('#');
- // empty path
- if (index < 0) { return '' }
- href = href.slice(index + 1);
- return href
- }
- function getUrl (path) {
- var href = window.location.href;
- var i = href.indexOf('#');
- var base = i >= 0 ? href.slice(0, i) : href;
- return (base + "#" + path)
- }
- function pushHash (path) {
- if (supportsPushState) {
- pushState(getUrl(path));
- } else {
- window.location.hash = path;
- }
- }
- function replaceHash (path) {
- if (supportsPushState) {
- replaceState(getUrl(path));
- } else {
- window.location.replace(getUrl(path));
- }
- }
- /* */
- var AbstractHistory = /*@__PURE__*/(function (History) {
- function AbstractHistory (router, base) {
- History.call(this, router, base);
- this.stack = [];
- this.index = -1;
- }
- if ( History ) AbstractHistory.__proto__ = History;
- AbstractHistory.prototype = Object.create( History && History.prototype );
- AbstractHistory.prototype.constructor = AbstractHistory;
- AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
- var this$1 = this;
- this.transitionTo(
- location,
- function (route) {
- this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
- this$1.index++;
- onComplete && onComplete(route);
- },
- onAbort
- );
- };
- AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
- var this$1 = this;
- this.transitionTo(
- location,
- function (route) {
- this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
- onComplete && onComplete(route);
- },
- onAbort
- );
- };
- AbstractHistory.prototype.go = function go (n) {
- var this$1 = this;
- var targetIndex = this.index + n;
- if (targetIndex < 0 || targetIndex >= this.stack.length) {
- return
- }
- var route = this.stack[targetIndex];
- this.confirmTransition(
- route,
- function () {
- var prev = this$1.current;
- this$1.index = targetIndex;
- this$1.updateRoute(route);
- this$1.router.afterHooks.forEach(function (hook) {
- hook && hook(route, prev);
- });
- },
- function (err) {
- if (isNavigationFailure(err, NavigationFailureType.duplicated)) {
- this$1.index = targetIndex;
- }
- }
- );
- };
- AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
- var current = this.stack[this.stack.length - 1];
- return current ? current.fullPath : '/'
- };
- AbstractHistory.prototype.ensureURL = function ensureURL () {
- // noop
- };
- return AbstractHistory;
- }(History));
- /* */
- var VueRouter = function VueRouter (options) {
- if ( options === void 0 ) options = {};
- if (true) {
- warn(this instanceof VueRouter, "Router must be called with the new operator.");
- }
- this.app = null;
- this.apps = [];
- this.options = options;
- this.beforeHooks = [];
- this.resolveHooks = [];
- this.afterHooks = [];
- this.matcher = createMatcher(options.routes || [], this);
- var mode = options.mode || 'hash';
- this.fallback =
- mode === 'history' && !supportsPushState && options.fallback !== false;
- if (this.fallback) {
- mode = 'hash';
- }
- if (!inBrowser) {
- mode = 'abstract';
- }
- this.mode = mode;
- switch (mode) {
- case 'history':
- this.history = new HTML5History(this, options.base);
- break
- case 'hash':
- this.history = new HashHistory(this, options.base, this.fallback);
- break
- case 'abstract':
- this.history = new AbstractHistory(this, options.base);
- break
- default:
- if (true) {
- assert(false, ("invalid mode: " + mode));
- }
- }
- };
- var prototypeAccessors = { currentRoute: { configurable: true } };
- VueRouter.prototype.match = function match (raw, current, redirectedFrom) {
- return this.matcher.match(raw, current, redirectedFrom)
- };
- prototypeAccessors.currentRoute.get = function () {
- return this.history && this.history.current
- };
- VueRouter.prototype.init = function init (app /* Vue component instance */) {
- var this$1 = this;
- "development" !== 'production' &&
- assert(
- install.installed,
- "not installed. Make sure to call `Vue.use(VueRouter)` " +
- "before creating root instance."
- );
- this.apps.push(app);
- // set up app destroyed handler
- // https://github.com/vuejs/vue-router/issues/2639
- app.$once('hook:destroyed', function () {
- // clean out app from this.apps array once destroyed
- var index = this$1.apps.indexOf(app);
- if (index > -1) { this$1.apps.splice(index, 1); }
- // ensure we still have a main app or null if no apps
- // we do not release the router so it can be reused
- if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }
- if (!this$1.app) { this$1.history.teardown(); }
- });
- // main app previously initialized
- // return as we don't need to set up new history listener
- if (this.app) {
- return
- }
- this.app = app;
- var history = this.history;
- if (history instanceof HTML5History || history instanceof HashHistory) {
- var handleInitialScroll = function (routeOrError) {
- var from = history.current;
- var expectScroll = this$1.options.scrollBehavior;
- var supportsScroll = supportsPushState && expectScroll;
- if (supportsScroll && 'fullPath' in routeOrError) {
- handleScroll(this$1, routeOrError, from, false);
- }
- };
- var setupListeners = function (routeOrError) {
- history.setupListeners();
- handleInitialScroll(routeOrError);
- };
- history.transitionTo(
- history.getCurrentLocation(),
- setupListeners,
- setupListeners
- );
- }
- history.listen(function (route) {
- this$1.apps.forEach(function (app) {
- app._route = route;
- });
- });
- };
- VueRouter.prototype.beforeEach = function beforeEach (fn) {
- return registerHook(this.beforeHooks, fn)
- };
- VueRouter.prototype.beforeResolve = function beforeResolve (fn) {
- return registerHook(this.resolveHooks, fn)
- };
- VueRouter.prototype.afterEach = function afterEach (fn) {
- return registerHook(this.afterHooks, fn)
- };
- VueRouter.prototype.onReady = function onReady (cb, errorCb) {
- this.history.onReady(cb, errorCb);
- };
- VueRouter.prototype.onError = function onError (errorCb) {
- this.history.onError(errorCb);
- };
- VueRouter.prototype.push = function push (location, onComplete, onAbort) {
- var this$1 = this;
- // $flow-disable-line
- if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
- return new Promise(function (resolve, reject) {
- this$1.history.push(location, resolve, reject);
- })
- } else {
- this.history.push(location, onComplete, onAbort);
- }
- };
- VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
- var this$1 = this;
- // $flow-disable-line
- if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
- return new Promise(function (resolve, reject) {
- this$1.history.replace(location, resolve, reject);
- })
- } else {
- this.history.replace(location, onComplete, onAbort);
- }
- };
- VueRouter.prototype.go = function go (n) {
- this.history.go(n);
- };
- VueRouter.prototype.back = function back () {
- this.go(-1);
- };
- VueRouter.prototype.forward = function forward () {
- this.go(1);
- };
- VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
- var route = to
- ? to.matched
- ? to
- : this.resolve(to).route
- : this.currentRoute;
- if (!route) {
- return []
- }
- return [].concat.apply(
- [],
- route.matched.map(function (m) {
- return Object.keys(m.components).map(function (key) {
- return m.components[key]
- })
- })
- )
- };
- VueRouter.prototype.resolve = function resolve (
- to,
- current,
- append
- ) {
- current = current || this.history.current;
- var location = normalizeLocation(to, current, append, this);
- var route = this.match(location, current);
- var fullPath = route.redirectedFrom || route.fullPath;
- var base = this.history.base;
- var href = createHref(base, fullPath, this.mode);
- return {
- location: location,
- route: route,
- href: href,
- // for backwards compat
- normalizedTo: location,
- resolved: route
- }
- };
- VueRouter.prototype.getRoutes = function getRoutes () {
- return this.matcher.getRoutes()
- };
- VueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {
- this.matcher.addRoute(parentOrRoute, route);
- if (this.history.current !== START) {
- this.history.transitionTo(this.history.getCurrentLocation());
- }
- };
- VueRouter.prototype.addRoutes = function addRoutes (routes) {
- if (true) {
- warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');
- }
- this.matcher.addRoutes(routes);
- if (this.history.current !== START) {
- this.history.transitionTo(this.history.getCurrentLocation());
- }
- };
- Object.defineProperties( VueRouter.prototype, prototypeAccessors );
- function registerHook (list, fn) {
- list.push(fn);
- return function () {
- var i = list.indexOf(fn);
- if (i > -1) { list.splice(i, 1); }
- }
- }
- function createHref (base, fullPath, mode) {
- var path = mode === 'hash' ? '#' + fullPath : fullPath;
- return base ? cleanPath(base + '/' + path) : path
- }
- VueRouter.install = install;
- VueRouter.version = '3.5.3';
- VueRouter.isNavigationFailure = isNavigationFailure;
- VueRouter.NavigationFailureType = NavigationFailureType;
- VueRouter.START_LOCATION = START;
- if (inBrowser && window.Vue) {
- window.Vue.use(VueRouter);
- }
- /* harmony default export */ __webpack_exports__["a"] = (VueRouter);
- /***/ }),
- /* 193 */
- /***/ (function(module, exports, __webpack_require__) {
- (function webpackUniversalModuleDefinition(root, factory) {
- if(true)
- module.exports = factory(__webpack_require__(4));
- else if(typeof define === 'function' && define.amd)
- define("iview", ["vue"], factory);
- else if(typeof exports === 'object')
- exports["iview"] = factory(require("vue"));
- else
- root["iview"] = factory(root["Vue"]);
- })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_16__) {
- 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, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // 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 = "/dist/";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 259);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = normalizeComponent;
- /* globals __VUE_SSR_CONTEXT__ */
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
- // This module is a runtime utility for cleaner component module output and will
- // be included in the final webpack user bundle.
- function normalizeComponent (
- scriptExports,
- render,
- staticRenderFns,
- functionalTemplate,
- injectStyles,
- scopeId,
- moduleIdentifier, /* server only */
- shadowMode /* vue-cli only */
- ) {
- scriptExports = scriptExports || {}
- // ES6 modules interop
- var type = typeof scriptExports.default
- if (type === 'object' || type === 'function') {
- scriptExports = scriptExports.default
- }
- // Vue.extend constructor export interop
- var options = typeof scriptExports === 'function'
- ? scriptExports.options
- : scriptExports
- // render functions
- if (render) {
- options.render = render
- options.staticRenderFns = staticRenderFns
- options._compiled = true
- }
- // functional template
- if (functionalTemplate) {
- options.functional = true
- }
- // scopedId
- if (scopeId) {
- options._scopeId = scopeId
- }
- var hook
- if (moduleIdentifier) { // server build
- hook = function (context) {
- // 2.3 injection
- context =
- context || // cached call
- (this.$vnode && this.$vnode.ssrContext) || // stateful
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
- // 2.2 with runInNewContext: true
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
- context = __VUE_SSR_CONTEXT__
- }
- // inject component styles
- if (injectStyles) {
- injectStyles.call(this, context)
- }
- // register component module identifier for async chunk inferrence
- if (context && context._registeredComponents) {
- context._registeredComponents.add(moduleIdentifier)
- }
- }
- // used by ssr in case component is cached and beforeCreate
- // never gets called
- options._ssrRegister = hook
- } else if (injectStyles) {
- hook = shadowMode
- ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
- : injectStyles
- }
- if (hook) {
- if (options.functional) {
- // for template-only hot-reload because in that case the render fn doesn't
- // go through the normalizer
- options._injectStyles = hook
- // register for functioal component in vue file
- var originalRender = options.render
- options.render = function renderWithStyleInjection (h, context) {
- hook.call(context)
- return originalRender(h, context)
- }
- } else {
- // inject component registration as beforeCreate hook
- var existing = options.beforeCreate
- options.beforeCreate = existing
- ? [].concat(existing, hook)
- : [hook]
- }
- }
- return {
- exports: scriptExports,
- options: options
- }
- }
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.default = function (innerThis, boundThis) {
- if (innerThis !== boundThis) {
- throw new TypeError("Cannot instantiate an arrow function");
- }
- };
- /***/ }),
- /* 2 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _defineProperty = __webpack_require__(269);
- var _defineProperty2 = _interopRequireDefault(_defineProperty);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = function (obj, key, value) {
- if (key in obj) {
- (0, _defineProperty2.default)(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- };
- /***/ }),
- /* 3 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.sharpMatcherRegx = exports.dimensionMap = exports.findComponentUpward = exports.deepCopy = exports.firstUpperCase = exports.MutationObserver = undefined;
- var _getIterator2 = __webpack_require__(45);
- var _getIterator3 = _interopRequireDefault(_getIterator2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- exports.oneOf = oneOf;
- exports.camelcaseToHyphen = camelcaseToHyphen;
- exports.getScrollBarSize = getScrollBarSize;
- exports.getStyle = getStyle;
- exports.warnProp = warnProp;
- exports.scrollTop = scrollTop;
- exports.findComponentDownward = findComponentDownward;
- exports.findComponentsDownward = findComponentsDownward;
- exports.findComponentsUpward = findComponentsUpward;
- exports.findBrothersComponents = findBrothersComponents;
- exports.hasClass = hasClass;
- exports.addClass = addClass;
- exports.removeClass = removeClass;
- exports.setMatchMedia = setMatchMedia;
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- function oneOf(value, validList) {
- for (var i = 0; i < validList.length; i++) {
- if (value === validList[i]) {
- return true;
- }
- }
- return false;
- }
- function camelcaseToHyphen(str) {
- return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
- }
- var cached = void 0;
- function getScrollBarSize(fresh) {
- if (isServer) return 0;
- if (fresh || cached === undefined) {
- var inner = document.createElement('div');
- inner.style.width = '100%';
- inner.style.height = '200px';
- var outer = document.createElement('div');
- var outerStyle = outer.style;
- outerStyle.position = 'absolute';
- outerStyle.top = 0;
- outerStyle.left = 0;
- outerStyle.pointerEvents = 'none';
- outerStyle.visibility = 'hidden';
- outerStyle.width = '200px';
- outerStyle.height = '150px';
- outerStyle.overflow = 'hidden';
- outer.appendChild(inner);
- document.body.appendChild(outer);
- var widthContained = inner.offsetWidth;
- outer.style.overflow = 'scroll';
- var widthScroll = inner.offsetWidth;
- if (widthContained === widthScroll) {
- widthScroll = outer.clientWidth;
- }
- document.body.removeChild(outer);
- cached = widthContained - widthScroll;
- }
- return cached;
- }
- var MutationObserver = exports.MutationObserver = isServer ? false : window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
- var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
- var MOZ_HACK_REGEXP = /^moz([A-Z])/;
- function camelCase(name) {
- return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
- return offset ? letter.toUpperCase() : letter;
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
- }
- function getStyle(element, styleName) {
- if (!element || !styleName) return null;
- styleName = camelCase(styleName);
- if (styleName === 'float') {
- styleName = 'cssFloat';
- }
- try {
- var computed = document.defaultView.getComputedStyle(element, '');
- return element.style[styleName] || computed ? computed[styleName] : null;
- } catch (e) {
- return element.style[styleName];
- }
- }
- function firstUpperCase(str) {
- return str.toString()[0].toUpperCase() + str.toString().slice(1);
- }
- exports.firstUpperCase = firstUpperCase;
- function warnProp(component, prop, correctType, wrongType) {
- correctType = firstUpperCase(correctType);
- wrongType = firstUpperCase(wrongType);
- console.error('[iView warn]: Invalid prop: type check failed for prop ' + String(prop) + '. Expected ' + String(correctType) + ', got ' + String(wrongType) + '. (found in component: ' + String(component) + ')');
- }
- function typeOf(obj) {
- var toString = Object.prototype.toString;
- var map = {
- '[object Boolean]': 'boolean',
- '[object Number]': 'number',
- '[object String]': 'string',
- '[object Function]': 'function',
- '[object Array]': 'array',
- '[object Date]': 'date',
- '[object RegExp]': 'regExp',
- '[object Undefined]': 'undefined',
- '[object Null]': 'null',
- '[object Object]': 'object'
- };
- return map[toString.call(obj)];
- }
- function deepCopy(data) {
- var t = typeOf(data);
- var o = void 0;
- if (t === 'array') {
- o = [];
- } else if (t === 'object') {
- o = {};
- } else {
- return data;
- }
- if (t === 'array') {
- for (var i = 0; i < data.length; i++) {
- o.push(deepCopy(data[i]));
- }
- } else if (t === 'object') {
- for (var _i in data) {
- o[_i] = deepCopy(data[_i]);
- }
- }
- return o;
- }
- exports.deepCopy = deepCopy;
- function scrollTop(el) {
- var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var to = arguments[2];
- var duration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 500;
- var endCallback = arguments[4];
- if (!window.requestAnimationFrame) {
- window.requestAnimationFrame = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
- return window.setTimeout(callback, 1000 / 60);
- };
- }
- var difference = Math.abs(from - to);
- var step = Math.ceil(difference / duration * 50);
- function scroll(start, end, step) {
- var _this = this;
- if (start === end) {
- endCallback && endCallback();
- return;
- }
- var d = start + step > end ? end : start + step;
- if (start > end) {
- d = start - step < end ? end : start - step;
- }
- if (el === window) {
- window.scrollTo(d, d);
- } else {
- el.scrollTop = d;
- }
- window.requestAnimationFrame(function () {
- (0, _newArrowCheck3.default)(this, _this);
- return scroll(d, end, step);
- }.bind(this));
- }
- scroll(from, to, step);
- }
- function findComponentUpward(context, componentName, componentNames) {
- if (typeof componentName === 'string') {
- componentNames = [componentName];
- } else {
- componentNames = componentName;
- }
- var parent = context.$parent;
- var name = parent.$options.name;
- while (parent && (!name || componentNames.indexOf(name) < 0)) {
- parent = parent.$parent;
- if (parent) name = parent.$options.name;
- }
- return parent;
- }
- exports.findComponentUpward = findComponentUpward;
- function findComponentDownward(context, componentName) {
- var $children = context.$children;
- var children = null;
- if ($children.length) {
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = (0, _getIterator3.default)($children), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var child = _step.value;
- var name = child.$options.name;
- if (name === componentName) {
- children = child;
- break;
- } else {
- children = findComponentDownward(child, componentName);
- if (children) break;
- }
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- }
- return children;
- }
- function findComponentsDownward(context, componentName) {
- var _this2 = this;
- return context.$children.reduce(function (components, child) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (child.$options.name === componentName) components.push(child);
- var foundChilds = findComponentsDownward(child, componentName);
- return components.concat(foundChilds);
- }.bind(this), []);
- }
- function findComponentsUpward(context, componentName) {
- var parents = [];
- var parent = context.$parent;
- if (parent) {
- if (parent.$options.name === componentName) parents.push(parent);
- return parents.concat(findComponentsUpward(parent, componentName));
- } else {
- return [];
- }
- }
- function findBrothersComponents(context, componentName) {
- var _this3 = this;
- var exceptMe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- var res = context.$parent.$children.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return item.$options.name === componentName;
- }.bind(this));
- var index = res.findIndex(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return item._uid === context._uid;
- }.bind(this));
- if (exceptMe) res.splice(index, 1);
- return res;
- }
- var trim = function trim(string) {
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
- };
- function hasClass(el, cls) {
- if (!el || !cls) return false;
- if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
- if (el.classList) {
- return el.classList.contains(cls);
- } else {
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
- }
- }
- function addClass(el, cls) {
- if (!el) return;
- var curClass = el.className;
- var classes = (cls || '').split(' ');
- for (var i = 0, j = classes.length; i < j; i++) {
- var clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.add(clsName);
- } else {
- if (!hasClass(el, clsName)) {
- curClass += ' ' + clsName;
- }
- }
- }
- if (!el.classList) {
- el.className = curClass;
- }
- }
- function removeClass(el, cls) {
- if (!el || !cls) return;
- var classes = cls.split(' ');
- var curClass = ' ' + el.className + ' ';
- for (var i = 0, j = classes.length; i < j; i++) {
- var clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.remove(clsName);
- } else {
- if (hasClass(el, clsName)) {
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
- }
- }
- }
- if (!el.classList) {
- el.className = trim(curClass);
- }
- }
- var dimensionMap = exports.dimensionMap = {
- xs: '480px',
- sm: '576px',
- md: '768px',
- lg: '992px',
- xl: '1200px',
- xxl: '1600px'
- };
- function setMatchMedia() {
- var _this4 = this;
- if (typeof window !== 'undefined') {
- var matchMediaPolyfill = function (mediaQuery) {
- (0, _newArrowCheck3.default)(this, _this4);
- return {
- media: mediaQuery,
- matches: false,
- on: function on() {},
- off: function off() {}
- };
- }.bind(this);
- window.matchMedia = window.matchMedia || matchMediaPolyfill;
- }
- }
- var sharpMatcherRegx = exports.sharpMatcherRegx = /#([^#]+)$/;
- /***/ }),
- /* 4 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function _broadcast(componentName, eventName, params) {
- var _this = this;
- this.$children.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- var name = child.$options.name;
- if (name === componentName) {
- child.$emit.apply(child, [eventName].concat(params));
- } else {
- _broadcast.apply(child, [componentName, eventName].concat([params]));
- }
- }.bind(this));
- }
- exports.default = {
- methods: {
- dispatch: function dispatch(componentName, eventName, params) {
- var parent = this.$parent || this.$root;
- var name = parent.$options.name;
- while (parent && (!name || name !== componentName)) {
- parent = parent.$parent;
- if (parent) {
- name = parent.$options.name;
- }
- }
- if (parent) {
- parent.$emit.apply(parent, [eventName].concat(params));
- }
- },
- broadcast: function broadcast(componentName, eventName, params) {
- _broadcast.call(this, componentName, eventName, params);
- }
- }
- };
- /***/ }),
- /* 5 */
- /***/ (function(module, exports) {
- var core = module.exports = { version: '2.6.9' };
- if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _locale = __webpack_require__(120);
- exports.default = {
- methods: {
- t: function t() {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return _locale.t.apply(this, args);
- }
- }
- };
- /***/ }),
- /* 7 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(9);
- var core = __webpack_require__(5);
- var ctx = __webpack_require__(24);
- var hide = __webpack_require__(25);
- var has = __webpack_require__(30);
- var PROTOTYPE = 'prototype';
- var $export = function (type, name, source) {
- var IS_FORCED = type & $export.F;
- var IS_GLOBAL = type & $export.G;
- var IS_STATIC = type & $export.S;
- var IS_PROTO = type & $export.P;
- var IS_BIND = type & $export.B;
- var IS_WRAP = type & $export.W;
- var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
- var expProto = exports[PROTOTYPE];
- var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
- var key, own, out;
- if (IS_GLOBAL) source = name;
- for (key in source) {
- // contains in native
- own = !IS_FORCED && target && target[key] !== undefined;
- if (own && has(exports, key)) continue;
- // export native or passed
- out = own ? target[key] : source[key];
- // prevent global pollution for namespaces
- exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
- // bind timers to global for call from export context
- : IS_BIND && own ? ctx(out, global)
- // wrap global constructors for prevent change them in library
- : IS_WRAP && target[key] == out ? (function (C) {
- var F = function (a, b, c) {
- if (this instanceof C) {
- switch (arguments.length) {
- case 0: return new C();
- case 1: return new C(a);
- case 2: return new C(a, b);
- } return new C(a, b, c);
- } return C.apply(this, arguments);
- };
- F[PROTOTYPE] = C[PROTOTYPE];
- return F;
- // make static versions for prototype methods
- })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
- // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
- if (IS_PROTO) {
- (exports.virtual || (exports.virtual = {}))[key] = out;
- // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
- if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
- }
- }
- };
- // type bitmap
- $export.F = 1; // forced
- $export.G = 2; // global
- $export.S = 4; // static
- $export.P = 8; // proto
- $export.B = 16; // bind
- $export.W = 32; // wrap
- $export.U = 64; // safe
- $export.R = 128; // real proto method for `library`
- module.exports = $export;
- /***/ }),
- /* 8 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__ = __webpack_require__(101);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__ = __webpack_require__(275);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 9 */
- /***/ (function(module, exports) {
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
- if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
- var store = __webpack_require__(67)('wks');
- var uid = __webpack_require__(53);
- var Symbol = __webpack_require__(9).Symbol;
- var USE_SYMBOL = typeof Symbol == 'function';
- var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
- };
- $exports.store = store;
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- inject: {
- FormInstance: {
- default: ''
- }
- },
- computed: {
- itemDisabled: function itemDisabled() {
- var state = this.disabled;
- if (!state && this.FormInstance) state = this.FormInstance.disabled;
- return state;
- }
- }
- };
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.off = exports.on = undefined;
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- var on = exports.on = function () {
- if (!isServer && document.addEventListener) {
- return function (element, event, handler) {
- var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- if (element && event && handler) {
- element.addEventListener(event, handler, useCapture);
- }
- };
- } else {
- return function (element, event, handler) {
- if (element && event && handler) {
- element.attachEvent('on' + event, handler);
- }
- };
- }
- }();
- var off = exports.off = function () {
- if (!isServer && document.removeEventListener) {
- return function (element, event, handler) {
- var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- if (element && event) {
- element.removeEventListener(event, handler, useCapture);
- }
- };
- } else {
- return function (element, event, handler) {
- if (element && event) {
- element.detachEvent('on' + event, handler);
- }
- };
- }
- }();
- /***/ }),
- /* 13 */
- /***/ (function(module, exports, __webpack_require__) {
- // Thank's IE8 for his funny defineProperty
- module.exports = !__webpack_require__(31)(function () {
- return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /* 14 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(22);
- var IE8_DOM_DEFINE = __webpack_require__(98);
- var toPrimitive = __webpack_require__(70);
- var dP = Object.defineProperty;
- exports.f = __webpack_require__(13) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return dP(O, P, Attributes);
- } catch (e) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /* 15 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(264), __esModule: true };
- /***/ }),
- /* 16 */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_16__;
- /***/ }),
- /* 17 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _from = __webpack_require__(111);
- var _from2 = _interopRequireDefault(_from);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = function (arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
- arr2[i] = arr[i];
- }
- return arr2;
- } else {
- return (0, _from2.default)(arr);
- }
- };
- /***/ }),
- /* 18 */
- /***/ (function(module, exports) {
- module.exports = function (it) {
- return typeof it === 'object' ? it !== null : typeof it === 'function';
- };
- /***/ }),
- /* 19 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _icon2.default;
- /***/ }),
- /* 20 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.TYPE_VALUE_RESOLVER_MAP = exports.DEFAULT_FORMATS = exports.formatDateLabels = exports.initTimeDate = exports.nextMonth = exports.prevMonth = exports.siblingMonth = exports.getFirstDayOfMonth = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isInRange = exports.clearHours = exports.toDate = undefined;
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _date2 = __webpack_require__(407);
- var _date3 = _interopRequireDefault(_date2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var toDate = exports.toDate = function toDate(date) {
- var _date = new Date(date);
- if (isNaN(_date.getTime()) && typeof date === 'string') {
- _date = date.split('-').map(Number);
- _date[1] += 1;
- _date = new (Function.prototype.bind.apply(Date, [null].concat((0, _toConsumableArray3.default)(_date))))();
- }
- if (isNaN(_date.getTime())) return null;
- return _date;
- };
- var clearHours = exports.clearHours = function clearHours(time) {
- var cloneDate = new Date(time);
- cloneDate.setHours(0, 0, 0, 0);
- return cloneDate.getTime();
- };
- var isInRange = exports.isInRange = function (time, a, b) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (!a || !b) return false;
- var _sort = [a, b].sort(),
- _sort2 = (0, _slicedToArray3.default)(_sort, 2),
- start = _sort2[0],
- end = _sort2[1];
- return time >= start && time <= end;
- }.bind(undefined);
- var formatDate = exports.formatDate = function formatDate(date, format) {
- date = toDate(date);
- if (!date) return '';
- return _date3.default.format(date, format || 'yyyy-MM-dd');
- };
- var parseDate = exports.parseDate = function parseDate(string, format) {
- return _date3.default.parse(string, format || 'yyyy-MM-dd');
- };
- var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {
- return new Date(year, month + 1, 0).getDate();
- };
- var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {
- var temp = new Date(date.getTime());
- temp.setDate(1);
- return temp.getDay();
- };
- var siblingMonth = exports.siblingMonth = function siblingMonth(src, diff) {
- var temp = new Date(src);
- var newMonth = temp.getMonth() + diff;
- var newMonthDayCount = getDayCountOfMonth(temp.getFullYear(), newMonth);
- if (newMonthDayCount < temp.getDate()) {
- temp.setDate(newMonthDayCount);
- }
- temp.setMonth(newMonth);
- return temp;
- };
- var prevMonth = exports.prevMonth = function prevMonth(src) {
- return siblingMonth(src, -1);
- };
- var nextMonth = exports.nextMonth = function nextMonth(src) {
- return siblingMonth(src, 1);
- };
- var initTimeDate = exports.initTimeDate = function initTimeDate() {
- var date = new Date();
- date.setHours(0);
- date.setMinutes(0);
- date.setSeconds(0);
- return date;
- };
- var formatDateLabels = exports.formatDateLabels = function () {
- var _this = this;
- var formats = {
- yyyy: function yyyy(date) {
- (0, _newArrowCheck3.default)(this, _this);
- return date.getFullYear();
- }.bind(this),
- m: function m(date) {
- (0, _newArrowCheck3.default)(this, _this);
- return date.getMonth() + 1;
- }.bind(this),
- mm: function mm(date) {
- (0, _newArrowCheck3.default)(this, _this);
- return ('0' + (date.getMonth() + 1)).slice(-2);
- }.bind(this),
- mmm: function mmm(date, locale) {
- (0, _newArrowCheck3.default)(this, _this);
- var monthName = date.toLocaleDateString(locale, {
- month: 'long'
- });
- return monthName.slice(0, 3);
- }.bind(this),
- Mmm: function Mmm(date, locale) {
- (0, _newArrowCheck3.default)(this, _this);
- var monthName = date.toLocaleDateString(locale, {
- month: 'long'
- });
- return (monthName[0].toUpperCase() + monthName.slice(1).toLowerCase()).slice(0, 3);
- }.bind(this),
- mmmm: function mmmm(date, locale) {
- (0, _newArrowCheck3.default)(this, _this);
- return date.toLocaleDateString(locale, {
- month: 'long'
- });
- }.bind(this),
- Mmmm: function Mmmm(date, locale) {
- (0, _newArrowCheck3.default)(this, _this);
- var monthName = date.toLocaleDateString(locale, {
- month: 'long'
- });
- return monthName[0].toUpperCase() + monthName.slice(1).toLowerCase();
- }.bind(this)
- };
- var formatRegex = new RegExp(['yyyy', 'Mmmm', 'mmmm', 'Mmm', 'mmm', 'mm', 'm'].join('|'), 'g');
- return function (locale, format, date) {
- var _this2 = this;
- var componetsRegex = /(\[[^\]]+\])([^\[\]]+)(\[[^\]]+\])/;
- var components = format.match(componetsRegex).slice(1);
- var separator = components[1];
- var labels = [components[0], components[2]].map(function (component) {
- (0, _newArrowCheck3.default)(this, _this2);
- var label = component.replace(/\[[^\]]+\]/, function (str) {
- (0, _newArrowCheck3.default)(this, _this2);
- return str.slice(1, -1).replace(formatRegex, function (match) {
- (0, _newArrowCheck3.default)(this, _this2);
- return formats[match](date, locale);
- }.bind(this));
- }.bind(this));
- return {
- label: label,
- type: component.indexOf('yy') != -1 ? 'year' : 'month'
- };
- }.bind(this));
- return {
- separator: separator,
- labels: labels
- };
- };
- }();
- var DEFAULT_FORMATS = exports.DEFAULT_FORMATS = {
- date: 'yyyy-MM-dd',
- month: 'yyyy-MM',
- year: 'yyyy',
- datetime: 'yyyy-MM-dd HH:mm:ss',
- time: 'HH:mm:ss',
- timerange: 'HH:mm:ss',
- daterange: 'yyyy-MM-dd',
- datetimerange: 'yyyy-MM-dd HH:mm:ss'
- };
- var DATE_FORMATTER = function DATE_FORMATTER(value, format) {
- return formatDate(value, format);
- };
- var DATE_PARSER = function DATE_PARSER(text, format) {
- return parseDate(text, format);
- };
- var RANGE_FORMATTER = function RANGE_FORMATTER(value, format, RANGE_SEPARATOR) {
- if (Array.isArray(value) && value.length === 2) {
- var start = value[0];
- var end = value[1];
- if (start && end) {
- return formatDate(start, format) + RANGE_SEPARATOR + formatDate(end, format);
- }
- } else if (!Array.isArray(value) && value instanceof Date) {
- return formatDate(value, format);
- }
- return '';
- };
- var RANGE_PARSER = function RANGE_PARSER(text, format, RANGE_SEPARATOR) {
- var array = Array.isArray(text) ? text : text.split(RANGE_SEPARATOR);
- if (array.length === 2) {
- var range1 = array[0];
- var range2 = array[1];
- return [range1 instanceof Date ? range1 : parseDate(range1, format), range2 instanceof Date ? range2 : parseDate(range2, format)];
- }
- return [];
- };
- var TYPE_VALUE_RESOLVER_MAP = exports.TYPE_VALUE_RESOLVER_MAP = {
- default: {
- formatter: function formatter(value) {
- if (!value) return '';
- return '' + value;
- },
- parser: function parser(text) {
- if (text === undefined || text === '') return null;
- return text;
- }
- },
- date: {
- formatter: DATE_FORMATTER,
- parser: DATE_PARSER
- },
- datetime: {
- formatter: DATE_FORMATTER,
- parser: DATE_PARSER
- },
- daterange: {
- formatter: RANGE_FORMATTER,
- parser: RANGE_PARSER
- },
- datetimerange: {
- formatter: RANGE_FORMATTER,
- parser: RANGE_PARSER
- },
- timerange: {
- formatter: RANGE_FORMATTER,
- parser: RANGE_PARSER
- },
- time: {
- formatter: DATE_FORMATTER,
- parser: DATE_PARSER
- },
- month: {
- formatter: DATE_FORMATTER,
- parser: DATE_PARSER
- },
- year: {
- formatter: DATE_FORMATTER,
- parser: DATE_PARSER
- },
- multiple: {
- formatter: function formatter(value, format) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return value.filter(Boolean).map(function (date) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return formatDate(date, format);
- }.bind(undefined)).join(',');
- }.bind(undefined),
- parser: function parser(value, format) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var values = typeof value === 'string' ? value.split(',') : value;
- return values.map(function (value) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (value instanceof Date) return value;
- if (typeof value === 'string') value = value.trim();else if (typeof value !== 'number' && !value) value = '';
- return parseDate(value, format);
- }.bind(undefined));
- }.bind(undefined)
- },
- number: {
- formatter: function formatter(value) {
- if (!value) return '';
- return '' + value;
- },
- parser: function parser(text) {
- var result = Number(text);
- if (!isNaN(text)) {
- return result;
- } else {
- return null;
- }
- }
- }
- };
- /***/ }),
- /* 21 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(260), __esModule: true };
- /***/ }),
- /* 22 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(18);
- module.exports = function (it) {
- if (!isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
- };
- /***/ }),
- /* 23 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function getTarget(node) {
- if (node === void 0) {
- node = document.body;
- }
- if (node === true) {
- return document.body;
- }
- return node instanceof window.Node ? node : document.querySelector(node);
- }
- var directive = {
- inserted: function inserted(el, _ref, vnode) {
- var value = _ref.value;
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
- var parentNode = el.parentNode;
- if (!parentNode) return;
- var home = document.createComment('');
- var hasMovedOut = false;
- if (value !== false) {
- parentNode.replaceChild(home, el);
- getTarget(value).appendChild(el);
- hasMovedOut = true;
- }
- if (!el.__transferDomData) {
- el.__transferDomData = {
- parentNode: parentNode,
- home: home,
- target: getTarget(value),
- hasMovedOut: hasMovedOut
- };
- }
- },
- componentUpdated: function componentUpdated(el, _ref2) {
- var value = _ref2.value;
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- var ref$1 = el.__transferDomData;
- if (!ref$1) return;
- var parentNode = ref$1.parentNode;
- var home = ref$1.home;
- var hasMovedOut = ref$1.hasMovedOut;
- if (!hasMovedOut && value) {
- parentNode.replaceChild(home, el);
- getTarget(value).appendChild(el);
- el.__transferDomData = (0, _assign2.default)({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
- } else if (hasMovedOut && value === false) {
- parentNode.replaceChild(el, home);
- el.__transferDomData = (0, _assign2.default)({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
- } else if (value) {
- getTarget(value).appendChild(el);
- }
- },
- unbind: function unbind(el) {
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className.replace('v-transfer-dom', '');
- var ref$1 = el.__transferDomData;
- if (!ref$1) return;
- if (el.__transferDomData.hasMovedOut === true) {
- el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el);
- }
- el.__transferDomData = null;
- }
- };
- exports.default = directive;
- /***/ }),
- /* 24 */
- /***/ (function(module, exports, __webpack_require__) {
- // optional / simple context binding
- var aFunction = __webpack_require__(43);
- module.exports = function (fn, that, length) {
- aFunction(fn);
- if (that === undefined) return fn;
- switch (length) {
- 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);
- };
- };
- /***/ }),
- /* 25 */
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(14);
- var createDesc = __webpack_require__(44);
- module.exports = __webpack_require__(13) ? function (object, key, value) {
- return dP.f(object, key, createDesc(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /* 26 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _isIterable2 = __webpack_require__(291);
- var _isIterable3 = _interopRequireDefault(_isIterable2);
- var _getIterator2 = __webpack_require__(45);
- var _getIterator3 = _interopRequireDefault(_getIterator2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = function () {
- function sliceIterator(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
- try {
- for (var _i = (0, _getIterator3.default)(arr), _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"]) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- return function (arr, i) {
- if (Array.isArray(arr)) {
- return arr;
- } else if ((0, _isIterable3.default)(Object(arr))) {
- return sliceIterator(arr, i);
- } else {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- };
- }();
- /***/ }),
- /* 27 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _iterator = __webpack_require__(301);
- var _iterator2 = _interopRequireDefault(_iterator);
- var _symbol = __webpack_require__(303);
- var _symbol2 = _interopRequireDefault(_symbol);
- var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
- return typeof obj === "undefined" ? "undefined" : _typeof(obj);
- } : function (obj) {
- return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
- };
- /***/ }),
- /* 28 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__ = __webpack_require__(131);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__ = __webpack_require__(355);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 29 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.13 ToObject(argument)
- var defined = __webpack_require__(63);
- module.exports = function (it) {
- return Object(defined(it));
- };
- /***/ }),
- /* 30 */
- /***/ (function(module, exports) {
- var hasOwnProperty = {}.hasOwnProperty;
- module.exports = function (it, key) {
- return hasOwnProperty.call(it, key);
- };
- /***/ }),
- /* 31 */
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (e) {
- return true;
- }
- };
- /***/ }),
- /* 32 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _assign2.default || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- /***/ }),
- /* 33 */
- /***/ (function(module, exports, __webpack_require__) {
- // to indexed object, toObject with fallback for non-array-like ES3 strings
- var IObject = __webpack_require__(64);
- var defined = __webpack_require__(63);
- module.exports = function (it) {
- return IObject(defined(it));
- };
- /***/ }),
- /* 34 */
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /* 35 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $at = __webpack_require__(280)(true);
- // 21.1.3.27 String.prototype[@@iterator]()
- __webpack_require__(72)(String, 'String', function (iterated) {
- this._t = String(iterated); // target
- this._i = 0; // next index
- // 21.1.5.2.1 %StringIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var index = this._i;
- var point;
- if (index >= O.length) return { value: undefined, done: true };
- point = $at(O, index);
- this._i += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /* 36 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__ = __webpack_require__(115);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__ = __webpack_require__(300);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 37 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var transferIndex = 0;
- var lastVisibleIndex = 0;
- function transferIncrease() {
- exports.transferIndex = transferIndex += 1;
- }
- function lastVisibleIncrease() {
- exports.lastVisibleIndex = lastVisibleIndex += 1;
- }
- exports.transferIndex = transferIndex;
- exports.transferIncrease = transferIncrease;
- exports.lastVisibleIndex = lastVisibleIndex;
- exports.lastVisibleIncrease = lastVisibleIncrease;
- /***/ }),
- /* 38 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__ = __webpack_require__(124);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__ = __webpack_require__(339);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 39 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _isFinite = __webpack_require__(75);
- var _isFinite2 = _interopRequireDefault(_isFinite);
- exports.changeColor = changeColor;
- exports.clamp = clamp;
- exports.getIncrement = getIncrement;
- exports.getTouches = getTouches;
- exports.toRGBAString = toRGBAString;
- exports.isValidHex = isValidHex;
- exports.simpleCheckForValidColor = simpleCheckForValidColor;
- var _tinycolor = __webpack_require__(149);
- var _tinycolor2 = _interopRequireDefault(_tinycolor);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function setAlpha(data, alpha) {
- var color = (0, _tinycolor2.default)(data);
- var _a = color._a;
- if (_a === undefined || _a === null) {
- color.setAlpha(alpha || 1);
- }
- return color;
- }
- function getColor(data, colorData) {
- var alpha = colorData && colorData.a;
- if (colorData) {
- if (colorData.hsl) {
- return setAlpha(colorData.hsl, alpha);
- }
- if (colorData.hex && colorData.hex.length > 0) {
- return setAlpha(colorData.hex, alpha);
- }
- }
- return setAlpha(colorData, alpha);
- }
- function changeColor(data, oldHue) {
- var colorData = data === '' ? '#2d8cf0' : data;
- var color = getColor(data, colorData);
- var hsl = color.toHsl();
- var hsv = color.toHsv();
- if (hsl.s === 0) {
- hsl.h = colorData.h || colorData.hsl && colorData.hsl.h || oldHue || 0;
- hsv.h = hsl.h;
- }
- if (hsv.v < 0.0164) {
- hsv.h = colorData.h || colorData.hsv && colorData.hsv.h || 0;
- hsv.s = colorData.s || colorData.hsv && colorData.hsv.s || 0;
- }
- if (hsl.l < 0.01) {
- hsl.h = colorData.h || colorData.hsl && colorData.hsl.h || 0;
- hsl.s = colorData.s || colorData.hsl && colorData.hsl.s || 0;
- }
- return {
- hsl: hsl,
- hex: color.toHexString().toUpperCase(),
- rgba: color.toRgb(),
- hsv: hsv,
- oldHue: colorData.h || oldHue || hsl.h,
- source: colorData.source,
- a: colorData.a || color.getAlpha()
- };
- }
- function clamp(value, min, max) {
- if (value < min) {
- return min;
- }
- if (value > max) {
- return max;
- }
- return value;
- }
- function getIncrement(key, keys, increment) {
- return (0, _assist.oneOf)(key, keys) ? increment : 0;
- }
- function getTouches(e, prop) {
- return e.touches ? e.touches[0][prop] : 0;
- }
- function toRGBAString(rgba) {
- var r = rgba.r,
- g = rgba.g,
- b = rgba.b,
- a = rgba.a;
- return 'rgba(' + String([r, g, b, a].join(',')) + ')';
- }
- function isValidHex(hex) {
- return (0, _tinycolor2.default)(hex).isValid();
- }
- function checkIteratee(data, counts, letter) {
- var checked = counts.checked,
- passed = counts.passed;
- var value = data[letter];
- if (value) {
- checked += 1;
- if ((0, _isFinite2.default)(value)) {
- passed += 1;
- }
- }
- return { checked: checked, passed: passed };
- }
- var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
- function simpleCheckForValidColor(data) {
- var results = keysToCheck.reduce(checkIteratee.bind(null, data), { checked: 0, passed: 0 });
- return results.checked === results.passed ? data : undefined;
- }
- /***/ }),
- /* 40 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.14 / 15.2.3.14 Object.keys(O)
- var $keys = __webpack_require__(96);
- var enumBugKeys = __webpack_require__(68);
- module.exports = Object.keys || function keys(O) {
- return $keys(O, enumBugKeys);
- };
- /***/ }),
- /* 41 */
- /***/ (function(module, exports) {
- var toString = {}.toString;
- module.exports = function (it) {
- return toString.call(it).slice(8, -1);
- };
- /***/ }),
- /* 42 */
- /***/ (function(module, exports) {
- module.exports = true;
- /***/ }),
- /* 43 */
- /***/ (function(module, exports) {
- module.exports = function (it) {
- if (typeof it != 'function') throw TypeError(it + ' is not a function!');
- return it;
- };
- /***/ }),
- /* 44 */
- /***/ (function(module, exports) {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /* 45 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(276), __esModule: true };
- /***/ }),
- /* 46 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(277);
- var global = __webpack_require__(9);
- var hide = __webpack_require__(25);
- var Iterators = __webpack_require__(34);
- var TO_STRING_TAG = __webpack_require__(10)('toStringTag');
- var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
- 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
- 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
- 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
- 'TextTrackList,TouchList').split(',');
- for (var i = 0; i < DOMIterables.length; i++) {
- var NAME = DOMIterables[i];
- var Collection = global[NAME];
- var proto = Collection && Collection.prototype;
- if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
- Iterators[NAME] = Iterators.Array;
- }
- /***/ }),
- /* 47 */
- /***/ (function(module, exports, __webpack_require__) {
- var def = __webpack_require__(14).f;
- var has = __webpack_require__(30);
- var TAG = __webpack_require__(10)('toStringTag');
- module.exports = function (it, tag, stat) {
- if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
- };
- /***/ }),
- /* 48 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- props: {
- to: {
- type: [Object, String]
- },
- replace: {
- type: Boolean,
- default: false
- },
- target: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['_blank', '_self', '_parent', '_top']);
- },
- default: '_self'
- },
- append: {
- type: Boolean,
- required: false,
- default: false
- }
- },
- computed: {
- linkUrl: function linkUrl() {
- var type = (0, _typeof3.default)(this.to);
- if (type !== 'string') {
- return null;
- }
- if (this.to.includes('//')) {
- return this.to;
- }
- var router = this.$router;
- if (router) {
- var current = this.$route;
- var route = router.resolve(this.to, current, this.append);
- return route ? route.href : this.to;
- }
- return this.to;
- }
- },
- methods: {
- handleOpenTo: function handleOpenTo() {
- var router = this.$router;
- var to = this.to;
- if (router) {
- var current = this.$route;
- var route = router.resolve(this.to, current, this.append);
- to = route ? route.href : this.to;
- }
- if (typeof this.to === 'string') return;
- window.open(to);
- },
- handleClick: function handleClick() {
- var _this = this;
- var new_window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var router = this.$router;
- if (new_window) {
- this.handleOpenTo();
- } else {
- if (router) {
- if (typeof this.to === 'string' && this.to.includes('//')) {
- window.location.href = this.to;
- } else {
- this.replace ? this.$router.replace(this.to, function () {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this)) : this.$router.push(this.to, function () {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this));
- }
- } else {
- window.location.href = this.to;
- }
- }
- },
- handleCheckClick: function handleCheckClick(event) {
- var new_window = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (this.to) {
- if (this.target === '_blank') {
- this.handleOpenTo();
- return false;
- } else {
- event.preventDefault();
- this.handleClick(new_window);
- }
- }
- }
- }
- };
- /***/ }),
- /* 49 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__ = __webpack_require__(142);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__ = __webpack_require__(381);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 50 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- data: function data() {
- return {
- prefixCls: 'ivu-color-picker',
- inputPrefixCls: 'ivu-input',
- iconPrefixCls: 'ivu-icon',
- transferPrefixCls: 'ivu-transfer'
- };
- }
- };
- /***/ }),
- /* 51 */
- /***/ (function(module, exports, __webpack_require__) {
- var ctx = __webpack_require__(24);
- var call = __webpack_require__(112);
- var isArrayIter = __webpack_require__(113);
- var anObject = __webpack_require__(22);
- var toLength = __webpack_require__(52);
- var getIterFn = __webpack_require__(73);
- var BREAK = {};
- var RETURN = {};
- var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
- var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
- var f = ctx(fn, that, entries ? 2 : 1);
- var index = 0;
- var length, step, iterator, result;
- if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
- // fast case for arrays with default iterator
- if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
- result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
- if (result === BREAK || result === RETURN) return result;
- } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
- result = call(iterator, f, step.value, entries);
- if (result === BREAK || result === RETURN) return result;
- }
- };
- exports.BREAK = BREAK;
- exports.RETURN = RETURN;
- /***/ }),
- /* 52 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.15 ToLength
- var toInteger = __webpack_require__(65);
- var min = Math.min;
- module.exports = function (it) {
- return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
- };
- /***/ }),
- /* 53 */
- /***/ (function(module, exports) {
- var id = 0;
- var px = Math.random();
- module.exports = function (key) {
- return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
- };
- /***/ }),
- /* 54 */
- /***/ (function(module, exports) {
- exports.f = {}.propertyIsEnumerable;
- /***/ }),
- /* 55 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- var anObject = __webpack_require__(22);
- var dPs = __webpack_require__(104);
- var enumBugKeys = __webpack_require__(68);
- var IE_PROTO = __webpack_require__(66)('IE_PROTO');
- var Empty = function () { /* empty */ };
- var PROTOTYPE = 'prototype';
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var createDict = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = __webpack_require__(69)('iframe');
- var i = enumBugKeys.length;
- var lt = '<';
- var gt = '>';
- var iframeDocument;
- iframe.style.display = 'none';
- __webpack_require__(105).appendChild(iframe);
- iframe.src = 'javascript:'; // eslint-disable-line no-script-url
- // createDict = iframe.contentWindow.Object;
- // html.removeChild(iframe);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
- return createDict();
- };
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE] = anObject(O);
- result = new Empty();
- Empty[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = createDict();
- return Properties === undefined ? result : dPs(result, Properties);
- };
- /***/ }),
- /* 56 */
- /***/ (function(module, exports, __webpack_require__) {
- // getting tag from 19.1.3.6 Object.prototype.toString()
- var cof = __webpack_require__(41);
- var TAG = __webpack_require__(10)('toStringTag');
- // ES3 wrong here
- var ARG = cof(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (e) { /* empty */ }
- };
- module.exports = function (it) {
- var O, T, B;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
- // builtinTag case
- : ARG ? cof(O)
- // ES3 arguments fallback
- : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
- };
- /***/ }),
- /* 57 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(296), __esModule: true };
- /***/ }),
- /* 58 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- props: {
- disabledHours: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- disabledMinutes: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- disabledSeconds: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- hideDisabledOptions: {
- type: Boolean,
- default: false
- }
- }
- };
- /***/ }),
- /* 59 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__ = __webpack_require__(170);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__ = __webpack_require__(418);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 60 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker-panel';
- var datePrefixCls = 'ivu-date-picker';
- exports.default = {
- props: {
- confirm: {
- type: Boolean,
- default: false
- }
- },
- methods: {
- iconBtnCls: function iconBtnCls(direction) {
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- return [prefixCls + '-icon-btn', datePrefixCls + '-' + String(direction) + '-btn', datePrefixCls + '-' + String(direction) + '-btn-arrow' + String(type)];
- },
- handleShortcutClick: function handleShortcutClick(shortcut) {
- if (shortcut.value) this.$emit('on-pick', shortcut.value());
- if (shortcut.onClick) shortcut.onClick(this);
- },
- handlePickClear: function handlePickClear() {
- this.resetView();
- this.$emit('on-pick-clear');
- },
- handlePickSuccess: function handlePickSuccess() {
- this.resetView();
- this.$emit('on-pick-success');
- },
- handlePickClick: function handlePickClick() {
- this.$emit('on-pick-click');
- },
- resetView: function resetView() {
- var _this = this;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- return this.currentView = this.selectionMode;
- }.bind(this), 500);
- },
- handleClear: function handleClear() {
- var _this2 = this;
- this.dates = this.dates.map(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- return null;
- }.bind(this));
- this.rangeState = {};
- this.$emit('on-pick', this.dates);
- this.handleConfirm();
- },
- handleConfirm: function handleConfirm(visible, type) {
- this.$emit('on-pick', this.dates, visible, type || this.type);
- },
- onToggleVisibility: function onToggleVisibility(open) {
- var _$refs = this.$refs,
- timeSpinner = _$refs.timeSpinner,
- timeSpinnerEnd = _$refs.timeSpinnerEnd;
- if (open && timeSpinner) timeSpinner.updateScroll();
- if (open && timeSpinnerEnd) timeSpinnerEnd.updateScroll();
- }
- }
- };
- /***/ }),
- /* 61 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__ = __webpack_require__(179);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__ = __webpack_require__(432);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 62 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__ = __webpack_require__(180);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__ = __webpack_require__(433);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 63 */
- /***/ (function(module, exports) {
- // 7.2.1 RequireObjectCoercible(argument)
- module.exports = function (it) {
- if (it == undefined) throw TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /* 64 */
- /***/ (function(module, exports, __webpack_require__) {
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- var cof = __webpack_require__(41);
- // eslint-disable-next-line no-prototype-builtins
- module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
- return cof(it) == 'String' ? it.split('') : Object(it);
- };
- /***/ }),
- /* 65 */
- /***/ (function(module, exports) {
- // 7.1.4 ToInteger
- var ceil = Math.ceil;
- var floor = Math.floor;
- module.exports = function (it) {
- return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
- };
- /***/ }),
- /* 66 */
- /***/ (function(module, exports, __webpack_require__) {
- var shared = __webpack_require__(67)('keys');
- var uid = __webpack_require__(53);
- module.exports = function (key) {
- return shared[key] || (shared[key] = uid(key));
- };
- /***/ }),
- /* 67 */
- /***/ (function(module, exports, __webpack_require__) {
- var core = __webpack_require__(5);
- var global = __webpack_require__(9);
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || (global[SHARED] = {});
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: core.version,
- mode: __webpack_require__(42) ? 'pure' : 'global',
- copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
- });
- /***/ }),
- /* 68 */
- /***/ (function(module, exports) {
- // IE 8- don't enum bug keys
- module.exports = (
- 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
- ).split(',');
- /***/ }),
- /* 69 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(18);
- var document = __webpack_require__(9).document;
- // typeof document.createElement is 'object' in old IE
- var is = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return is ? document.createElement(it) : {};
- };
- /***/ }),
- /* 70 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.1.1 ToPrimitive(input [, PreferredType])
- var isObject = __webpack_require__(18);
- // 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 (it, S) {
- if (!isObject(it)) return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
- if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
- throw TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /* 71 */
- /***/ (function(module, exports) {
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /* 72 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var LIBRARY = __webpack_require__(42);
- var $export = __webpack_require__(7);
- var redefine = __webpack_require__(103);
- var hide = __webpack_require__(25);
- var Iterators = __webpack_require__(34);
- var $iterCreate = __webpack_require__(279);
- var setToStringTag = __webpack_require__(47);
- var getPrototypeOf = __webpack_require__(106);
- var ITERATOR = __webpack_require__(10)('iterator');
- var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
- var FF_ITERATOR = '@@iterator';
- var KEYS = 'keys';
- var VALUES = 'values';
- var returnThis = function () { return this; };
- module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
- $iterCreate(Constructor, NAME, next);
- var getMethod = function (kind) {
- if (!BUGGY && kind in proto) return proto[kind];
- switch (kind) {
- case KEYS: return function keys() { return new Constructor(this, kind); };
- case VALUES: return function values() { return new Constructor(this, kind); };
- } return function entries() { return new Constructor(this, kind); };
- };
- var TAG = NAME + ' Iterator';
- var DEF_VALUES = DEFAULT == VALUES;
- var VALUES_BUG = false;
- var proto = Base.prototype;
- var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
- var $default = $native || getMethod(DEFAULT);
- var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
- var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
- var methods, key, IteratorPrototype;
- // Fix native
- if ($anyNative) {
- IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
- if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
- // Set @@toStringTag to native iterators
- setToStringTag(IteratorPrototype, TAG, true);
- // fix for some old engines
- if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
- }
- }
- // fix Array#{values, @@iterator}.name in V8 / FF
- if (DEF_VALUES && $native && $native.name !== VALUES) {
- VALUES_BUG = true;
- $default = function values() { return $native.call(this); };
- }
- // Define iterator
- if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
- hide(proto, ITERATOR, $default);
- }
- // Plug for library
- Iterators[NAME] = $default;
- Iterators[TAG] = returnThis;
- if (DEFAULT) {
- methods = {
- values: DEF_VALUES ? $default : getMethod(VALUES),
- keys: IS_SET ? $default : getMethod(KEYS),
- entries: $entries
- };
- if (FORCED) for (key in methods) {
- if (!(key in proto)) redefine(proto, key, methods[key]);
- } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
- }
- return methods;
- };
- /***/ }),
- /* 73 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(56);
- var ITERATOR = __webpack_require__(10)('iterator');
- var Iterators = __webpack_require__(34);
- module.exports = __webpack_require__(5).getIteratorMethod = function (it) {
- if (it != undefined) return it[ITERATOR]
- || it['@@iterator']
- || Iterators[classof(it)];
- };
- /***/ }),
- /* 74 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__ = __webpack_require__(110);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__ = __webpack_require__(327);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 75 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(294), __esModule: true };
- /***/ }),
- /* 76 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.directive = undefined;
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _extends2 = __webpack_require__(32);
- var _extends3 = _interopRequireDefault(_extends2);
- var _defineProperties = __webpack_require__(311);
- var _defineProperties2 = _interopRequireDefault(_defineProperties);
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _create = __webpack_require__(314);
- var _create2 = _interopRequireDefault(_create);
- exports.install = install;
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var CLICK = 'click';
- var captureInstances = (0, _create2.default)(null);
- var nonCaptureInstances = (0, _create2.default)(null);
- var instancesList = [captureInstances, nonCaptureInstances];
- var commonHandler = function _onCommonEvent(context, instances, event) {
- var target = event.target;
- var itemIteratee = function _itemIteratee(item) {
- var el = item.el;
- if (el !== target && !el.contains(target)) {
- var binding = item.binding;
- if (binding.modifiers.stop) {
- event.stopPropagation();
- }
- if (binding.modifiers.prevent) {
- event.preventDefault();
- }
- binding.value.call(context, event);
- }
- };
- var keysIteratee = function _keysIteratee(eventName) {
- return instances[eventName].forEach(itemIteratee);
- };
- (0, _keys2.default)(instances).forEach(keysIteratee);
- };
- var captureEventHandler = function onCaptureEvent(event) {
- commonHandler(this, captureInstances, event);
- };
- var nonCaptureEventHandler = function onNonCaptureEvent(event) {
- commonHandler(this, nonCaptureInstances, event);
- };
- var getEventHandler = function _getEventHandler(useCapture) {
- return useCapture ? captureEventHandler : nonCaptureEventHandler;
- };
- var directive = exports.directive = (0, _defineProperties2.default)({}, {
- $_captureInstances: {
- value: captureInstances
- },
- $_nonCaptureInstances: {
- value: nonCaptureInstances
- },
- $_onCaptureEvent: {
- value: captureEventHandler
- },
- $_onNonCaptureEvent: {
- value: nonCaptureEventHandler
- },
- bind: {
- value: function bind(el, binding) {
- if (typeof binding.value !== 'function') {
- throw new TypeError('Binding value must be a function.');
- }
- var eventType = void 0;
- var modifiers = binding.modifiers;
- if (modifiers.click) eventType = 'click';else if (modifiers.mousedown) eventType = 'mousedown';else if (modifiers.touchstart) eventType = 'touchstart';else eventType = CLICK;
- var useCapture = binding.arg;
- var normalisedBinding = (0, _extends3.default)({}, binding, {
- modifiers: (0, _extends3.default)({
- capture: false,
- prevent: false,
- stop: false
- }, binding.modifiers)
- });
- var instances = useCapture ? captureInstances : nonCaptureInstances;
- if (!Array.isArray(instances[eventType])) {
- instances[eventType] = [];
- }
- if (instances[eventType].push({ el: el, binding: normalisedBinding }) === 1) {
- if ((typeof document === 'undefined' ? 'undefined' : (0, _typeof3.default)(document)) === 'object' && document) {
- document.addEventListener(eventType, getEventHandler(useCapture), useCapture);
- }
- }
- }
- },
- unbind: {
- value: function unbind(el) {
- var compareElements = function _compareElements(item) {
- return item.el !== el;
- };
- var instancesIteratee = function _instancesIteratee(instances) {
- var instanceKeys = (0, _keys2.default)(instances);
- if (instanceKeys.length) {
- var useCapture = instances === captureInstances;
- var keysIteratee = function _keysIteratee(eventName) {
- var newInstance = instances[eventName].filter(compareElements);
- if (newInstance.length) {
- instances[eventName] = newInstance;
- } else {
- if ((typeof document === 'undefined' ? 'undefined' : (0, _typeof3.default)(document)) === 'object' && document) {
- document.removeEventListener(eventName, getEventHandler(useCapture), useCapture);
- }
- delete instances[eventName];
- }
- };
- instanceKeys.forEach(keysIteratee);
- }
- };
- instancesList.forEach(instancesIteratee);
- }
- },
- version: {
- enumerable: true,
- value: '3.7.1'
- }
- });
- function install(Vue) {
- Vue.directive('click-outside', directive);
- }
- /***/ }),
- /* 77 */
- /***/ (function(module, exports, __webpack_require__) {
- exports.f = __webpack_require__(10);
- /***/ }),
- /* 78 */
- /***/ (function(module, exports, __webpack_require__) {
- var META = __webpack_require__(53)('meta');
- var isObject = __webpack_require__(18);
- var has = __webpack_require__(30);
- var setDesc = __webpack_require__(14).f;
- var id = 0;
- var isExtensible = Object.isExtensible || function () {
- return true;
- };
- var FREEZE = !__webpack_require__(31)(function () {
- return isExtensible(Object.preventExtensions({}));
- });
- var setMeta = function (it) {
- setDesc(it, META, { value: {
- i: 'O' + ++id, // object ID
- w: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return primitive with prefix
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!has(it, META)) {
- // 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
- setMeta(it);
- // return object ID
- } return it[META].i;
- };
- var getWeak = function (it, create) {
- if (!has(it, META)) {
- // 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
- setMeta(it);
- // return hash weak collections IDs
- } return it[META].w;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
- return it;
- };
- var meta = module.exports = {
- KEY: META,
- NEED: false,
- fastKey: fastKey,
- getWeak: getWeak,
- onFreeze: onFreeze
- };
- /***/ }),
- /* 79 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(9);
- var core = __webpack_require__(5);
- var LIBRARY = __webpack_require__(42);
- var wksExt = __webpack_require__(77);
- var defineProperty = __webpack_require__(14).f;
- module.exports = function (name) {
- var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
- if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
- };
- /***/ }),
- /* 80 */
- /***/ (function(module, exports) {
- /***/ }),
- /* 81 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__ = __webpack_require__(123);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__ = __webpack_require__(328);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 82 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- bind: function bind(el, binding, vnode) {
- function documentHandler(e) {
- if (el.contains(e.target)) {
- return false;
- }
- if (binding.expression) {
- binding.value(e);
- }
- }
- el.__vueClickOutside__ = documentHandler;
- document.addEventListener('click', documentHandler);
- },
- update: function update() {},
- unbind: function unbind(el, binding) {
- document.removeEventListener('click', el.__vueClickOutside__);
- delete el.__vueClickOutside__;
- }
- };
- /***/ }),
- /* 83 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assist = __webpack_require__(3);
- var Transition = {
- beforeEnter: function beforeEnter(el) {
- (0, _assist.addClass)(el, 'collapse-transition');
- if (!el.dataset) el.dataset = {};
- el.dataset.oldPaddingTop = el.style.paddingTop;
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
- el.style.height = '0';
- el.style.paddingTop = 0;
- el.style.paddingBottom = 0;
- },
- enter: function enter(el) {
- el.dataset.oldOverflow = el.style.overflow;
- if (el.scrollHeight !== 0) {
- el.style.height = el.scrollHeight + 'px';
- el.style.paddingTop = el.dataset.oldPaddingTop;
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
- } else {
- el.style.height = '';
- el.style.paddingTop = el.dataset.oldPaddingTop;
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
- }
- el.style.overflow = 'hidden';
- },
- afterEnter: function afterEnter(el) {
- (0, _assist.removeClass)(el, 'collapse-transition');
- el.style.height = '';
- el.style.overflow = el.dataset.oldOverflow;
- },
- beforeLeave: function beforeLeave(el) {
- if (!el.dataset) el.dataset = {};
- el.dataset.oldPaddingTop = el.style.paddingTop;
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
- el.dataset.oldOverflow = el.style.overflow;
- el.style.height = el.scrollHeight + 'px';
- el.style.overflow = 'hidden';
- },
- leave: function leave(el) {
- if (el.scrollHeight !== 0) {
- (0, _assist.addClass)(el, 'collapse-transition');
- el.style.height = 0;
- el.style.paddingTop = 0;
- el.style.paddingBottom = 0;
- }
- },
- afterLeave: function afterLeave(el) {
- (0, _assist.removeClass)(el, 'collapse-transition');
- el.style.height = '';
- el.style.overflow = el.dataset.oldOverflow;
- el.style.paddingTop = el.dataset.oldPaddingTop;
- el.style.paddingBottom = el.dataset.oldPaddingBottom;
- }
- };
- exports.default = {
- name: 'CollapseTransition',
- functional: true,
- props: {
- appear: Boolean
- },
- render: function render(h, _ref) {
- var children = _ref.children,
- props = _ref.props;
- var data = {
- on: Transition,
- props: {
- appear: props.appear
- }
- };
- return h('transition', data, children);
- }
- };
- /***/ }),
- /* 84 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _handleEscapeMixin = __webpack_require__(151);
- var _handleEscapeMixin2 = _interopRequireDefault(_handleEscapeMixin);
- var _utils = __webpack_require__(39);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- mixins: [_emitter2.default, _handleEscapeMixin2.default],
- props: {
- focused: {
- type: Boolean,
- default: false
- },
- value: {
- type: Object,
- default: undefined
- }
- },
- beforeDestroy: function beforeDestroy() {
- this.unbindEventListeners();
- },
- created: function created() {
- var _this = this;
- if (this.focused) {
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- return this.$el.focus();
- }.bind(this), 1);
- }
- },
- methods: {
- handleLeft: function handleLeft(e) {
- this.handleSlide(e, this.left, 'left');
- },
- handleRight: function handleRight(e) {
- this.handleSlide(e, this.right, 'right');
- },
- handleUp: function handleUp(e) {
- this.handleSlide(e, this.up, 'up');
- },
- handleDown: function handleDown(e) {
- this.handleSlide(e, this.down, 'down');
- },
- handleMouseDown: function handleMouseDown(e) {
- this.dispatch('ColorPicker', 'on-dragging', true);
- this.handleChange(e, true);
- (0, _dom.on)(window, 'mousemove', this.handleChange);
- (0, _dom.on)(window, 'mouseup', this.handleMouseUp);
- },
- handleMouseUp: function handleMouseUp() {
- this.unbindEventListeners();
- },
- unbindEventListeners: function unbindEventListeners() {
- var _this2 = this;
- (0, _dom.off)(window, 'mousemove', this.handleChange);
- (0, _dom.off)(window, 'mouseup', this.handleMouseUp);
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.dispatch('ColorPicker', 'on-dragging', false);
- }.bind(this), 1);
- },
- getLeft: function getLeft(e) {
- var container = this.$refs.container;
- var xOffset = container.getBoundingClientRect().left + window.pageXOffset;
- var pageX = e.pageX || (0, _utils.getTouches)(e, 'PageX');
- return pageX - xOffset;
- },
- getTop: function getTop(e) {
- var container = this.$refs.container;
- var yOffset = container.getBoundingClientRect().top + window.pageYOffset;
- var pageY = e.pageY || (0, _utils.getTouches)(e, 'PageY');
- return pageY - yOffset;
- }
- }
- };
- /***/ }),
- /* 85 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _util = __webpack_require__(20);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'PanelTable',
- props: {
- tableDate: {
- type: Date,
- required: true
- },
- disabledDate: {
- type: Function
- },
- selectionMode: {
- type: String,
- required: true
- },
- value: {
- type: Array,
- required: true
- },
- rangeState: {
- type: Object,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return {
- from: null,
- to: null,
- selecting: false
- };
- }.bind(undefined)
- },
- focusedDate: {
- type: Date,
- required: true
- }
- },
- computed: {
- dates: function dates() {
- var selectionMode = this.selectionMode,
- value = this.value,
- rangeState = this.rangeState;
- var rangeSelecting = selectionMode === 'range' && rangeState.selecting;
- return rangeSelecting ? [rangeState.from] : value;
- }
- },
- methods: {
- handleClick: function handleClick(cell, e) {
- e.stopPropagation();
- if (cell.disabled || cell.type === 'weekLabel') return;
- var newDate = new Date((0, _util.clearHours)(cell.date));
- this.$emit('on-pick', newDate);
- this.$emit('on-pick-click');
- },
- handleMouseMove: function handleMouseMove(cell) {
- if (!this.rangeState.selecting) return;
- if (cell.disabled) return;
- var newDate = cell.date;
- this.$emit('on-change-range', newDate);
- }
- }
- };
- /***/ }),
- /* 86 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = 'ivu-date-picker-cells';
- /***/ }),
- /* 87 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _from = __webpack_require__(111);
- var _from2 = _interopRequireDefault(_from);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- props: {
- lockScroll: {
- type: Boolean,
- default: true
- }
- },
- methods: {
- checkScrollBar: function checkScrollBar() {
- var fullWindowWidth = window.innerWidth;
- if (!fullWindowWidth) {
- var documentElementRect = document.documentElement.getBoundingClientRect();
- fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
- }
- this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
- if (this.bodyIsOverflowing) {
- this.scrollBarWidth = (0, _assist.getScrollBarSize)();
- }
- },
- checkMaskInVisible: function checkMaskInVisible() {
- var _this = this;
- var masks = document.getElementsByClassName('ivu-modal-mask') || [];
- return (0, _from2.default)(masks).every(function (m) {
- (0, _newArrowCheck3.default)(this, _this);
- return m.style.display === 'none' || m.classList.contains('fade-leave-to');
- }.bind(this));
- },
- setScrollBar: function setScrollBar() {
- if (this.bodyIsOverflowing && this.scrollBarWidth !== undefined) {
- document.body.style.paddingRight = String(this.scrollBarWidth) + 'px';
- }
- },
- resetScrollBar: function resetScrollBar() {
- document.body.style.paddingRight = '';
- },
- addScrollEffect: function addScrollEffect() {
- if (!this.lockScroll) return;
- this.checkScrollBar();
- this.setScrollBar();
- document.body.style.overflow = 'hidden';
- },
- removeScrollEffect: function removeScrollEffect() {
- if (!this.lockScroll) return;
- if (this.checkMaskInVisible()) {
- document.body.style.overflow = '';
- this.resetScrollBar();
- }
- }
- }
- };
- /***/ }),
- /* 88 */
- /***/ (function(module, exports) {
- module.exports = function (it, Constructor, name, forbiddenField) {
- if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
- throw TypeError(name + ': incorrect invocation!');
- } return it;
- };
- /***/ }),
- /* 89 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 25.4.1.5 NewPromiseCapability(C)
- var aFunction = __webpack_require__(43);
- function PromiseCapability(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);
- }
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /* 90 */
- /***/ (function(module, exports, __webpack_require__) {
- var hide = __webpack_require__(25);
- module.exports = function (target, src, safe) {
- for (var key in src) {
- if (safe && target[key]) target[key] = src[key];
- else hide(target, key, src[key]);
- } return target;
- };
- /***/ }),
- /* 91 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__ = __webpack_require__(198);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__ = __webpack_require__(465);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 92 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assist = __webpack_require__(3);
- exports.default = {
- data: function data() {
- return {
- menu: (0, _assist.findComponentUpward)(this, 'Menu')
- };
- },
- computed: {
- hasParentSubmenu: function hasParentSubmenu() {
- return !!(0, _assist.findComponentUpward)(this, 'Submenu');
- },
- parentSubmenuNum: function parentSubmenuNum() {
- return (0, _assist.findComponentsUpward)(this, 'Submenu').length;
- },
- mode: function mode() {
- return this.menu.mode;
- }
- }
- };
- /***/ }),
- /* 93 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__ = __webpack_require__(228);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__ = __webpack_require__(527);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 94 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var forEach = __webpack_require__(229).forEach;
- var elementUtilsMaker = __webpack_require__(529);
- var listenerHandlerMaker = __webpack_require__(530);
- var idGeneratorMaker = __webpack_require__(531);
- var idHandlerMaker = __webpack_require__(532);
- var reporterMaker = __webpack_require__(533);
- var browserDetector = __webpack_require__(230);
- var batchProcessorMaker = __webpack_require__(534);
- var stateHandler = __webpack_require__(536);
- //Detection strategies.
- var objectStrategyMaker = __webpack_require__(537);
- var scrollStrategyMaker = __webpack_require__(538);
- function isCollection(obj) {
- return Array.isArray(obj) || obj.length !== undefined;
- }
- function toArray(collection) {
- if (!Array.isArray(collection)) {
- var array = [];
- forEach(collection, function (obj) {
- array.push(obj);
- });
- return array;
- } else {
- return collection;
- }
- }
- function isElement(obj) {
- return obj && obj.nodeType === 1;
- }
- /**
- * @typedef idHandler
- * @type {object}
- * @property {function} get Gets the resize detector id of the element.
- * @property {function} set Generate and sets the resize detector id of the element.
- */
- /**
- * @typedef Options
- * @type {object}
- * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.
- Default is true. If true, the listener is guaranteed to be called when it has been added.
- If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).
- * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.
- If not provided, a default id handler will be used.
- * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.
- If not provided, a default id handler will be used.
- If set to false, then nothing will be reported.
- * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.
- */
- /**
- * Creates an element resize detector instance.
- * @public
- * @param {Options?} options Optional global options object that will decide how this instance will work.
- */
- module.exports = function(options) {
- options = options || {};
- //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.
- var idHandler;
- if (options.idHandler) {
- // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler
- // so that readonly flag always is true when it's used here. This may be removed next major version bump.
- idHandler = {
- get: function (element) { return options.idHandler.get(element, true); },
- set: options.idHandler.set
- };
- } else {
- var idGenerator = idGeneratorMaker();
- var defaultIdHandler = idHandlerMaker({
- idGenerator: idGenerator,
- stateHandler: stateHandler
- });
- idHandler = defaultIdHandler;
- }
- //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.
- var reporter = options.reporter;
- if(!reporter) {
- //If options.reporter is false, then the reporter should be quiet.
- var quiet = reporter === false;
- reporter = reporterMaker(quiet);
- }
- //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.
- var batchProcessor = getOption(options, "batchProcessor", batchProcessorMaker({ reporter: reporter }));
- //Options to be used as default for the listenTo function.
- var globalOptions = {};
- globalOptions.callOnAdd = !!getOption(options, "callOnAdd", true);
- globalOptions.debug = !!getOption(options, "debug", false);
- var eventListenerHandler = listenerHandlerMaker(idHandler);
- var elementUtils = elementUtilsMaker({
- stateHandler: stateHandler
- });
- //The detection strategy to be used.
- var detectionStrategy;
- var desiredStrategy = getOption(options, "strategy", "object");
- var importantCssRules = getOption(options, "important", false);
- var strategyOptions = {
- reporter: reporter,
- batchProcessor: batchProcessor,
- stateHandler: stateHandler,
- idHandler: idHandler,
- important: importantCssRules
- };
- if(desiredStrategy === "scroll") {
- if (browserDetector.isLegacyOpera()) {
- reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");
- desiredStrategy = "object";
- } else if (browserDetector.isIE(9)) {
- reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");
- desiredStrategy = "object";
- }
- }
- if(desiredStrategy === "scroll") {
- detectionStrategy = scrollStrategyMaker(strategyOptions);
- } else if(desiredStrategy === "object") {
- detectionStrategy = objectStrategyMaker(strategyOptions);
- } else {
- throw new Error("Invalid strategy name: " + desiredStrategy);
- }
- //Calls can be made to listenTo with elements that are still being installed.
- //Also, same elements can occur in the elements list in the listenTo function.
- //With this map, the ready callbacks can be synchronized between the calls
- //so that the ready callback can always be called when an element is ready - even if
- //it wasn't installed from the function itself.
- var onReadyCallbacks = {};
- /**
- * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.
- * @public
- * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.
- * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.
- * @param {function} listener The callback to be executed for each resize event for each element.
- */
- function listenTo(options, elements, listener) {
- function onResizeCallback(element) {
- var listeners = eventListenerHandler.get(element);
- forEach(listeners, function callListenerProxy(listener) {
- listener(element);
- });
- }
- function addListener(callOnAdd, element, listener) {
- eventListenerHandler.add(element, listener);
- if(callOnAdd) {
- listener(element);
- }
- }
- //Options object may be omitted.
- if(!listener) {
- listener = elements;
- elements = options;
- options = {};
- }
- if(!elements) {
- throw new Error("At least one element required.");
- }
- if(!listener) {
- throw new Error("Listener required.");
- }
- if (isElement(elements)) {
- // A single element has been passed in.
- elements = [elements];
- } else if (isCollection(elements)) {
- // Convert collection to array for plugins.
- // TODO: May want to check so that all the elements in the collection are valid elements.
- elements = toArray(elements);
- } else {
- return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
- }
- var elementsReady = 0;
- var callOnAdd = getOption(options, "callOnAdd", globalOptions.callOnAdd);
- var onReadyCallback = getOption(options, "onReady", function noop() {});
- var debug = getOption(options, "debug", globalOptions.debug);
- forEach(elements, function attachListenerToElement(element) {
- if (!stateHandler.getState(element)) {
- stateHandler.initState(element);
- idHandler.set(element);
- }
- var id = idHandler.get(element);
- debug && reporter.log("Attaching listener to element", id, element);
- if(!elementUtils.isDetectable(element)) {
- debug && reporter.log(id, "Not detectable.");
- if(elementUtils.isBusy(element)) {
- debug && reporter.log(id, "System busy making it detectable");
- //The element is being prepared to be detectable. Do not make it detectable.
- //Just add the listener, because the element will soon be detectable.
- addListener(callOnAdd, element, listener);
- onReadyCallbacks[id] = onReadyCallbacks[id] || [];
- onReadyCallbacks[id].push(function onReady() {
- elementsReady++;
- if(elementsReady === elements.length) {
- onReadyCallback();
- }
- });
- return;
- }
- debug && reporter.log(id, "Making detectable...");
- //The element is not prepared to be detectable, so do prepare it and add a listener to it.
- elementUtils.markBusy(element, true);
- return detectionStrategy.makeDetectable({ debug: debug, important: importantCssRules }, element, function onElementDetectable(element) {
- debug && reporter.log(id, "onElementDetectable");
- if (stateHandler.getState(element)) {
- elementUtils.markAsDetectable(element);
- elementUtils.markBusy(element, false);
- detectionStrategy.addListener(element, onResizeCallback);
- addListener(callOnAdd, element, listener);
- // Since the element size might have changed since the call to "listenTo", we need to check for this change,
- // so that a resize event may be emitted.
- // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.
- // Also, check the state existance before since the element may have been uninstalled in the installation process.
- var state = stateHandler.getState(element);
- if (state && state.startSize) {
- var width = element.offsetWidth;
- var height = element.offsetHeight;
- if (state.startSize.width !== width || state.startSize.height !== height) {
- onResizeCallback(element);
- }
- }
- if(onReadyCallbacks[id]) {
- forEach(onReadyCallbacks[id], function(callback) {
- callback();
- });
- }
- } else {
- // The element has been unisntalled before being detectable.
- debug && reporter.log(id, "Element uninstalled before being detectable.");
- }
- delete onReadyCallbacks[id];
- elementsReady++;
- if(elementsReady === elements.length) {
- onReadyCallback();
- }
- });
- }
- debug && reporter.log(id, "Already detecable, adding listener.");
- //The element has been prepared to be detectable and is ready to be listened to.
- addListener(callOnAdd, element, listener);
- elementsReady++;
- });
- if(elementsReady === elements.length) {
- onReadyCallback();
- }
- }
- function uninstall(elements) {
- if(!elements) {
- return reporter.error("At least one element is required.");
- }
- if (isElement(elements)) {
- // A single element has been passed in.
- elements = [elements];
- } else if (isCollection(elements)) {
- // Convert collection to array for plugins.
- // TODO: May want to check so that all the elements in the collection are valid elements.
- elements = toArray(elements);
- } else {
- return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
- }
- forEach(elements, function (element) {
- eventListenerHandler.removeAllListeners(element);
- detectionStrategy.uninstall(element);
- stateHandler.cleanState(element);
- });
- }
- function initDocument(targetDocument) {
- detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);
- }
- return {
- listenTo: listenTo,
- removeListener: eventListenerHandler.removeListener,
- removeAllListeners: eventListenerHandler.removeAllListeners,
- uninstall: uninstall,
- initDocument: initDocument
- };
- };
- function getOption(options, name, defaultValue) {
- var value = options[name];
- if((value === undefined || value === null) && defaultValue !== undefined) {
- return defaultValue;
- }
- return value;
- }
- /***/ }),
- /* 95 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- methods: {
- alignCls: function alignCls(column) {
- var _ref;
- var row = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var cellClassName = '';
- if (row.cellClassName && column.key && row.cellClassName[column.key]) {
- cellClassName = row.cellClassName[column.key];
- }
- return [String(this.prefixCls) + '-column-' + String(column.__id), (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(cellClassName), cellClassName), (0, _defineProperty3.default)(_ref, '' + String(column.className), column.className), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-column-' + String(column.align), column.align), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', this.fixed === 'left' && column.fixed !== 'left' || this.fixed === 'right' && column.fixed !== 'right' || !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')), _ref)];
- },
- isPopperShow: function isPopperShow(column) {
- return column.filters && (!this.fixed && !column.fixed || this.fixed === 'left' && column.fixed === 'left' || this.fixed === 'right' && column.fixed === 'right');
- },
- setCellWidth: function setCellWidth(column) {
- var width = '';
- if (column.width) {
- width = column.width;
- } else if (this.columnsWidth[column._index]) {
- width = this.columnsWidth[column._index].width;
- }
- if (width === '0') width = '';
- return width;
- }
- }
- };
- /***/ }),
- /* 96 */
- /***/ (function(module, exports, __webpack_require__) {
- var has = __webpack_require__(30);
- var toIObject = __webpack_require__(33);
- var arrayIndexOf = __webpack_require__(262)(false);
- var IE_PROTO = __webpack_require__(66)('IE_PROTO');
- module.exports = function (object, names) {
- var O = toIObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (has(O, key = names[i++])) {
- ~arrayIndexOf(result, key) || result.push(key);
- }
- return result;
- };
- /***/ }),
- /* 97 */
- /***/ (function(module, exports, __webpack_require__) {
- // most Object methods by ES6 should accept primitives
- var $export = __webpack_require__(7);
- var core = __webpack_require__(5);
- var fails = __webpack_require__(31);
- module.exports = function (KEY, exec) {
- var fn = (core.Object || {})[KEY] || Object[KEY];
- var exp = {};
- exp[KEY] = exec(fn);
- $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
- };
- /***/ }),
- /* 98 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = !__webpack_require__(13) && !__webpack_require__(31)(function () {
- return Object.defineProperty(__webpack_require__(69)('div'), 'a', { get: function () { return 7; } }).a != 7;
- });
- /***/ }),
- /* 99 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-affix';
- function getScroll(target, top) {
- var prop = top ? 'pageYOffset' : 'pageXOffset';
- var method = top ? 'scrollTop' : 'scrollLeft';
- var ret = target[prop];
- if (typeof ret !== 'number') {
- ret = window.document.documentElement[method];
- }
- return ret;
- }
- function getOffset(element) {
- var rect = element.getBoundingClientRect();
- var scrollTop = getScroll(window, true);
- var scrollLeft = getScroll(window);
- var docEl = window.document.body;
- var clientTop = docEl.clientTop || 0;
- var clientLeft = docEl.clientLeft || 0;
- return {
- top: rect.top + scrollTop - clientTop,
- left: rect.left + scrollLeft - clientLeft
- };
- }
- exports.default = {
- name: 'Affix',
- props: {
- offsetTop: {
- type: Number,
- default: 0
- },
- offsetBottom: {
- type: Number
- },
- useCapture: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- affix: false,
- styles: {},
- slot: false,
- slotStyle: {}
- };
- },
- computed: {
- offsetType: function offsetType() {
- var type = 'top';
- if (this.offsetBottom >= 0) {
- type = 'bottom';
- }
- return type;
- },
- classes: function classes() {
- return [(0, _defineProperty3.default)({}, '' + prefixCls, this.affix)];
- }
- },
- mounted: function mounted() {
- var _this = this;
- (0, _dom.on)(window, 'scroll', this.handleScroll, this.useCapture);
- (0, _dom.on)(window, 'resize', this.handleScroll, this.useCapture);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.handleScroll();
- }.bind(this));
- },
- beforeDestroy: function beforeDestroy() {
- (0, _dom.off)(window, 'scroll', this.handleScroll, this.useCapture);
- (0, _dom.off)(window, 'resize', this.handleScroll, this.useCapture);
- },
- methods: {
- handleScroll: function handleScroll() {
- var affix = this.affix;
- var scrollTop = getScroll(window, true);
- var elOffset = getOffset(this.$el);
- var windowHeight = window.innerHeight;
- var elHeight = this.$el.getElementsByTagName('div')[0].offsetHeight;
- if (elOffset.top - this.offsetTop < scrollTop && this.offsetType == 'top' && !affix) {
- this.affix = true;
- this.slotStyle = {
- width: this.$refs.point.clientWidth + 'px',
- height: this.$refs.point.clientHeight + 'px'
- };
- this.slot = true;
- this.styles = {
- top: String(this.offsetTop) + 'px',
- left: String(elOffset.left) + 'px',
- width: String(this.$el.offsetWidth) + 'px'
- };
- this.$emit('on-change', true);
- } else if (elOffset.top - this.offsetTop > scrollTop && this.offsetType == 'top' && affix) {
- this.slot = false;
- this.slotStyle = {};
- this.affix = false;
- this.styles = null;
- this.$emit('on-change', false);
- }
- if (elOffset.top + this.offsetBottom + elHeight > scrollTop + windowHeight && this.offsetType == 'bottom' && !affix) {
- this.affix = true;
- this.styles = {
- bottom: String(this.offsetBottom) + 'px',
- left: String(elOffset.left) + 'px',
- width: String(this.$el.offsetWidth) + 'px'
- };
- this.$emit('on-change', true);
- } else if (elOffset.top + this.offsetBottom + elHeight < scrollTop + windowHeight && this.offsetType == 'bottom' && affix) {
- this.affix = false;
- this.styles = null;
- this.$emit('on-change', false);
- }
- }
- }
- };
- /***/ }),
- /* 100 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-alert';
- exports.default = {
- name: 'Alert',
- components: { Icon: _icon2.default },
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['success', 'info', 'warning', 'error']);
- },
- default: 'info'
- },
- closable: {
- type: Boolean,
- default: false
- },
- showIcon: {
- type: Boolean,
- default: false
- },
- banner: {
- type: Boolean,
- default: false
- },
- fade: {
- type: Boolean,
- default: true
- }
- },
- data: function data() {
- return {
- closed: false,
- desc: false
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.type), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-icon', this.showIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-with-desc', this.desc), (0, _defineProperty3.default)(_ref, prefixCls + '-with-banner', this.banner), _ref)];
- },
- messageClasses: function messageClasses() {
- return prefixCls + '-message';
- },
- descClasses: function descClasses() {
- return prefixCls + '-desc';
- },
- closeClasses: function closeClasses() {
- return prefixCls + '-close';
- },
- iconClasses: function iconClasses() {
- return prefixCls + '-icon';
- },
- iconType: function iconType() {
- var type = '';
- switch (this.type) {
- case 'success':
- type = 'ios-checkmark-circle';
- break;
- case 'info':
- type = 'ios-information-circle';
- break;
- case 'warning':
- type = 'ios-alert';
- break;
- case 'error':
- type = 'ios-close-circle';
- break;
- }
- if (this.desc) type += '-outline';
- return type;
- }
- },
- methods: {
- close: function close(e) {
- this.closed = true;
- this.$emit('on-close', e);
- }
- },
- mounted: function mounted() {
- this.desc = this.$slots.desc !== undefined;
- }
- };
- /***/ }),
- /* 101 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-icon';
- exports.default = {
- name: 'Icon',
- props: {
- type: {
- type: String,
- default: ''
- },
- size: [Number, String],
- color: String,
- custom: {
- type: String,
- default: ''
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), this.type !== ''), (0, _defineProperty3.default)(_ref, '' + String(this.custom), this.custom !== ''), _ref)];
- },
- styles: function styles() {
- var style = {};
- if (this.size) {
- style['font-size'] = String(this.size) + 'px';
- }
- if (this.color) {
- style.color = this.color;
- }
- return style;
- }
- },
- methods: {
- handleClick: function handleClick(event) {
- this.$emit('click', event);
- }
- }
- };
- /***/ }),
- /* 102 */
- /***/ (function(module, exports) {
- module.exports = function (done, value) {
- return { value: value, done: !!done };
- };
- /***/ }),
- /* 103 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(25);
- /***/ }),
- /* 104 */
- /***/ (function(module, exports, __webpack_require__) {
- var dP = __webpack_require__(14);
- var anObject = __webpack_require__(22);
- var getKeys = __webpack_require__(40);
- module.exports = __webpack_require__(13) ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = getKeys(Properties);
- var length = keys.length;
- var i = 0;
- var P;
- while (length > i) dP.f(O, P = keys[i++], Properties[P]);
- return O;
- };
- /***/ }),
- /* 105 */
- /***/ (function(module, exports, __webpack_require__) {
- var document = __webpack_require__(9).document;
- module.exports = document && document.documentElement;
- /***/ }),
- /* 106 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
- var has = __webpack_require__(30);
- var toObject = __webpack_require__(29);
- var IE_PROTO = __webpack_require__(66)('IE_PROTO');
- var ObjectProto = Object.prototype;
- module.exports = 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 ? ObjectProto : null;
- };
- /***/ }),
- /* 107 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Anchor',
- provide: function provide() {
- return {
- anchorCom: this
- };
- },
- data: function data() {
- return {
- prefix: 'ivu-anchor',
- isAffixed: false,
- inkTop: 0,
- animating: false,
- currentLink: '',
- currentId: '',
- scrollContainer: null,
- scrollElement: null,
- titlesOffsetArr: [],
- wrapperTop: 0,
- upperFirstTitle: true
- };
- },
- props: {
- affix: {
- type: Boolean,
- default: true
- },
- offsetTop: {
- type: Number,
- default: 0
- },
- offsetBottom: Number,
- bounds: {
- type: Number,
- default: 5
- },
- container: null,
- showInk: {
- type: Boolean,
- default: false
- },
- scrollOffset: {
- type: Number,
- default: 0
- }
- },
- computed: {
- wrapperComponent: function wrapperComponent() {
- return this.affix ? 'Affix' : 'div';
- },
- wrapperStyle: function wrapperStyle() {
- return {
- maxHeight: this.offsetTop ? 'calc(100vh - ' + String(this.offsetTop) + 'px)' : '100vh'
- };
- },
- containerIsWindow: function containerIsWindow() {
- return this.scrollContainer === window;
- }
- },
- methods: {
- handleAffixStateChange: function handleAffixStateChange(state) {
- this.isAffixed = this.affix && state;
- },
- handleScroll: function handleScroll(e) {
- this.upperFirstTitle = e.target.scrollTop < this.titlesOffsetArr[0].offset;
- if (this.animating) return;
- this.updateTitleOffset();
- var scrollTop = document.documentElement.scrollTop || document.body.scrollTop || e.target.scrollTop;
- this.getCurrentScrollAtTitleId(scrollTop);
- },
- handleHashChange: function handleHashChange() {
- var url = window.location.href;
- var sharpLinkMatch = _assist.sharpMatcherRegx.exec(url);
- if (!sharpLinkMatch) return;
- this.currentLink = sharpLinkMatch[0];
- this.currentId = sharpLinkMatch[1];
- },
- handleScrollTo: function handleScrollTo() {
- var _this = this;
- var anchor = document.getElementById(this.currentId);
- var currentLinkElementA = document.querySelector('a[data-href="' + String(this.currentLink) + '"]');
- var offset = this.scrollOffset;
- if (currentLinkElementA) {
- offset = parseFloat(currentLinkElementA.getAttribute('data-scroll-offset'));
- }
- if (!anchor) return;
- var offsetTop = anchor.offsetTop - this.wrapperTop - offset;
- this.animating = true;
- (0, _assist.scrollTop)(this.scrollContainer, this.scrollElement.scrollTop, offsetTop, 600, function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.animating = false;
- }.bind(this));
- this.handleSetInkTop();
- },
- handleSetInkTop: function handleSetInkTop() {
- var currentLinkElementA = document.querySelector('a[data-href="' + String(this.currentLink) + '"]');
- if (!currentLinkElementA) return;
- var elementATop = currentLinkElementA.offsetTop;
- var top = elementATop < 0 ? this.offsetTop : elementATop;
- this.inkTop = top;
- },
- updateTitleOffset: function updateTitleOffset() {
- var _this2 = this;
- var links = (0, _assist.findComponentsDownward)(this, 'AnchorLink').map(function (link) {
- (0, _newArrowCheck3.default)(this, _this2);
- return link.href;
- }.bind(this));
- var idArr = links.map(function (link) {
- (0, _newArrowCheck3.default)(this, _this2);
- return link.split('#')[1];
- }.bind(this));
- var offsetArr = [];
- idArr.forEach(function (id) {
- (0, _newArrowCheck3.default)(this, _this2);
- var titleEle = document.getElementById(id);
- if (titleEle) offsetArr.push({
- link: '#' + String(id),
- offset: titleEle.offsetTop - this.scrollElement.offsetTop
- });
- }.bind(this));
- this.titlesOffsetArr = offsetArr;
- },
- getCurrentScrollAtTitleId: function getCurrentScrollAtTitleId(scrollTop) {
- var i = -1;
- var len = this.titlesOffsetArr.length;
- var titleItem = {
- link: '#',
- offset: 0
- };
- scrollTop += this.bounds;
- while (++i < len) {
- var currentEle = this.titlesOffsetArr[i];
- var nextEle = this.titlesOffsetArr[i + 1];
- if (scrollTop >= currentEle.offset && scrollTop < (nextEle && nextEle.offset || Infinity)) {
- titleItem = this.titlesOffsetArr[i];
- break;
- }
- }
- this.currentLink = titleItem.link;
- this.handleSetInkTop();
- },
- getContainer: function getContainer() {
- this.scrollContainer = this.container ? typeof this.container === 'string' ? document.querySelector(this.container) : this.container : window;
- this.scrollElement = this.container ? this.scrollContainer : document.documentElement || document.body;
- },
- removeListener: function removeListener() {
- (0, _dom.off)(this.scrollContainer, 'scroll', this.handleScroll);
- (0, _dom.off)(window, 'hashchange', this.handleHashChange);
- },
- init: function init() {
- var _this3 = this;
- this.handleHashChange();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.removeListener();
- this.getContainer();
- this.wrapperTop = this.containerIsWindow ? 0 : this.scrollElement.offsetTop;
- this.handleScrollTo();
- this.handleSetInkTop();
- this.updateTitleOffset();
- if (this.titlesOffsetArr[0]) {
- this.upperFirstTitle = this.scrollElement.scrollTop < this.titlesOffsetArr[0].offset;
- }
- (0, _dom.on)(this.scrollContainer, 'scroll', this.handleScroll);
- (0, _dom.on)(window, 'hashchange', this.handleHashChange);
- }.bind(this));
- }
- },
- watch: {
- '$route': function $route() {
- var _this4 = this;
- this.handleHashChange();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this4);
- this.handleScrollTo();
- }.bind(this));
- },
- container: function container() {
- this.init();
- },
- currentLink: function currentLink(newHref, oldHref) {
- this.$emit('on-change', newHref, oldHref);
- }
- },
- mounted: function mounted() {
- this.init();
- },
- beforeDestroy: function beforeDestroy() {
- this.removeListener();
- }
- };
- /***/ }),
- /* 108 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'AnchorLink',
- inject: ['anchorCom'],
- props: {
- href: String,
- title: String,
- scrollOffset: {
- type: Number,
- default: function _default() {
- return this.anchorCom.scrollOffset;
- }
- }
- },
- data: function data() {
- return {
- prefix: 'ivu-anchor-link'
- };
- },
- computed: {
- anchorLinkClasses: function anchorLinkClasses() {
- return [this.prefix, this.anchorCom.currentLink === this.href ? String(this.prefix) + '-active' : ''];
- },
- linkTitleClasses: function linkTitleClasses() {
- return [String(this.prefix) + '-title'];
- }
- },
- methods: {
- goAnchor: function goAnchor() {
- var _this = this;
- this.currentLink = this.href;
- this.anchorCom.handleHashChange();
- this.anchorCom.handleScrollTo();
- this.anchorCom.$emit('on-select', this.href);
- var isRoute = this.$router;
- if (isRoute) {
- this.$router.push(this.href, function () {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this));
- } else {
- window.location.href = this.href;
- }
- }
- },
- mounted: function mounted() {
- var _this2 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.anchorCom.init();
- }.bind(this));
- }
- };
- /***/ }),
- /* 109 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _select = __webpack_require__(74);
- var _select2 = _interopRequireDefault(_select);
- var _option = __webpack_require__(81);
- var _option2 = _interopRequireDefault(_option);
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'AutoComplete',
- mixins: [_emitter2.default, _form2.default],
- components: { iSelect: _select2.default, iOption: _option2.default, iInput: _input2.default },
- props: {
- value: {
- type: [String, Number],
- default: ''
- },
- label: {
- type: [String, Number],
- default: ''
- },
- data: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- disabled: {
- type: Boolean,
- default: false
- },
- clearable: {
- type: Boolean,
- default: false
- },
- placeholder: {
- type: String
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- icon: {
- type: String
- },
- filterMethod: {
- type: [Function, Boolean],
- default: false
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'bottom', 'top-start', 'bottom-start', 'top-end', 'bottom-end']);
- },
- default: 'bottom-start'
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- name: {
- type: String
- },
- elementId: {
- type: String
- },
- transferClassName: {
- type: String
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- currentValue: this.value,
- disableEmitChange: false };
- },
- computed: {
- inputIcon: function inputIcon() {
- var icon = '';
- if (this.clearable && this.currentValue && !this.disabled) {
- icon = 'ios-close-circle';
- } else if (this.icon) {
- icon = this.icon;
- }
- return icon;
- },
- filteredData: function filteredData() {
- var _this = this;
- if (this.filterMethod) {
- return this.data.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.filterMethod(this.currentValue, item);
- }.bind(this));
- } else {
- return this.data;
- }
- }
- },
- watch: {
- value: function value(val) {
- if (this.currentValue !== val) {
- this.disableEmitChange = true;
- }
- this.currentValue = val;
- },
- currentValue: function currentValue(val) {
- this.$refs.select.setQuery(val);
- this.$emit('input', val);
- if (this.disableEmitChange) {
- this.disableEmitChange = false;
- return;
- }
- this.$emit('on-change', val);
- this.dispatch('FormItem', 'on-form-change', val);
- }
- },
- methods: {
- remoteMethod: function remoteMethod(query) {
- this.$emit('on-search', query);
- },
- handleSelect: function handleSelect(option) {
- var val = option.value;
- if (val === undefined || val === null) return;
- this.currentValue = val;
- this.$refs.input.blur();
- this.$emit('on-select', val);
- },
- handleFocus: function handleFocus(event) {
- this.$emit('on-focus', event);
- },
- handleBlur: function handleBlur(event) {
- this.$emit('on-blur', event);
- },
- handleClear: function handleClear() {
- if (!this.clearable) return;
- this.currentValue = '';
- this.$refs.select.reset();
- this.$emit('on-clear');
- },
- handleClickOutside: function handleClickOutside() {
- var _this2 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.$refs.input.blur();
- }.bind(this));
- }
- }
- };
- /***/ }),
- /* 110 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _isFinite = __webpack_require__(75);
- var _isFinite2 = _interopRequireDefault(_isFinite);
- var _getIterator2 = __webpack_require__(45);
- var _getIterator3 = _interopRequireDefault(_getIterator2);
- var _stringify = __webpack_require__(57);
- var _stringify2 = _interopRequireDefault(_stringify);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _extends3 = __webpack_require__(32);
- var _extends4 = _interopRequireDefault(_extends3);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _vClickOutsideX = __webpack_require__(76);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _selectHead = __webpack_require__(324);
- var _selectHead2 = _interopRequireDefault(_selectHead);
- var _functionalOptions = __webpack_require__(326);
- var _functionalOptions2 = _interopRequireDefault(_functionalOptions);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-select';
- var optionRegexp = /^i-option$|^Option$/i;
- var optionGroupRegexp = /option-?group/i;
- var findChild = function (instance, checkFn) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var match = checkFn(instance);
- if (match) return instance;
- for (var i = 0, l = instance.$children.length; i < l; i++) {
- var child = instance.$children[i];
- match = findChild(child, checkFn);
- if (match) return match;
- }
- }.bind(undefined);
- var findOptionsInVNode = function (node) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var opts = node.componentOptions;
- if (opts && optionRegexp.test(opts.tag)) return [node];
- if (!node.children && (!opts || !opts.children)) return [];
- var children = [].concat((0, _toConsumableArray3.default)(node.children || []), (0, _toConsumableArray3.default)(opts && opts.children || []));
- var options = children.reduce(function (arr, el) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [].concat((0, _toConsumableArray3.default)(arr), (0, _toConsumableArray3.default)(findOptionsInVNode(el)));
- }.bind(undefined), []).filter(Boolean);
- return options.length > 0 ? options : [];
- }.bind(undefined);
- var extractOptions = function (options) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return options.reduce(function (options, slotEntry) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return options.concat(findOptionsInVNode(slotEntry));
- }.bind(undefined), []);
- }.bind(undefined);
- var applyProp = function (node, propName, value) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return (0, _extends4.default)({}, node, {
- componentOptions: (0, _extends4.default)({}, node.componentOptions, {
- propsData: (0, _extends4.default)({}, node.componentOptions.propsData, (0, _defineProperty3.default)({}, propName, value))
- })
- });
- }.bind(undefined);
- var getNestedProperty = function (obj, path) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var keys = path.split('.');
- return keys.reduce(function (o, key) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return o && o[key] || null;
- }.bind(undefined), obj);
- }.bind(undefined);
- var getOptionLabel = function (option) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (option.componentOptions.propsData.label) return option.componentOptions.propsData.label;
- var textContent = (option.componentOptions.children || []).reduce(function (str, child) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return str + (child.text || '');
- }.bind(undefined), '');
- var innerHTML = getNestedProperty(option, 'data.domProps.innerHTML');
- return textContent || (typeof innerHTML === 'string' ? innerHTML : '');
- }.bind(undefined);
- var checkValuesNotEqual = function (value, publicValue, values) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var strValue = (0, _stringify2.default)(value);
- var strPublic = (0, _stringify2.default)(publicValue);
- var strValues = (0, _stringify2.default)(values.map(function (item) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return item.value;
- }.bind(undefined)));
- return strValue !== strPublic || strValue !== strValues || strValues !== strPublic;
- }.bind(undefined);
- var ANIMATION_TIMEOUT = 300;
- exports.default = {
- name: 'iSelect',
- mixins: [_emitter2.default, _locale2.default, _form2.default],
- components: { FunctionalOptions: _functionalOptions2.default, Drop: _dropdown2.default, SelectHead: _selectHead2.default, Icon: _icon2.default },
- directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
- props: {
- value: {
- type: [String, Number, Array],
- default: ''
- },
- label: {
- type: [String, Number, Array],
- default: ''
- },
- defaultLabel: {
- type: [String, Number, Array],
- default: ''
- },
- multiple: {
- type: Boolean,
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- clearable: {
- type: Boolean,
- default: false
- },
- placeholder: {
- type: String
- },
- filterable: {
- type: Boolean,
- default: false
- },
- filterMethod: {
- type: Function
- },
- remoteMethod: {
- type: Function
- },
- loading: {
- type: Boolean,
- default: false
- },
- loadingText: {
- type: String
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- labelInValue: {
- type: Boolean,
- default: false
- },
- notFoundText: {
- type: String
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'bottom', 'top-start', 'bottom-start', 'top-end', 'bottom-end']);
- },
- default: 'bottom-start'
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- autoComplete: {
- type: Boolean,
- default: false
- },
- name: {
- type: String
- },
- elementId: {
- type: String
- },
- transferClassName: {
- type: String
- },
- prefix: {
- type: String
- },
- maxTagCount: {
- type: Number
- },
- maxTagPlaceholder: {
- type: Function
- },
- allowCreate: {
- type: Boolean,
- default: false
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- filterByLabel: {
- type: Boolean,
- default: false
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- mounted: function mounted() {
- var _this = this;
- this.$on('on-select-selected', this.onOptionClick);
- if (!this.remote && this.selectOptions.length > 0) {
- this.values = this.getInitialValue().map(function (value) {
- (0, _newArrowCheck3.default)(this, _this);
- if (typeof value !== 'number' && !value) return null;
- return this.getOptionData(value);
- }.bind(this)).filter(Boolean);
- }
- this.checkUpdateStatus();
- if (this.remote && this.value && this.defaultLabel) {
- if (!this.multiple) {
- this.query = this.defaultLabel;
- } else if (this.multiple && this.defaultLabel instanceof Array && this.value.length === this.defaultLabel.length) {
- var values = this.value.map(function (item, index) {
- (0, _newArrowCheck3.default)(this, _this);
- return {
- value: item,
- label: this.defaultLabel[index]
- };
- }.bind(this));
- this.$emit('on-set-default-options', JSON.parse((0, _stringify2.default)(values)));
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.values = values;
- }.bind(this));
- }
- }
- },
- beforeDestroy: function beforeDestroy() {
- this.$off('on-select-selected');
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- values: [],
- dropDownWidth: 0,
- visible: false,
- focusIndex: -1,
- isFocused: false,
- query: '',
- initialLabel: this.label,
- hasMouseHoverHead: false,
- slotOptions: this.$slots.default,
- caretPosition: -1,
- lastRemoteQuery: '',
- unchangedQuery: true,
- hasExpectedValue: false,
- isTyping: false,
- preventRemoteCall: false,
- filterQueryChange: false };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-visible', this.visible), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-multiple', this.multiple), (0, _defineProperty3.default)(_ref, prefixCls + '-single', !this.multiple), (0, _defineProperty3.default)(_ref, prefixCls + '-show-clear', this.showCloseIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), _ref)];
- },
- dropdownCls: function dropdownCls() {
- var _ref2;
- return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-dropdown-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, prefixCls + '-multiple', this.multiple && this.transfer), (0, _defineProperty3.default)(_ref2, 'ivu-auto-complete', this.autoComplete), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
- },
- selectionCls: function selectionCls() {
- var _ref3;
- return _ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-selection', !this.autoComplete), (0, _defineProperty3.default)(_ref3, prefixCls + '-selection-focused', this.isFocused), _ref3;
- },
- localeNotFoundText: function localeNotFoundText() {
- if (typeof this.notFoundText === 'undefined') {
- return this.t('i.select.noMatch');
- } else {
- return this.notFoundText;
- }
- },
- localeLoadingText: function localeLoadingText() {
- if (typeof this.loadingText === 'undefined') {
- return this.t('i.select.loading');
- } else {
- return this.loadingText;
- }
- },
- showCreateItem: function showCreateItem() {
- var _this2 = this;
- var state = false;
- if (this.allowCreate && this.query !== '') {
- state = true;
- var $options = (0, _assist.findComponentsDownward)(this, 'iOption');
- if ($options && $options.length) {
- if ($options.find(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- return item.optionLabel === this.query;
- }.bind(this))) state = false;
- }
- }
- return state;
- },
- transitionName: function transitionName() {
- return this.placement === 'bottom' ? 'slide-up' : 'slide-down';
- },
- dropVisible: function dropVisible() {
- var status = true;
- var noOptions = !this.selectOptions || this.selectOptions.length === 0;
- if (!this.loading && this.remote && this.query === '' && noOptions) status = false;
- if (this.autoComplete && noOptions) status = false;
- return this.visible && status;
- },
- showNotFoundLabel: function showNotFoundLabel() {
- var loading = this.loading,
- remote = this.remote,
- selectOptions = this.selectOptions;
- return selectOptions && selectOptions.length === 0 && (!remote || remote && !loading);
- },
- publicValue: function publicValue() {
- var _this3 = this;
- return this.multiple ? this.values.map(function (option) {
- (0, _newArrowCheck3.default)(this, _this3);
- return option.value;
- }.bind(this)) : (this.values[0] || {}).value;
- },
- canBeCleared: function canBeCleared() {
- var uiStateMatch = this.hasMouseHoverHead || this.active;
- var qualifiesForClear = !this.multiple && !this.itemDisabled && this.clearable;
- return uiStateMatch && qualifiesForClear && this.reset;
- },
- selectOptions: function selectOptions() {
- var _this4 = this;
- var selectOptions = [];
- var slotOptions = this.slotOptions || [];
- var optionCounter = -1;
- var currentIndex = this.focusIndex;
- var selectedValues = this.values.filter(Boolean).map(function (_ref4) {
- var value = _ref4.value;
- (0, _newArrowCheck3.default)(this, _this4);
- return value;
- }.bind(this));
- if (this.autoComplete) {
- var copyChildren = function (node, fn) {
- (0, _newArrowCheck3.default)(this, _this4);
- return (0, _extends4.default)({}, node, {
- children: (node.children || []).map(fn).map(function (child) {
- (0, _newArrowCheck3.default)(this, _this4);
- return copyChildren(child, fn);
- }.bind(this))
- });
- }.bind(this);
- var autoCompleteOptions = extractOptions(slotOptions);
- var selectedSlotOption = autoCompleteOptions[currentIndex];
- return slotOptions.map(function (node) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (node === selectedSlotOption || getNestedProperty(node, 'componentOptions.propsData.value') === this.value) return applyProp(node, 'isFocused', true);
- return copyChildren(node, function (child) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (child !== selectedSlotOption) return child;
- return applyProp(child, 'isFocused', true);
- }.bind(this));
- }.bind(this));
- }
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = (0, _getIterator3.default)(slotOptions), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var option = _step.value;
- var cOptions = option.componentOptions;
- if (!cOptions) continue;
- if (optionGroupRegexp.test(cOptions.tag)) {
- var children = cOptions.children;
- if (this.filterable && this.isTyping) {
- children = children.filter(function (_ref5) {
- var componentOptions = _ref5.componentOptions;
- (0, _newArrowCheck3.default)(this, _this4);
- return this.validateOption(componentOptions);
- }.bind(this));
- }
- children = children.map(function (opt) {
- (0, _newArrowCheck3.default)(this, _this4);
- optionCounter = optionCounter + 1;
- return this.processOption(opt, selectedValues, optionCounter === currentIndex);
- }.bind(this));
- if (children.length > 0) selectOptions.push((0, _extends4.default)({}, option, { componentOptions: (0, _extends4.default)({}, cOptions, { children: children }) }));
- } else {
- if (this.filterQueryChange) {
- var optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
- if (!optionPassesFilter) continue;
- }
- optionCounter = optionCounter + 1;
- selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex));
- }
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- return selectOptions;
- },
- flatOptions: function flatOptions() {
- return extractOptions(this.selectOptions);
- },
- selectTabindex: function selectTabindex() {
- return this.itemDisabled || this.filterable ? -1 : 0;
- },
- remote: function remote() {
- return typeof this.remoteMethod === 'function';
- }
- },
- methods: {
- setQuery: function setQuery(query) {
- if (query) {
- this.onQueryChange(query);
- return;
- }
- if (query === null) {
- this.onQueryChange('');
- this.values = [];
- this.lastRemoteQuery = '';
- }
- },
- clearSingleSelect: function clearSingleSelect() {
- if (!this.multiple) this.$emit('input', '');
- this.$emit('on-clear');
- this.hideMenu();
- if (this.clearable) this.reset();
- },
- getOptionData: function getOptionData(value) {
- var _this5 = this;
- var option = this.flatOptions.find(function (_ref6) {
- var componentOptions = _ref6.componentOptions;
- (0, _newArrowCheck3.default)(this, _this5);
- return componentOptions.propsData.value === value;
- }.bind(this));
- if (!option) return null;
- var label = getOptionLabel(option);
- var disabled = option.componentOptions.propsData.disabled;
- return {
- value: value,
- label: label,
- disabled: disabled
- };
- },
- getInitialValue: function getInitialValue() {
- var _this6 = this;
- var multiple = this.multiple,
- remote = this.remote,
- value = this.value;
- var initialValue = Array.isArray(value) ? value : [value];
- if (!multiple && (typeof initialValue[0] === 'undefined' || String(initialValue[0]).trim() === '' && !(0, _isFinite2.default)(initialValue[0]))) initialValue = [];
- if (remote && !multiple && value) {
- var data = this.getOptionData(value);
- this.query = data ? data.label : String(value);
- }
- return initialValue.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this6);
- return Boolean(item) || item === 0;
- }.bind(this));
- },
- processOption: function processOption(option, values, isFocused) {
- if (!option.componentOptions) return option;
- var optionValue = option.componentOptions.propsData.value;
- var disabled = option.componentOptions.propsData.disabled;
- var isSelected = values.includes(optionValue);
- var propsData = (0, _extends4.default)({}, option.componentOptions.propsData, {
- selected: isSelected,
- isFocused: isFocused,
- disabled: typeof disabled === 'undefined' ? false : disabled !== false
- });
- return (0, _extends4.default)({}, option, {
- componentOptions: (0, _extends4.default)({}, option.componentOptions, {
- propsData: propsData
- })
- });
- },
- validateOption: function validateOption(_ref7) {
- var _this7 = this;
- var children = _ref7.children,
- elm = _ref7.elm,
- propsData = _ref7.propsData;
- var value = propsData.value;
- var label = propsData.label || '';
- var textContent = elm && elm.textContent || (children || []).reduce(function (str, node) {
- (0, _newArrowCheck3.default)(this, _this7);
- var nodeText = node.elm ? node.elm.textContent : node.text;
- return String(str) + ' ' + String(nodeText);
- }.bind(this), '') || '';
- var stringValues = this.filterByLabel ? [label].toString() : [value, label, textContent].toString();
- var query = this.query.toLowerCase().trim();
- return stringValues.toLowerCase().includes(query);
- },
- toggleMenu: function toggleMenu(e, force) {
- if (this.itemDisabled) {
- return false;
- }
- this.visible = typeof force !== 'undefined' ? force : !this.visible;
- if (this.visible) {
- this.dropDownWidth = this.$el.getBoundingClientRect().width;
- this.broadcast('Drop', 'on-update-popper');
- }
- },
- hideMenu: function hideMenu() {
- var _this8 = this;
- this.toggleMenu(null, false);
- this.isTyping = false;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this8);
- return this.unchangedQuery = true;
- }.bind(this), ANIMATION_TIMEOUT);
- },
- onClickOutside: function onClickOutside(event) {
- var _this9 = this;
- if (this.visible) {
- if (event.type === 'mousedown') {
- event.preventDefault();
- return;
- }
- if (this.transfer) {
- var $el = this.$refs.dropdown.$el;
- if ($el === event.target || $el.contains(event.target)) {
- return;
- }
- }
- if (this.filterable) {
- var input = this.$el.querySelector('input[type="text"]');
- this.caretPosition = input.selectionStart;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this9);
- var caretPosition = this.caretPosition === -1 ? input.value.length : this.caretPosition;
- input.setSelectionRange(caretPosition, caretPosition);
- }.bind(this));
- }
- if (!this.autoComplete) event.stopPropagation();
- event.preventDefault();
- this.hideMenu();
- this.isFocused = true;
- this.$emit('on-clickoutside', event);
- } else {
- this.caretPosition = -1;
- this.isFocused = false;
- }
- },
- reset: function reset() {
- this.query = '';
- this.focusIndex = -1;
- this.unchangedQuery = true;
- this.values = [];
- this.filterQueryChange = false;
- },
- handleKeydown: function handleKeydown(e) {
- var key = e.key || e.code;
- var keyCode = e.keyCode || e.which;
- if (key === 'Backspace' || keyCode === 8) {
- return;
- }
- if (this.visible) {
- e.preventDefault();
- if (key === 'Tab') {
- e.stopPropagation();
- }
- if (key === 'Escape') {
- e.stopPropagation();
- this.hideMenu();
- }
- if (key === 'ArrowUp') {
- this.navigateOptions(-1);
- }
- if (key === 'ArrowDown') {
- this.navigateOptions(1);
- }
- if (key === 'Enter') {
- if (this.focusIndex === -1) return this.hideMenu();
- var optionComponent = this.flatOptions[this.focusIndex];
- if (optionComponent) {
- var option = this.getOptionData(optionComponent.componentOptions.propsData.value);
- this.onOptionClick(option);
- } else {
- this.hideMenu();
- }
- }
- } else {
- var keysThatCanOpenSelect = ['ArrowUp', 'ArrowDown'];
- if (keysThatCanOpenSelect.includes(e.key)) this.toggleMenu(null, true);
- }
- },
- navigateOptions: function navigateOptions(direction) {
- var optionsLength = this.flatOptions.length - 1;
- if (optionsLength < 0) return;
- var index = this.focusIndex + direction;
- if (index < 0) index = optionsLength;
- if (index > optionsLength) index = 0;
- if (direction > 0) {
- var nearestActiveOption = -1;
- for (var i = 0; i < this.flatOptions.length; i++) {
- var optionIsActive = !this.flatOptions[i].componentOptions.propsData.disabled;
- if (optionIsActive) nearestActiveOption = i;
- if (nearestActiveOption >= index) break;
- }
- index = nearestActiveOption;
- } else {
- var _nearestActiveOption = this.flatOptions.length;
- for (var _i = optionsLength; _i >= 0; _i--) {
- var _optionIsActive = !this.flatOptions[_i].componentOptions.propsData.disabled;
- if (_optionIsActive) _nearestActiveOption = _i;
- if (_nearestActiveOption <= index) break;
- }
- index = _nearestActiveOption;
- }
- this.focusIndex = index;
- },
- onOptionClick: function onOptionClick(option) {
- var _this10 = this;
- if (this.multiple) {
- if (this.remote) this.lastRemoteQuery = this.lastRemoteQuery || this.query;else this.lastRemoteQuery = '';
- var valueIsSelected = this.values.find(function (_ref8) {
- var value = _ref8.value;
- (0, _newArrowCheck3.default)(this, _this10);
- return value === option.value;
- }.bind(this));
- if (valueIsSelected) {
- this.values = this.values.filter(function (_ref9) {
- var value = _ref9.value;
- (0, _newArrowCheck3.default)(this, _this10);
- return value !== option.value;
- }.bind(this));
- } else {
- this.values = this.values.concat(option);
- }
- this.isFocused = true;
- } else {
- this.query = String(option.label).trim();
- this.values = [option];
- this.lastRemoteQuery = '';
- this.hideMenu();
- }
- this.focusIndex = this.flatOptions.findIndex(function (opt) {
- (0, _newArrowCheck3.default)(this, _this10);
- if (!opt || !opt.componentOptions) return false;
- return opt.componentOptions.propsData.value === option.value;
- }.bind(this));
- if (this.filterable) {
- var inputField = this.$el.querySelector('input[type="text"]');
- if (!this.autoComplete) this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this10);
- return inputField.focus();
- }.bind(this));
- }
- this.$emit('on-select', option);
- this.broadcast('Drop', 'on-update-popper');
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this10);
- this.filterQueryChange = false;
- }.bind(this), ANIMATION_TIMEOUT);
- },
- onQueryChange: function onQueryChange(query) {
- this.isTyping = true;
- if (query.length > 0 && query !== this.query) {
- if (this.autoComplete) {
- var isInputFocused = document.hasFocus && document.hasFocus() && document.activeElement === this.$el.querySelector('input');
- this.visible = isInputFocused;
- } else {
- this.visible = true;
- }
- }
- this.query = query;
- this.unchangedQuery = this.visible;
- this.filterQueryChange = true;
- },
- toggleHeaderFocus: function toggleHeaderFocus(_ref10) {
- var type = _ref10.type;
- if (this.itemDisabled) {
- return;
- }
- this.isFocused = type === 'focus';
- },
- updateSlotOptions: function updateSlotOptions() {
- this.slotOptions = this.$slots.default;
- },
- checkUpdateStatus: function checkUpdateStatus() {
- if (this.getInitialValue().length > 0 && this.selectOptions.length === 0) {
- this.hasExpectedValue = true;
- }
- },
- handleCreateItem: function handleCreateItem() {
- var _this11 = this;
- if (this.allowCreate && this.query !== '' && this.showCreateItem) {
- var query = this.query;
- this.$emit('on-create', query);
- this.query = '';
- var option = {
- value: query,
- label: query,
- tag: undefined
- };
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this11);
- return this.onOptionClick(option);
- }.bind(this));
- }
- }
- },
- watch: {
- value: function value(_value) {
- var _this12 = this;
- var getInitialValue = this.getInitialValue,
- getOptionData = this.getOptionData,
- publicValue = this.publicValue,
- values = this.values;
- this.checkUpdateStatus();
- if (_value === '') this.values = [];else if (checkValuesNotEqual(_value, publicValue, values)) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this12);
- return this.values = getInitialValue().map(getOptionData).filter(Boolean);
- }.bind(this));
- if (!this.multiple) this.dispatch('FormItem', 'on-form-change', this.publicValue);
- }
- },
- values: function values(now, before) {
- var newValue = (0, _stringify2.default)(now);
- var oldValue = (0, _stringify2.default)(before);
- var vModelValue = this.publicValue;
- var shouldEmitInput = newValue !== oldValue && vModelValue !== this.value;
- if (shouldEmitInput) {
- var emitValue = this.publicValue;
- if (this.labelInValue) {
- if (this.multiple) {
- emitValue = this.values;
- } else {
- emitValue = this.values[0];
- }
- }
- if (Array.isArray(vModelValue) && !vModelValue.length && this.value === null) vModelValue = null;else if (vModelValue === undefined && this.value === null) vModelValue = null;
- this.$emit('input', vModelValue);
- this.$emit('on-change', emitValue);
- this.dispatch('FormItem', 'on-form-change', emitValue);
- }
- },
- query: function query(_query) {
- var _this13 = this;
- this.$emit('on-query-change', _query);
- var remoteMethod = this.remoteMethod,
- lastRemoteQuery = this.lastRemoteQuery;
- var hasValidQuery = _query !== '' && (_query !== lastRemoteQuery || !lastRemoteQuery);
- var shouldCallRemoteMethod = remoteMethod && hasValidQuery && !this.preventRemoteCall;
- this.preventRemoteCall = false;
- if (shouldCallRemoteMethod) {
- this.focusIndex = -1;
- var promise = this.remoteMethod(_query);
- this.initialLabel = '';
- if (promise && promise.then) {
- promise.then(function (options) {
- (0, _newArrowCheck3.default)(this, _this13);
- if (options) this.options = options;
- }.bind(this));
- }
- }
- if (_query !== '' && this.remote) this.lastRemoteQuery = _query;
- },
- loading: function loading(state) {
- if (state === false) {
- this.updateSlotOptions();
- }
- },
- isFocused: function isFocused(focused) {
- var el = this.filterable ? this.$el.querySelector('input[type="text"]') : this.$el;
- el[this.isFocused ? 'focus' : 'blur']();
- var _values = (0, _slicedToArray3.default)(this.values, 1),
- selectedOption = _values[0];
- if (selectedOption && this.filterable && !this.multiple && !focused) {
- var selectedLabel = String(selectedOption.label || selectedOption.value).trim();
- if (selectedLabel && this.query !== selectedLabel) {
- this.preventRemoteCall = true;
- this.query = selectedLabel;
- }
- }
- },
- focusIndex: function focusIndex(index) {
- var _this14 = this;
- if (index < 0 || this.autoComplete) return;
- var optionValue = this.flatOptions[index].componentOptions.propsData.value;
- var optionInstance = findChild(this, function (_ref11) {
- var $options = _ref11.$options;
- (0, _newArrowCheck3.default)(this, _this14);
- return $options.componentName === 'select-item' && $options.propsData.value === optionValue;
- }.bind(this));
- var bottomOverflowDistance = optionInstance.$el.getBoundingClientRect().bottom - this.$refs.dropdown.$el.getBoundingClientRect().bottom;
- var topOverflowDistance = optionInstance.$el.getBoundingClientRect().top - this.$refs.dropdown.$el.getBoundingClientRect().top;
- if (bottomOverflowDistance > 0) {
- this.$refs.dropdown.$el.scrollTop += bottomOverflowDistance;
- }
- if (topOverflowDistance < 0) {
- this.$refs.dropdown.$el.scrollTop += topOverflowDistance;
- }
- },
- dropVisible: function dropVisible(open) {
- this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper');
- },
- selectOptions: function selectOptions() {
- if (this.hasExpectedValue && this.selectOptions.length > 0) {
- if (this.values.length === 0) {
- this.values = this.getInitialValue();
- }
- this.values = this.values.map(this.getOptionData).filter(Boolean);
- this.hasExpectedValue = false;
- }
- if (this.slotOptions && this.slotOptions.length === 0) {
- this.query = '';
- }
- this.broadcast('Drop', 'on-update-popper');
- },
- visible: function visible(state) {
- this.$emit('on-open-change', state);
- },
- slotOptions: function slotOptions(options, old) {
- if (!this.remote) {
- var values = this.getInitialValue();
- if (this.flatOptions && this.flatOptions.length && values.length && !this.multiple) {
- this.values = values.map(this.getOptionData).filter(Boolean);
- }
- }
- if (options && old && options.length !== old.length) {
- this.broadcast('Drop', 'on-update-popper');
- }
- }
- }
- };
- /***/ }),
- /* 111 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(297), __esModule: true };
- /***/ }),
- /* 112 */
- /***/ (function(module, exports, __webpack_require__) {
- // call something on iterator step with safe closing on error
- var anObject = __webpack_require__(22);
- 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 (e) {
- var ret = iterator['return'];
- if (ret !== undefined) anObject(ret.call(iterator));
- throw e;
- }
- };
- /***/ }),
- /* 113 */
- /***/ (function(module, exports, __webpack_require__) {
- // check on default Array iterator
- var Iterators = __webpack_require__(34);
- var ITERATOR = __webpack_require__(10)('iterator');
- var ArrayProto = Array.prototype;
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
- };
- /***/ }),
- /* 114 */
- /***/ (function(module, exports, __webpack_require__) {
- var ITERATOR = __webpack_require__(10)('iterator');
- var SAFE_CLOSING = false;
- try {
- var riter = [7][ITERATOR]();
- riter['return'] = function () { SAFE_CLOSING = true; };
- // eslint-disable-next-line no-throw-literal
- Array.from(riter, function () { throw 2; });
- } catch (e) { /* empty */ }
- module.exports = function (exec, skipClosing) {
- if (!skipClosing && !SAFE_CLOSING) return false;
- var safe = false;
- try {
- var arr = [7];
- var iter = arr[ITERATOR]();
- iter.next = function () { return { done: safe = true }; };
- arr[ITERATOR] = function () { return iter; };
- exec(arr);
- } catch (e) { /* empty */ }
- return safe;
- };
- /***/ }),
- /* 115 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- var _assist = __webpack_require__(3);
- var _transferQueue = __webpack_require__(37);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- var Popper = isServer ? function () {} : __webpack_require__(116);exports.default = {
- name: 'Drop',
- props: {
- placement: {
- type: String,
- default: 'bottom-start'
- },
- className: {
- type: String
- },
- transfer: {
- type: Boolean
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- popper: null,
- width: '',
- popperStatus: false,
- tIndex: this.handleGetIndex()
- };
- },
- computed: {
- styles: function styles() {
- var style = {};
- if (this.width) style.minWidth = String(this.width) + 'px';
- if (this.transfer) style['z-index'] = 1060 + this.tIndex;
- return style;
- }
- },
- methods: {
- update: function update() {
- var _this = this;
- if (isServer) return;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- if (this.popper) {
- this.popper.update();
- this.popperStatus = true;
- } else {
- this.popper = new Popper(this.$parent.$refs.reference, this.$el, {
- eventsEnabled: this.eventsEnabled,
- placement: this.placement,
- modifiers: {
- computeStyle: {
- gpuAcceleration: false
- },
- preventOverflow: {
- boundariesElement: 'window'
- }
- },
- onCreate: function onCreate() {
- (0, _newArrowCheck3.default)(this, _this);
- this.resetTransformOrigin();
- this.$nextTick(this.popper.update());
- }.bind(this),
- onUpdate: function onUpdate() {
- (0, _newArrowCheck3.default)(this, _this);
- this.resetTransformOrigin();
- }.bind(this)
- });
- }
- if (this.$parent.$options.name === 'iSelect') {
- this.width = parseInt((0, _assist.getStyle)(this.$parent.$el, 'width'));
- }
- this.tIndex = this.handleGetIndex();
- }.bind(this));
- },
- destroy: function destroy() {
- var _this2 = this;
- if (this.popper) {
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- if (this.popper && !this.popperStatus) {
- this.popper.popper.style.display = 'none';
- this.popper.destroy();
- this.popper = null;
- }
- this.popperStatus = false;
- }.bind(this), 300);
- }
- },
- resetTransformOrigin: function resetTransformOrigin() {
- if (!this.popper) return;
- var x_placement = this.popper.popper.getAttribute('x-placement');
- var placementStart = x_placement.split('-')[0];
- var placementEnd = x_placement.split('-')[1];
- var leftOrRight = x_placement === 'left' || x_placement === 'right';
- if (!leftOrRight) {
- this.popper.popper.style.transformOrigin = placementStart === 'bottom' || placementStart !== 'top' && placementEnd === 'start' ? 'center top' : 'center bottom';
- }
- },
- handleGetIndex: function handleGetIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- }
- },
- created: function created() {
- this.$on('on-update-popper', this.update);
- this.$on('on-destroy-popper', this.destroy);
- },
- beforeDestroy: function beforeDestroy() {
- this.$off('on-update-popper', this.update);
- this.$off('on-destroy-popper', this.destroy);
- if (this.popper) {
- this.popper.destroy();
- this.popper = null;
- }
- }
- };
- /***/ }),
- /* 116 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {/**!
- * @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.15.0
- * @license
- * Copyright (c) 2016 Federico Zivolo and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- (function (global, factory) {
- true ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Popper = factory());
- }(this, (function () { 'use strict';
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
- var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
- var timeoutDuration = 0;
- for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
- if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
- timeoutDuration = 1;
- break;
- }
- }
- function microtaskDebounce(fn) {
- var called = false;
- return function () {
- if (called) {
- return;
- }
- called = true;
- window.Promise.resolve().then(function () {
- called = false;
- fn();
- });
- };
- }
- function taskDebounce(fn) {
- var scheduled = false;
- return function () {
- if (!scheduled) {
- scheduled = true;
- setTimeout(function () {
- scheduled = false;
- fn();
- }, timeoutDuration);
- }
- };
- }
- var supportsMicroTasks = isBrowser && window.Promise;
- /**
- * Create a debounced version of a method, that's asynchronously deferred
- * but called in the minimum time possible.
- *
- * @method
- * @memberof Popper.Utils
- * @argument {Function} fn
- * @returns {Function}
- */
- var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
- /**
- * Check if the given variable is a function
- * @method
- * @memberof Popper.Utils
- * @argument {Any} functionToCheck - variable to check
- * @returns {Boolean} answer to: is a function?
- */
- function isFunction(functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- }
- /**
- * Get CSS computed property of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Eement} element
- * @argument {String} property
- */
- function getStyleComputedProperty(element, property) {
- if (element.nodeType !== 1) {
- return [];
- }
- // NOTE: 1 DOM access here
- var window = element.ownerDocument.defaultView;
- var css = window.getComputedStyle(element, null);
- return property ? css[property] : css;
- }
- /**
- * Returns the parentNode or the host of the element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} parent
- */
- function getParentNode(element) {
- if (element.nodeName === 'HTML') {
- return element;
- }
- return element.parentNode || element.host;
- }
- /**
- * Returns the scrolling parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} scroll parent
- */
- function getScrollParent(element) {
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
- if (!element) {
- return document.body;
- }
- switch (element.nodeName) {
- case 'HTML':
- case 'BODY':
- return element.ownerDocument.body;
- case '#document':
- return element.body;
- }
- // Firefox want us to check `-x` and `-y` variations as well
- var _getStyleComputedProp = getStyleComputedProperty(element),
- overflow = _getStyleComputedProp.overflow,
- overflowX = _getStyleComputedProp.overflowX,
- overflowY = _getStyleComputedProp.overflowY;
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
- return element;
- }
- return getScrollParent(getParentNode(element));
- }
- var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
- var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
- /**
- * Determines if the browser is Internet Explorer
- * @method
- * @memberof Popper.Utils
- * @param {Number} version to check
- * @returns {Boolean} isIE
- */
- function isIE(version) {
- if (version === 11) {
- return isIE11;
- }
- if (version === 10) {
- return isIE10;
- }
- return isIE11 || isIE10;
- }
- /**
- * Returns the offset parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} offset parent
- */
- function getOffsetParent(element) {
- if (!element) {
- return document.documentElement;
- }
- var noOffsetParent = isIE(10) ? document.body : null;
- // NOTE: 1 DOM access here
- var offsetParent = element.offsetParent || null;
- // Skip hidden elements which don't have an offsetParent
- while (offsetParent === noOffsetParent && element.nextElementSibling) {
- offsetParent = (element = element.nextElementSibling).offsetParent;
- }
- var nodeName = offsetParent && offsetParent.nodeName;
- if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- return element ? element.ownerDocument.documentElement : document.documentElement;
- }
- // .offsetParent will return the closest TH, TD or TABLE in case
- // no offsetParent is present, I hate this job...
- if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
- return getOffsetParent(offsetParent);
- }
- return offsetParent;
- }
- function isOffsetContainer(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY') {
- return false;
- }
- return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
- }
- /**
- * Finds the root node (document, shadowDOM root) of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} node
- * @returns {Element} root node
- */
- function getRoot(node) {
- if (node.parentNode !== null) {
- return getRoot(node.parentNode);
- }
- return node;
- }
- /**
- * Finds the offset parent common to the two provided nodes
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element1
- * @argument {Element} element2
- * @returns {Element} common offset parent
- */
- function findCommonOffsetParent(element1, element2) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
- return document.documentElement;
- }
- // Here we make sure to give as "start" the element that comes first in the DOM
- var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
- var start = order ? element1 : element2;
- var end = order ? element2 : element1;
- // Get common ancestor container
- var range = document.createRange();
- range.setStart(start, 0);
- range.setEnd(end, 0);
- var commonAncestorContainer = range.commonAncestorContainer;
- // Both nodes are inside #document
- if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
- if (isOffsetContainer(commonAncestorContainer)) {
- return commonAncestorContainer;
- }
- return getOffsetParent(commonAncestorContainer);
- }
- // one of the nodes is inside shadowDOM, find which one
- var element1root = getRoot(element1);
- if (element1root.host) {
- return findCommonOffsetParent(element1root.host, element2);
- } else {
- return findCommonOffsetParent(element1, getRoot(element2).host);
- }
- }
- /**
- * Gets the scroll value of the given element in the given side (top and left)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {String} side `top` or `left`
- * @returns {number} amount of scrolled pixels
- */
- function getScroll(element) {
- var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
- var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- var html = element.ownerDocument.documentElement;
- var scrollingElement = element.ownerDocument.scrollingElement || html;
- return scrollingElement[upperSide];
- }
- return element[upperSide];
- }
- /*
- * Sum or subtract the element scroll values (left and top) from a given rect object
- * @method
- * @memberof Popper.Utils
- * @param {Object} rect - Rect object you want to change
- * @param {HTMLElement} element - The element from the function reads the scroll values
- * @param {Boolean} subtract - set to true if you want to subtract the scroll values
- * @return {Object} rect - The modifier rect object
- */
- function includeScroll(rect, element) {
- var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- var modifier = subtract ? -1 : 1;
- rect.top += scrollTop * modifier;
- rect.bottom += scrollTop * modifier;
- rect.left += scrollLeft * modifier;
- rect.right += scrollLeft * modifier;
- return rect;
- }
- /*
- * Helper to detect borders of a given element
- * @method
- * @memberof Popper.Utils
- * @param {CSSStyleDeclaration} styles
- * Result of `getStyleComputedProperty` on the given element
- * @param {String} axis - `x` or `y`
- * @return {number} borders - The borders size of the given axis
- */
- function getBordersSize(styles, axis) {
- var sideA = axis === 'x' ? 'Left' : 'Top';
- var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
- return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
- }
- function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
- }
- function getWindowSizes(document) {
- var body = document.body;
- var html = document.documentElement;
- var computedStyle = isIE(10) && getComputedStyle(html);
- return {
- height: getSize('Height', body, html, computedStyle),
- width: getSize('Width', body, html, computedStyle)
- };
- }
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
- var createClass = function () {
- 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);
- }
- }
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- var defineProperty = function (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;
- };
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- /**
- * Given element offsets, generate an output similar to getBoundingClientRect
- * @method
- * @memberof Popper.Utils
- * @argument {Object} offsets
- * @returns {Object} ClientRect like output
- */
- function getClientRect(offsets) {
- return _extends({}, offsets, {
- right: offsets.left + offsets.width,
- bottom: offsets.top + offsets.height
- });
- }
- /**
- * Get bounding client rect of given element
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} element
- * @return {Object} client rect
- */
- function getBoundingClientRect(element) {
- var rect = {};
- // IE10 10 FIX: Please, don't ask, the element isn't
- // considered in DOM in some circumstances...
- // This isn't reproducible in IE10 compatibility mode of IE11
- try {
- if (isIE(10)) {
- rect = element.getBoundingClientRect();
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- rect.top += scrollTop;
- rect.left += scrollLeft;
- rect.bottom += scrollTop;
- rect.right += scrollLeft;
- } else {
- rect = element.getBoundingClientRect();
- }
- } catch (e) {}
- var result = {
- left: rect.left,
- top: rect.top,
- width: rect.right - rect.left,
- height: rect.bottom - rect.top
- };
- // subtract scrollbar size from sizes
- var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
- var width = sizes.width || element.clientWidth || result.right - result.left;
- var height = sizes.height || element.clientHeight || result.bottom - result.top;
- var horizScrollbar = element.offsetWidth - width;
- var vertScrollbar = element.offsetHeight - height;
- // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
- // we make this check conditional for performance reasons
- if (horizScrollbar || vertScrollbar) {
- var styles = getStyleComputedProperty(element);
- horizScrollbar -= getBordersSize(styles, 'x');
- vertScrollbar -= getBordersSize(styles, 'y');
- result.width -= horizScrollbar;
- result.height -= vertScrollbar;
- }
- return getClientRect(result);
- }
- function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var isIE10 = isIE(10);
- var isHTML = parent.nodeName === 'HTML';
- var childrenRect = getBoundingClientRect(children);
- var parentRect = getBoundingClientRect(parent);
- var scrollParent = getScrollParent(children);
- var styles = getStyleComputedProperty(parent);
- var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
- var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
- // In cases where the parent is fixed, we must ignore negative scroll in offset calc
- if (fixedPosition && isHTML) {
- parentRect.top = Math.max(parentRect.top, 0);
- parentRect.left = Math.max(parentRect.left, 0);
- }
- var offsets = getClientRect({
- top: childrenRect.top - parentRect.top - borderTopWidth,
- left: childrenRect.left - parentRect.left - borderLeftWidth,
- width: childrenRect.width,
- height: childrenRect.height
- });
- offsets.marginTop = 0;
- offsets.marginLeft = 0;
- // Subtract margins of documentElement in case it's being used as parent
- // we do this only on HTML because it's the only element that behaves
- // differently when margins are applied to it. The margins are included in
- // the box of the documentElement, in the other cases not.
- if (!isIE10 && isHTML) {
- var marginTop = parseFloat(styles.marginTop, 10);
- var marginLeft = parseFloat(styles.marginLeft, 10);
- offsets.top -= borderTopWidth - marginTop;
- offsets.bottom -= borderTopWidth - marginTop;
- offsets.left -= borderLeftWidth - marginLeft;
- offsets.right -= borderLeftWidth - marginLeft;
- // Attach marginTop and marginLeft because in some circumstances we may need them
- offsets.marginTop = marginTop;
- offsets.marginLeft = marginLeft;
- }
- if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
- offsets = includeScroll(offsets, parent);
- }
- return offsets;
- }
- function getViewportOffsetRectRelativeToArtbitraryNode(element) {
- var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var html = element.ownerDocument.documentElement;
- var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
- var width = Math.max(html.clientWidth, window.innerWidth || 0);
- var height = Math.max(html.clientHeight, window.innerHeight || 0);
- var scrollTop = !excludeScroll ? getScroll(html) : 0;
- var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
- var offset = {
- top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
- left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
- width: width,
- height: height
- };
- return getClientRect(offset);
- }
- /**
- * Check if the given element is fixed or is inside a fixed parent
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {Element} customContainer
- * @returns {Boolean} answer to "isFixed?"
- */
- function isFixed(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- return false;
- }
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
- return true;
- }
- var parentNode = getParentNode(element);
- if (!parentNode) {
- return false;
- }
- return isFixed(parentNode);
- }
- /**
- * Finds the first parent of an element that has a transformed property defined
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} first transformed parent or documentElement
- */
- function getFixedPositionOffsetParent(element) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element || !element.parentElement || isIE()) {
- return document.documentElement;
- }
- var el = element.parentElement;
- while (el && getStyleComputedProperty(el, 'transform') === 'none') {
- el = el.parentElement;
- }
- return el || document.documentElement;
- }
- /**
- * Computed the boundaries limits and return them
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} popper
- * @param {HTMLElement} reference
- * @param {number} padding
- * @param {HTMLElement} boundariesElement - Element used to define the boundaries
- * @param {Boolean} fixedPosition - Is in fixed position mode
- * @returns {Object} Coordinates of the boundaries
- */
- function getBoundaries(popper, reference, padding, boundariesElement) {
- var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- // NOTE: 1 DOM access here
- var boundaries = { top: 0, left: 0 };
- var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
- // Handle viewport case
- if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
- } else {
- // Handle other cases based on DOM element used as boundaries
- var boundariesNode = void 0;
- if (boundariesElement === 'scrollParent') {
- boundariesNode = getScrollParent(getParentNode(reference));
- if (boundariesNode.nodeName === 'BODY') {
- boundariesNode = popper.ownerDocument.documentElement;
- }
- } else if (boundariesElement === 'window') {
- boundariesNode = popper.ownerDocument.documentElement;
- } else {
- boundariesNode = boundariesElement;
- }
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
- // In case of HTML, we need a different computation
- if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
- var _getWindowSizes = getWindowSizes(popper.ownerDocument),
- height = _getWindowSizes.height,
- width = _getWindowSizes.width;
- boundaries.top += offsets.top - offsets.marginTop;
- boundaries.bottom = height + offsets.top;
- boundaries.left += offsets.left - offsets.marginLeft;
- boundaries.right = width + offsets.left;
- } else {
- // for all the other DOM elements, this one is good
- boundaries = offsets;
- }
- }
- // Add paddings
- padding = padding || 0;
- var isPaddingNumber = typeof padding === 'number';
- boundaries.left += isPaddingNumber ? padding : padding.left || 0;
- boundaries.top += isPaddingNumber ? padding : padding.top || 0;
- boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
- boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
- return boundaries;
- }
- function getArea(_ref) {
- var width = _ref.width,
- height = _ref.height;
- return width * height;
- }
- /**
- * Utility used to transform the `auto` placement to the placement with more
- * available space.
- * @method
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
- var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
- if (placement.indexOf('auto') === -1) {
- return placement;
- }
- var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
- var rects = {
- top: {
- width: boundaries.width,
- height: refRect.top - boundaries.top
- },
- right: {
- width: boundaries.right - refRect.right,
- height: boundaries.height
- },
- bottom: {
- width: boundaries.width,
- height: boundaries.bottom - refRect.bottom
- },
- left: {
- width: refRect.left - boundaries.left,
- height: boundaries.height
- }
- };
- var sortedAreas = Object.keys(rects).map(function (key) {
- return _extends({
- key: key
- }, rects[key], {
- area: getArea(rects[key])
- });
- }).sort(function (a, b) {
- return b.area - a.area;
- });
- var filteredAreas = sortedAreas.filter(function (_ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- return width >= popper.clientWidth && height >= popper.clientHeight;
- });
- var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
- var variation = placement.split('-')[1];
- return computedPlacement + (variation ? '-' + variation : '');
- }
- /**
- * Get offsets to the reference element
- * @method
- * @memberof Popper.Utils
- * @param {Object} state
- * @param {Element} popper - the popper element
- * @param {Element} reference - the reference element (the popper will be relative to this)
- * @param {Element} fixedPosition - is in fixed position mode
- * @returns {Object} An object containing the offsets which will be applied to the popper
- */
- function getReferenceOffsets(state, popper, reference) {
- var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
- }
- /**
- * Get the outer sizes of the given element (offset size + margins)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Object} object containing width and height properties
- */
- function getOuterSizes(element) {
- var window = element.ownerDocument.defaultView;
- var styles = window.getComputedStyle(element);
- var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
- var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
- var result = {
- width: element.offsetWidth + y,
- height: element.offsetHeight + x
- };
- return result;
- }
- /**
- * Get the opposite placement of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement
- * @returns {String} flipped placement
- */
- function getOppositePlacement(placement) {
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
- return placement.replace(/left|right|bottom|top/g, function (matched) {
- return hash[matched];
- });
- }
- /**
- * Get offsets to the popper
- * @method
- * @memberof Popper.Utils
- * @param {Object} position - CSS position the Popper will get applied
- * @param {HTMLElement} popper - the popper element
- * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
- * @param {String} placement - one of the valid placement options
- * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
- */
- function getPopperOffsets(popper, referenceOffsets, placement) {
- placement = placement.split('-')[0];
- // Get popper node sizes
- var popperRect = getOuterSizes(popper);
- // Add position, width and height to our offsets object
- var popperOffsets = {
- width: popperRect.width,
- height: popperRect.height
- };
- // depending by the popper placement we have to compute its offsets slightly differently
- var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
- var mainSide = isHoriz ? 'top' : 'left';
- var secondarySide = isHoriz ? 'left' : 'top';
- var measurement = isHoriz ? 'height' : 'width';
- var secondaryMeasurement = !isHoriz ? 'height' : 'width';
- popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
- if (placement === secondarySide) {
- popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
- } else {
- popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
- }
- return popperOffsets;
- }
- /**
- * Mimics the `find` method of Array
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function find(arr, check) {
- // use native find if supported
- if (Array.prototype.find) {
- return arr.find(check);
- }
- // use `filter` to obtain the same behavior of `find`
- return arr.filter(check)[0];
- }
- /**
- * Return the index of the matching object
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function findIndex(arr, prop, value) {
- // use native findIndex if supported
- if (Array.prototype.findIndex) {
- return arr.findIndex(function (cur) {
- return cur[prop] === value;
- });
- }
- // use `find` + `indexOf` if `findIndex` isn't supported
- var match = find(arr, function (obj) {
- return obj[prop] === value;
- });
- return arr.indexOf(match);
- }
- /**
- * Loop trough the list of modifiers and run them in order,
- * each of them will then edit the data object.
- * @method
- * @memberof Popper.Utils
- * @param {dataObject} data
- * @param {Array} modifiers
- * @param {String} ends - Optional modifier name used as stopper
- * @returns {dataObject}
- */
- function runModifiers(modifiers, data, ends) {
- var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
- modifiersToRun.forEach(function (modifier) {
- if (modifier['function']) {
- // eslint-disable-line dot-notation
- console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
- }
- var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
- if (modifier.enabled && isFunction(fn)) {
- // Add properties to offsets to make them a complete clientRect object
- // we do this before each modifier to make sure the previous one doesn't
- // mess with these values
- data.offsets.popper = getClientRect(data.offsets.popper);
- data.offsets.reference = getClientRect(data.offsets.reference);
- data = fn(data, modifier);
- }
- });
- return data;
- }
- /**
- * Updates the position of the popper, computing the new offsets and applying
- * the new style.<br />
- * Prefer `scheduleUpdate` over `update` because of performance reasons.
- * @method
- * @memberof Popper
- */
- function update() {
- // if popper is destroyed, don't perform any further update
- if (this.state.isDestroyed) {
- return;
- }
- var data = {
- instance: this,
- styles: {},
- arrowStyles: {},
- attributes: {},
- flipped: false,
- offsets: {}
- };
- // compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
- // store the computed placement inside `originalPlacement`
- data.originalPlacement = data.placement;
- data.positionFixed = this.options.positionFixed;
- // compute the popper offsets
- data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
- data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
- // run the modifiers
- data = runModifiers(this.modifiers, data);
- // the first `update` will call `onCreate` callback
- // the other ones will call `onUpdate` callback
- if (!this.state.isCreated) {
- this.state.isCreated = true;
- this.options.onCreate(data);
- } else {
- this.options.onUpdate(data);
- }
- }
- /**
- * Helper used to know if the given modifier is enabled.
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean}
- */
- function isModifierEnabled(modifiers, modifierName) {
- return modifiers.some(function (_ref) {
- var name = _ref.name,
- enabled = _ref.enabled;
- return enabled && name === modifierName;
- });
- }
- /**
- * Get the prefixed supported property name
- * @method
- * @memberof Popper.Utils
- * @argument {String} property (camelCase)
- * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
- */
- function getSupportedPropertyName(property) {
- var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
- var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
- for (var i = 0; i < prefixes.length; i++) {
- var prefix = prefixes[i];
- var toCheck = prefix ? '' + prefix + upperProp : property;
- if (typeof document.body.style[toCheck] !== 'undefined') {
- return toCheck;
- }
- }
- return null;
- }
- /**
- * Destroys the popper.
- * @method
- * @memberof Popper
- */
- function destroy() {
- this.state.isDestroyed = true;
- // touch DOM only if `applyStyle` modifier is enabled
- if (isModifierEnabled(this.modifiers, 'applyStyle')) {
- this.popper.removeAttribute('x-placement');
- this.popper.style.position = '';
- this.popper.style.top = '';
- this.popper.style.left = '';
- this.popper.style.right = '';
- this.popper.style.bottom = '';
- this.popper.style.willChange = '';
- this.popper.style[getSupportedPropertyName('transform')] = '';
- }
- this.disableEventListeners();
- // remove the popper if user explicity asked for the deletion on destroy
- // do not use `remove` because IE11 doesn't support it
- if (this.options.removeOnDestroy) {
- this.popper.parentNode.removeChild(this.popper);
- }
- return this;
- }
- /**
- * Get the window associated with the element
- * @argument {Element} element
- * @returns {Window}
- */
- function getWindow(element) {
- var ownerDocument = element.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView : window;
- }
- function attachToScrollParents(scrollParent, event, callback, scrollParents) {
- var isBody = scrollParent.nodeName === 'BODY';
- var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
- target.addEventListener(event, callback, { passive: true });
- if (!isBody) {
- attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
- }
- scrollParents.push(target);
- }
- /**
- * Setup needed event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function setupEventListeners(reference, options, state, updateBound) {
- // Resize event listener on window
- state.updateBound = updateBound;
- getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
- // Scroll event listener on scroll parents
- var scrollElement = getScrollParent(reference);
- attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
- state.scrollElement = scrollElement;
- state.eventsEnabled = true;
- return state;
- }
- /**
- * It will add resize/scroll events and start recalculating
- * position of the popper element when they are triggered.
- * @method
- * @memberof Popper
- */
- function enableEventListeners() {
- if (!this.state.eventsEnabled) {
- this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
- }
- }
- /**
- * Remove event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function removeEventListeners(reference, state) {
- // Remove resize event listener on window
- getWindow(reference).removeEventListener('resize', state.updateBound);
- // Remove scroll event listener on scroll parents
- state.scrollParents.forEach(function (target) {
- target.removeEventListener('scroll', state.updateBound);
- });
- // Reset state
- state.updateBound = null;
- state.scrollParents = [];
- state.scrollElement = null;
- state.eventsEnabled = false;
- return state;
- }
- /**
- * It will remove resize/scroll events and won't recalculate popper position
- * when they are triggered. It also won't trigger `onUpdate` callback anymore,
- * unless you call `update` method manually.
- * @method
- * @memberof Popper
- */
- function disableEventListeners() {
- if (this.state.eventsEnabled) {
- cancelAnimationFrame(this.scheduleUpdate);
- this.state = removeEventListeners(this.reference, this.state);
- }
- }
- /**
- * Tells if a given input is a number
- * @method
- * @memberof Popper.Utils
- * @param {*} input to check
- * @return {Boolean}
- */
- function isNumeric(n) {
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
- }
- /**
- * Set the style to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the style to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setStyles(element, styles) {
- Object.keys(styles).forEach(function (prop) {
- var unit = '';
- // add unit if the value is numeric and is one of the following
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
- unit = 'px';
- }
- element.style[prop] = styles[prop] + unit;
- });
- }
- /**
- * Set the attributes to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the attributes to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setAttributes(element, attributes) {
- Object.keys(attributes).forEach(function (prop) {
- var value = attributes[prop];
- if (value !== false) {
- element.setAttribute(prop, attributes[prop]);
- } else {
- element.removeAttribute(prop);
- }
- });
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} data.styles - List of style properties - values to apply to popper element
- * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The same data object
- */
- function applyStyle(data) {
- // any property present in `data.styles` will be applied to the popper,
- // in this way we can make the 3rd party modifiers add custom styles to it
- // Be aware, modifiers could override the properties defined in the previous
- // lines of this modifier!
- setStyles(data.instance.popper, data.styles);
- // any property present in `data.attributes` will be applied to the popper,
- // they will be set as HTML attributes of the element
- setAttributes(data.instance.popper, data.attributes);
- // if arrowElement is defined and arrowStyles has some properties
- if (data.arrowElement && Object.keys(data.arrowStyles).length) {
- setStyles(data.arrowElement, data.arrowStyles);
- }
- return data;
- }
- /**
- * Set the x-placement attribute before everything else because it could be used
- * to add margins to the popper margins needs to be calculated to get the
- * correct popper offsets.
- * @method
- * @memberof Popper.modifiers
- * @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper
- * @param {Object} options - Popper.js options
- */
- function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
- // compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
- popper.setAttribute('x-placement', placement);
- // Apply `position` to popper before anything else because
- // without the position applied we can't guarantee correct computations
- setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
- return options;
- }
- /**
- * @function
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Boolean} shouldRound - If the offsets should be rounded at all
- * @returns {Object} The popper's position offsets rounded
- *
- * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
- * good as it can be within reason.
- * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
- *
- * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
- * as well on High DPI screens).
- *
- * Firefox prefers no rounding for positioning and does not have blurriness on
- * high DPI screens.
- *
- * Only horizontal placement and left/right values need to be considered.
- */
- function getRoundedOffsets(data, shouldRound) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var round = Math.round,
- floor = Math.floor;
- var noRound = function noRound(v) {
- return v;
- };
- var referenceWidth = round(reference.width);
- var popperWidth = round(popper.width);
- var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
- var isVariation = data.placement.indexOf('-') !== -1;
- var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
- var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
- var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
- var verticalToInteger = !shouldRound ? noRound : round;
- return {
- left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
- top: verticalToInteger(popper.top),
- bottom: verticalToInteger(popper.bottom),
- right: horizontalToInteger(popper.right)
- };
- }
- var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeStyle(data, options) {
- var x = options.x,
- y = options.y;
- var popper = data.offsets.popper;
- // Remove this legacy support in Popper.js v2
- var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'applyStyle';
- }).gpuAcceleration;
- if (legacyGpuAccelerationOption !== undefined) {
- console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
- }
- var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
- var offsetParent = getOffsetParent(data.instance.popper);
- var offsetParentRect = getBoundingClientRect(offsetParent);
- // Styles
- var styles = {
- position: popper.position
- };
- var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
- var sideA = x === 'bottom' ? 'top' : 'bottom';
- var sideB = y === 'right' ? 'left' : 'right';
- // if gpuAcceleration is set to `true` and transform is supported,
- // we use `translate3d` to apply the position to the popper we
- // automatically use the supported prefixed version if needed
- var prefixedProperty = getSupportedPropertyName('transform');
- // now, let's make a step back and look at this code closely (wtf?)
- // If the content of the popper grows once it's been positioned, it
- // may happen that the popper gets misplaced because of the new content
- // overflowing its reference element
- // To avoid this problem, we provide two options (x and y), which allow
- // the consumer to define the offset origin.
- // If we position a popper on top of a reference element, we can set
- // `x` to `top` to make the popper grow towards its top instead of
- // its bottom.
- var left = void 0,
- top = void 0;
- if (sideA === 'bottom') {
- // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
- // and not the bottom of the html element
- if (offsetParent.nodeName === 'HTML') {
- top = -offsetParent.clientHeight + offsets.bottom;
- } else {
- top = -offsetParentRect.height + offsets.bottom;
- }
- } else {
- top = offsets.top;
- }
- if (sideB === 'right') {
- if (offsetParent.nodeName === 'HTML') {
- left = -offsetParent.clientWidth + offsets.right;
- } else {
- left = -offsetParentRect.width + offsets.right;
- }
- } else {
- left = offsets.left;
- }
- if (gpuAcceleration && prefixedProperty) {
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
- styles[sideA] = 0;
- styles[sideB] = 0;
- styles.willChange = 'transform';
- } else {
- // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
- var invertTop = sideA === 'bottom' ? -1 : 1;
- var invertLeft = sideB === 'right' ? -1 : 1;
- styles[sideA] = top * invertTop;
- styles[sideB] = left * invertLeft;
- styles.willChange = sideA + ', ' + sideB;
- }
- // Attributes
- var attributes = {
- 'x-placement': data.placement
- };
- // Update `data` attributes, styles and arrowStyles
- data.attributes = _extends({}, attributes, data.attributes);
- data.styles = _extends({}, styles, data.styles);
- data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
- return data;
- }
- /**
- * Helper used to know if the given modifier depends from another one.<br />
- * It checks if the needed modifier is listed and enabled.
- * @method
- * @memberof Popper.Utils
- * @param {Array} modifiers - list of modifiers
- * @param {String} requestingName - name of requesting modifier
- * @param {String} requestedName - name of requested modifier
- * @returns {Boolean}
- */
- function isModifierRequired(modifiers, requestingName, requestedName) {
- var requesting = find(modifiers, function (_ref) {
- var name = _ref.name;
- return name === requestingName;
- });
- var isRequired = !!requesting && modifiers.some(function (modifier) {
- return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
- });
- if (!isRequired) {
- var _requesting = '`' + requestingName + '`';
- var requested = '`' + requestedName + '`';
- console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
- }
- return isRequired;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function arrow(data, options) {
- var _data$offsets$arrow;
- // arrow depends on keepTogether in order to work
- if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
- return data;
- }
- var arrowElement = options.element;
- // if arrowElement is a string, suppose it's a CSS selector
- if (typeof arrowElement === 'string') {
- arrowElement = data.instance.popper.querySelector(arrowElement);
- // if arrowElement is not found, don't run the modifier
- if (!arrowElement) {
- return data;
- }
- } else {
- // if the arrowElement isn't a query selector we must check that the
- // provided DOM node is child of its popper node
- if (!data.instance.popper.contains(arrowElement)) {
- console.warn('WARNING: `arrow.element` must be child of its popper element!');
- return data;
- }
- }
- var placement = data.placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
- var len = isVertical ? 'height' : 'width';
- var sideCapitalized = isVertical ? 'Top' : 'Left';
- var side = sideCapitalized.toLowerCase();
- var altSide = isVertical ? 'left' : 'top';
- var opSide = isVertical ? 'bottom' : 'right';
- var arrowElementSize = getOuterSizes(arrowElement)[len];
- //
- // extends keepTogether behavior making sure the popper and its
- // reference have enough pixels in conjunction
- //
- // top/left side
- if (reference[opSide] - arrowElementSize < popper[side]) {
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
- }
- // bottom/right side
- if (reference[side] + arrowElementSize > popper[opSide]) {
- data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
- }
- data.offsets.popper = getClientRect(data.offsets.popper);
- // compute center of the popper
- var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
- // Compute the sideValue using the updated popper offsets
- // take popper margin in account because we don't have this info available
- var css = getStyleComputedProperty(data.instance.popper);
- var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
- var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
- var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
- // prevent arrowElement from being placed not contiguously to its popper
- sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
- data.arrowElement = arrowElement;
- data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
- return data;
- }
- /**
- * Get the opposite placement variation of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement variation
- * @returns {String} flipped placement variation
- */
- function getOppositeVariation(variation) {
- if (variation === 'end') {
- return 'start';
- } else if (variation === 'start') {
- return 'end';
- }
- return variation;
- }
- /**
- * List of accepted placements to use as values of the `placement` option.<br />
- * Valid placements are:
- * - `auto`
- * - `top`
- * - `right`
- * - `bottom`
- * - `left`
- *
- * Each placement can have a variation from this list:
- * - `-start`
- * - `-end`
- *
- * Variations are interpreted easily if you think of them as the left to right
- * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
- * is right.<br />
- * Vertically (`left` and `right`), `start` is top and `end` is bottom.
- *
- * Some valid examples are:
- * - `top-end` (on top of reference, right aligned)
- * - `right-start` (on right of reference, top aligned)
- * - `bottom` (on bottom, centered)
- * - `auto-end` (on the side with more space available, alignment depends by placement)
- *
- * @static
- * @type {Array}
- * @enum {String}
- * @readonly
- * @method placements
- * @memberof Popper
- */
- var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
- // Get rid of `auto` `auto-start` and `auto-end`
- var validPlacements = placements.slice(3);
- /**
- * Given an initial placement, returns all the subsequent placements
- * clockwise (or counter-clockwise).
- *
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement - A valid placement (it accepts variations)
- * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
- * @returns {Array} placements including their variations
- */
- function clockwise(placement) {
- var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var index = validPlacements.indexOf(placement);
- var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
- return counter ? arr.reverse() : arr;
- }
- var BEHAVIORS = {
- FLIP: 'flip',
- CLOCKWISE: 'clockwise',
- COUNTERCLOCKWISE: 'counterclockwise'
- };
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function flip(data, options) {
- // if `inner` modifier is enabled, we can't use the `flip` modifier
- if (isModifierEnabled(data.instance.modifiers, 'inner')) {
- return data;
- }
- if (data.flipped && data.placement === data.originalPlacement) {
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
- return data;
- }
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
- var placement = data.placement.split('-')[0];
- var placementOpposite = getOppositePlacement(placement);
- var variation = data.placement.split('-')[1] || '';
- var flipOrder = [];
- switch (options.behavior) {
- case BEHAVIORS.FLIP:
- flipOrder = [placement, placementOpposite];
- break;
- case BEHAVIORS.CLOCKWISE:
- flipOrder = clockwise(placement);
- break;
- case BEHAVIORS.COUNTERCLOCKWISE:
- flipOrder = clockwise(placement, true);
- break;
- default:
- flipOrder = options.behavior;
- }
- flipOrder.forEach(function (step, index) {
- if (placement !== step || flipOrder.length === index + 1) {
- return data;
- }
- placement = data.placement.split('-')[0];
- placementOpposite = getOppositePlacement(placement);
- var popperOffsets = data.offsets.popper;
- var refOffsets = data.offsets.reference;
- // using floor because the reference offsets may contain decimals we are not going to consider here
- var floor = Math.floor;
- var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
- var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
- var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
- var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
- var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
- var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
- // flip the variation if required
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- // flips variation if reference element overflows boundaries
- var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
- // flips variation if popper content overflows boundaries
- var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
- var flippedVariation = flippedVariationByRef || flippedVariationByContent;
- if (overlapsRef || overflowsBoundaries || flippedVariation) {
- // this boolean to detect any flip loop
- data.flipped = true;
- if (overlapsRef || overflowsBoundaries) {
- placement = flipOrder[index + 1];
- }
- if (flippedVariation) {
- variation = getOppositeVariation(variation);
- }
- data.placement = placement + (variation ? '-' + variation : '');
- // this object contains `position`, we want to preserve it along with
- // any additional property we may add in the future
- data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
- data = runModifiers(data.instance.modifiers, data, 'flip');
- }
- });
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function keepTogether(data) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var placement = data.placement.split('-')[0];
- var floor = Math.floor;
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- var side = isVertical ? 'right' : 'bottom';
- var opSide = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
- if (popper[side] < floor(reference[opSide])) {
- data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
- }
- if (popper[opSide] > floor(reference[side])) {
- data.offsets.popper[opSide] = floor(reference[side]);
- }
- return data;
- }
- /**
- * Converts a string containing value + unit into a px value number
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} str - Value + unit string
- * @argument {String} measurement - `height` or `width`
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @returns {Number|String}
- * Value in pixels, or original string if no values were extracted
- */
- function toValue(str, measurement, popperOffsets, referenceOffsets) {
- // separate value from unit
- var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
- var value = +split[1];
- var unit = split[2];
- // If it's not a number it's an operator, I guess
- if (!value) {
- return str;
- }
- if (unit.indexOf('%') === 0) {
- var element = void 0;
- switch (unit) {
- case '%p':
- element = popperOffsets;
- break;
- case '%':
- case '%r':
- default:
- element = referenceOffsets;
- }
- var rect = getClientRect(element);
- return rect[measurement] / 100 * value;
- } else if (unit === 'vh' || unit === 'vw') {
- // if is a vh or vw, we calculate the size based on the viewport
- var size = void 0;
- if (unit === 'vh') {
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
- } else {
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
- return size / 100 * value;
- } else {
- // if is an explicit pixel unit, we get rid of the unit and keep the value
- // if is an implicit unit, it's px, and we return just the value
- return value;
- }
- }
- /**
- * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} offset
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @argument {String} basePlacement
- * @returns {Array} a two cells array with x and y offsets in numbers
- */
- function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
- var offsets = [0, 0];
- // Use height if placement is left or right and index is 0 otherwise use width
- // in this way the first offset will use an axis and the second one
- // will use the other one
- var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
- // Split the offset string to obtain a list of values and operands
- // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
- var fragments = offset.split(/(\+|\-)/).map(function (frag) {
- return frag.trim();
- });
- // Detect if the offset string contains a pair of values or a single one
- // they could be separated by comma or space
- var divider = fragments.indexOf(find(fragments, function (frag) {
- return frag.search(/,|\s/) !== -1;
- }));
- if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
- console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
- }
- // If divider is found, we divide the list of values and operands to divide
- // them by ofset X and Y.
- var splitRegex = /\s*,\s*|\s+/;
- var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
- // Convert the values with units to absolute pixels to allow our computations
- ops = ops.map(function (op, index) {
- // Most of the units rely on the orientation of the popper
- var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
- var mergeWithPrevious = false;
- return op
- // This aggregates any `+` or `-` sign that aren't considered operators
- // e.g.: 10 + +5 => [10, +, +5]
- .reduce(function (a, b) {
- if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
- a[a.length - 1] = b;
- mergeWithPrevious = true;
- return a;
- } else if (mergeWithPrevious) {
- a[a.length - 1] += b;
- mergeWithPrevious = false;
- return a;
- } else {
- return a.concat(b);
- }
- }, [])
- // Here we convert the string values into number values (in px)
- .map(function (str) {
- return toValue(str, measurement, popperOffsets, referenceOffsets);
- });
- });
- // Loop trough the offsets arrays and execute the operations
- ops.forEach(function (op, index) {
- op.forEach(function (frag, index2) {
- if (isNumeric(frag)) {
- offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
- }
- });
- });
- return offsets;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @argument {Number|String} options.offset=0
- * The offset value as described in the modifier description
- * @returns {Object} The data object, properly modified
- */
- function offset(data, _ref) {
- var offset = _ref.offset;
- var placement = data.placement,
- _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var basePlacement = placement.split('-')[0];
- var offsets = void 0;
- if (isNumeric(+offset)) {
- offsets = [+offset, 0];
- } else {
- offsets = parseOffset(offset, popper, reference, basePlacement);
- }
- if (basePlacement === 'left') {
- popper.top += offsets[0];
- popper.left -= offsets[1];
- } else if (basePlacement === 'right') {
- popper.top += offsets[0];
- popper.left += offsets[1];
- } else if (basePlacement === 'top') {
- popper.left += offsets[0];
- popper.top -= offsets[1];
- } else if (basePlacement === 'bottom') {
- popper.left += offsets[0];
- popper.top += offsets[1];
- }
- data.popper = popper;
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function preventOverflow(data, options) {
- var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
- // If offsetParent is the reference element, we really want to
- // go one step up and use the next offsetParent as reference to
- // avoid to make this modifier completely useless and look like broken
- if (data.instance.reference === boundariesElement) {
- boundariesElement = getOffsetParent(boundariesElement);
- }
- // NOTE: DOM access here
- // resets the popper's position so that the document size can be calculated excluding
- // the size of the popper element itself
- var transformProp = getSupportedPropertyName('transform');
- var popperStyles = data.instance.popper.style; // assignment to help minification
- var top = popperStyles.top,
- left = popperStyles.left,
- transform = popperStyles[transformProp];
- popperStyles.top = '';
- popperStyles.left = '';
- popperStyles[transformProp] = '';
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
- // NOTE: DOM access here
- // restores the original style properties after the offsets have been computed
- popperStyles.top = top;
- popperStyles.left = left;
- popperStyles[transformProp] = transform;
- options.boundaries = boundaries;
- var order = options.priority;
- var popper = data.offsets.popper;
- var check = {
- primary: function primary(placement) {
- var value = popper[placement];
- if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
- value = Math.max(popper[placement], boundaries[placement]);
- }
- return defineProperty({}, placement, value);
- },
- secondary: function secondary(placement) {
- var mainSide = placement === 'right' ? 'left' : 'top';
- var value = popper[mainSide];
- if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
- value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
- }
- return defineProperty({}, mainSide, value);
- }
- };
- order.forEach(function (placement) {
- var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
- popper = _extends({}, popper, check[side](placement));
- });
- data.offsets.popper = popper;
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function shift(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var shiftvariation = placement.split('-')[1];
- // if shift shiftvariation is specified, run the modifier
- if (shiftvariation) {
- var _data$offsets = data.offsets,
- reference = _data$offsets.reference,
- popper = _data$offsets.popper;
- var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
- var side = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
- var shiftOffsets = {
- start: defineProperty({}, side, reference[side]),
- end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
- };
- data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
- }
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function hide(data) {
- if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
- return data;
- }
- var refRect = data.offsets.reference;
- var bound = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'preventOverflow';
- }).boundaries;
- if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === true) {
- return data;
- }
- data.hide = true;
- data.attributes['x-out-of-boundaries'] = '';
- } else {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === false) {
- return data;
- }
- data.hide = false;
- data.attributes['x-out-of-boundaries'] = false;
- }
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function inner(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
- var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
- popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
- data.placement = getOppositePlacement(placement);
- data.offsets.popper = getClientRect(popper);
- return data;
- }
- /**
- * Modifier function, each modifier can have a function of this type assigned
- * to its `fn` property.<br />
- * These functions will be called on each update, this means that you must
- * make sure they are performant enough to avoid performance bottlenecks.
- *
- * @function ModifierFn
- * @argument {dataObject} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {dataObject} The data object, properly modified
- */
- /**
- * Modifiers are plugins used to alter the behavior of your poppers.<br />
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
- * needed by the library.
- *
- * Usually you don't want to override the `order`, `fn` and `onLoad` props.
- * All the other properties are configurations that could be tweaked.
- * @namespace modifiers
- */
- var modifiers = {
- /**
- * Modifier used to shift the popper on the start or end of its reference
- * element.<br />
- * It will read the variation of the `placement` property.<br />
- * It can be one either `-end` or `-start`.
- * @memberof modifiers
- * @inner
- */
- shift: {
- /** @prop {number} order=100 - Index used to define the order of execution */
- order: 100,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: shift
- },
- /**
- * The `offset` modifier can shift your popper on both its axis.
- *
- * It accepts the following units:
- * - `px` or unit-less, interpreted as pixels
- * - `%` or `%r`, percentage relative to the length of the reference element
- * - `%p`, percentage relative to the length of the popper element
- * - `vw`, CSS viewport width unit
- * - `vh`, CSS viewport height unit
- *
- * For length is intended the main axis relative to the placement of the popper.<br />
- * This means that if the placement is `top` or `bottom`, the length will be the
- * `width`. In case of `left` or `right`, it will be the `height`.
- *
- * You can provide a single value (as `Number` or `String`), or a pair of values
- * as `String` divided by a comma or one (or more) white spaces.<br />
- * The latter is a deprecated method because it leads to confusion and will be
- * removed in v2.<br />
- * Additionally, it accepts additions and subtractions between different units.
- * Note that multiplications and divisions aren't supported.
- *
- * Valid examples are:
- * ```
- * 10
- * '10%'
- * '10, 10'
- * '10%, 10'
- * '10 + 10%'
- * '10 - 5vh + 3%'
- * '-10px + 5vh, 5px - 6%'
- * ```
- * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
- * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
- * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
- *
- * @memberof modifiers
- * @inner
- */
- offset: {
- /** @prop {number} order=200 - Index used to define the order of execution */
- order: 200,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: offset,
- /** @prop {Number|String} offset=0
- * The offset value as described in the modifier description
- */
- offset: 0
- },
- /**
- * Modifier used to prevent the popper from being positioned outside the boundary.
- *
- * A scenario exists where the reference itself is not within the boundaries.<br />
- * We can say it has "escaped the boundaries" — or just "escaped".<br />
- * In this case we need to decide whether the popper should either:
- *
- * - detach from the reference and remain "trapped" in the boundaries, or
- * - if it should ignore the boundary and "escape with its reference"
- *
- * When `escapeWithReference` is set to`true` and reference is completely
- * outside its boundaries, the popper will overflow (or completely leave)
- * the boundaries in order to remain attached to the edge of the reference.
- *
- * @memberof modifiers
- * @inner
- */
- preventOverflow: {
- /** @prop {number} order=300 - Index used to define the order of execution */
- order: 300,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: preventOverflow,
- /**
- * @prop {Array} [priority=['left','right','top','bottom']]
- * Popper will try to prevent overflow following these priorities by default,
- * then, it could overflow on the left and on top of the `boundariesElement`
- */
- priority: ['left', 'right', 'top', 'bottom'],
- /**
- * @prop {number} padding=5
- * Amount of pixel used to define a minimum distance between the boundaries
- * and the popper. This makes sure the popper always has a little padding
- * between the edges of its container
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='scrollParent'
- * Boundaries used by the modifier. Can be `scrollParent`, `window`,
- * `viewport` or any DOM element.
- */
- boundariesElement: 'scrollParent'
- },
- /**
- * Modifier used to make sure the reference and its popper stay near each other
- * without leaving any gap between the two. Especially useful when the arrow is
- * enabled and you want to ensure that it points to its reference element.
- * It cares only about the first axis. You can still have poppers with margin
- * between the popper and its reference element.
- * @memberof modifiers
- * @inner
- */
- keepTogether: {
- /** @prop {number} order=400 - Index used to define the order of execution */
- order: 400,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: keepTogether
- },
- /**
- * This modifier is used to move the `arrowElement` of the popper to make
- * sure it is positioned between the reference element and its popper element.
- * It will read the outer size of the `arrowElement` node to detect how many
- * pixels of conjunction are needed.
- *
- * It has no effect if no `arrowElement` is provided.
- * @memberof modifiers
- * @inner
- */
- arrow: {
- /** @prop {number} order=500 - Index used to define the order of execution */
- order: 500,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: arrow,
- /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
- element: '[x-arrow]'
- },
- /**
- * Modifier used to flip the popper's placement when it starts to overlap its
- * reference element.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- *
- * **NOTE:** this modifier will interrupt the current update cycle and will
- * restart it if it detects the need to flip the placement.
- * @memberof modifiers
- * @inner
- */
- flip: {
- /** @prop {number} order=600 - Index used to define the order of execution */
- order: 600,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: flip,
- /**
- * @prop {String|Array} behavior='flip'
- * The behavior used to change the popper's placement. It can be one of
- * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
- * placements (with optional variations)
- */
- behavior: 'flip',
- /**
- * @prop {number} padding=5
- * The popper will flip if it hits the edges of the `boundariesElement`
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='viewport'
- * The element which will define the boundaries of the popper position.
- * The popper will never be placed outside of the defined boundaries
- * (except if `keepTogether` is enabled)
- */
- boundariesElement: 'viewport',
- /**
- * @prop {Boolean} flipVariations=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the reference element overlaps its boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariations: false,
- /**
- * @prop {Boolean} flipVariationsByContent=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the popper element overlaps its reference boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariationsByContent: false
- },
- /**
- * Modifier used to make the popper flow toward the inner of the reference element.
- * By default, when this modifier is disabled, the popper will be placed outside
- * the reference element.
- * @memberof modifiers
- * @inner
- */
- inner: {
- /** @prop {number} order=700 - Index used to define the order of execution */
- order: 700,
- /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
- enabled: false,
- /** @prop {ModifierFn} */
- fn: inner
- },
- /**
- * Modifier used to hide the popper when its reference element is outside of the
- * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
- * be used to hide with a CSS selector the popper when its reference is
- * out of boundaries.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- * @memberof modifiers
- * @inner
- */
- hide: {
- /** @prop {number} order=800 - Index used to define the order of execution */
- order: 800,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: hide
- },
- /**
- * Computes the style that will be applied to the popper element to gets
- * properly positioned.
- *
- * Note that this modifier will not touch the DOM, it just prepares the styles
- * so that `applyStyle` modifier can apply it. This separation is useful
- * in case you need to replace `applyStyle` with a custom implementation.
- *
- * This modifier has `850` as `order` value to maintain backward compatibility
- * with previous versions of Popper.js. Expect the modifiers ordering method
- * to change in future major versions of the library.
- *
- * @memberof modifiers
- * @inner
- */
- computeStyle: {
- /** @prop {number} order=850 - Index used to define the order of execution */
- order: 850,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: computeStyle,
- /**
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: true,
- /**
- * @prop {string} [x='bottom']
- * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
- * Change this if your popper should grow in a direction different from `bottom`
- */
- x: 'bottom',
- /**
- * @prop {string} [x='left']
- * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
- * Change this if your popper should grow in a direction different from `right`
- */
- y: 'right'
- },
- /**
- * Applies the computed styles to the popper element.
- *
- * All the DOM manipulations are limited to this modifier. This is useful in case
- * you want to integrate Popper.js inside a framework or view library and you
- * want to delegate all the DOM manipulations to it.
- *
- * Note that if you disable this modifier, you must make sure the popper element
- * has its position set to `absolute` before Popper.js can do its work!
- *
- * Just disable this modifier and define your own to achieve the desired effect.
- *
- * @memberof modifiers
- * @inner
- */
- applyStyle: {
- /** @prop {number} order=900 - Index used to define the order of execution */
- order: 900,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: applyStyle,
- /** @prop {Function} */
- onLoad: applyStyleOnLoad,
- /**
- * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: undefined
- }
- };
- /**
- * The `dataObject` is an object containing all the information used by Popper.js.
- * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
- * @name dataObject
- * @property {Object} data.instance The Popper.js instance
- * @property {String} data.placement Placement applied to popper
- * @property {String} data.originalPlacement Placement originally defined on init
- * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
- * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
- * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
- * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.boundaries Offsets of the popper boundaries
- * @property {Object} data.offsets The measurements of popper, reference and arrow elements
- * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
- */
- /**
- * Default options provided to Popper.js constructor.<br />
- * These can be overridden using the `options` argument of Popper.js.<br />
- * To override an option, simply pass an object with the same
- * structure of the `options` object, as the 3rd argument. For example:
- * ```
- * new Popper(ref, pop, {
- * modifiers: {
- * preventOverflow: { enabled: false }
- * }
- * })
- * ```
- * @type {Object}
- * @static
- * @memberof Popper
- */
- var Defaults = {
- /**
- * Popper's placement.
- * @prop {Popper.placements} placement='bottom'
- */
- placement: 'bottom',
- /**
- * Set this to true if you want popper to position it self in 'fixed' mode
- * @prop {Boolean} positionFixed=false
- */
- positionFixed: false,
- /**
- * Whether events (resize, scroll) are initially enabled.
- * @prop {Boolean} eventsEnabled=true
- */
- eventsEnabled: true,
- /**
- * Set to true if you want to automatically remove the popper when
- * you call the `destroy` method.
- * @prop {Boolean} removeOnDestroy=false
- */
- removeOnDestroy: false,
- /**
- * Callback called when the popper is created.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onCreate}
- */
- onCreate: function onCreate() {},
- /**
- * Callback called when the popper is updated. This callback is not called
- * on the initialization/creation of the popper, but only on subsequent
- * updates.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onUpdate}
- */
- onUpdate: function onUpdate() {},
- /**
- * List of modifiers used to modify the offsets before they are applied to the popper.
- * They provide most of the functionalities of Popper.js.
- * @prop {modifiers}
- */
- modifiers: modifiers
- };
- /**
- * @callback onCreate
- * @param {dataObject} data
- */
- /**
- * @callback onUpdate
- * @param {dataObject} data
- */
- // Utils
- // Methods
- var Popper = function () {
- /**
- * Creates a new Popper.js instance.
- * @class Popper
- * @param {Element|referenceObject} reference - The reference element used to position the popper
- * @param {Element} popper - The HTML / XML element used as the popper
- * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
- * @return {Object} instance - The generated Popper.js instance
- */
- function Popper(reference, popper) {
- var _this = this;
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- classCallCheck(this, Popper);
- this.scheduleUpdate = function () {
- return requestAnimationFrame(_this.update);
- };
- // make update() debounced, so that it only runs at most once-per-tick
- this.update = debounce(this.update.bind(this));
- // with {} we create a new object with the options inside it
- this.options = _extends({}, Popper.Defaults, options);
- // init state
- this.state = {
- isDestroyed: false,
- isCreated: false,
- scrollParents: []
- };
- // get reference and popper elements (allow jQuery wrappers)
- this.reference = reference && reference.jquery ? reference[0] : reference;
- this.popper = popper && popper.jquery ? popper[0] : popper;
- // Deep merge modifiers options
- this.options.modifiers = {};
- Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
- _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
- });
- // Refactoring modifiers' list (Object => Array)
- this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
- return _extends({
- name: name
- }, _this.options.modifiers[name]);
- })
- // sort the modifiers by order
- .sort(function (a, b) {
- return a.order - b.order;
- });
- // modifiers have the ability to execute arbitrary code when Popper.js get inited
- // such code is executed in the same order of its modifier
- // they could add new properties to their options configuration
- // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
- this.modifiers.forEach(function (modifierOptions) {
- if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
- modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
- }
- });
- // fire the first update to position the popper in the right place
- this.update();
- var eventsEnabled = this.options.eventsEnabled;
- if (eventsEnabled) {
- // setup event listeners, they will take care of update the position in specific situations
- this.enableEventListeners();
- }
- this.state.eventsEnabled = eventsEnabled;
- }
- // We can't use class properties because they don't get listed in the
- // class prototype and break stuff like Sinon stubs
- createClass(Popper, [{
- key: 'update',
- value: function update$$1() {
- return update.call(this);
- }
- }, {
- key: 'destroy',
- value: function destroy$$1() {
- return destroy.call(this);
- }
- }, {
- key: 'enableEventListeners',
- value: function enableEventListeners$$1() {
- return enableEventListeners.call(this);
- }
- }, {
- key: 'disableEventListeners',
- value: function disableEventListeners$$1() {
- return disableEventListeners.call(this);
- }
- /**
- * Schedules an update. It will run on the next UI update available.
- * @method scheduleUpdate
- * @memberof Popper
- */
- /**
- * Collection of utilities useful when writing custom modifiers.
- * Starting from version 1.7, this method is available only if you
- * include `popper-utils.js` before `popper.js`.
- *
- * **DEPRECATION**: This way to access PopperUtils is deprecated
- * and will be removed in v2! Use the PopperUtils module directly instead.
- * Due to the high instability of the methods contained in Utils, we can't
- * guarantee them to follow semver. Use them at your own risk!
- * @static
- * @private
- * @type {Object}
- * @deprecated since version 1.8
- * @member Utils
- * @memberof Popper
- */
- }]);
- return Popper;
- }();
- /**
- * The `referenceObject` is an object that provides an interface compatible with Popper.js
- * and lets you use it as replacement of a real DOM node.<br />
- * You can use this method to position a popper relatively to a set of coordinates
- * in case you don't have a DOM node to use as reference.
- *
- * ```
- * new Popper(referenceObject, popperNode);
- * ```
- *
- * NB: This feature isn't supported in Internet Explorer 10.
- * @name referenceObject
- * @property {Function} data.getBoundingClientRect
- * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
- * @property {number} data.clientWidth
- * An ES6 getter that will return the width of the virtual reference element.
- * @property {number} data.clientHeight
- * An ES6 getter that will return the height of the virtual reference element.
- */
- Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
- Popper.placements = placements;
- Popper.Defaults = Defaults;
- return Popper;
- })));
- //# sourceMappingURL=popper.js.map
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(117)))
- /***/ }),
- /* 117 */
- /***/ (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 || Function("return this")() || (1,eval)("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;
- /***/ }),
- /* 118 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.2.2 IsArray(argument)
- var cof = __webpack_require__(41);
- module.exports = Array.isArray || function isArray(arg) {
- return cof(arg) == 'Array';
- };
- /***/ }),
- /* 119 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
- var $keys = __webpack_require__(96);
- var hiddenKeys = __webpack_require__(68).concat('length', 'prototype');
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return $keys(O, hiddenKeys);
- };
- /***/ }),
- /* 120 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.i18n = exports.use = exports.t = undefined;
- var _getPrototypeOf = __webpack_require__(317);
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
- var _zhCN = __webpack_require__(320);
- var _zhCN2 = _interopRequireDefault(_zhCN);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- var _deepmerge = __webpack_require__(322);
- var _deepmerge2 = _interopRequireDefault(_deepmerge);
- var _format = __webpack_require__(323);
- var _format2 = _interopRequireDefault(_format);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var format = (0, _format2.default)(_vue2.default);
- var lang = _zhCN2.default;
- var merged = false;
- var i18nHandler = function i18nHandler() {
- var vuei18n = (0, _getPrototypeOf2.default)(this || _vue2.default).$t;
- if (typeof vuei18n === 'function' && !!_vue2.default.locale) {
- if (!merged) {
- merged = true;
- _vue2.default.locale(_vue2.default.config.lang, (0, _deepmerge2.default)(lang, _vue2.default.locale(_vue2.default.config.lang) || {}, { clone: true }));
- }
- return vuei18n.apply(this, arguments);
- }
- };
- var t = exports.t = function t(path, options) {
- var value = i18nHandler.apply(this, arguments);
- if (value !== null && value !== undefined) return value;
- var array = path.split('.');
- var current = lang;
- for (var i = 0, j = array.length; i < j; i++) {
- var property = array[i];
- value = current[property];
- if (i === j - 1) return format(value, options);
- if (!value) return '';
- current = value;
- }
- return '';
- };
- var use = exports.use = function use(l) {
- lang = l || lang;
- };
- var i18n = exports.i18n = function i18n(fn) {
- i18nHandler = fn || i18nHandler;
- };
- exports.default = { use: use, t: t, i18n: i18n };
- /***/ }),
- /* 121 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-select';
- exports.default = {
- name: 'iSelectHead',
- mixins: [_emitter2.default, _locale2.default],
- components: { Icon: _icon2.default },
- props: {
- disabled: {
- type: Boolean,
- default: false
- },
- filterable: {
- type: Boolean,
- default: false
- },
- multiple: {
- type: Boolean,
- default: false
- },
- remote: {
- type: Boolean,
- default: false
- },
- initialLabel: {
- type: [String, Number, Array]
- },
- values: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- clearable: {
- type: [Function, Boolean],
- default: false
- },
- inputElementId: {
- type: String
- },
- placeholder: {
- type: String
- },
- queryProp: {
- type: String,
- default: ''
- },
- prefix: {
- type: String
- },
- maxTagCount: {
- type: Number
- },
- maxTagPlaceholder: {
- type: Function
- },
- allowCreate: {
- type: Boolean
- },
- showCreateItem: {
- type: Boolean
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- query: '',
- inputLength: 20,
- remoteInitialLabel: this.initialLabel,
- preventRemoteCall: false
- };
- },
- computed: {
- singleDisplayClasses: function singleDisplayClasses() {
- var _ref;
- var filterable = this.filterable,
- multiple = this.multiple,
- showPlaceholder = this.showPlaceholder;
- return [(_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-head-with-prefix', this.$slots.prefix || this.prefix), (0, _defineProperty3.default)(_ref, prefixCls + '-placeholder', showPlaceholder && !filterable), (0, _defineProperty3.default)(_ref, prefixCls + '-selected-value', !showPlaceholder && !multiple && !filterable), _ref)];
- },
- singleDisplayValue: function singleDisplayValue() {
- if (this.multiple && this.values.length > 0 || this.filterable) return '';
- return '' + String(this.selectedSingle) || this.localePlaceholder;
- },
- showPlaceholder: function showPlaceholder() {
- var status = false;
- if (!this.multiple) {
- var value = this.values[0];
- if (typeof value === 'undefined' || String(value).trim() === '') {
- status = !this.remoteInitialLabel;
- }
- } else {
- if (!this.values.length > 0) {
- status = true;
- }
- }
- return status;
- },
- resetSelect: function resetSelect() {
- return !this.showPlaceholder && this.clearable;
- },
- inputStyle: function inputStyle() {
- var style = {};
- if (this.multiple) {
- if (this.showPlaceholder) {
- style.width = '100%';
- } else {
- style.width = String(this.inputLength) + 'px';
- }
- }
- return style;
- },
- localePlaceholder: function localePlaceholder() {
- if (this.placeholder === undefined) {
- return this.t('i.select.placeholder');
- } else {
- return this.placeholder;
- }
- },
- selectedSingle: function selectedSingle() {
- var selected = this.values[0];
- return selected ? selected.label : this.remoteInitialLabel || '';
- },
- selectedMultiple: function selectedMultiple() {
- return this.multiple ? this.values : [];
- },
- headCls: function headCls() {
- return (0, _defineProperty3.default)({}, prefixCls + '-head-flex', this.filterable && (this.$slots.prefix || this.prefix));
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-down';
- if (this.$IVIEW) {
- if (this.$IVIEW.select.customArrow) {
- type = '';
- } else if (this.$IVIEW.select.arrow) {
- type = this.$IVIEW.select.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.select.customArrow) {
- type = this.$IVIEW.select.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.select.arrowSize) {
- size = this.$IVIEW.select.arrowSize;
- }
- }
- return size;
- }
- },
- methods: {
- onInputFocus: function onInputFocus() {
- this.$emit('on-input-focus');
- },
- onInputBlur: function onInputBlur() {
- if (this.showCreateItem) return;
- if (!this.values.length) this.query = '';
- this.$emit('on-input-blur');
- },
- removeTag: function removeTag(value) {
- if (this.disabled) return false;
- this.dispatch('iSelect', 'on-select-selected', value);
- },
- resetInputState: function resetInputState() {
- this.inputLength = this.$refs.input.value.length * 12 + 20;
- this.$emit('on-keydown');
- },
- handleInputDelete: function handleInputDelete(e) {
- var targetValue = e.target.value;
- if (this.multiple && this.selectedMultiple.length && this.query === '' && targetValue === '') {
- this.removeTag(this.selectedMultiple[this.selectedMultiple.length - 1]);
- }
- },
- handleInputEnter: function handleInputEnter(e) {
- this.$emit('on-enter');
- if (this.showCreateItem) e.stopPropagation();
- },
- onHeaderClick: function onHeaderClick(e) {
- if (this.filterable && e.target === this.$el) {
- this.$refs.input.focus();
- }
- },
- onClear: function onClear() {
- this.$emit('on-clear');
- }
- },
- watch: {
- values: function values(_ref3) {
- var _this = this;
- var _ref4 = (0, _slicedToArray3.default)(_ref3, 1),
- value = _ref4[0];
- if (!this.filterable) return;
- this.preventRemoteCall = true;
- if (this.multiple) {
- this.query = '';
- this.preventRemoteCall = false;
- return;
- }
- if (typeof value === 'undefined' || value === '' || value === null) this.query = '';else this.query = value.label;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- return this.preventRemoteCall = false;
- }.bind(this));
- },
- query: function query(val) {
- if (this.preventRemoteCall) {
- this.preventRemoteCall = false;
- return;
- }
- this.$emit('on-query-change', val);
- },
- queryProp: function queryProp(query) {
- if (query !== this.query) this.query = query;
- }
- }
- };
- /***/ }),
- /* 122 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var returnArrayFn = function () {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined);
- exports.default = {
- props: {
- options: {
- type: Array,
- default: returnArrayFn
- },
- slotOptions: {
- type: Array,
- default: returnArrayFn
- },
- slotUpdateHook: {
- type: Function,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- }.bind(undefined)
- }
- },
- render: function render(h) {
- if (this.slotOptions !== this.$parent.$slots.default) this.slotUpdateHook();
- return h('ul', [this.$slots.default, this.options]);
- }
- };
- /***/ }),
- /* 123 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-select-item';
- exports.default = {
- name: 'iOption',
- componentName: 'select-item',
- mixins: [_emitter2.default, _form2.default],
- props: {
- value: {
- type: [String, Number],
- required: true
- },
- label: {
- type: [String, Number]
- },
- disabled: {
- type: Boolean,
- default: false
- },
- selected: {
- type: Boolean,
- default: false
- },
- isFocused: {
- type: Boolean,
- default: false
- },
- tag: {
- type: [String, Number]
- }
- },
- data: function data() {
- return {
- searchLabel: '',
- autoComplete: false
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected && !this.autoComplete), (0, _defineProperty3.default)(_ref, prefixCls + '-focus', this.isFocused), _ref)];
- },
- showLabel: function showLabel() {
- return this.label ? this.label : this.value;
- },
- optionLabel: function optionLabel() {
- return this.label || this.$el && this.$el.textContent;
- }
- },
- methods: {
- select: function select() {
- if (this.itemDisabled) return false;
- this.dispatch('iSelect', 'on-select-selected', {
- value: this.value,
- label: this.optionLabel,
- tag: this.tag
- });
- this.$emit('on-select-selected', {
- value: this.value,
- label: this.optionLabel,
- tag: this.tag
- });
- }
- },
- mounted: function mounted() {
- var Select = (0, _assist.findComponentUpward)(this, 'iSelect');
- if (Select) this.autoComplete = Select.autoComplete;
- }
- };
- /***/ }),
- /* 124 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _isNan = __webpack_require__(329);
- var _isNan2 = _interopRequireDefault(_isNan);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _calcTextareaHeight = __webpack_require__(332);
- var _calcTextareaHeight2 = _interopRequireDefault(_calcTextareaHeight);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-input';
- exports.default = {
- name: 'Input',
- mixins: [_emitter2.default, _form2.default],
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number', 'tel']);
- },
- default: 'text'
- },
- value: {
- type: [String, Number],
- default: ''
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- placeholder: {
- type: String,
- default: ''
- },
- maxlength: {
- type: [String, Number]
- },
- disabled: {
- type: Boolean,
- default: false
- },
- icon: String,
- autosize: {
- type: [Boolean, Object],
- default: false
- },
- rows: {
- type: Number,
- default: 2
- },
- readonly: {
- type: Boolean,
- default: false
- },
- name: {
- type: String
- },
- number: {
- type: Boolean,
- default: false
- },
- autofocus: {
- type: Boolean,
- default: false
- },
- spellcheck: {
- type: Boolean,
- default: false
- },
- autocomplete: {
- type: String,
- default: 'off'
- },
- clearable: {
- type: Boolean,
- default: false
- },
- elementId: {
- type: String
- },
- wrap: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['hard', 'soft']);
- },
- default: 'soft'
- },
- prefix: {
- type: String,
- default: ''
- },
- suffix: {
- type: String,
- default: ''
- },
- search: {
- type: Boolean,
- default: false
- },
- enterButton: {
- type: [Boolean, String],
- default: false
- },
- showWordLimit: {
- type: Boolean,
- default: false
- },
- password: {
- type: Boolean,
- default: false
- },
- border: {
- type: Boolean,
- default: true
- }
- },
- data: function data() {
- return {
- currentValue: this.value,
- prefixCls: prefixCls,
- slotReady: false,
- textareaStyles: {},
- isOnComposition: false,
- showPassword: false,
- clearableIconOffset: 0
- };
- },
- computed: {
- currentType: function currentType() {
- var type = this.type;
- if (type === 'password' && this.password && this.showPassword) type = 'text';
- return type;
- },
- prepend: function prepend() {
- var state = false;
- if (this.type !== 'textarea') state = this.$slots.prepend !== undefined;
- return state;
- },
- append: function append() {
- var state = false;
- if (this.type !== 'textarea') state = this.$slots.append !== undefined;
- return state;
- },
- showPrefix: function showPrefix() {
- var state = false;
- if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined;
- return state;
- },
- showSuffix: function showSuffix() {
- var state = false;
- if (this.type !== 'textarea') state = this.suffix !== '' || this.$slots.suffix !== undefined;
- return state;
- },
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-type-' + String(this.type), this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-group', this.prepend || this.append || this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-group-' + String(this.size), (this.prepend || this.append || this.search && this.enterButton) && !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-group-with-prepend', this.prepend), (0, _defineProperty3.default)(_ref, prefixCls + '-group-with-append', this.append || this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-hide-icon', this.append), (0, _defineProperty3.default)(_ref, prefixCls + '-with-search', this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), _ref)];
- },
- inputClasses: function inputClasses() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-no-border', !this.border), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-prefix', this.showPrefix), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-suffix', this.showSuffix || this.search && this.enterButton === false), _ref2)];
- },
- textareaClasses: function textareaClasses() {
- var _ref3;
- return ['' + prefixCls, (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref3, prefixCls + '-no-border', !this.border), _ref3)];
- },
- upperLimit: function upperLimit() {
- return this.maxlength;
- },
- textLength: function textLength() {
- if (typeof this.value === 'number') {
- return String(this.value).length;
- }
- return (this.value || '').length;
- },
- clearableStyles: function clearableStyles() {
- var style = {};
- var offset = this.clearableIconOffset;
- if (offset) style.transform = 'translateX(-' + String(offset) + 'px)';
- return style;
- }
- },
- methods: {
- handleEnter: function handleEnter(event) {
- this.$emit('on-enter', event);
- if (this.search) this.$emit('on-search', this.currentValue);
- },
- handleKeydown: function handleKeydown(event) {
- this.$emit('on-keydown', event);
- },
- handleKeypress: function handleKeypress(event) {
- this.$emit('on-keypress', event);
- },
- handleKeyup: function handleKeyup(event) {
- this.$emit('on-keyup', event);
- },
- handleIconClick: function handleIconClick(event) {
- this.$emit('on-click', event);
- },
- handleFocus: function handleFocus(event) {
- this.$emit('on-focus', event);
- },
- handleBlur: function handleBlur(event) {
- this.$emit('on-blur', event);
- if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
- this.dispatch('FormItem', 'on-form-blur', this.currentValue);
- }
- },
- handleComposition: function handleComposition(event) {
- if (event.type === 'compositionstart') {
- this.isOnComposition = true;
- }
- if (event.type === 'compositionend') {
- this.isOnComposition = false;
- this.handleInput(event);
- }
- },
- handleInput: function handleInput(event) {
- if (this.isOnComposition) return;
- var value = event.target.value;
- if (this.number && value !== '') value = (0, _isNan2.default)(Number(value)) ? value : Number(value);
- this.$emit('input', value);
- this.setCurrentValue(value);
- this.$emit('on-change', event);
- },
- handleChange: function handleChange(event) {
- this.$emit('on-input-change', event);
- },
- setCurrentValue: function setCurrentValue(value) {
- var _this = this;
- if (value === this.currentValue) return;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.resizeTextarea();
- }.bind(this));
- this.currentValue = value;
- if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
- this.dispatch('FormItem', 'on-form-change', value);
- }
- },
- resizeTextarea: function resizeTextarea() {
- var autosize = this.autosize;
- if (!autosize || this.type !== 'textarea') {
- return false;
- }
- var minRows = autosize.minRows;
- var maxRows = autosize.maxRows;
- this.textareaStyles = (0, _calcTextareaHeight2.default)(this.$refs.textarea, minRows, maxRows);
- },
- focus: function focus(option) {
- var $el = this.type === 'textarea' ? this.$refs.textarea : this.$refs.input;
- $el.focus(option);
- var _ref4 = option || {},
- cursor = _ref4.cursor;
- if (cursor) {
- var len = $el.value.length;
- switch (cursor) {
- case 'start':
- $el.setSelectionRange(0, 0);
- break;
- case 'end':
- $el.setSelectionRange(len, len);
- break;
- default:
- $el.setSelectionRange(0, len);
- }
- }
- },
- blur: function blur() {
- if (this.type === 'textarea') {
- this.$refs.textarea.blur();
- } else {
- this.$refs.input.blur();
- }
- },
- handleClear: function handleClear() {
- var e = { target: { value: '' } };
- this.$emit('input', '');
- this.setCurrentValue('');
- this.$emit('on-change', e);
- this.$emit('on-clear');
- },
- handleSearch: function handleSearch() {
- if (this.itemDisabled) return false;
- this.$refs.input.focus();
- this.$emit('on-search', this.currentValue);
- },
- handleToggleShowPassword: function handleToggleShowPassword() {
- var _this2 = this;
- if (this.itemDisabled) return false;
- this.showPassword = !this.showPassword;
- this.focus();
- var len = this.currentValue.length;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.$refs.input.setSelectionRange(len, len);
- }.bind(this), 0);
- },
- handleCalcIconOffset: function handleCalcIconOffset() {
- var $el = this.$el.querySelectorAll('.ivu-input-group-append')[0];
- if ($el) {
- this.clearableIconOffset = $el.offsetWidth;
- } else {
- this.clearableIconOffset = 0;
- }
- }
- },
- watch: {
- value: function value(val) {
- this.setCurrentValue(val);
- },
- type: function type() {
- this.$nextTick(this.handleCalcIconOffset);
- }
- },
- mounted: function mounted() {
- this.slotReady = true;
- this.resizeTextarea();
- this.handleCalcIconOffset();
- },
- updated: function updated() {
- this.$nextTick(this.handleCalcIconOffset);
- }
- };
- /***/ }),
- /* 125 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__ = __webpack_require__(126);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__ = __webpack_require__(342);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 126 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-avatar';
- var sizeList = ['small', 'large', 'default'];
- exports.default = {
- name: 'Avatar',
- components: { Icon: _icon2.default },
- props: {
- shape: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['circle', 'square']);
- },
- default: 'circle'
- },
- size: {
- type: [String, Number],
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- src: {
- type: String
- },
- icon: {
- type: String
- },
- customIcon: {
- type: String,
- default: ''
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- scale: 1,
- childrenWidth: 0,
- isSlotShow: false,
- slotTemp: null
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.shape), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-image', !!this.src), (0, _defineProperty3.default)(_ref, prefixCls + '-icon', !!this.icon || !!this.customIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), (0, _assist.oneOf)(this.size, sizeList)), _ref)];
- },
- styles: function styles() {
- var style = {};
- if (this.size && !(0, _assist.oneOf)(this.size, sizeList)) {
- style.width = String(this.size) + 'px';
- style.height = String(this.size) + 'px';
- style.lineHeight = String(this.size) + 'px';
- style.fontSize = this.size / 2 + 'px';
- }
- return style;
- },
- childrenStyle: function childrenStyle() {
- var style = {};
- if (this.isSlotShow) {
- style = {
- msTransform: 'scale(' + String(this.scale) + ')',
- WebkitTransform: 'scale(' + String(this.scale) + ')',
- transform: 'scale(' + String(this.scale) + ')',
- position: 'absolute',
- display: 'inline-block',
- left: 'calc(50% - ' + String(Math.round(this.childrenWidth / 2)) + 'px)'
- };
- }
- return style;
- }
- },
- watch: {
- size: function size(val, oldVal) {
- if (val !== oldVal) this.setScale();
- }
- },
- methods: {
- setScale: function setScale() {
- this.isSlotShow = !this.src && !this.icon;
- if (this.$refs.children) {
- this.childrenWidth = this.$refs.children.offsetWidth;
- var avatarWidth = this.$el.getBoundingClientRect().width;
- if (avatarWidth - 8 < this.childrenWidth) {
- this.scale = (avatarWidth - 8) / this.childrenWidth;
- } else {
- this.scale = 1;
- }
- }
- },
- handleError: function handleError(e) {
- this.$emit('on-error', e);
- }
- },
- beforeCreate: function beforeCreate() {
- this.slotTemp = this.$slots.default;
- },
- mounted: function mounted() {
- this.setScale();
- },
- updated: function updated() {
- if (this.$slots.default !== this.slotTemp) {
- this.slotTemp = this.$slots.default;
- this.setScale();
- }
- }
- };
- /***/ }),
- /* 127 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-back-top';
- exports.default = {
- props: {
- height: {
- type: Number,
- default: 400
- },
- bottom: {
- type: Number,
- default: 30
- },
- right: {
- type: Number,
- default: 30
- },
- duration: {
- type: Number,
- default: 1000
- }
- },
- data: function data() {
- return {
- backTop: false
- };
- },
- mounted: function mounted() {
- (0, _dom.on)(window, 'scroll', this.handleScroll);
- (0, _dom.on)(window, 'resize', this.handleScroll);
- },
- beforeDestroy: function beforeDestroy() {
- (0, _dom.off)(window, 'scroll', this.handleScroll);
- (0, _dom.off)(window, 'resize', this.handleScroll);
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-show', this.backTop)];
- },
- styles: function styles() {
- return {
- bottom: String(this.bottom) + 'px',
- right: String(this.right) + 'px'
- };
- },
- innerClasses: function innerClasses() {
- return prefixCls + '-inner';
- }
- },
- methods: {
- handleScroll: function handleScroll() {
- this.backTop = window.pageYOffset >= this.height;
- },
- back: function back() {
- var sTop = document.documentElement.scrollTop || document.body.scrollTop;
- (0, _assist.scrollTop)(window, sTop, 0, this.duration);
- this.$emit('on-click');
- }
- }
- };
- /***/ }),
- /* 128 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var initColorList = ['blue', 'green', 'red', 'yellow', 'pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
- var prefixCls = 'ivu-badge';
- exports.default = {
- name: 'Badge',
- props: {
- count: Number,
- dot: {
- type: Boolean,
- default: false
- },
- overflowCount: {
- type: [Number, String],
- default: 99
- },
- className: String,
- showZero: {
- type: Boolean,
- default: false
- },
- text: {
- type: String,
- default: ''
- },
- status: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['success', 'processing', 'default', 'error', 'warning']);
- }
- },
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['success', 'primary', 'normal', 'error', 'warning', 'info']);
- }
- },
- offset: {
- type: Array
- },
- color: {
- type: String
- }
- },
- computed: {
- classes: function classes() {
- return '' + prefixCls;
- },
- dotClasses: function dotClasses() {
- return prefixCls + '-dot';
- },
- countClasses: function countClasses() {
- var _ref;
- return [prefixCls + '-count', (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-count-alone', this.alone), (0, _defineProperty3.default)(_ref, prefixCls + '-count-' + String(this.type), !!this.type), _ref)];
- },
- customCountClasses: function customCountClasses() {
- return [prefixCls + '-count', prefixCls + '-count-custom', (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
- },
- statusClasses: function statusClasses() {
- var _ref3;
- return [prefixCls + '-status-dot', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-status-' + String(this.status), !!this.status), (0, _defineProperty3.default)(_ref3, prefixCls + '-status-' + String(this.color), !!this.color && (0, _assist.oneOf)(this.color, initColorList)), _ref3)];
- },
- statusStyles: function statusStyles() {
- return (0, _assist.oneOf)(this.color, initColorList) ? {} : { backgroundColor: this.color };
- },
- styles: function styles() {
- var style = {};
- if (this.offset && this.offset.length === 2) {
- style['margin-top'] = String(this.offset[0]) + 'px';
- style['margin-right'] = String(this.offset[1]) + 'px';
- }
- return style;
- },
- finalCount: function finalCount() {
- if (this.text !== '') return this.text;
- return parseInt(this.count) >= parseInt(this.overflowCount) ? String(this.overflowCount) + '+' : this.count;
- },
- badge: function badge() {
- var status = false;
- if (this.count) {
- status = !(parseInt(this.count) === 0);
- }
- if (this.dot) {
- status = true;
- if (this.count !== null) {
- if (parseInt(this.count) === 0) {
- status = false;
- }
- }
- }
- if (this.text !== '') status = true;
- return status || this.showZero;
- },
- hasCount: function hasCount() {
- if (this.count || this.text !== '') return true;
- if (this.showZero && parseInt(this.count) === 0) return true;else return false;
- },
- alone: function alone() {
- return this.$slots.default === undefined;
- }
- }
- };
- /***/ }),
- /* 129 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-breadcrumb';
- exports.default = {
- name: 'Breadcrumb',
- props: {
- separator: {
- type: String,
- default: '/'
- }
- },
- computed: {
- classes: function classes() {
- return '' + prefixCls;
- }
- },
- mounted: function mounted() {
- this.updateChildren();
- },
- updated: function updated() {
- var _this = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.updateChildren();
- }.bind(this));
- },
- methods: {
- updateChildren: function updateChildren() {
- var _this2 = this;
- this.$children.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this2);
- child.separator = this.separator;
- }.bind(this));
- }
- },
- watch: {
- separator: function separator() {
- this.updateChildren();
- }
- }
- };
- /***/ }),
- /* 130 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _link = __webpack_require__(48);
- var _link2 = _interopRequireDefault(_link);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-breadcrumb-item';
- exports.default = {
- name: 'BreadcrumbItem',
- mixins: [_link2.default],
- props: {},
- data: function data() {
- return {
- separator: '',
- showSeparator: false
- };
- },
- computed: {
- linkClasses: function linkClasses() {
- return prefixCls + '-link';
- },
- separatorClasses: function separatorClasses() {
- return prefixCls + '-separator';
- }
- },
- mounted: function mounted() {
- this.showSeparator = this.$slots.separator !== undefined;
- }
- };
- /***/ }),
- /* 131 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- var _link = __webpack_require__(48);
- var _link2 = _interopRequireDefault(_link);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-btn';
- exports.default = {
- name: 'Button',
- mixins: [_link2.default, _form2.default],
- components: { Icon: _icon2.default },
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['default', 'primary', 'dashed', 'text', 'info', 'success', 'warning', 'error']);
- },
- default: 'default'
- },
- shape: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['circle', 'circle-outline']);
- }
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- loading: Boolean,
- disabled: Boolean,
- htmlType: {
- default: 'button',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['button', 'submit', 'reset']);
- }
- },
- icon: {
- type: String,
- default: ''
- },
- customIcon: {
- type: String,
- default: ''
- },
- long: {
- type: Boolean,
- default: false
- },
- ghost: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- showSlot: function showSlot() {
- return !!this.$slots.default;
- },
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.type), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-long', this.long), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.shape), !!this.shape), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), this.size !== 'default'), (0, _defineProperty3.default)(_ref, prefixCls + '-loading', this.loading != null && this.loading), (0, _defineProperty3.default)(_ref, prefixCls + '-icon-only', !this.showSlot && (!!this.icon || !!this.customIcon || this.loading)), (0, _defineProperty3.default)(_ref, prefixCls + '-ghost', this.ghost), _ref)];
- },
- isHrefPattern: function isHrefPattern() {
- var to = this.to;
- return !!to;
- },
- tagName: function tagName() {
- var isHrefPattern = this.isHrefPattern;
- return isHrefPattern ? 'a' : 'button';
- },
- tagProps: function tagProps() {
- var isHrefPattern = this.isHrefPattern;
- if (isHrefPattern) {
- var linkUrl = this.linkUrl,
- target = this.target;
- return { href: linkUrl, target: target };
- } else {
- var htmlType = this.htmlType;
- return { type: htmlType };
- }
- }
- },
- methods: {
- handleClickLink: function handleClickLink(event) {
- this.$emit('click', event);
- var openInNewWindow = event.ctrlKey || event.metaKey;
- this.handleCheckClick(event, openInNewWindow);
- }
- }
- };
- /***/ }),
- /* 132 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-btn-group';
- exports.default = {
- name: 'ButtonGroup',
- props: {
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- shape: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['circle', 'circle-outline']);
- }
- },
- vertical: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.shape), !!this.shape), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
- }
- }
- };
- /***/ }),
- /* 133 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _link = __webpack_require__(48);
- var _link2 = _interopRequireDefault(_link);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-card';
- var defaultPadding = 16;
- exports.default = {
- name: 'Card',
- mixins: [_link2.default],
- components: { Icon: _icon2.default },
- props: {
- bordered: {
- type: Boolean,
- default: true
- },
- disHover: {
- type: Boolean,
- default: false
- },
- shadow: {
- type: Boolean,
- default: false
- },
- padding: {
- type: Number,
- default: defaultPadding
- },
- title: {
- type: String
- },
- icon: {
- type: String
- }
- },
- data: function data() {
- return {
- showHead: true,
- showExtra: true
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-bordered', this.bordered && !this.shadow), (0, _defineProperty3.default)(_ref, prefixCls + '-dis-hover', this.disHover || this.shadow), (0, _defineProperty3.default)(_ref, prefixCls + '-shadow', this.shadow), _ref)];
- },
- headClasses: function headClasses() {
- return prefixCls + '-head';
- },
- extraClasses: function extraClasses() {
- return prefixCls + '-extra';
- },
- bodyClasses: function bodyClasses() {
- return prefixCls + '-body';
- },
- bodyStyles: function bodyStyles() {
- if (this.padding !== defaultPadding) {
- return {
- padding: String(this.padding) + 'px'
- };
- } else {
- return '';
- }
- },
- isHrefPattern: function isHrefPattern() {
- var to = this.to;
- return !!to;
- },
- tagName: function tagName() {
- var isHrefPattern = this.isHrefPattern;
- return isHrefPattern ? 'a' : 'div';
- },
- tagProps: function tagProps() {
- var isHrefPattern = this.isHrefPattern;
- if (isHrefPattern) {
- var linkUrl = this.linkUrl,
- target = this.target;
- return { href: linkUrl, target: target };
- } else {
- return {};
- }
- }
- },
- methods: {
- handleClickLink: function handleClickLink(event) {
- if (!this.isHrefPattern) return;
- var openInNewWindow = event.ctrlKey || event.metaKey;
- this.handleCheckClick(event, openInNewWindow);
- }
- },
- mounted: function mounted() {
- this.showHead = this.title || this.$slots.title !== undefined;
- this.showExtra = this.$slots.extra !== undefined;
- }
- };
- /***/ }),
- /* 134 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-carousel';
- exports.default = {
- name: 'Carousel',
- components: { Icon: _icon2.default },
- props: {
- arrow: {
- type: String,
- default: 'hover',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['hover', 'always', 'never']);
- }
- },
- autoplay: {
- type: Boolean,
- default: false
- },
- autoplaySpeed: {
- type: Number,
- default: 2000
- },
- loop: {
- type: Boolean,
- default: false
- },
- easing: {
- type: String,
- default: 'ease'
- },
- dots: {
- type: String,
- default: 'inside',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['inside', 'outside', 'none']);
- }
- },
- radiusDot: {
- type: Boolean,
- default: false
- },
- trigger: {
- type: String,
- default: 'click',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['click', 'hover']);
- }
- },
- value: {
- type: Number,
- default: 0
- },
- height: {
- type: [String, Number],
- default: 'auto',
- validator: function validator(value) {
- return value === 'auto' || Object.prototype.toString.call(value) === '[object Number]';
- }
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- listWidth: 0,
- trackWidth: 0,
- trackOffset: 0,
- trackCopyOffset: 0,
- showCopyTrack: false,
- slides: [],
- slideInstances: [],
- timer: null,
- ready: false,
- currentIndex: this.value,
- trackIndex: this.value,
- copyTrackIndex: this.value,
- hideTrackPos: -1 };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls];
- },
- trackStyles: function trackStyles() {
- var visibleStyle = this.trackIndex === -1 ? 'hidden' : 'visible';
- return {
- width: String(this.trackWidth) + 'px',
- transform: 'translate3d(' + -this.trackOffset + 'px, 0px, 0px)',
- transition: 'transform 500ms ' + String(this.easing),
- visibility: visibleStyle
- };
- },
- copyTrackStyles: function copyTrackStyles() {
- return {
- width: String(this.trackWidth) + 'px',
- transform: 'translate3d(' + -this.trackCopyOffset + 'px, 0px, 0px)',
- transition: 'transform 500ms ' + String(this.easing),
- position: 'absolute'
- };
- },
- arrowClasses: function arrowClasses() {
- return [prefixCls + '-arrow', prefixCls + '-arrow-' + String(this.arrow)];
- },
- dotsClasses: function dotsClasses() {
- return [prefixCls + '-dots', prefixCls + '-dots-' + String(this.dots)];
- }
- },
- methods: {
- findChild: function findChild(cb) {
- var _this2 = this;
- var find = function find(child) {
- var _this = this;
- var name = child.$options.componentName;
- if (name) {
- cb(child);
- } else if (child.$children.length) {
- child.$children.forEach(function (innerChild) {
- (0, _newArrowCheck3.default)(this, _this);
- find(innerChild, cb);
- }.bind(this));
- }
- };
- if (this.slideInstances.length || !this.$children) {
- this.slideInstances.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this2);
- find(child);
- }.bind(this));
- } else {
- this.$children.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this2);
- find(child);
- }.bind(this));
- }
- },
- initCopyTrackDom: function initCopyTrackDom() {
- var _this3 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.$refs.copyTrack.innerHTML = this.$refs.originTrack.innerHTML;
- }.bind(this));
- },
- updateSlides: function updateSlides(init) {
- var _this4 = this;
- var slides = [];
- var index = 1;
- this.findChild(function (child) {
- (0, _newArrowCheck3.default)(this, _this4);
- slides.push({
- $el: child.$el
- });
- child.index = index++;
- if (init) {
- this.slideInstances.push(child);
- }
- }.bind(this));
- this.slides = slides;
- this.updatePos();
- },
- updatePos: function updatePos() {
- var _this5 = this;
- this.findChild(function (child) {
- (0, _newArrowCheck3.default)(this, _this5);
- child.width = this.listWidth;
- child.height = typeof this.height === 'number' ? String(this.height) + 'px' : this.height;
- }.bind(this));
- this.trackWidth = (this.slides.length || 0) * this.listWidth;
- },
- slotChange: function slotChange() {
- var _this6 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this6);
- this.slides = [];
- this.slideInstances = [];
- this.updateSlides(true, true);
- this.updatePos();
- this.updateOffset();
- }.bind(this));
- },
- handleResize: function handleResize() {
- this.listWidth = parseInt((0, _assist.getStyle)(this.$el, 'width'));
- this.updatePos();
- this.updateOffset();
- },
- updateTrackPos: function updateTrackPos(index) {
- if (this.showCopyTrack) {
- this.trackIndex = index;
- } else {
- this.copyTrackIndex = index;
- }
- },
- updateTrackIndex: function updateTrackIndex(index) {
- if (this.showCopyTrack) {
- this.copyTrackIndex = index;
- } else {
- this.trackIndex = index;
- }
- this.currentIndex = index;
- },
- add: function add(offset) {
- var slidesLen = this.slides.length;
- if (this.loop) {
- if (offset > 0) {
- this.hideTrackPos = -1;
- } else {
- this.hideTrackPos = slidesLen;
- }
- this.updateTrackPos(this.hideTrackPos);
- }
- var oldIndex = this.showCopyTrack ? this.copyTrackIndex : this.trackIndex;
- var index = oldIndex + offset;
- while (index < 0) {
- index += slidesLen;
- }if ((offset > 0 && index === slidesLen || offset < 0 && index === slidesLen - 1) && this.loop) {
- this.showCopyTrack = !this.showCopyTrack;
- this.trackIndex += offset;
- this.copyTrackIndex += offset;
- } else {
- if (!this.loop) index = index % this.slides.length;
- this.updateTrackIndex(index);
- }
- this.currentIndex = index === this.slides.length ? 0 : index;
- this.$emit('on-change', oldIndex, this.currentIndex);
- this.$emit('input', this.currentIndex);
- },
- arrowEvent: function arrowEvent(offset) {
- this.setAutoplay();
- this.add(offset);
- },
- dotsEvent: function dotsEvent(event, n) {
- var curIndex = this.showCopyTrack ? this.copyTrackIndex : this.trackIndex;
- var oldCurrentIndex = this.currentIndex;
- if (event === this.trigger && curIndex !== n) {
- this.updateTrackIndex(n);
- this.$emit('on-change', oldCurrentIndex, this.currentIndex);
- this.$emit('input', n);
- this.setAutoplay();
- }
- },
- setAutoplay: function setAutoplay() {
- var _this7 = this;
- window.clearInterval(this.timer);
- if (this.autoplay) {
- this.timer = window.setInterval(function () {
- (0, _newArrowCheck3.default)(this, _this7);
- this.add(1);
- }.bind(this), this.autoplaySpeed);
- }
- },
- updateOffset: function updateOffset() {
- var _this8 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this8);
- var ofs = this.copyTrackIndex > 0 ? -1 : 1;
- this.trackOffset = this.trackIndex * this.listWidth;
- this.trackCopyOffset = this.copyTrackIndex * this.listWidth + ofs;
- }.bind(this));
- },
- handleClick: function handleClick(type) {
- this.$emit('on-click', this[type]);
- }
- },
- watch: {
- autoplay: function autoplay() {
- this.setAutoplay();
- },
- autoplaySpeed: function autoplaySpeed() {
- this.setAutoplay();
- },
- trackIndex: function trackIndex() {
- this.updateOffset();
- },
- copyTrackIndex: function copyTrackIndex() {
- this.updateOffset();
- },
- height: function height() {
- this.updatePos();
- },
- value: function value(val) {
- this.updateTrackIndex(val);
- this.setAutoplay();
- }
- },
- mounted: function mounted() {
- this.updateSlides(true);
- this.handleResize();
- this.setAutoplay();
- (0, _dom.on)(window, 'resize', this.handleResize);
- },
- beforeDestroy: function beforeDestroy() {
- (0, _dom.off)(window, 'resize', this.handleResize);
- }
- };
- /***/ }),
- /* 135 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-carousel-item';
- exports.default = {
- componentName: 'carousel-item',
- name: 'CarouselItem',
- data: function data() {
- return {
- prefixCls: prefixCls,
- width: 0,
- height: 'auto',
- left: 0
- };
- },
- computed: {
- styles: function styles() {
- return {
- width: String(this.width) + 'px',
- height: '' + String(this.height),
- left: String(this.left) + 'px'
- };
- }
- },
- mounted: function mounted() {
- this.$parent.slotChange();
- },
- watch: {
- width: function width(val) {
- var _this = this;
- if (val && this.$parent.loop) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.$parent.initCopyTrackDom();
- }.bind(this));
- }
- },
- height: function height(val) {
- var _this2 = this;
- if (val && this.$parent.loop) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.$parent.initCopyTrackDom();
- }.bind(this));
- }
- }
- },
- beforeDestroy: function beforeDestroy() {
- this.$parent.slotChange();
- }
- };
- /***/ }),
- /* 136 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _stringify = __webpack_require__(57);
- var _stringify2 = _interopRequireDefault(_stringify);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _caspanel = __webpack_require__(368);
- var _caspanel2 = _interopRequireDefault(_caspanel);
- var _clickoutside = __webpack_require__(82);
- var _clickoutside2 = _interopRequireDefault(_clickoutside);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-cascader';
- var selectPrefixCls = 'ivu-select';
- exports.default = {
- name: 'Cascader',
- mixins: [_emitter2.default, _locale2.default, _form2.default],
- components: { iInput: _input2.default, Drop: _dropdown2.default, Icon: _icon2.default, Caspanel: _caspanel2.default },
- directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
- props: {
- data: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- value: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- disabled: {
- type: Boolean,
- default: false
- },
- clearable: {
- type: Boolean,
- default: true
- },
- placeholder: {
- type: String
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- trigger: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['click', 'hover']);
- },
- default: 'click'
- },
- changeOnSelect: {
- type: Boolean,
- default: false
- },
- renderFormat: {
- type: Function,
- default: function _default(label) {
- return label.join(' / ');
- }
- },
- loadData: {
- type: Function
- },
- filterable: {
- type: Boolean,
- default: false
- },
- notFoundText: {
- type: String
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- name: {
- type: String
- },
- elementId: {
- type: String
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- transferClassName: {
- type: String
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- selectPrefixCls: selectPrefixCls,
- visible: false,
- selected: [],
- tmpSelected: [],
- updatingValue: false,
- currentValue: this.value || [],
- query: '',
- validDataStr: '',
- isLoadedChildren: false,
- isValueNull: false };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-show-clear', this.showCloseIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-size-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-visible', this.visible), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-not-found', this.filterable && this.query !== '' && !this.querySelections.length), _ref)];
- },
- showCloseIcon: function showCloseIcon() {
- return this.currentValue && this.currentValue.length && this.clearable && !this.itemDisabled;
- },
- displayRender: function displayRender() {
- var label = [];
- for (var i = 0; i < this.selected.length; i++) {
- label.push(this.selected[i].label);
- }
- return this.renderFormat(label, this.selected);
- },
- displayInputRender: function displayInputRender() {
- return this.filterable ? '' : this.displayRender;
- },
- localePlaceholder: function localePlaceholder() {
- if (this.placeholder === undefined) {
- return this.t('i.select.placeholder');
- } else {
- return this.placeholder;
- }
- },
- inputPlaceholder: function inputPlaceholder() {
- return this.filterable && this.currentValue.length ? null : this.localePlaceholder;
- },
- localeNotFoundText: function localeNotFoundText() {
- if (this.notFoundText === undefined) {
- return this.t('i.select.noMatch');
- } else {
- return this.notFoundText;
- }
- },
- querySelections: function querySelections() {
- var _this = this;
- var selections = [];
- function getSelections(arr, label, value) {
- for (var i = 0; i < arr.length; i++) {
- var item = arr[i];
- item.__label = label ? label + ' / ' + item.label : item.label;
- item.__value = value ? value + ',' + item.value : item.value;
- if (item.children && item.children.length) {
- getSelections(item.children, item.__label, item.__value);
- delete item.__label;
- delete item.__value;
- } else {
- selections.push({
- label: item.__label,
- value: item.__value,
- display: item.__label,
- item: item,
- disabled: !!item.disabled
- });
- }
- }
- }
- getSelections(this.data);
- selections = selections.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return item.label ? item.label.indexOf(this.query) > -1 : false;
- }.bind(this)).map(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- item.display = item.display.replace(new RegExp(this.query, 'g'), '<span>' + String(this.query) + '</span>');
- return item;
- }.bind(this));
- return selections;
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-down';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.customArrow) {
- type = '';
- } else if (this.$IVIEW.cascader.arrow) {
- type = this.$IVIEW.cascader.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.customArrow) {
- type = this.$IVIEW.cascader.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.arrowSize) {
- size = this.$IVIEW.cascader.arrowSize;
- }
- }
- return size;
- },
- dropdownCls: function dropdownCls() {
- var _ref2;
- return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
- }
- },
- methods: {
- clearSelect: function clearSelect() {
- if (this.itemDisabled) return false;
- var oldVal = (0, _stringify2.default)(this.currentValue);
- this.currentValue = this.selected = this.tmpSelected = [];
- this.handleClose();
- this.emitValue(this.currentValue, oldVal);
- this.broadcast('Caspanel', 'on-clear');
- },
- handleClose: function handleClose() {
- this.visible = false;
- },
- toggleOpen: function toggleOpen() {
- if (this.itemDisabled) return false;
- if (this.visible) {
- if (!this.filterable) this.handleClose();
- } else {
- this.onFocus();
- }
- },
- onFocus: function onFocus() {
- this.visible = true;
- if (!this.currentValue.length) {
- this.broadcast('Caspanel', 'on-clear');
- }
- },
- updateResult: function updateResult(result) {
- this.tmpSelected = result;
- },
- updateSelected: function updateSelected() {
- var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var changeOnSelectDataChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!this.changeOnSelect || init || changeOnSelectDataChange) {
- this.broadcast('Caspanel', 'on-find-selected', {
- value: this.currentValue
- });
- }
- },
- emitValue: function emitValue(val, oldVal) {
- var _this2 = this;
- if ((0, _stringify2.default)(val) !== oldVal) {
- this.$emit('on-change', this.currentValue, JSON.parse((0, _stringify2.default)(this.selected)));
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.dispatch('FormItem', 'on-form-change', {
- value: this.currentValue,
- selected: JSON.parse((0, _stringify2.default)(this.selected))
- });
- }.bind(this));
- }
- },
- handleInput: function handleInput(event) {
- this.query = event.target.value;
- },
- handleSelectItem: function handleSelectItem(index) {
- var _this3 = this;
- var item = this.querySelections[index];
- if (item.item.disabled) return false;
- this.query = '';
- this.$refs.input.currentValue = '';
- var oldVal = (0, _stringify2.default)(this.currentValue);
- this.currentValue = item.value.split(',');
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.emitValue(this.currentValue, oldVal);
- this.handleClose();
- }.bind(this), 0);
- },
- handleFocus: function handleFocus() {
- this.$refs.input.focus();
- },
- getValidData: function getValidData(data) {
- var _this5 = this;
- function deleteData(item) {
- var _this4 = this;
- var new_item = (0, _assign2.default)({}, item);
- if ('loading' in new_item) {
- delete new_item.loading;
- }
- if ('__value' in new_item) {
- delete new_item.__value;
- }
- if ('__label' in new_item) {
- delete new_item.__label;
- }
- if ('children' in new_item && new_item.children.length) {
- new_item.children = new_item.children.map(function (i) {
- (0, _newArrowCheck3.default)(this, _this4);
- return deleteData(i);
- }.bind(this));
- }
- return new_item;
- }
- return data.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this5);
- return deleteData(item);
- }.bind(this));
- }
- },
- created: function created() {
- var _this6 = this;
- this.validDataStr = (0, _stringify2.default)(this.getValidData(this.data));
- this.$on('on-result-change', function (params) {
- (0, _newArrowCheck3.default)(this, _this6);
- var lastValue = params.lastValue;
- var changeOnSelect = params.changeOnSelect;
- var fromInit = params.fromInit;
- if (lastValue || changeOnSelect) {
- var oldVal = (0, _stringify2.default)(this.currentValue);
- this.selected = this.tmpSelected;
- var newVal = [];
- this.selected.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this6);
- newVal.push(item.value);
- }.bind(this));
- if (!fromInit) {
- this.updatingValue = true;
- this.currentValue = newVal;
- this.emitValue(this.currentValue, oldVal);
- }
- }
- if (lastValue && !fromInit) {
- this.handleClose();
- }
- }.bind(this));
- },
- mounted: function mounted() {
- this.updateSelected(true);
- },
- watch: {
- visible: function visible(val) {
- if (val) {
- if (this.currentValue.length) {
- this.updateSelected();
- }
- if (this.transfer) {
- this.$refs.drop.update();
- }
- this.broadcast('Drop', 'on-update-popper');
- } else {
- if (this.filterable) {
- this.query = '';
- this.$refs.input.currentValue = '';
- }
- if (this.transfer) {
- this.$refs.drop.destroy();
- }
- this.broadcast('Drop', 'on-destroy-popper');
- }
- this.$emit('on-visible-change', val);
- },
- value: function value(val) {
- if (val === null) this.isValueNull = true;
- this.currentValue = val || [];
- if (val === null || !val.length) this.selected = [];
- },
- currentValue: function currentValue() {
- if (this.isValueNull) {
- this.isValueNull = false;
- this.$emit('input', null);
- } else {
- this.$emit('input', this.currentValue);
- }
- if (this.updatingValue) {
- this.updatingValue = false;
- return;
- }
- this.updateSelected(true);
- },
- data: {
- deep: true,
- handler: function handler() {
- var _this7 = this;
- var validDataStr = (0, _stringify2.default)(this.getValidData(this.data));
- if (validDataStr !== this.validDataStr) {
- this.validDataStr = validDataStr;
- if (!this.isLoadedChildren) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this7);
- return this.updateSelected(false, this.changeOnSelect);
- }.bind(this));
- }
- this.isLoadedChildren = false;
- }
- }
- }
- }
- };
- /***/ }),
- /* 137 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _casitem = __webpack_require__(369);
- var _casitem2 = _interopRequireDefault(_casitem);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var key = 1;
- exports.default = {
- name: 'Caspanel',
- mixins: [_emitter2.default],
- components: { Casitem: _casitem2.default },
- props: {
- data: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- disabled: Boolean,
- changeOnSelect: Boolean,
- trigger: String,
- prefixCls: String
- },
- data: function data() {
- return {
- tmpItem: {},
- result: [],
- sublist: []
- };
- },
- watch: {
- data: function data() {
- this.sublist = [];
- }
- },
- methods: {
- handleClickItem: function handleClickItem(item) {
- if (this.trigger !== 'click' && item.children && item.children.length) return;
- this.handleTriggerItem(item, false, true);
- },
- handleHoverItem: function handleHoverItem(item) {
- if (this.trigger !== 'hover' || !item.children || !item.children.length) return;
- this.handleTriggerItem(item, false, true);
- },
- handleTriggerItem: function handleTriggerItem(item) {
- var _this = this;
- var fromInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var fromUser = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- if (item.disabled) return;
- var cascader = (0, _assist.findComponentUpward)(this, 'Cascader');
- if (item.loading !== undefined && !item.children.length) {
- if (cascader && cascader.loadData) {
- cascader.loadData(item, function () {
- (0, _newArrowCheck3.default)(this, _this);
- if (fromUser) {
- cascader.isLoadedChildren = true;
- }
- if (item.children.length) {
- this.handleTriggerItem(item);
- }
- }.bind(this));
- return;
- }
- }
- var backItem = this.getBaseItem(item);
- if (this.changeOnSelect || backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value || backItem.label === this.tmpItem.label && backItem.value === this.tmpItem.value) {
- this.tmpItem = backItem;
- this.emitUpdate([backItem]);
- }
- if (item.children && item.children.length) {
- this.sublist = item.children;
- this.dispatch('Cascader', 'on-result-change', {
- lastValue: false,
- changeOnSelect: this.changeOnSelect,
- fromInit: fromInit
- });
- if (this.changeOnSelect) {
- var Caspanel = (0, _assist.findComponentDownward)(this, 'Caspanel');
- if (Caspanel) {
- Caspanel.$emit('on-clear', true);
- }
- }
- } else {
- this.sublist = [];
- this.dispatch('Cascader', 'on-result-change', {
- lastValue: true,
- changeOnSelect: this.changeOnSelect,
- fromInit: fromInit
- });
- }
- if (cascader) {
- cascader.$refs.drop.update();
- }
- },
- updateResult: function updateResult(item) {
- this.result = [this.tmpItem].concat(item);
- this.emitUpdate(this.result);
- },
- getBaseItem: function getBaseItem(item) {
- var backItem = (0, _assign2.default)({}, item);
- if (backItem.children) {
- delete backItem.children;
- }
- return backItem;
- },
- emitUpdate: function emitUpdate(result) {
- if (this.$parent.$options.name === 'Caspanel') {
- this.$parent.updateResult(result);
- } else {
- this.$parent.$parent.updateResult(result);
- }
- },
- getKey: function getKey() {
- return key++;
- }
- },
- mounted: function mounted() {
- var _this2 = this;
- this.$on('on-find-selected', function (params) {
- (0, _newArrowCheck3.default)(this, _this2);
- var val = params.value;
- var value = [].concat((0, _toConsumableArray3.default)(val));
- for (var i = 0; i < value.length; i++) {
- for (var j = 0; j < this.data.length; j++) {
- if (value[i] === this.data[j].value) {
- this.handleTriggerItem(this.data[j], true);
- value.splice(0, 1);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.broadcast('Caspanel', 'on-find-selected', {
- value: value
- });
- }.bind(this));
- return false;
- }
- }
- }
- }.bind(this));
- this.$on('on-clear', function () {
- var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- (0, _newArrowCheck3.default)(this, _this2);
- this.sublist = [];
- this.tmpItem = {};
- if (deep) {
- var Caspanel = (0, _assist.findComponentDownward)(this, 'Caspanel');
- if (Caspanel) {
- Caspanel.$emit('on-clear', true);
- }
- }
- }.bind(this));
- }
- };
- /***/ }),
- /* 138 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Casitem',
- components: { Icon: _icon2.default },
- props: {
- data: Object,
- prefixCls: String,
- tmpItem: Object
- },
- computed: {
- classes: function classes() {
- var _ref;
- return [String(this.prefixCls) + '-menu-item', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-menu-item-active', this.tmpItem.value === this.data.value), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-menu-item-disabled', this.data.disabled), _ref)];
- },
- showArrow: function showArrow() {
- return this.data.children && this.data.children.length || 'loading' in this.data && !this.data.loading;
- },
- showLoading: function showLoading() {
- return 'loading' in this.data && this.data.loading;
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-forward';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.customItemArrow) {
- type = '';
- } else if (this.$IVIEW.cascader.itemArrow) {
- type = this.$IVIEW.cascader.itemArrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.customItemArrow) {
- type = this.$IVIEW.cascader.customItemArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cascader.itemArrowSize) {
- size = this.$IVIEW.cascader.itemArrowSize;
- }
- }
- return size;
- }
- }
- };
- /***/ }),
- /* 139 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _cellItem = __webpack_require__(375);
- var _cellItem2 = _interopRequireDefault(_cellItem);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _link = __webpack_require__(48);
- var _link2 = _interopRequireDefault(_link);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-cell';
- exports.default = {
- name: 'Cell',
- inject: ['cellGroup'],
- mixins: [_link2.default],
- components: { CellItem: _cellItem2.default, Icon: _icon2.default },
- props: {
- name: {
- type: [String, Number]
- },
- title: {
- type: String,
- default: ''
- },
- label: {
- type: String,
- default: ''
- },
- extra: {
- type: String,
- default: ''
- },
- disabled: {
- type: Boolean,
- default: false
- },
- selected: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected), (0, _defineProperty3.default)(_ref, prefixCls + '-with-link', this.to), _ref)];
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-forward';
- if (this.$IVIEW) {
- if (this.$IVIEW.cell.customArrow) {
- type = '';
- } else if (this.$IVIEW.cell.arrow) {
- type = this.$IVIEW.cell.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cell.customArrow) {
- type = this.$IVIEW.cell.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.cell.arrowSize) {
- size = this.$IVIEW.cell.arrowSize;
- }
- }
- return size;
- }
- },
- methods: {
- handleClickItem: function handleClickItem(event, new_window) {
- this.cellGroup.handleClick(this.name);
- this.handleCheckClick(event, new_window);
- }
- }
- };
- /***/ }),
- /* 140 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- props: {
- title: {
- type: String,
- default: ''
- },
- label: {
- type: String,
- default: ''
- },
- extra: {
- type: String,
- default: ''
- }
- }
- };
- /***/ }),
- /* 141 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- name: 'CellGroup',
- provide: function provide() {
- return {
- cellGroup: this
- };
- },
- methods: {
- handleClick: function handleClick(name) {
- this.$emit('on-click', name);
- }
- }
- };
- /***/ }),
- /* 142 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-checkbox';
- exports.default = {
- name: 'Checkbox',
- mixins: [_emitter2.default, _form2.default],
- props: {
- disabled: {
- type: Boolean,
- default: false
- },
- value: {
- type: [String, Number, Boolean],
- default: false
- },
- trueValue: {
- type: [String, Number, Boolean],
- default: true
- },
- falseValue: {
- type: [String, Number, Boolean],
- default: false
- },
- label: {
- type: [String, Number, Boolean]
- },
- indeterminate: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- name: {
- type: String
- },
- border: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- model: [],
- currentValue: this.value,
- group: false,
- showSlot: true,
- parent: (0, _assist.findComponentUpward)(this, 'CheckboxGroup'),
- focusInner: false
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-group-item', this.group), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-checked', this.currentValue), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-border', this.border), _ref)];
- },
- checkboxClasses: function checkboxClasses() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-checked', this.currentValue), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-indeterminate', this.indeterminate), _ref2)];
- },
- innerClasses: function innerClasses() {
- return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-focus', this.focusInner)];
- },
- inputClasses: function inputClasses() {
- return prefixCls + '-input';
- }
- },
- mounted: function mounted() {
- this.parent = (0, _assist.findComponentUpward)(this, 'CheckboxGroup');
- if (this.parent) {
- this.group = true;
- }
- if (this.group) {
- this.parent.updateModel(true);
- } else {
- this.updateModel();
- this.showSlot = this.$slots.default !== undefined;
- }
- },
- methods: {
- change: function change(event) {
- if (this.itemDisabled) {
- return false;
- }
- var checked = event.target.checked;
- this.currentValue = checked;
- var value = checked ? this.trueValue : this.falseValue;
- this.$emit('input', value);
- if (this.group) {
- this.parent.change(this.model);
- } else {
- this.$emit('on-change', value);
- this.dispatch('FormItem', 'on-form-change', value);
- }
- },
- updateModel: function updateModel() {
- this.currentValue = this.value === this.trueValue;
- },
- onBlur: function onBlur() {
- this.focusInner = false;
- },
- onFocus: function onFocus() {
- this.focusInner = true;
- }
- },
- watch: {
- value: function value(val) {
- if (val === this.trueValue || val === this.falseValue) {
- this.updateModel();
- } else {
- throw 'Value should be trueValue or falseValue.';
- }
- }
- }
- };
- /***/ }),
- /* 143 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__ = __webpack_require__(144);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__ = __webpack_require__(382);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 144 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-checkbox-group';
- exports.default = {
- name: 'CheckboxGroup',
- mixins: [_emitter2.default],
- props: {
- value: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- }
- },
- data: function data() {
- return {
- currentValue: this.value || [],
- children: []
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, 'ivu-checkbox-' + String(this.size), !!this.size)];
- }
- },
- mounted: function mounted() {
- this.updateModel(true);
- },
- methods: {
- updateModel: function updateModel(update) {
- var _this = this;
- this.children = (0, _assist.findComponentsDownward)(this, 'Checkbox');
- if (this.children) {
- var value = this.value || [];
- this.children.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- child.model = value;
- if (update) {
- child.currentValue = value.indexOf(child.label) >= 0;
- child.group = true;
- }
- }.bind(this));
- }
- },
- change: function change(data) {
- this.currentValue = data;
- this.$emit('input', data);
- this.$emit('on-change', data);
- this.dispatch('FormItem', 'on-form-change', data);
- }
- },
- watch: {
- value: function value() {
- this.updateModel(true);
- }
- }
- };
- /***/ }),
- /* 145 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assist = __webpack_require__(3);
- var _random_str = __webpack_require__(385);
- var _random_str2 = _interopRequireDefault(_random_str);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-chart-circle';
- exports.default = {
- name: 'iCircle',
- props: {
- percent: {
- type: Number,
- default: 0
- },
- size: {
- type: Number,
- default: 120
- },
- strokeWidth: {
- type: Number,
- default: 6
- },
- strokeColor: {
- type: [String, Array],
- default: '#2d8cf0'
- },
- strokeLinecap: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['square', 'round']);
- },
- default: 'round'
- },
- trailWidth: {
- type: Number,
- default: 5
- },
- trailColor: {
- type: String,
- default: '#eaeef2'
- },
- dashboard: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- id: 'ivu-chart-circle-' + String((0, _random_str2.default)(3))
- };
- },
- computed: {
- circleSize: function circleSize() {
- return {
- width: String(this.size) + 'px',
- height: String(this.size) + 'px'
- };
- },
- computedStrokeWidth: function computedStrokeWidth() {
- return this.percent === 0 && this.dashboard ? 0 : this.strokeWidth;
- },
- radius: function radius() {
- return 50 - this.strokeWidth / 2;
- },
- pathString: function pathString() {
- if (this.dashboard) {
- return 'M 50,50 m 0,' + String(this.radius) + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,-' + 2 * this.radius + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,' + 2 * this.radius;
- } else {
- return 'M 50,50 m 0,-' + String(this.radius) + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,' + 2 * this.radius + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,-' + 2 * this.radius;
- }
- },
- len: function len() {
- return Math.PI * 2 * this.radius;
- },
- trailStyle: function trailStyle() {
- var style = {};
- if (this.dashboard) {
- style = {
- 'stroke-dasharray': this.len - 75 + 'px ' + String(this.len) + 'px',
- 'stroke-dashoffset': '-' + 75 / 2 + 'px',
- 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s'
- };
- }
- return style;
- },
- pathStyle: function pathStyle() {
- var style = {};
- if (this.dashboard) {
- style = {
- 'stroke-dasharray': this.percent / 100 * (this.len - 75) + 'px ' + String(this.len) + 'px',
- 'stroke-dashoffset': '-' + 75 / 2 + 'px',
- 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .6s ease 0s, stroke .6s, stroke-width .06s ease .6s'
- };
- } else {
- style = {
- 'stroke-dasharray': String(this.len) + 'px ' + String(this.len) + 'px',
- 'stroke-dashoffset': (100 - this.percent) / 100 * this.len + 'px',
- 'transition': 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease'
- };
- }
- return style;
- },
- wrapClasses: function wrapClasses() {
- return '' + prefixCls;
- },
- innerClasses: function innerClasses() {
- return prefixCls + '-inner';
- },
- strokeValue: function strokeValue() {
- var color = this.strokeColor;
- if (typeof this.strokeColor !== 'string') {
- color = 'url(#' + String(this.id) + ')';
- }
- return color;
- },
- showDefs: function showDefs() {
- return typeof this.strokeColor !== 'string';
- }
- }
- };
- /***/ }),
- /* 146 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-collapse';
- exports.default = {
- name: 'Collapse',
- props: {
- accordion: {
- type: Boolean,
- default: false
- },
- value: {
- type: [Array, String]
- },
- simple: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- currentValue: this.value
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-simple', this.simple)];
- }
- },
- mounted: function mounted() {
- this.setActive();
- },
- methods: {
- setActive: function setActive() {
- var _this = this;
- var activeKey = this.getActiveKey();
- this.$children.forEach(function (child, index) {
- (0, _newArrowCheck3.default)(this, _this);
- var name = child.name || index.toString();
- child.isActive = activeKey.indexOf(name) > -1;
- child.index = index;
- }.bind(this));
- },
- getActiveKey: function getActiveKey() {
- var activeKey = this.currentValue || [];
- var accordion = this.accordion;
- if (!Array.isArray(activeKey)) {
- activeKey = [activeKey];
- }
- if (accordion && activeKey.length > 1) {
- activeKey = [activeKey[0]];
- }
- for (var i = 0; i < activeKey.length; i++) {
- activeKey[i] = activeKey[i].toString();
- }
- return activeKey;
- },
- toggle: function toggle(data) {
- var name = data.name.toString();
- var newActiveKey = [];
- if (this.accordion) {
- if (!data.isActive) {
- newActiveKey.push(name);
- }
- } else {
- var activeKey = this.getActiveKey();
- var nameIndex = activeKey.indexOf(name);
- if (data.isActive) {
- if (nameIndex > -1) {
- activeKey.splice(nameIndex, 1);
- }
- } else {
- if (nameIndex < 0) {
- activeKey.push(name);
- }
- }
- newActiveKey = activeKey;
- }
- this.currentValue = newActiveKey;
- this.$emit('input', newActiveKey);
- this.$emit('on-change', newActiveKey);
- }
- },
- watch: {
- value: function value(val) {
- this.currentValue = val;
- },
- currentValue: function currentValue() {
- this.setActive();
- }
- }
- };
- /***/ }),
- /* 147 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _collapseTransition = __webpack_require__(83);
- var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-collapse';
- exports.default = {
- name: 'Panel',
- components: { Icon: _icon2.default, CollapseTransition: _collapseTransition2.default },
- props: {
- name: {
- type: String
- },
- hideArrow: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- index: 0,
- isActive: false,
- mounted: false
- };
- },
- computed: {
- itemClasses: function itemClasses() {
- return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.isActive)];
- },
- headerClasses: function headerClasses() {
- return prefixCls + '-header';
- },
- contentClasses: function contentClasses() {
- return prefixCls + '-content';
- },
- boxClasses: function boxClasses() {
- return prefixCls + '-content-box';
- }
- },
- methods: {
- toggle: function toggle() {
- this.$parent.toggle({
- name: this.name || this.index,
- isActive: this.isActive
- });
- }
- },
- mounted: function mounted() {
- this.mounted = true;
- this.$parent.setActive();
- }
- };
- /***/ }),
- /* 148 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _tinycolor = __webpack_require__(149);
- var _tinycolor2 = _interopRequireDefault(_tinycolor);
- var _vClickOutsideX = __webpack_require__(76);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _recommendColors = __webpack_require__(394);
- var _recommendColors2 = _interopRequireDefault(_recommendColors);
- var _saturation = __webpack_require__(396);
- var _saturation2 = _interopRequireDefault(_saturation);
- var _hue = __webpack_require__(398);
- var _hue2 = _interopRequireDefault(_hue);
- var _alpha = __webpack_require__(400);
- var _alpha2 = _interopRequireDefault(_alpha);
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- var _prefixMixin = __webpack_require__(50);
- var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
- var _utils = __webpack_require__(39);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'ColorPicker',
- components: { Drop: _dropdown2.default, RecommendColors: _recommendColors2.default, Saturation: _saturation2.default, Hue: _hue2.default, Alpha: _alpha2.default, iInput: _input2.default, iButton: _button2.default, Icon: _icon2.default },
- directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
- mixins: [_emitter2.default, _locale2.default, _prefixMixin2.default, _form2.default],
- props: {
- value: {
- type: String,
- default: undefined
- },
- hue: {
- type: Boolean,
- default: true
- },
- alpha: {
- type: Boolean,
- default: false
- },
- recommend: {
- type: Boolean,
- default: false
- },
- format: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['hsl', 'hsv', 'hex', 'rgb']);
- },
- default: undefined
- },
- colors: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- disabled: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- hideDropDown: {
- type: Boolean,
- default: false
- },
- placement: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
- },
- default: 'bottom'
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- name: {
- type: String,
- default: undefined
- },
- editable: {
- type: Boolean,
- default: true
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- transferClassName: {
- type: String
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- val: (0, _utils.changeColor)(this.value || ''),
- currentValue: this.value || '',
- dragging: false,
- visible: false,
- recommendedColor: ['#2d8cf0', '#19be6b', '#ff9900', '#ed4014', '#00b5ff', '#19c919', '#f9e31c', '#ea1a1a', '#9b1dea', '#00c2b1', '#ac7a33', '#1d35ea', '#8bc34a', '#f16b62', '#ea4ca3', '#0d94aa', '#febd79', '#5d4037', '#00bcd4', '#f06292', '#cddc39', '#607d8b', '#000000', '#ffffff']
- };
- },
- computed: {
- arrowClasses: function arrowClasses() {
- return [String(this.inputPrefixCls) + '-icon', String(this.inputPrefixCls) + '-icon-normal'];
- },
- transition: function transition() {
- return (0, _assist.oneOf)(this.placement, ['bottom-start', 'bottom', 'bottom-end']) ? 'slide-up' : 'fade';
- },
- saturationColors: {
- get: function get() {
- return this.val;
- },
- set: function set(newVal) {
- this.val = newVal;
- this.$emit('on-active-change', this.formatColor);
- }
- },
- classes: function classes() {
- return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-transfer', this.transfer)];
- },
- wrapClasses: function wrapClasses() {
- return [String(this.prefixCls) + '-rel', String(this.prefixCls) + '-' + String(this.size), String(this.inputPrefixCls) + '-wrapper', String(this.inputPrefixCls) + '-wrapper-' + String(this.size), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-disabled', this.itemDisabled)];
- },
- inputClasses: function inputClasses() {
- var _ref3;
- return [String(this.prefixCls) + '-input', '' + String(this.inputPrefixCls), String(this.inputPrefixCls) + '-' + String(this.size), (_ref3 = {}, (0, _defineProperty3.default)(_ref3, String(this.prefixCls) + '-focused', this.visible), (0, _defineProperty3.default)(_ref3, String(this.prefixCls) + '-disabled', this.itemDisabled), _ref3)];
- },
- dropClasses: function dropClasses() {
- var _ref4;
- return [String(this.transferPrefixCls) + '-no-max-height', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, String(this.prefixCls) + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref4, String(this.prefixCls) + '-hide-drop', this.hideDropDown), (0, _defineProperty3.default)(_ref4, this.transferClassName, this.transferClassName), _ref4)];
- },
- displayedColorStyle: function displayedColorStyle() {
- return { backgroundColor: (0, _utils.toRGBAString)(this.visible ? this.saturationColors.rgba : (0, _tinycolor2.default)(this.value).toRgb()) };
- },
- formatColor: function formatColor() {
- var format = this.format,
- saturationColors = this.saturationColors;
- if (format) {
- if (format === 'hsl') {
- return (0, _tinycolor2.default)(saturationColors.hsl).toHslString();
- }
- if (format === 'hsv') {
- return (0, _tinycolor2.default)(saturationColors.hsv).toHsvString();
- }
- if (format === 'hex') {
- return saturationColors.hex;
- }
- if (format === 'rgb') {
- return (0, _utils.toRGBAString)(saturationColors.rgba);
- }
- } else if (this.alpha) {
- return (0, _utils.toRGBAString)(saturationColors.rgba);
- }
- return saturationColors.hex;
- },
- confirmColorClasses: function confirmColorClasses() {
- return [String(this.prefixCls) + '-confirm-color', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-confirm-color-editable', this.editable)];
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-down';
- if (this.$IVIEW) {
- if (this.$IVIEW.colorPicker.customArrow) {
- type = '';
- } else if (this.$IVIEW.colorPicker.arrow) {
- type = this.$IVIEW.colorPicker.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.colorPicker.customArrow) {
- type = this.$IVIEW.colorPicker.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.colorPicker.arrowSize) {
- size = this.$IVIEW.colorPicker.arrowSize;
- }
- }
- return size;
- }
- },
- watch: {
- value: function value(newVal) {
- this.val = (0, _utils.changeColor)(newVal || '');
- },
- visible: function visible(val) {
- this.val = (0, _utils.changeColor)(this.value || '');
- this.$refs.drop[val ? 'update' : 'destroy']();
- this.$emit('on-open-change', Boolean(val));
- }
- },
- mounted: function mounted() {
- this.$on('on-escape-keydown', this.closer);
- this.$on('on-dragging', this.setDragging);
- },
- methods: {
- setDragging: function setDragging(value) {
- this.dragging = value;
- },
- handleClose: function handleClose(event) {
- if (this.visible) {
- if (this.dragging || event.type === 'mousedown') {
- if (this.$refs.editColorInput && event.target !== this.$refs.editColorInput.$el.querySelector('input')) {
- event.preventDefault();
- }
- return;
- }
- if (this.transfer) {
- var $el = this.$refs.drop.$el;
- if ($el === event.target || $el.contains(event.target)) {
- return;
- }
- }
- this.closer(event);
- return;
- }
- this.visible = false;
- },
- toggleVisible: function toggleVisible() {
- if (this.itemDisabled) {
- return;
- }
- this.visible = !this.visible;
- this.$refs.input.focus();
- },
- childChange: function childChange(data) {
- this.colorChange(data);
- },
- colorChange: function colorChange(data, oldHue) {
- this.oldHue = this.saturationColors.hsl.h;
- this.saturationColors = (0, _utils.changeColor)(data, oldHue || this.oldHue);
- },
- closer: function closer(event) {
- if (event) {
- event.preventDefault();
- event.stopPropagation();
- }
- this.visible = false;
- this.$refs.input.focus();
- },
- handleButtons: function handleButtons(event, value) {
- this.currentValue = value;
- this.$emit('input', value);
- this.$emit('on-change', value);
- this.dispatch('FormItem', 'on-form-change', value);
- this.closer(event);
- },
- handleSuccess: function handleSuccess(event) {
- this.handleButtons(event, this.formatColor);
- this.$emit('on-pick-success');
- },
- handleClear: function handleClear(event) {
- this.handleButtons(event, '');
- this.$emit('on-pick-clear');
- },
- handleSelectColor: function handleSelectColor(color) {
- this.val = (0, _utils.changeColor)(color);
- this.$emit('on-active-change', this.formatColor);
- },
- handleEditColor: function handleEditColor(event) {
- var value = event.target.value;
- this.handleSelectColor(value);
- },
- handleFirstTab: function handleFirstTab(event) {
- if (event.shiftKey) {
- event.preventDefault();
- event.stopPropagation();
- this.$refs.ok.$el.focus();
- }
- },
- handleLastTab: function handleLastTab(event) {
- if (!event.shiftKey) {
- event.preventDefault();
- event.stopPropagation();
- this.$refs.saturation.$el.focus();
- }
- },
- onTab: function onTab(event) {
- if (this.visible) {
- event.preventDefault();
- }
- },
- onEscape: function onEscape(event) {
- if (this.visible) {
- this.closer(event);
- }
- },
- onArrow: function onArrow(event) {
- if (!this.visible) {
- event.preventDefault();
- event.stopPropagation();
- this.visible = true;
- }
- }
- }
- };
- /***/ }),
- /* 149 */
- /***/ (function(module, exports, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1
- // https://github.com/bgrins/TinyColor
- // Brian Grinstead, MIT License
- (function(Math) {
- var trimLeft = /^\s+/,
- trimRight = /\s+$/,
- tinyCounter = 0,
- mathRound = Math.round,
- mathMin = Math.min,
- mathMax = Math.max,
- mathRandom = Math.random;
- function tinycolor (color, opts) {
- color = (color) ? color : '';
- opts = opts || { };
- // If input is already a tinycolor, return itself
- if (color instanceof tinycolor) {
- return color;
- }
- // If we are called as a function, call using new instead
- if (!(this instanceof tinycolor)) {
- return new tinycolor(color, opts);
- }
- var rgb = inputToRGB(color);
- this._originalInput = color,
- this._r = rgb.r,
- this._g = rgb.g,
- this._b = rgb.b,
- this._a = rgb.a,
- this._roundA = mathRound(100*this._a) / 100,
- this._format = opts.format || rgb.format;
- this._gradientType = opts.gradientType;
- // Don't let the range of [0,255] come back in [0,1].
- // Potentially lose a little bit of precision here, but will fix issues where
- // .5 gets interpreted as half of the total, instead of half of 1
- // If it was supposed to be 128, this was already taken care of by `inputToRgb`
- if (this._r < 1) { this._r = mathRound(this._r); }
- if (this._g < 1) { this._g = mathRound(this._g); }
- if (this._b < 1) { this._b = mathRound(this._b); }
- this._ok = rgb.ok;
- this._tc_id = tinyCounter++;
- }
- tinycolor.prototype = {
- isDark: function() {
- return this.getBrightness() < 128;
- },
- isLight: function() {
- return !this.isDark();
- },
- isValid: function() {
- return this._ok;
- },
- getOriginalInput: function() {
- return this._originalInput;
- },
- getFormat: function() {
- return this._format;
- },
- getAlpha: function() {
- return this._a;
- },
- getBrightness: function() {
- //http://www.w3.org/TR/AERT#color-contrast
- var rgb = this.toRgb();
- return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
- },
- getLuminance: function() {
- //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
- var rgb = this.toRgb();
- var RsRGB, GsRGB, BsRGB, R, G, B;
- RsRGB = rgb.r/255;
- GsRGB = rgb.g/255;
- BsRGB = rgb.b/255;
- if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
- if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
- if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
- return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
- },
- setAlpha: function(value) {
- this._a = boundAlpha(value);
- this._roundA = mathRound(100*this._a) / 100;
- return this;
- },
- toHsv: function() {
- var hsv = rgbToHsv(this._r, this._g, this._b);
- return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
- },
- toHsvString: function() {
- var hsv = rgbToHsv(this._r, this._g, this._b);
- var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
- return (this._a == 1) ?
- "hsv(" + h + ", " + s + "%, " + v + "%)" :
- "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
- },
- toHsl: function() {
- var hsl = rgbToHsl(this._r, this._g, this._b);
- return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
- },
- toHslString: function() {
- var hsl = rgbToHsl(this._r, this._g, this._b);
- var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
- return (this._a == 1) ?
- "hsl(" + h + ", " + s + "%, " + l + "%)" :
- "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
- },
- toHex: function(allow3Char) {
- return rgbToHex(this._r, this._g, this._b, allow3Char);
- },
- toHexString: function(allow3Char) {
- return '#' + this.toHex(allow3Char);
- },
- toHex8: function(allow4Char) {
- return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
- },
- toHex8String: function(allow4Char) {
- return '#' + this.toHex8(allow4Char);
- },
- toRgb: function() {
- return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
- },
- toRgbString: function() {
- return (this._a == 1) ?
- "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
- "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
- },
- toPercentageRgb: function() {
- return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
- },
- toPercentageRgbString: function() {
- return (this._a == 1) ?
- "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
- "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
- },
- toName: function() {
- if (this._a === 0) {
- return "transparent";
- }
- if (this._a < 1) {
- return false;
- }
- return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
- },
- toFilter: function(secondColor) {
- var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
- var secondHex8String = hex8String;
- var gradientType = this._gradientType ? "GradientType = 1, " : "";
- if (secondColor) {
- var s = tinycolor(secondColor);
- secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
- }
- return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
- },
- toString: function(format) {
- var formatSet = !!format;
- format = format || this._format;
- var formattedString = false;
- var hasAlpha = this._a < 1 && this._a >= 0;
- var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
- if (needsAlphaFormat) {
- // Special case for "transparent", all other non-alpha formats
- // will return rgba when there is transparency.
- if (format === "name" && this._a === 0) {
- return this.toName();
- }
- return this.toRgbString();
- }
- if (format === "rgb") {
- formattedString = this.toRgbString();
- }
- if (format === "prgb") {
- formattedString = this.toPercentageRgbString();
- }
- if (format === "hex" || format === "hex6") {
- formattedString = this.toHexString();
- }
- if (format === "hex3") {
- formattedString = this.toHexString(true);
- }
- if (format === "hex4") {
- formattedString = this.toHex8String(true);
- }
- if (format === "hex8") {
- formattedString = this.toHex8String();
- }
- if (format === "name") {
- formattedString = this.toName();
- }
- if (format === "hsl") {
- formattedString = this.toHslString();
- }
- if (format === "hsv") {
- formattedString = this.toHsvString();
- }
- return formattedString || this.toHexString();
- },
- clone: function() {
- return tinycolor(this.toString());
- },
- _applyModification: function(fn, args) {
- var color = fn.apply(null, [this].concat([].slice.call(args)));
- this._r = color._r;
- this._g = color._g;
- this._b = color._b;
- this.setAlpha(color._a);
- return this;
- },
- lighten: function() {
- return this._applyModification(lighten, arguments);
- },
- brighten: function() {
- return this._applyModification(brighten, arguments);
- },
- darken: function() {
- return this._applyModification(darken, arguments);
- },
- desaturate: function() {
- return this._applyModification(desaturate, arguments);
- },
- saturate: function() {
- return this._applyModification(saturate, arguments);
- },
- greyscale: function() {
- return this._applyModification(greyscale, arguments);
- },
- spin: function() {
- return this._applyModification(spin, arguments);
- },
- _applyCombination: function(fn, args) {
- return fn.apply(null, [this].concat([].slice.call(args)));
- },
- analogous: function() {
- return this._applyCombination(analogous, arguments);
- },
- complement: function() {
- return this._applyCombination(complement, arguments);
- },
- monochromatic: function() {
- return this._applyCombination(monochromatic, arguments);
- },
- splitcomplement: function() {
- return this._applyCombination(splitcomplement, arguments);
- },
- triad: function() {
- return this._applyCombination(triad, arguments);
- },
- tetrad: function() {
- return this._applyCombination(tetrad, arguments);
- }
- };
- // If input is an object, force 1 into "1.0" to handle ratios properly
- // String input requires "1.0" as input, so 1 will be treated as 1
- tinycolor.fromRatio = function(color, opts) {
- if (typeof color == "object") {
- var newColor = {};
- for (var i in color) {
- if (color.hasOwnProperty(i)) {
- if (i === "a") {
- newColor[i] = color[i];
- }
- else {
- newColor[i] = convertToPercentage(color[i]);
- }
- }
- }
- color = newColor;
- }
- return tinycolor(color, opts);
- };
- // Given a string or object, convert that input to RGB
- // Possible string inputs:
- //
- // "red"
- // "#f00" or "f00"
- // "#ff0000" or "ff0000"
- // "#ff000000" or "ff000000"
- // "rgb 255 0 0" or "rgb (255, 0, 0)"
- // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
- // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
- // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
- // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
- // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
- // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
- //
- function inputToRGB(color) {
- var rgb = { r: 0, g: 0, b: 0 };
- var a = 1;
- var s = null;
- var v = null;
- var l = null;
- var ok = false;
- var format = false;
- if (typeof color == "string") {
- color = stringInputToObject(color);
- }
- if (typeof color == "object") {
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
- rgb = rgbToRgb(color.r, color.g, color.b);
- ok = true;
- format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
- }
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
- s = convertToPercentage(color.s);
- v = convertToPercentage(color.v);
- rgb = hsvToRgb(color.h, s, v);
- ok = true;
- format = "hsv";
- }
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
- s = convertToPercentage(color.s);
- l = convertToPercentage(color.l);
- rgb = hslToRgb(color.h, s, l);
- ok = true;
- format = "hsl";
- }
- if (color.hasOwnProperty("a")) {
- a = color.a;
- }
- }
- a = boundAlpha(a);
- return {
- ok: ok,
- format: color.format || format,
- r: mathMin(255, mathMax(rgb.r, 0)),
- g: mathMin(255, mathMax(rgb.g, 0)),
- b: mathMin(255, mathMax(rgb.b, 0)),
- a: a
- };
- }
- // Conversion Functions
- // --------------------
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
- // `rgbToRgb`
- // Handle bounds / percentage checking to conform to CSS color spec
- // <http://www.w3.org/TR/css3-color/>
- // *Assumes:* r, g, b in [0, 255] or [0, 1]
- // *Returns:* { r, g, b } in [0, 255]
- function rgbToRgb(r, g, b){
- return {
- r: bound01(r, 255) * 255,
- g: bound01(g, 255) * 255,
- b: bound01(b, 255) * 255
- };
- }
- // `rgbToHsl`
- // Converts an RGB color value to HSL.
- // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
- // *Returns:* { h, s, l } in [0,1]
- function rgbToHsl(r, g, b) {
- r = bound01(r, 255);
- g = bound01(g, 255);
- b = bound01(b, 255);
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
- var h, s, l = (max + min) / 2;
- if(max == min) {
- h = s = 0; // achromatic
- }
- else {
- var d = max - min;
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
- switch(max) {
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
- case g: h = (b - r) / d + 2; break;
- case b: h = (r - g) / d + 4; break;
- }
- h /= 6;
- }
- return { h: h, s: s, l: l };
- }
- // `hslToRgb`
- // Converts an HSL color value to RGB.
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
- // *Returns:* { r, g, b } in the set [0, 255]
- function hslToRgb(h, s, l) {
- var r, g, b;
- h = bound01(h, 360);
- s = bound01(s, 100);
- l = bound01(l, 100);
- function hue2rgb(p, q, t) {
- if(t < 0) t += 1;
- if(t > 1) t -= 1;
- if(t < 1/6) return p + (q - p) * 6 * t;
- if(t < 1/2) return q;
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
- return p;
- }
- if(s === 0) {
- r = g = b = l; // achromatic
- }
- else {
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
- var p = 2 * l - q;
- r = hue2rgb(p, q, h + 1/3);
- g = hue2rgb(p, q, h);
- b = hue2rgb(p, q, h - 1/3);
- }
- return { r: r * 255, g: g * 255, b: b * 255 };
- }
- // `rgbToHsv`
- // Converts an RGB color value to HSV
- // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
- // *Returns:* { h, s, v } in [0,1]
- function rgbToHsv(r, g, b) {
- r = bound01(r, 255);
- g = bound01(g, 255);
- b = bound01(b, 255);
- var max = mathMax(r, g, b), min = mathMin(r, g, b);
- var h, s, v = max;
- var d = max - min;
- s = max === 0 ? 0 : d / max;
- if(max == min) {
- h = 0; // achromatic
- }
- else {
- switch(max) {
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
- case g: h = (b - r) / d + 2; break;
- case b: h = (r - g) / d + 4; break;
- }
- h /= 6;
- }
- return { h: h, s: s, v: v };
- }
- // `hsvToRgb`
- // Converts an HSV color value to RGB.
- // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
- // *Returns:* { r, g, b } in the set [0, 255]
- function hsvToRgb(h, s, v) {
- h = bound01(h, 360) * 6;
- s = bound01(s, 100);
- v = bound01(v, 100);
- var i = Math.floor(h),
- f = h - i,
- p = v * (1 - s),
- q = v * (1 - f * s),
- t = v * (1 - (1 - f) * s),
- mod = i % 6,
- r = [v, q, p, p, t, v][mod],
- g = [t, v, v, q, p, p][mod],
- b = [p, p, t, v, v, q][mod];
- return { r: r * 255, g: g * 255, b: b * 255 };
- }
- // `rgbToHex`
- // Converts an RGB color to hex
- // Assumes r, g, and b are contained in the set [0, 255]
- // Returns a 3 or 6 character hex
- function rgbToHex(r, g, b, allow3Char) {
- var hex = [
- pad2(mathRound(r).toString(16)),
- pad2(mathRound(g).toString(16)),
- pad2(mathRound(b).toString(16))
- ];
- // Return a 3 character hex if possible
- if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
- }
- return hex.join("");
- }
- // `rgbaToHex`
- // Converts an RGBA color plus alpha transparency to hex
- // Assumes r, g, b are contained in the set [0, 255] and
- // a in [0, 1]. Returns a 4 or 8 character rgba hex
- function rgbaToHex(r, g, b, a, allow4Char) {
- var hex = [
- pad2(mathRound(r).toString(16)),
- pad2(mathRound(g).toString(16)),
- pad2(mathRound(b).toString(16)),
- pad2(convertDecimalToHex(a))
- ];
- // Return a 4 character hex if possible
- if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
- }
- return hex.join("");
- }
- // `rgbaToArgbHex`
- // Converts an RGBA color to an ARGB Hex8 string
- // Rarely used, but required for "toFilter()"
- function rgbaToArgbHex(r, g, b, a) {
- var hex = [
- pad2(convertDecimalToHex(a)),
- pad2(mathRound(r).toString(16)),
- pad2(mathRound(g).toString(16)),
- pad2(mathRound(b).toString(16))
- ];
- return hex.join("");
- }
- // `equals`
- // Can be called with any tinycolor input
- tinycolor.equals = function (color1, color2) {
- if (!color1 || !color2) { return false; }
- return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
- };
- tinycolor.random = function() {
- return tinycolor.fromRatio({
- r: mathRandom(),
- g: mathRandom(),
- b: mathRandom()
- });
- };
- // Modification Functions
- // ----------------------
- // Thanks to less.js for some of the basics here
- // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
- function desaturate(color, amount) {
- amount = (amount === 0) ? 0 : (amount || 10);
- var hsl = tinycolor(color).toHsl();
- hsl.s -= amount / 100;
- hsl.s = clamp01(hsl.s);
- return tinycolor(hsl);
- }
- function saturate(color, amount) {
- amount = (amount === 0) ? 0 : (amount || 10);
- var hsl = tinycolor(color).toHsl();
- hsl.s += amount / 100;
- hsl.s = clamp01(hsl.s);
- return tinycolor(hsl);
- }
- function greyscale(color) {
- return tinycolor(color).desaturate(100);
- }
- function lighten (color, amount) {
- amount = (amount === 0) ? 0 : (amount || 10);
- var hsl = tinycolor(color).toHsl();
- hsl.l += amount / 100;
- hsl.l = clamp01(hsl.l);
- return tinycolor(hsl);
- }
- function brighten(color, amount) {
- amount = (amount === 0) ? 0 : (amount || 10);
- var rgb = tinycolor(color).toRgb();
- rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
- rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
- rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
- return tinycolor(rgb);
- }
- function darken (color, amount) {
- amount = (amount === 0) ? 0 : (amount || 10);
- var hsl = tinycolor(color).toHsl();
- hsl.l -= amount / 100;
- hsl.l = clamp01(hsl.l);
- return tinycolor(hsl);
- }
- // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
- // Values outside of this range will be wrapped into this range.
- function spin(color, amount) {
- var hsl = tinycolor(color).toHsl();
- var hue = (hsl.h + amount) % 360;
- hsl.h = hue < 0 ? 360 + hue : hue;
- return tinycolor(hsl);
- }
- // Combination Functions
- // ---------------------
- // Thanks to jQuery xColor for some of the ideas behind these
- // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
- function complement(color) {
- var hsl = tinycolor(color).toHsl();
- hsl.h = (hsl.h + 180) % 360;
- return tinycolor(hsl);
- }
- function triad(color) {
- var hsl = tinycolor(color).toHsl();
- var h = hsl.h;
- return [
- tinycolor(color),
- tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
- tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
- ];
- }
- function tetrad(color) {
- var hsl = tinycolor(color).toHsl();
- var h = hsl.h;
- return [
- tinycolor(color),
- tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
- tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
- tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
- ];
- }
- function splitcomplement(color) {
- var hsl = tinycolor(color).toHsl();
- var h = hsl.h;
- return [
- tinycolor(color),
- tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
- tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
- ];
- }
- function analogous(color, results, slices) {
- results = results || 6;
- slices = slices || 30;
- var hsl = tinycolor(color).toHsl();
- var part = 360 / slices;
- var ret = [tinycolor(color)];
- for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
- hsl.h = (hsl.h + part) % 360;
- ret.push(tinycolor(hsl));
- }
- return ret;
- }
- function monochromatic(color, results) {
- results = results || 6;
- var hsv = tinycolor(color).toHsv();
- var h = hsv.h, s = hsv.s, v = hsv.v;
- var ret = [];
- var modification = 1 / results;
- while (results--) {
- ret.push(tinycolor({ h: h, s: s, v: v}));
- v = (v + modification) % 1;
- }
- return ret;
- }
- // Utility Functions
- // ---------------------
- tinycolor.mix = function(color1, color2, amount) {
- amount = (amount === 0) ? 0 : (amount || 50);
- var rgb1 = tinycolor(color1).toRgb();
- var rgb2 = tinycolor(color2).toRgb();
- var p = amount / 100;
- var rgba = {
- r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
- g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
- b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
- a: ((rgb2.a - rgb1.a) * p) + rgb1.a
- };
- return tinycolor(rgba);
- };
- // Readability Functions
- // ---------------------
- // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
- // `contrast`
- // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
- tinycolor.readability = function(color1, color2) {
- var c1 = tinycolor(color1);
- var c2 = tinycolor(color2);
- return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
- };
- // `isReadable`
- // Ensure that foreground and background color combinations meet WCAG2 guidelines.
- // The third argument is an optional Object.
- // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
- // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
- // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
- // *Example*
- // tinycolor.isReadable("#000", "#111") => false
- // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
- tinycolor.isReadable = function(color1, color2, wcag2) {
- var readability = tinycolor.readability(color1, color2);
- var wcag2Parms, out;
- out = false;
- wcag2Parms = validateWCAG2Parms(wcag2);
- switch (wcag2Parms.level + wcag2Parms.size) {
- case "AAsmall":
- case "AAAlarge":
- out = readability >= 4.5;
- break;
- case "AAlarge":
- out = readability >= 3;
- break;
- case "AAAsmall":
- out = readability >= 7;
- break;
- }
- return out;
- };
- // `mostReadable`
- // Given a base color and a list of possible foreground or background
- // colors for that base, returns the most readable color.
- // Optionally returns Black or White if the most readable color is unreadable.
- // *Example*
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
- // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
- // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
- tinycolor.mostReadable = function(baseColor, colorList, args) {
- var bestColor = null;
- var bestScore = 0;
- var readability;
- var includeFallbackColors, level, size ;
- args = args || {};
- includeFallbackColors = args.includeFallbackColors ;
- level = args.level;
- size = args.size;
- for (var i= 0; i < colorList.length ; i++) {
- readability = tinycolor.readability(baseColor, colorList[i]);
- if (readability > bestScore) {
- bestScore = readability;
- bestColor = tinycolor(colorList[i]);
- }
- }
- if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
- return bestColor;
- }
- else {
- args.includeFallbackColors=false;
- return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
- }
- };
- // Big List of Colors
- // ------------------
- // <http://www.w3.org/TR/css3-color/#svg-color>
- var names = tinycolor.names = {
- aliceblue: "f0f8ff",
- antiquewhite: "faebd7",
- aqua: "0ff",
- aquamarine: "7fffd4",
- azure: "f0ffff",
- beige: "f5f5dc",
- bisque: "ffe4c4",
- black: "000",
- blanchedalmond: "ffebcd",
- blue: "00f",
- blueviolet: "8a2be2",
- brown: "a52a2a",
- burlywood: "deb887",
- burntsienna: "ea7e5d",
- cadetblue: "5f9ea0",
- chartreuse: "7fff00",
- chocolate: "d2691e",
- coral: "ff7f50",
- cornflowerblue: "6495ed",
- cornsilk: "fff8dc",
- crimson: "dc143c",
- cyan: "0ff",
- darkblue: "00008b",
- darkcyan: "008b8b",
- darkgoldenrod: "b8860b",
- darkgray: "a9a9a9",
- darkgreen: "006400",
- darkgrey: "a9a9a9",
- darkkhaki: "bdb76b",
- darkmagenta: "8b008b",
- darkolivegreen: "556b2f",
- darkorange: "ff8c00",
- darkorchid: "9932cc",
- darkred: "8b0000",
- darksalmon: "e9967a",
- darkseagreen: "8fbc8f",
- darkslateblue: "483d8b",
- darkslategray: "2f4f4f",
- darkslategrey: "2f4f4f",
- darkturquoise: "00ced1",
- darkviolet: "9400d3",
- deeppink: "ff1493",
- deepskyblue: "00bfff",
- dimgray: "696969",
- dimgrey: "696969",
- dodgerblue: "1e90ff",
- firebrick: "b22222",
- floralwhite: "fffaf0",
- forestgreen: "228b22",
- fuchsia: "f0f",
- gainsboro: "dcdcdc",
- ghostwhite: "f8f8ff",
- gold: "ffd700",
- goldenrod: "daa520",
- gray: "808080",
- green: "008000",
- greenyellow: "adff2f",
- grey: "808080",
- honeydew: "f0fff0",
- hotpink: "ff69b4",
- indianred: "cd5c5c",
- indigo: "4b0082",
- ivory: "fffff0",
- khaki: "f0e68c",
- lavender: "e6e6fa",
- lavenderblush: "fff0f5",
- lawngreen: "7cfc00",
- lemonchiffon: "fffacd",
- lightblue: "add8e6",
- lightcoral: "f08080",
- lightcyan: "e0ffff",
- lightgoldenrodyellow: "fafad2",
- lightgray: "d3d3d3",
- lightgreen: "90ee90",
- lightgrey: "d3d3d3",
- lightpink: "ffb6c1",
- lightsalmon: "ffa07a",
- lightseagreen: "20b2aa",
- lightskyblue: "87cefa",
- lightslategray: "789",
- lightslategrey: "789",
- lightsteelblue: "b0c4de",
- lightyellow: "ffffe0",
- lime: "0f0",
- limegreen: "32cd32",
- linen: "faf0e6",
- magenta: "f0f",
- maroon: "800000",
- mediumaquamarine: "66cdaa",
- mediumblue: "0000cd",
- mediumorchid: "ba55d3",
- mediumpurple: "9370db",
- mediumseagreen: "3cb371",
- mediumslateblue: "7b68ee",
- mediumspringgreen: "00fa9a",
- mediumturquoise: "48d1cc",
- mediumvioletred: "c71585",
- midnightblue: "191970",
- mintcream: "f5fffa",
- mistyrose: "ffe4e1",
- moccasin: "ffe4b5",
- navajowhite: "ffdead",
- navy: "000080",
- oldlace: "fdf5e6",
- olive: "808000",
- olivedrab: "6b8e23",
- orange: "ffa500",
- orangered: "ff4500",
- orchid: "da70d6",
- palegoldenrod: "eee8aa",
- palegreen: "98fb98",
- paleturquoise: "afeeee",
- palevioletred: "db7093",
- papayawhip: "ffefd5",
- peachpuff: "ffdab9",
- peru: "cd853f",
- pink: "ffc0cb",
- plum: "dda0dd",
- powderblue: "b0e0e6",
- purple: "800080",
- rebeccapurple: "663399",
- red: "f00",
- rosybrown: "bc8f8f",
- royalblue: "4169e1",
- saddlebrown: "8b4513",
- salmon: "fa8072",
- sandybrown: "f4a460",
- seagreen: "2e8b57",
- seashell: "fff5ee",
- sienna: "a0522d",
- silver: "c0c0c0",
- skyblue: "87ceeb",
- slateblue: "6a5acd",
- slategray: "708090",
- slategrey: "708090",
- snow: "fffafa",
- springgreen: "00ff7f",
- steelblue: "4682b4",
- tan: "d2b48c",
- teal: "008080",
- thistle: "d8bfd8",
- tomato: "ff6347",
- turquoise: "40e0d0",
- violet: "ee82ee",
- wheat: "f5deb3",
- white: "fff",
- whitesmoke: "f5f5f5",
- yellow: "ff0",
- yellowgreen: "9acd32"
- };
- // Make it easy to access colors via `hexNames[hex]`
- var hexNames = tinycolor.hexNames = flip(names);
- // Utilities
- // ---------
- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
- function flip(o) {
- var flipped = { };
- for (var i in o) {
- if (o.hasOwnProperty(i)) {
- flipped[o[i]] = i;
- }
- }
- return flipped;
- }
- // Return a valid alpha value [0,1] with all invalid values being set to 1
- function boundAlpha(a) {
- a = parseFloat(a);
- if (isNaN(a) || a < 0 || a > 1) {
- a = 1;
- }
- return a;
- }
- // Take input from [0, n] and return it as [0, 1]
- function bound01(n, max) {
- if (isOnePointZero(n)) { n = "100%"; }
- var processPercent = isPercentage(n);
- n = mathMin(max, mathMax(0, parseFloat(n)));
- // Automatically convert percentage into number
- if (processPercent) {
- n = parseInt(n * max, 10) / 100;
- }
- // Handle floating point rounding errors
- if ((Math.abs(n - max) < 0.000001)) {
- return 1;
- }
- // Convert into [0, 1] range if it isn't already
- return (n % max) / parseFloat(max);
- }
- // Force a number between 0 and 1
- function clamp01(val) {
- return mathMin(1, mathMax(0, val));
- }
- // Parse a base-16 hex value into a base-10 integer
- function parseIntFromHex(val) {
- return parseInt(val, 16);
- }
- // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
- // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
- function isOnePointZero(n) {
- return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
- }
- // Check to see if string passed in is a percentage
- function isPercentage(n) {
- return typeof n === "string" && n.indexOf('%') != -1;
- }
- // Force a hex value to have 2 characters
- function pad2(c) {
- return c.length == 1 ? '0' + c : '' + c;
- }
- // Replace a decimal with it's percentage value
- function convertToPercentage(n) {
- if (n <= 1) {
- n = (n * 100) + "%";
- }
- return n;
- }
- // Converts a decimal to a hex value
- function convertDecimalToHex(d) {
- return Math.round(parseFloat(d) * 255).toString(16);
- }
- // Converts a hex value to a decimal
- function convertHexToDecimal(h) {
- return (parseIntFromHex(h) / 255);
- }
- var matchers = (function() {
- // <http://www.w3.org/TR/css3-values/#integers>
- var CSS_INTEGER = "[-\\+]?\\d+%?";
- // <http://www.w3.org/TR/css3-values/#number-value>
- var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
- // Actual matching.
- // Parentheses and commas are optional, but not required.
- // Whitespace can take the place of commas or opening paren
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
- return {
- CSS_UNIT: new RegExp(CSS_UNIT),
- rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
- rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
- hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
- hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
- hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
- hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
- };
- })();
- // `isValidCSSUnit`
- // Take in a single string / number and check to see if it looks like a CSS unit
- // (see `matchers` above for definition).
- function isValidCSSUnit(color) {
- return !!matchers.CSS_UNIT.exec(color);
- }
- // `stringInputToObject`
- // Permissive string parsing. Take in a number of formats, and output an object
- // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
- function stringInputToObject(color) {
- color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
- var named = false;
- if (names[color]) {
- color = names[color];
- named = true;
- }
- else if (color == 'transparent') {
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
- }
- // Try to match string input using regular expressions.
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
- // Just return an object and let the conversion functions handle that.
- // This way the result will be the same whether the tinycolor is initialized with string or object.
- var match;
- if ((match = matchers.rgb.exec(color))) {
- return { r: match[1], g: match[2], b: match[3] };
- }
- if ((match = matchers.rgba.exec(color))) {
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
- }
- if ((match = matchers.hsl.exec(color))) {
- return { h: match[1], s: match[2], l: match[3] };
- }
- if ((match = matchers.hsla.exec(color))) {
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
- }
- if ((match = matchers.hsv.exec(color))) {
- return { h: match[1], s: match[2], v: match[3] };
- }
- if ((match = matchers.hsva.exec(color))) {
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
- }
- if ((match = matchers.hex8.exec(color))) {
- return {
- r: parseIntFromHex(match[1]),
- g: parseIntFromHex(match[2]),
- b: parseIntFromHex(match[3]),
- a: convertHexToDecimal(match[4]),
- format: named ? "name" : "hex8"
- };
- }
- if ((match = matchers.hex6.exec(color))) {
- return {
- r: parseIntFromHex(match[1]),
- g: parseIntFromHex(match[2]),
- b: parseIntFromHex(match[3]),
- format: named ? "name" : "hex"
- };
- }
- if ((match = matchers.hex4.exec(color))) {
- return {
- r: parseIntFromHex(match[1] + '' + match[1]),
- g: parseIntFromHex(match[2] + '' + match[2]),
- b: parseIntFromHex(match[3] + '' + match[3]),
- a: convertHexToDecimal(match[4] + '' + match[4]),
- format: named ? "name" : "hex8"
- };
- }
- if ((match = matchers.hex3.exec(color))) {
- return {
- r: parseIntFromHex(match[1] + '' + match[1]),
- g: parseIntFromHex(match[2] + '' + match[2]),
- b: parseIntFromHex(match[3] + '' + match[3]),
- format: named ? "name" : "hex"
- };
- }
- return false;
- }
- function validateWCAG2Parms(parms) {
- // return valid WCAG2 parms for isReadable.
- // If input parms are invalid, return {"level":"AA", "size":"small"}
- var level, size;
- parms = parms || {"level":"AA", "size":"small"};
- level = (parms.level || "AA").toUpperCase();
- size = (parms.size || "small").toLowerCase();
- if (level !== "AA" && level !== "AAA") {
- level = "AA";
- }
- if (size !== "small" && size !== "large") {
- size = "small";
- }
- return {"level":level, "size":size};
- }
- // Node: Export function
- if (typeof module !== "undefined" && module.exports) {
- module.exports = tinycolor;
- }
- // AMD/requirejs: Define the module
- else if (true) {
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }
- // Browser: Expose to window
- else {
- window.tinycolor = tinycolor;
- }
- })(Math);
- /***/ }),
- /* 150 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _extends2 = __webpack_require__(32);
- var _extends3 = _interopRequireDefault(_extends2);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _handleEscapeMixin = __webpack_require__(151);
- var _handleEscapeMixin2 = _interopRequireDefault(_handleEscapeMixin);
- var _prefixMixin = __webpack_require__(50);
- var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
- var _utils = __webpack_require__(39);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'RecommendedColors',
- mixins: [_emitter2.default, _handleEscapeMixin2.default, _prefixMixin2.default],
- props: {
- list: {
- type: Array,
- default: undefined
- }
- },
- data: function data() {
- var columns = 12;
- var rows = Math.ceil(this.list.length / columns);
- var normalStep = 1;
- return {
- left: -normalStep,
- right: normalStep,
- up: -normalStep,
- down: normalStep,
- powerKey: 'shiftKey',
- grid: { x: 1, y: 1 },
- rows: rows,
- columns: columns
- };
- },
- computed: {
- hideClass: function hideClass() {
- return String(this.prefixCls) + '-hide';
- },
- linearIndex: function linearIndex() {
- return this.getLinearIndex(this.grid);
- },
- currentCircle: function currentCircle() {
- return this.$refs['color-circle-' + String(this.linearIndex)][0];
- }
- },
- methods: {
- getLinearIndex: function getLinearIndex(grid) {
- return this.columns * (grid.y - 1) + grid.x - 1;
- },
- getMaxLimit: function getMaxLimit(axis) {
- return axis === 'x' ? this.columns : this.rows;
- },
- handleArrow: function handleArrow(e, axis, direction) {
- e.preventDefault();
- e.stopPropagation();
- this.blurColor();
- var grid = (0, _extends3.default)({}, this.grid);
- if (e[this.powerKey]) {
- if (direction < 0) {
- grid[axis] = 1;
- } else {
- grid[axis] = this.getMaxLimit(axis);
- }
- } else {
- grid[axis] += direction;
- }
- var index = this.getLinearIndex(grid);
- if (index >= 0 && index < this.list.length) {
- this.grid[axis] = (0, _utils.clamp)(grid[axis], 1, this.getMaxLimit(axis));
- }
- this.focusColor();
- },
- blurColor: function blurColor() {
- this.currentCircle.classList.add(this.hideClass);
- },
- focusColor: function focusColor() {
- this.currentCircle.classList.remove(this.hideClass);
- },
- handleEnter: function handleEnter(e) {
- this.handleClick(e, this.currentCircle);
- },
- handleClick: function handleClick(e, circle) {
- e.preventDefault();
- e.stopPropagation();
- this.$refs.reference.focus();
- var target = circle || e.target;
- var colorId = target.dataset.colorId || target.parentElement.dataset.colorId;
- if (colorId) {
- this.blurColor();
- var id = Number(colorId) + 1;
- this.grid.x = id % this.columns || this.columns;
- this.grid.y = Math.ceil(id / this.columns);
- this.focusColor();
- this.$emit('picker-color', this.list[colorId]);
- this.$emit('change', { hex: this.list[colorId], source: 'hex' });
- }
- },
- lineBreak: function lineBreak(list, index) {
- if (!index) {
- return false;
- }
- var nextIndex = index + 1;
- return nextIndex < list.length && nextIndex % this.columns === 0;
- }
- }
- };
- /***/ }),
- /* 151 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- methods: {
- handleEscape: function handleEscape(e) {
- this.dispatch('ColorPicker', 'on-escape-keydown', e);
- }
- }
- };
- /***/ }),
- /* 152 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _hsaMixin = __webpack_require__(84);
- var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
- var _prefixMixin = __webpack_require__(50);
- var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
- var _utils = __webpack_require__(39);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Saturation',
- mixins: [_hsaMixin2.default, _prefixMixin2.default],
- data: function data() {
- var normalStep = 0.01;
- return {
- left: -normalStep,
- right: normalStep,
- up: normalStep,
- down: -normalStep,
- multiplier: 10,
- powerKey: 'shiftKey'
- };
- },
- computed: {
- bgColorStyle: function bgColorStyle() {
- return { background: 'hsl(' + String(this.value.hsv.h) + ', 100%, 50%)' };
- },
- pointerStyle: function pointerStyle() {
- return { top: -(this.value.hsv.v * 100) + 1 + 100 + '%', left: this.value.hsv.s * 100 + '%' };
- }
- },
- methods: {
- change: function change(h, s, v, a) {
- this.$emit('change', { h: h, s: s, v: v, a: a, source: 'hsva' });
- },
- handleSlide: function handleSlide(e, direction, key) {
- e.preventDefault();
- e.stopPropagation();
- var isPowerKey = e[this.powerKey];
- var increment = isPowerKey ? direction * this.multiplier : direction;
- var _value$hsv = this.value.hsv,
- h = _value$hsv.h,
- s = _value$hsv.s,
- v = _value$hsv.v,
- a = _value$hsv.a;
- var saturation = (0, _utils.clamp)(s + (0, _utils.getIncrement)(key, ['left', 'right'], increment), 0, 1);
- var bright = (0, _utils.clamp)(v + (0, _utils.getIncrement)(key, ['up', 'down'], increment), 0, 1);
- this.change(h, saturation, bright, a);
- },
- handleChange: function handleChange(e) {
- e.preventDefault();
- e.stopPropagation();
- var _$refs$container = this.$refs.container,
- clientWidth = _$refs$container.clientWidth,
- clientHeight = _$refs$container.clientHeight;
- var left = (0, _utils.clamp)(this.getLeft(e), 0, clientWidth);
- var top = (0, _utils.clamp)(this.getTop(e), 0, clientHeight);
- var saturation = left / clientWidth;
- var bright = (0, _utils.clamp)(1 - top / clientHeight, 0, 1);
- this.change(this.value.hsv.h, saturation, bright, this.value.hsv.a);
- },
- handleMouseDown: function handleMouseDown(e) {
- _hsaMixin2.default.methods.handleMouseDown.call(this, e);
- (0, _dom.on)(window, 'mouseup', this.handleChange);
- },
- unbindEventListeners: function unbindEventListeners(e) {
- _hsaMixin2.default.methods.unbindEventListeners.call(this, e);
- (0, _dom.off)(window, 'mouseup', this.handleChange);
- }
- }
- };
- /***/ }),
- /* 153 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _hsaMixin = __webpack_require__(84);
- var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
- var _prefixMixin = __webpack_require__(50);
- var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
- var _utils = __webpack_require__(39);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Hue',
- mixins: [_hsaMixin2.default, _prefixMixin2.default],
- data: function data() {
- var normalStep = 1 / 360 * 25;
- var jumpStep = 20 * normalStep;
- return {
- left: -normalStep,
- right: normalStep,
- up: jumpStep,
- down: -jumpStep,
- powerKey: 'shiftKey',
- percent: (0, _utils.clamp)(this.value.hsl.h * 100 / 360, 0, 100)
- };
- },
- watch: {
- value: function value() {
- this.percent = (0, _utils.clamp)(this.value.hsl.h * 100 / 360, 0, 100);
- }
- },
- methods: {
- change: function change(percent) {
- this.percent = (0, _utils.clamp)(percent, 0, 100);
- var _value$hsl = this.value.hsl,
- h = _value$hsl.h,
- s = _value$hsl.s,
- l = _value$hsl.l,
- a = _value$hsl.a;
- var newHue = (0, _utils.clamp)(percent / 100 * 360, 0, 360);
- if (h !== newHue) {
- this.$emit('change', { h: newHue, s: s, l: l, a: a, source: 'hsl' });
- }
- },
- handleSlide: function handleSlide(e, direction) {
- e.preventDefault();
- e.stopPropagation();
- if (e[this.powerKey]) {
- this.change(direction < 0 ? 0 : 100);
- return;
- }
- this.change(this.percent + direction);
- },
- handleChange: function handleChange(e) {
- e.preventDefault();
- e.stopPropagation();
- var left = this.getLeft(e);
- if (left < 0) {
- this.change(0);
- return;
- }
- var clientWidth = this.$refs.container.clientWidth;
- if (left > clientWidth) {
- this.change(100);
- return;
- }
- this.change(left * 100 / clientWidth);
- }
- }
- };
- /***/ }),
- /* 154 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _hsaMixin = __webpack_require__(84);
- var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
- var _prefixMixin = __webpack_require__(50);
- var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
- var _utils = __webpack_require__(39);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Alpha',
- mixins: [_hsaMixin2.default, _prefixMixin2.default],
- data: function data() {
- var normalStep = 1;
- var jumpStep = 10;
- return {
- left: -normalStep,
- right: normalStep,
- up: jumpStep,
- down: -jumpStep,
- powerKey: 'shiftKey'
- };
- },
- computed: {
- gradientStyle: function gradientStyle() {
- var _value$rgba = this.value.rgba,
- r = _value$rgba.r,
- g = _value$rgba.g,
- b = _value$rgba.b;
- var start = (0, _utils.toRGBAString)({ r: r, g: g, b: b, a: 0 });
- var finish = (0, _utils.toRGBAString)({ r: r, g: g, b: b, a: 1 });
- return { background: 'linear-gradient(to right, ' + String(start) + ' 0%, ' + String(finish) + ' 100%)' };
- }
- },
- methods: {
- change: function change(newAlpha) {
- var _value$hsl = this.value.hsl,
- h = _value$hsl.h,
- s = _value$hsl.s,
- l = _value$hsl.l;
- var a = this.value.a;
- if (a !== newAlpha) {
- this.$emit('change', { h: h, s: s, l: l, a: newAlpha, source: 'rgba' });
- }
- },
- handleSlide: function handleSlide(e, direction) {
- e.preventDefault();
- e.stopPropagation();
- this.change((0, _utils.clamp)(e[this.powerKey] ? direction : Math.round(this.value.hsl.a * 100 + direction) / 100, 0, 1));
- },
- handleChange: function handleChange(e) {
- e.preventDefault();
- e.stopPropagation();
- var left = this.getLeft(e);
- if (left < 0) {
- this.change(0);
- return;
- }
- var clientWidth = this.$refs.container.clientWidth;
- if (left > clientWidth) {
- this.change(1);
- return;
- }
- this.change(Math.round(left * 100 / clientWidth) / 100);
- }
- }
- };
- /***/ }),
- /* 155 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__ = __webpack_require__(156);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__ = __webpack_require__(404);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 156 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var prefixCls = 'ivu-layout';
- exports.default = {
- name: 'Content',
- computed: {
- wrapClasses: function wrapClasses() {
- return prefixCls + '-content';
- }
- }
- };
- /***/ }),
- /* 157 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__ = __webpack_require__(158);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__ = __webpack_require__(408);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 158 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _stringify = __webpack_require__(57);
- var _stringify2 = _interopRequireDefault(_stringify);
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _extends2 = __webpack_require__(32);
- var _extends3 = _interopRequireDefault(_extends2);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _vClickOutsideX = __webpack_require__(76);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- var _util = __webpack_require__(20);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-date-picker';
- var pickerPrefixCls = 'ivu-picker';
- var isEmptyArray = function (val) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return val.reduce(function (isEmpty, str) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return isEmpty && !str || typeof str === 'string' && str.trim() === '';
- }.bind(undefined), true);
- }.bind(undefined);
- var keyValueMapper = {
- 40: 'up',
- 39: 'right',
- 38: 'down',
- 37: 'left'
- };
- var mapPossibleValues = function (key, horizontal, vertical) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (key === 'left') return horizontal * -1;
- if (key === 'right') return horizontal * 1;
- if (key === 'up') return vertical * 1;
- if (key === 'down') return vertical * -1;
- }.bind(undefined);
- var pulseElement = function (el) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var pulseClass = 'ivu-date-picker-btn-pulse';
- el.classList.add(pulseClass);
- setTimeout(function () {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return el.classList.remove(pulseClass);
- }.bind(undefined), 200);
- }.bind(undefined);
- var extractTime = function (date) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (!date) return [0, 0, 0];
- return [date.getHours(), date.getMinutes(), date.getSeconds()];
- }.bind(undefined);
- exports.default = {
- mixins: [_emitter2.default, _form2.default],
- components: { iInput: _input2.default, Drop: _dropdown2.default, Icon: _icon2.default },
- directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
- props: {
- format: {
- type: String
- },
- readonly: {
- type: Boolean,
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- editable: {
- type: Boolean,
- default: true
- },
- clearable: {
- type: Boolean,
- default: true
- },
- confirm: {
- type: Boolean,
- default: false
- },
- open: {
- type: Boolean,
- default: null
- },
- multiple: {
- type: Boolean,
- default: false
- },
- timePickerOptions: {
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return {};
- }.bind(undefined),
- type: Object
- },
- splitPanels: {
- type: Boolean,
- default: false
- },
- showWeekNumbers: {
- type: Boolean,
- default: false
- },
- startDate: {
- type: Date
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- placeholder: {
- type: String,
- default: ''
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
- },
- default: 'bottom-start'
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- name: {
- type: String
- },
- elementId: {
- type: String
- },
- steps: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- value: {
- type: [Date, String, Array]
- },
- options: {
- type: Object,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return {};
- }.bind(undefined)
- },
- separator: {
- type: String,
- default: ' - '
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- transferClassName: {
- type: String
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- var isRange = this.type.includes('range');
- var emptyArray = isRange ? [null, null] : [null];
- var initialValue = isEmptyArray((isRange ? this.value : [this.value]) || []) ? emptyArray : this.parseDate(this.value);
- var focusedTime = initialValue.map(extractTime);
- return {
- prefixCls: prefixCls,
- showClose: false,
- visible: false,
- internalValue: initialValue,
- disableClickOutSide: false,
- disableCloseUnderTransfer: false,
- selectionMode: this.onSelectionModeChange(this.type),
- forceInputRerender: 1,
- isFocused: false,
- focusedDate: initialValue[0] || this.startDate || new Date(),
- focusedTime: {
- column: 0,
- picker: 0,
- time: focusedTime,
- active: false
- },
- internalFocus: false,
- isValueNull: false };
- },
- computed: {
- wrapperClasses: function wrapperClasses() {
- return [prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-focused', this.isFocused)];
- },
- publicVModelValue: function publicVModelValue() {
- var _this = this;
- if (this.multiple) {
- return this.internalValue.slice();
- } else {
- var isRange = this.type.includes('range');
- var val = this.internalValue.map(function (date) {
- (0, _newArrowCheck3.default)(this, _this);
- return date instanceof Date ? new Date(date) : date || '';
- }.bind(this));
- if (this.type.match(/^time/)) val = val.map(this.formatDate);
- return isRange || this.multiple ? val : val[0];
- }
- },
- publicStringValue: function publicStringValue() {
- var formatDate = this.formatDate,
- publicVModelValue = this.publicVModelValue,
- type = this.type;
- if (type.match(/^time/)) return publicVModelValue;
- if (this.multiple) return formatDate(publicVModelValue);
- return Array.isArray(publicVModelValue) ? publicVModelValue.map(formatDate) : formatDate(publicVModelValue);
- },
- opened: function opened() {
- return this.open === null ? this.visible : this.open;
- },
- transition: function transition() {
- var bottomPlaced = this.placement.match(/^bottom/);
- return bottomPlaced ? 'slide-up' : 'slide-down';
- },
- visualValue: function visualValue() {
- return this.formatDate(this.internalValue);
- },
- isConfirm: function isConfirm() {
- return this.confirm || this.type === 'datetime' || this.type === 'datetimerange' || this.multiple;
- },
- arrowType: function arrowType() {
- var type = '';
- if (this.type === 'time' || this.type === 'timerange') {
- type = 'ios-time-outline';
- if (this.$IVIEW) {
- if (this.$IVIEW.timePicker.customIcon) {
- type = '';
- } else if (this.$IVIEW.timePicker.icon) {
- type = this.$IVIEW.timePicker.icon;
- }
- }
- } else {
- type = 'ios-calendar-outline';
- if (this.$IVIEW) {
- if (this.$IVIEW.datePicker.customIcon) {
- type = '';
- } else if (this.$IVIEW.datePicker.icon) {
- type = this.$IVIEW.datePicker.icon;
- }
- }
- }
- if (this.showClose) type = 'ios-close-circle';
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (!this.showClose) {
- if (this.type === 'time' || this.type === 'timerange') {
- if (this.$IVIEW) {
- if (this.$IVIEW.timePicker.customIcon) {
- type = this.$IVIEW.timePicker.customIcon;
- }
- }
- } else {
- if (this.$IVIEW) {
- if (this.$IVIEW.datePicker.customIcon) {
- type = this.$IVIEW.datePicker.customIcon;
- }
- }
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (!this.showClose) {
- if (this.type === 'time' || this.type === 'timerange') {
- if (this.$IVIEW) {
- if (this.$IVIEW.timePicker.iconSize) {
- size = this.$IVIEW.timePicker.iconSize;
- }
- }
- } else {
- if (this.$IVIEW) {
- if (this.$IVIEW.datePicker.iconSize) {
- size = this.$IVIEW.datePicker.iconSize;
- }
- }
- }
- }
- return size;
- },
- dropdownCls: function dropdownCls() {
- var _ref2;
- return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
- }
- },
- methods: {
- onSelectionModeChange: function onSelectionModeChange(type) {
- if (type.match(/^date/)) type = 'date';
- this.selectionMode = (0, _assist.oneOf)(type, ['year', 'month', 'date', 'time']) && type;
- return this.selectionMode;
- },
- handleTransferClick: function handleTransferClick() {
- if (this.transfer) this.disableCloseUnderTransfer = true;
- },
- handleClose: function handleClose(e) {
- if (this.disableCloseUnderTransfer) {
- this.disableCloseUnderTransfer = false;
- return false;
- }
- if (e && e.type === 'mousedown' && this.visible) {
- e.preventDefault();
- e.stopPropagation();
- return;
- }
- if (this.visible) {
- var pickerPanel = this.$refs.pickerPanel && this.$refs.pickerPanel.$el;
- if (e && pickerPanel && pickerPanel.contains(e.target)) return;
- this.visible = false;
- e && e.preventDefault();
- e && e.stopPropagation();
- this.$emit('on-clickoutside', e);
- return;
- }
- this.isFocused = false;
- this.disableClickOutSide = false;
- },
- handleFocus: function handleFocus(e) {
- if (this.readonly) return;
- this.isFocused = true;
- if (e && e.type === 'focus') return;
- if (!this.itemDisabled) {
- this.visible = true;
- }
- },
- handleBlur: function handleBlur(e) {
- if (this.internalFocus) {
- this.internalFocus = false;
- return;
- }
- if (this.visible) {
- e.preventDefault();
- return;
- }
- this.isFocused = false;
- this.onSelectionModeChange(this.type);
- this.internalValue = this.internalValue.slice();
- this.reset();
- this.$refs.pickerPanel.onToggleVisibility(false);
- },
- handleKeydown: function handleKeydown(e) {
- var _this2 = this;
- var keyCode = e.keyCode;
- if (keyCode === 9) {
- if (this.visible) {
- e.stopPropagation();
- e.preventDefault();
- if (this.isConfirm) {
- var selector = '.' + pickerPrefixCls + '-confirm > *';
- var tabbable = this.$refs.drop.$el.querySelectorAll(selector);
- this.internalFocus = true;
- var element = [].concat((0, _toConsumableArray3.default)(tabbable))[e.shiftKey ? 'pop' : 'shift']();
- element.focus();
- } else {
- this.handleClose();
- }
- } else {
- this.focused = false;
- }
- }
- var arrows = [37, 38, 39, 40];
- if (!this.visible && arrows.includes(keyCode)) {
- this.visible = true;
- return;
- }
- if (keyCode === 27) {
- if (this.visible) {
- e.stopPropagation();
- this.handleClose();
- }
- }
- if (keyCode === 13) {
- var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
- if (timePickers.length > 0) {
- var columnsPerPicker = timePickers[0].showSeconds ? 3 : 2;
- var pickerIndex = Math.floor(this.focusedTime.column / columnsPerPicker);
- var value = this.focusedTime.time[pickerIndex];
- timePickers[pickerIndex].chooseValue(value);
- return;
- }
- if (this.type.match(/range/)) {
- this.$refs.pickerPanel.handleRangePick(this.focusedDate, 'date');
- } else {
- var panels = (0, _assist.findComponentsDownward)(this, 'PanelTable');
- var compareDate = function (d) {
- (0, _newArrowCheck3.default)(this, _this2);
- var sliceIndex = ['year', 'month', 'date'].indexOf(this.type) + 1;
- return [d.getFullYear(), d.getMonth(), d.getDate()].slice(0, sliceIndex).join('-');
- }.bind(this);
- var dateIsValid = panels.find(function (_ref3) {
- var cells = _ref3.cells;
- (0, _newArrowCheck3.default)(this, _this2);
- return cells.find(function (_ref4) {
- var date = _ref4.date,
- disabled = _ref4.disabled;
- (0, _newArrowCheck3.default)(this, _this2);
- return compareDate(date) === compareDate(this.focusedDate) && !disabled;
- }.bind(this));
- }.bind(this));
- if (dateIsValid) this.onPick(this.focusedDate, false, 'date');
- }
- }
- if (!arrows.includes(keyCode)) return;
- if (this.focusedTime.active) e.preventDefault();
- this.navigateDatePanel(keyValueMapper[keyCode], e.shiftKey);
- },
- reset: function reset() {
- this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset();
- },
- navigateTimePanel: function navigateTimePanel(direction) {
- var _this3 = this;
- this.focusedTime.active = true;
- var horizontal = direction.match(/left|right/);
- var vertical = direction.match(/up|down/);
- var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
- var maxNrOfColumns = (timePickers[0].showSeconds ? 3 : 2) * timePickers.length;
- var column = function (currentColumn) {
- (0, _newArrowCheck3.default)(this, _this3);
- var incremented = currentColumn + (horizontal ? direction === 'left' ? -1 : 1 : 0);
- return (incremented + maxNrOfColumns) % maxNrOfColumns;
- }.bind(this)(this.focusedTime.column);
- var columnsPerPicker = maxNrOfColumns / timePickers.length;
- var pickerIndex = Math.floor(column / columnsPerPicker);
- var col = column % columnsPerPicker;
- if (horizontal) {
- var time = this.internalValue.map(extractTime);
- this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
- column: column,
- time: time
- });
- timePickers.forEach(function (instance, i) {
- (0, _newArrowCheck3.default)(this, _this3);
- if (i === pickerIndex) instance.updateFocusedTime(col, time[pickerIndex]);else instance.updateFocusedTime(-1, instance.focusedTime);
- }.bind(this));
- }
- if (vertical) {
- var increment = direction === 'up' ? 1 : -1;
- var timeParts = ['hours', 'minutes', 'seconds'];
- var pickerPossibleValues = timePickers[pickerIndex][String(timeParts[col]) + 'List'];
- var currentIndex = pickerPossibleValues.findIndex(function (_ref5) {
- var text = _ref5.text;
- (0, _newArrowCheck3.default)(this, _this3);
- return this.focusedTime.time[pickerIndex][col] === text;
- }.bind(this));
- var nextIndex = (currentIndex + increment + pickerPossibleValues.length) % pickerPossibleValues.length;
- var nextValue = pickerPossibleValues[nextIndex].text;
- var times = this.focusedTime.time.map(function (time, i) {
- (0, _newArrowCheck3.default)(this, _this3);
- if (i !== pickerIndex) return time;
- time[col] = nextValue;
- return time;
- }.bind(this));
- this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
- time: times
- });
- timePickers.forEach(function (instance, i) {
- (0, _newArrowCheck3.default)(this, _this3);
- if (i === pickerIndex) instance.updateFocusedTime(col, times[i]);else instance.updateFocusedTime(-1, instance.focusedTime);
- }.bind(this));
- }
- },
- navigateDatePanel: function navigateDatePanel(direction, shift) {
- var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
- if (timePickers.length > 0) {
- this.navigateTimePanel(direction, shift, timePickers);
- return;
- }
- if (shift) {
- if (this.type === 'year') {
- this.focusedDate = new Date(this.focusedDate.getFullYear() + mapPossibleValues(direction, 0, 10), this.focusedDate.getMonth(), this.focusedDate.getDate());
- } else {
- this.focusedDate = new Date(this.focusedDate.getFullYear() + mapPossibleValues(direction, 0, 1), this.focusedDate.getMonth() + mapPossibleValues(direction, 1, 0), this.focusedDate.getDate());
- }
- var position = direction.match(/left|down/) ? 'prev' : 'next';
- var double = direction.match(/up|down/) ? '-double' : '';
- var button = this.$refs.drop.$el.querySelector('.ivu-date-picker-' + position + '-btn-arrow' + double);
- if (button) pulseElement(button);
- return;
- }
- var initialDate = this.focusedDate || this.internalValue && this.internalValue[0] || new Date();
- var focusedDate = new Date(initialDate);
- if (this.type.match(/^date/)) {
- var lastOfMonth = (0, _util.getDayCountOfMonth)(initialDate.getFullYear(), initialDate.getMonth());
- var startDay = initialDate.getDate();
- var nextDay = focusedDate.getDate() + mapPossibleValues(direction, 1, 7);
- if (nextDay < 1) {
- if (direction.match(/left|right/)) {
- focusedDate.setMonth(focusedDate.getMonth() + 1);
- focusedDate.setDate(nextDay);
- } else {
- focusedDate.setDate(startDay + Math.floor((lastOfMonth - startDay) / 7) * 7);
- }
- } else if (nextDay > lastOfMonth) {
- if (direction.match(/left|right/)) {
- focusedDate.setMonth(focusedDate.getMonth() - 1);
- focusedDate.setDate(nextDay);
- } else {
- focusedDate.setDate(startDay % 7);
- }
- } else {
- focusedDate.setDate(nextDay);
- }
- }
- if (this.type.match(/^month/)) {
- focusedDate.setMonth(focusedDate.getMonth() + mapPossibleValues(direction, 1, 3));
- }
- if (this.type.match(/^year/)) {
- focusedDate.setFullYear(focusedDate.getFullYear() + mapPossibleValues(direction, 1, 3));
- }
- this.focusedDate = focusedDate;
- },
- handleInputChange: function handleInputChange(event) {
- var _this4 = this;
- var isArrayValue = this.type.includes('range') || this.multiple;
- var oldValue = this.visualValue;
- var newValue = event.target.value;
- var newDate = this.parseDate(newValue);
- var disabledDateFn = this.options && typeof this.options.disabledDate === 'function' && this.options.disabledDate;
- var valueToTest = isArrayValue ? newDate : newDate[0];
- var isDisabled = disabledDateFn && disabledDateFn(valueToTest);
- var isValidDate = newDate.reduce(function (valid, date) {
- (0, _newArrowCheck3.default)(this, _this4);
- return valid && date instanceof Date;
- }.bind(this), true);
- if (newValue !== oldValue && !isDisabled && isValidDate) {
- this.emitChange(this.type);
- this.internalValue = newDate;
- } else {
- this.forceInputRerender++;
- }
- },
- handleInputMouseenter: function handleInputMouseenter() {
- if (this.readonly || this.itemDisabled) return;
- if (this.visualValue && this.clearable) {
- this.showClose = true;
- }
- },
- handleInputMouseleave: function handleInputMouseleave() {
- this.showClose = false;
- },
- handleIconClick: function handleIconClick(e) {
- if (this.showClose) {
- if (e) e.stopPropagation();
- this.handleClear();
- } else if (!this.itemDisabled) {
- this.handleFocus();
- }
- },
- handleClear: function handleClear() {
- var _this5 = this;
- this.visible = false;
- this.internalValue = this.internalValue.map(function () {
- (0, _newArrowCheck3.default)(this, _this5);
- return null;
- }.bind(this));
- this.$emit('on-clear');
- this.dispatch('FormItem', 'on-form-change', '');
- this.emitChange(this.type);
- this.reset();
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this5);
- return this.onSelectionModeChange(this.type);
- }.bind(this), 500);
- },
- emitChange: function emitChange(type) {
- var _this6 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this6);
- this.$emit('on-change', this.publicStringValue, type);
- this.dispatch('FormItem', 'on-form-change', this.publicStringValue);
- }.bind(this));
- },
- parseDate: function parseDate(val) {
- var _this7 = this;
- var isRange = this.type.includes('range');
- var type = this.type;
- var parser = (_util.TYPE_VALUE_RESOLVER_MAP[type] || _util.TYPE_VALUE_RESOLVER_MAP['default']).parser;
- var format = this.format || _util.DEFAULT_FORMATS[type];
- var multipleParser = _util.TYPE_VALUE_RESOLVER_MAP['multiple'].parser;
- if (val && type === 'time' && !(val instanceof Date)) {
- val = parser(val, format, this.separator);
- } else if (this.multiple && val) {
- val = multipleParser(val, format, this.separator);
- } else if (isRange) {
- if (!val) {
- val = [null, null];
- } else {
- if (typeof val === 'string') {
- val = parser(val, format, this.separator);
- } else if (type === 'timerange') {
- val = parser(val, format, this.separator).map(function (v) {
- (0, _newArrowCheck3.default)(this, _this7);
- return v || '';
- }.bind(this));
- } else {
- var _val = val,
- _val2 = (0, _slicedToArray3.default)(_val, 2),
- start = _val2[0],
- end = _val2[1];
- if (start instanceof Date && end instanceof Date) {
- val = val.map(function (date) {
- (0, _newArrowCheck3.default)(this, _this7);
- return new Date(date);
- }.bind(this));
- } else if (typeof start === 'string' && typeof end === 'string') {
- val = parser(val.join(this.separator), format, this.separator);
- } else if (!start || !end) {
- val = [null, null];
- }
- }
- }
- } else if (typeof val === 'string' && type.indexOf('time') !== 0) {
- val = parser(val, format) || null;
- }
- return isRange || this.multiple ? val || [] : [val];
- },
- formatDate: function formatDate(value) {
- var format = _util.DEFAULT_FORMATS[this.type];
- if (this.multiple) {
- var formatter = _util.TYPE_VALUE_RESOLVER_MAP.multiple.formatter;
- return formatter(value, this.format || format, this.separator);
- } else {
- var _ref6 = _util.TYPE_VALUE_RESOLVER_MAP[this.type] || _util.TYPE_VALUE_RESOLVER_MAP['default'],
- _formatter = _ref6.formatter;
- return _formatter(value, this.format || format, this.separator);
- }
- },
- onPick: function onPick(dates) {
- var _this8 = this;
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var type = arguments[2];
- if (this.multiple) {
- var pickedTimeStamp = dates.getTime();
- var indexOfPickedDate = this.internalValue.findIndex(function (date) {
- (0, _newArrowCheck3.default)(this, _this8);
- return date && date.getTime() === pickedTimeStamp;
- }.bind(this));
- var allDates = [].concat((0, _toConsumableArray3.default)(this.internalValue), [dates]).filter(Boolean);
- var timeStamps = allDates.map(function (date) {
- (0, _newArrowCheck3.default)(this, _this8);
- return date.getTime();
- }.bind(this)).filter(function (ts, i, arr) {
- (0, _newArrowCheck3.default)(this, _this8);
- return arr.indexOf(ts) === i && i !== indexOfPickedDate;
- }.bind(this));
- this.internalValue = timeStamps.map(function (ts) {
- (0, _newArrowCheck3.default)(this, _this8);
- return new Date(ts);
- }.bind(this));
- } else {
- dates = this.parseDate(dates);
- this.internalValue = Array.isArray(dates) ? dates : [dates];
- }
- if (this.internalValue[0]) this.focusedDate = this.internalValue[0];
- this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
- time: this.internalValue.map(extractTime)
- });
- if (!this.isConfirm) this.onSelectionModeChange(this.type);
- if (!this.isConfirm) this.visible = visible;
- this.emitChange(type);
- },
- onPickSuccess: function onPickSuccess() {
- this.visible = false;
- this.$emit('on-ok');
- this.focus();
- this.reset();
- },
- focus: function focus() {
- this.$refs.input && this.$refs.input.focus();
- },
- updatePopper: function updatePopper() {
- this.$refs.drop.update();
- }
- },
- watch: {
- visible: function visible(state) {
- if (state === false) {
- this.$refs.drop.destroy();
- }
- if (state) this.$refs.drop.update();
- this.$emit('on-open-change', state);
- },
- value: function value(val) {
- if (val === null) this.isValueNull = true;
- this.internalValue = this.parseDate(val);
- },
- open: function open(val) {
- this.visible = val === true;
- },
- type: function type(_type) {
- this.onSelectionModeChange(_type);
- },
- publicVModelValue: function publicVModelValue(now, before) {
- var newValue = (0, _stringify2.default)(now);
- var oldValue = (0, _stringify2.default)(before);
- var shouldEmitInput = newValue !== oldValue || (typeof now === 'undefined' ? 'undefined' : (0, _typeof3.default)(now)) !== (typeof before === 'undefined' ? 'undefined' : (0, _typeof3.default)(before));
- if (shouldEmitInput) {
- if (this.isValueNull) {
- this.isValueNull = false;
- this.$emit('input', null);
- } else {
- this.$emit('input', now);
- }
- }
- }
- },
- mounted: function mounted() {
- var _this9 = this;
- if (this.open !== null) this.visible = this.open;
- this.$on('focus-input', function () {
- (0, _newArrowCheck3.default)(this, _this9);
- return this.focus();
- }.bind(this));
- this.$on('update-popper', function () {
- (0, _newArrowCheck3.default)(this, _this9);
- return this.updatePopper();
- }.bind(this));
- },
- beforeDestroy: function beforeDestroy() {
- this.$off('focus-input');
- this.$off('update-popper');
- }
- };
- /***/ }),
- /* 159 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _dateTable = __webpack_require__(160);
- var _dateTable2 = _interopRequireDefault(_dateTable);
- var _yearTable = __webpack_require__(162);
- var _yearTable2 = _interopRequireDefault(_yearTable);
- var _monthTable = __webpack_require__(164);
- var _monthTable2 = _interopRequireDefault(_monthTable);
- var _time = __webpack_require__(166);
- var _time2 = _interopRequireDefault(_time);
- var _confirm = __webpack_require__(59);
- var _confirm2 = _interopRequireDefault(_confirm);
- var _datePanelLabel = __webpack_require__(171);
- var _datePanelLabel2 = _interopRequireDefault(_datePanelLabel);
- var _panelMixin = __webpack_require__(60);
- var _panelMixin2 = _interopRequireDefault(_panelMixin);
- var _datePanelMixin = __webpack_require__(173);
- var _datePanelMixin2 = _interopRequireDefault(_datePanelMixin);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _util = __webpack_require__(20);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker-panel';
- var datePrefixCls = 'ivu-date-picker';
- exports.default = {
- name: 'DatePickerPanel',
- mixins: [_panelMixin2.default, _locale2.default, _datePanelMixin2.default],
- components: { Icon: _icon2.default, DateTable: _dateTable2.default, YearTable: _yearTable2.default, MonthTable: _monthTable2.default, TimePicker: _time2.default, Confirm: _confirm2.default, datePanelLabel: _datePanelLabel2.default },
- props: {
- multiple: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- var selectionMode = this.selectionMode,
- value = this.value;
- var dates = value.slice().sort();
- return {
- prefixCls: prefixCls,
- datePrefixCls: datePrefixCls,
- currentView: selectionMode || 'date',
- pickerTable: this.getTableType(selectionMode),
- dates: dates,
- panelDate: this.startDate || dates[0] || new Date()
- };
- },
- computed: {
- classes: function classes() {
- return [prefixCls + '-body-wrapper', (0, _defineProperty3.default)({}, prefixCls + '-with-sidebar', this.shortcuts.length)];
- },
- panelPickerHandlers: function panelPickerHandlers() {
- return this.pickerTable === String(this.currentView) + '-table' ? this.handlePick : this.handlePreSelection;
- },
- datePanelLabel: function datePanelLabel() {
- var _this = this;
- var locale = this.t('i.locale');
- var datePanelLabel = this.t('i.datepicker.datePanelLabel');
- var date = this.panelDate;
- var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date),
- labels = _formatDateLabels.labels,
- separator = _formatDateLabels.separator;
- var handler = function (type) {
- (0, _newArrowCheck3.default)(this, _this);
- return function () {
- (0, _newArrowCheck3.default)(this, _this);
- return this.pickerTable = this.getTableType(type);
- }.bind(this);
- }.bind(this);
- return {
- separator: separator,
- labels: labels.map(function (obj) {
- (0, _newArrowCheck3.default)(this, _this);
- return obj.handler = handler(obj.type), obj;
- }.bind(this))
- };
- },
- timeDisabled: function timeDisabled() {
- return !this.dates[0];
- }
- },
- watch: {
- value: function value(newVal) {
- this.dates = newVal;
- var panelDate = this.multiple ? this.dates[this.dates.length - 1] : this.startDate || this.dates[0];
- this.panelDate = panelDate || new Date();
- },
- currentView: function currentView(_currentView) {
- var _this2 = this;
- this.$emit('on-selection-mode-change', _currentView);
- if (this.currentView === 'time') {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- var spinner = this.$refs.timePicker.$refs.timeSpinner;
- spinner.updateScroll();
- }.bind(this));
- }
- },
- selectionMode: function selectionMode(type) {
- this.currentView = type;
- this.pickerTable = this.getTableType(type);
- },
- focusedDate: function focusedDate(date) {
- var isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear();
- var isDifferentMonth = isDifferentYear || date.getMonth() !== this.panelDate.getMonth();
- if (isDifferentYear || isDifferentMonth) {
- if (!this.multiple) this.panelDate = date;
- }
- }
- },
- methods: {
- reset: function reset() {
- this.currentView = this.selectionMode;
- this.pickerTable = this.getTableType(this.currentView);
- },
- changeYear: function changeYear(dir) {
- if (this.selectionMode === 'year' || this.pickerTable === 'year-table') {
- this.panelDate = new Date(this.panelDate.getFullYear() + dir * 10, 0, 1);
- } else {
- this.panelDate = (0, _util.siblingMonth)(this.panelDate, dir * 12);
- }
- },
- getTableType: function getTableType(currentView) {
- return currentView.match(/^time/) ? 'time-picker' : String(currentView) + '-table';
- },
- changeMonth: function changeMonth(dir) {
- this.panelDate = (0, _util.siblingMonth)(this.panelDate, dir);
- },
- handlePreSelection: function handlePreSelection(value) {
- this.panelDate = value;
- if (this.pickerTable === 'year-table') this.pickerTable = 'month-table';else this.pickerTable = this.getTableType(this.currentView);
- },
- handlePick: function handlePick(value, type) {
- var selectionMode = this.selectionMode,
- panelDate = this.panelDate;
- if (selectionMode === 'year') value = new Date(value.getFullYear(), 0, 1);else if (selectionMode === 'month') value = new Date(panelDate.getFullYear(), value.getMonth(), 1);else value = new Date(value);
- this.dates = [value];
- this.$emit('on-pick', value, false, type || selectionMode);
- }
- }
- };
- /***/ }),
- /* 160 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__ = __webpack_require__(161);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__ = __webpack_require__(414);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 161 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _extends2 = __webpack_require__(32);
- var _extends3 = _interopRequireDefault(_extends2);
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _util = __webpack_require__(20);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _jsCalendar = __webpack_require__(410);
- var _jsCalendar2 = _interopRequireDefault(_jsCalendar);
- var _mixin = __webpack_require__(85);
- var _mixin2 = _interopRequireDefault(_mixin);
- var _prefixCls = __webpack_require__(86);
- var _prefixCls2 = _interopRequireDefault(_prefixCls);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- mixins: [_locale2.default, _mixin2.default],
- props: {
- showWeekNumbers: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: _prefixCls2.default
- };
- },
- computed: {
- classes: function classes() {
- return ['' + String(_prefixCls2.default), (0, _defineProperty3.default)({}, String(_prefixCls2.default) + '-show-week-numbers', this.showWeekNumbers)];
- },
- calendar: function calendar() {
- var weekStartDay = Number(this.t('i.datepicker.weekStartDay'));
- return new _jsCalendar2.default.Generator({ onlyDays: !this.showWeekNumbers, weekStart: weekStartDay });
- },
- headerDays: function headerDays() {
- var _this = this;
- var weekStartDay = Number(this.t('i.datepicker.weekStartDay'));
- var translatedDays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.t('i.datepicker.weeks.' + item);
- }.bind(this));
- var weekDays = translatedDays.splice(weekStartDay, 7 - weekStartDay).concat(translatedDays.splice(0, weekStartDay));
- return this.showWeekNumbers ? [''].concat(weekDays) : weekDays;
- },
- cells: function cells() {
- var _this2 = this;
- var tableYear = this.tableDate.getFullYear();
- var tableMonth = this.tableDate.getMonth();
- var today = (0, _util.clearHours)(new Date());
- var selectedDays = this.dates.filter(Boolean).map(_util.clearHours);
- var _dates$map = this.dates.map(_util.clearHours),
- _dates$map2 = (0, _slicedToArray3.default)(_dates$map, 2),
- minDay = _dates$map2[0],
- maxDay = _dates$map2[1];
- var rangeStart = this.rangeState.from && (0, _util.clearHours)(this.rangeState.from);
- var rangeEnd = this.rangeState.to && (0, _util.clearHours)(this.rangeState.to);
- var isRange = this.selectionMode === 'range';
- var disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate;
- return this.calendar(tableYear, tableMonth, function (cell) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000 + 480 * 60 * 1000);
- var time = cell.date && (0, _util.clearHours)(cell.date);
- var dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();
- return (0, _extends3.default)({}, cell, {
- type: time === today ? 'today' : cell.type,
- selected: dateIsInCurrentMonth && selectedDays.includes(time),
- disabled: cell.date && disabledTestFn && disabledTestFn(new Date(time)),
- range: dateIsInCurrentMonth && isRange && (0, _util.isInRange)(time, rangeStart, rangeEnd),
- start: dateIsInCurrentMonth && isRange && time === minDay,
- end: dateIsInCurrentMonth && isRange && time === maxDay
- });
- }.bind(this)).cells.slice(this.showWeekNumbers ? 8 : 0);
- }
- },
- methods: {
- getCellCls: function getCellCls(cell) {
- var _ref2;
- return [String(_prefixCls2.default) + '-cell', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-selected', cell.selected || cell.start || cell.end), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-today', cell.type === 'today'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-prev-month', cell.type === 'prevMonth'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-next-month', cell.type === 'nextMonth'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-week-label', cell.type === 'weekLabel'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-focused', (0, _util.clearHours)(cell.date) === (0, _util.clearHours)(this.focusedDate)), _ref2)];
- }
- }
- };
- /***/ }),
- /* 162 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__ = __webpack_require__(163);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__ = __webpack_require__(415);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 163 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _util = __webpack_require__(20);
- var _assist = __webpack_require__(3);
- var _mixin = __webpack_require__(85);
- var _mixin2 = _interopRequireDefault(_mixin);
- var _prefixCls = __webpack_require__(86);
- var _prefixCls2 = _interopRequireDefault(_prefixCls);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- mixins: [_mixin2.default],
- props: {},
- computed: {
- classes: function classes() {
- return ['' + String(_prefixCls2.default), String(_prefixCls2.default) + '-year'];
- },
- startYear: function startYear() {
- return Math.floor(this.tableDate.getFullYear() / 10) * 10;
- },
- cells: function cells() {
- var _this = this;
- var cells = [];
- var cell_tmpl = {
- text: '',
- selected: false,
- disabled: false
- };
- var selectedDays = this.dates.filter(Boolean).map(function (date) {
- (0, _newArrowCheck3.default)(this, _this);
- return (0, _util.clearHours)(new Date(date.getFullYear(), 0, 1));
- }.bind(this));
- var focusedDate = (0, _util.clearHours)(new Date(this.focusedDate.getFullYear(), 0, 1));
- for (var i = 0; i < 10; i++) {
- var cell = (0, _assist.deepCopy)(cell_tmpl);
- cell.date = new Date(this.startYear + i, 0, 1);
- cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'year';
- var day = (0, _util.clearHours)(cell.date);
- cell.selected = selectedDays.includes(day);
- cell.focused = day === focusedDate;
- cells.push(cell);
- }
- return cells;
- }
- },
- methods: {
- getCellCls: function getCellCls(cell) {
- var _ref;
- return [String(_prefixCls2.default) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), _ref)];
- }
- }
- };
- /***/ }),
- /* 164 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__ = __webpack_require__(165);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__ = __webpack_require__(416);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 165 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _util = __webpack_require__(20);
- var _assist = __webpack_require__(3);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _mixin = __webpack_require__(85);
- var _mixin2 = _interopRequireDefault(_mixin);
- var _prefixCls = __webpack_require__(86);
- var _prefixCls2 = _interopRequireDefault(_prefixCls);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- mixins: [_locale2.default, _mixin2.default],
- props: {},
- computed: {
- classes: function classes() {
- return ['' + String(_prefixCls2.default), String(_prefixCls2.default) + '-month'];
- },
- cells: function cells() {
- var _this = this;
- var cells = [];
- var cell_tmpl = {
- text: '',
- selected: false,
- disabled: false
- };
- var tableYear = this.tableDate.getFullYear();
- var selectedDays = this.dates.filter(Boolean).map(function (date) {
- (0, _newArrowCheck3.default)(this, _this);
- return (0, _util.clearHours)(new Date(date.getFullYear(), date.getMonth(), 1));
- }.bind(this));
- var focusedDate = (0, _util.clearHours)(new Date(this.focusedDate.getFullYear(), this.focusedDate.getMonth(), 1));
- for (var i = 0; i < 12; i++) {
- var cell = (0, _assist.deepCopy)(cell_tmpl);
- cell.date = new Date(tableYear, i, 1);
- cell.text = this.tCell(i + 1);
- var day = (0, _util.clearHours)(cell.date);
- cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'month';
- cell.selected = selectedDays.includes(day);
- cell.focused = day === focusedDate;
- cells.push(cell);
- }
- return cells;
- }
- },
- methods: {
- getCellCls: function getCellCls(cell) {
- var _ref;
- return [String(_prefixCls2.default) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), _ref)];
- },
- tCell: function tCell(nr) {
- return this.t('i.datepicker.months.m' + String(nr));
- }
- }
- };
- /***/ }),
- /* 166 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(167);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(419);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 167 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _timeSpinner = __webpack_require__(168);
- var _timeSpinner2 = _interopRequireDefault(_timeSpinner);
- var _confirm = __webpack_require__(59);
- var _confirm2 = _interopRequireDefault(_confirm);
- var _timeMixins = __webpack_require__(58);
- var _timeMixins2 = _interopRequireDefault(_timeMixins);
- var _panelMixin = __webpack_require__(60);
- var _panelMixin2 = _interopRequireDefault(_panelMixin);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _util = __webpack_require__(20);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker-panel';
- var timePrefixCls = 'ivu-time-picker';
- var capitalize = function (str) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return str[0].toUpperCase() + str.slice(1);
- }.bind(undefined);
- var mergeDateHMS = function (date, hours, minutes, seconds) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var newDate = new Date(date.getTime());
- newDate.setHours(hours);
- newDate.setMinutes(minutes);
- newDate.setSeconds(seconds);
- return newDate;
- }.bind(undefined);
- var unique = function (el, i, arr) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return arr.indexOf(el) === i;
- }.bind(undefined);
- var returnFalse = function () {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return false;
- }.bind(undefined);
- exports.default = {
- name: 'TimePickerPanel',
- mixins: [_panelMixin2.default, _locale2.default, _timeMixins2.default],
- components: { TimeSpinner: _timeSpinner2.default, Confirm: _confirm2.default },
- props: {
- disabledDate: {
- type: Function,
- default: returnFalse
- },
- steps: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- format: {
- type: String,
- default: 'HH:mm:ss'
- },
- value: {
- type: Array,
- required: true
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- timePrefixCls: timePrefixCls,
- date: this.value[0] || (0, _util.initTimeDate)(),
- showDate: false
- };
- },
- computed: {
- showSeconds: function showSeconds() {
- return !!(this.format || '').match(/ss/);
- },
- visibleDate: function visibleDate() {
- var date = this.date;
- var month = date.getMonth() + 1;
- var tYear = this.t('i.datepicker.year');
- var tMonth = this.t('i.datepicker.month' + String(month));
- return '' + String(date.getFullYear()) + String(tYear) + ' ' + String(tMonth);
- },
- timeSlots: function timeSlots() {
- var _this = this;
- if (!this.value[0]) return [];
- return ['getHours', 'getMinutes', 'getSeconds'].map(function (slot) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.date[slot]();
- }.bind(this));
- },
- disabledHMS: function disabledHMS() {
- var _this2 = this;
- var disabledTypes = ['disabledHours', 'disabledMinutes', 'disabledSeconds'];
- if (this.disabledDate === returnFalse || !this.value[0]) {
- var disabled = disabledTypes.reduce(function (obj, type) {
- (0, _newArrowCheck3.default)(this, _this2);
- return obj[type] = this[type], obj;
- }.bind(this), {});
- return disabled;
- } else {
- var slots = [24, 60, 60];
- var _disabled = ['Hours', 'Minutes', 'Seconds'].map(function (type) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this['disabled' + String(type)];
- }.bind(this));
- var disabledHMS = _disabled.map(function (preDisabled, j) {
- (0, _newArrowCheck3.default)(this, _this2);
- var slot = slots[j];
- var toDisable = preDisabled;
- var _loop = function _loop(i) {
- var hms = _this2.timeSlots.map(function (slot, x) {
- (0, _newArrowCheck3.default)(this, _this2);
- return x === j ? i : slot;
- }.bind(_this2));
- var testDateTime = mergeDateHMS.apply(undefined, [_this2.date].concat((0, _toConsumableArray3.default)(hms)));
- if (_this2.disabledDate(testDateTime, true)) toDisable.push(i);
- };
- for (var i = 0; i < slot; i += this.steps[j] || 1) {
- _loop(i);
- }
- return toDisable.filter(unique);
- }.bind(this));
- return disabledTypes.reduce(function (obj, type, i) {
- (0, _newArrowCheck3.default)(this, _this2);
- return obj[type] = disabledHMS[i], obj;
- }.bind(this), {});
- }
- }
- },
- watch: {
- value: function value(dates) {
- var newVal = dates[0] || (0, _util.initTimeDate)();
- newVal = new Date(newVal);
- this.date = newVal;
- }
- },
- methods: {
- handleChange: function handleChange(date) {
- var _this3 = this;
- var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var newDate = new Date(this.date);
- (0, _keys2.default)(date).forEach(function (type) {
- (0, _newArrowCheck3.default)(this, _this3);
- return newDate['set' + String(capitalize(type))](date[type]);
- }.bind(this));
- if (emit) this.$emit('on-pick', newDate, 'time');
- }
- },
- mounted: function mounted() {
- if (this.$parent && this.$parent.$options.name === 'DatePicker') this.showDate = true;
- }
- };
- /***/ }),
- /* 168 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__ = __webpack_require__(169);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__ = __webpack_require__(417);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 169 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _extends3 = __webpack_require__(32);
- var _extends4 = _interopRequireDefault(_extends3);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _timeMixins = __webpack_require__(58);
- var _timeMixins2 = _interopRequireDefault(_timeMixins);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-time-picker-cells';
- var timeParts = ['hours', 'minutes', 'seconds'];
- exports.default = {
- name: 'TimeSpinner',
- mixins: [_timeMixins2.default],
- props: {
- hours: {
- type: [Number, String],
- default: NaN
- },
- minutes: {
- type: [Number, String],
- default: NaN
- },
- seconds: {
- type: [Number, String],
- default: NaN
- },
- showSeconds: {
- type: Boolean,
- default: true
- },
- steps: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- }
- },
- data: function data() {
- var _this = this;
- return {
- spinerSteps: [1, 1, 1].map(function (one, i) {
- (0, _newArrowCheck3.default)(this, _this);
- return Math.abs(this.steps[i]) || one;
- }.bind(this)),
- prefixCls: prefixCls,
- compiled: false,
- focusedColumn: -1,
- focusedTime: [0, 0, 0] };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-with-seconds', this.showSeconds)];
- },
- hoursList: function hoursList() {
- var hours = [];
- var step = this.spinerSteps[0];
- var focusedHour = this.focusedColumn === 0 && this.focusedTime[0];
- var hour_tmpl = {
- text: 0,
- selected: false,
- disabled: false,
- hide: false
- };
- for (var i = 0; i < 24; i += step) {
- var hour = (0, _assist.deepCopy)(hour_tmpl);
- hour.text = i;
- hour.focused = i === focusedHour;
- if (this.disabledHours.length && this.disabledHours.indexOf(i) > -1) {
- hour.disabled = true;
- if (this.hideDisabledOptions) hour.hide = true;
- }
- if (this.hours === i) hour.selected = true;
- hours.push(hour);
- }
- return hours;
- },
- minutesList: function minutesList() {
- var minutes = [];
- var step = this.spinerSteps[1];
- var focusedMinute = this.focusedColumn === 1 && this.focusedTime[1];
- var minute_tmpl = {
- text: 0,
- selected: false,
- disabled: false,
- hide: false
- };
- for (var i = 0; i < 60; i += step) {
- var minute = (0, _assist.deepCopy)(minute_tmpl);
- minute.text = i;
- minute.focused = i === focusedMinute;
- if (this.disabledMinutes.length && this.disabledMinutes.indexOf(i) > -1) {
- minute.disabled = true;
- if (this.hideDisabledOptions) minute.hide = true;
- }
- if (this.minutes === i) minute.selected = true;
- minutes.push(minute);
- }
- return minutes;
- },
- secondsList: function secondsList() {
- var seconds = [];
- var step = this.spinerSteps[2];
- var focusedMinute = this.focusedColumn === 2 && this.focusedTime[2];
- var second_tmpl = {
- text: 0,
- selected: false,
- disabled: false,
- hide: false
- };
- for (var i = 0; i < 60; i += step) {
- var second = (0, _assist.deepCopy)(second_tmpl);
- second.text = i;
- second.focused = i === focusedMinute;
- if (this.disabledSeconds.length && this.disabledSeconds.indexOf(i) > -1) {
- second.disabled = true;
- if (this.hideDisabledOptions) second.hide = true;
- }
- if (this.seconds === i) second.selected = true;
- seconds.push(second);
- }
- return seconds;
- }
- },
- methods: {
- getCellCls: function getCellCls(cell) {
- var _ref2;
- return [prefixCls + '-cell', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-disabled', cell.disabled), _ref2)];
- },
- chooseValue: function chooseValue(values) {
- var _this2 = this;
- var changes = timeParts.reduce(function (obj, part, i) {
- (0, _newArrowCheck3.default)(this, _this2);
- var value = values[i];
- if (this[part] === value) return obj;
- return (0, _extends4.default)({}, obj, (0, _defineProperty3.default)({}, part, value));
- }.bind(this), {});
- if ((0, _keys2.default)(changes).length > 0) {
- this.emitChange(changes);
- }
- },
- handleClick: function handleClick(type, cell) {
- if (cell.disabled) return;
- var data = (0, _defineProperty3.default)({}, type, cell.text);
- this.emitChange(data);
- },
- emitChange: function emitChange(changes) {
- this.$emit('on-change', changes);
- this.$emit('on-pick-click');
- },
- scroll: function scroll(type, index) {
- var from = this.$refs[type].scrollTop;
- var to = 24 * this.getScrollIndex(type, index);
- (0, _assist.scrollTop)(this.$refs[type], from, to, 500);
- },
- getScrollIndex: function getScrollIndex(type, index) {
- var _this3 = this;
- var Type = (0, _assist.firstUpperCase)(type);
- var disabled = this['disabled' + String(Type)];
- if (disabled.length && this.hideDisabledOptions) {
- var _count = 0;
- disabled.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return item <= index ? _count++ : '';
- }.bind(this));
- index -= _count;
- }
- return index;
- },
- updateScroll: function updateScroll() {
- var _this4 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this4);
- timeParts.forEach(function (type) {
- (0, _newArrowCheck3.default)(this, _this4);
- this.$refs[type].scrollTop = 24 * this[String(type) + 'List'].findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this4);
- return obj.text == this[type];
- }.bind(this));
- }.bind(this));
- }.bind(this));
- },
- formatTime: function formatTime(text) {
- return text < 10 ? '0' + text : text;
- },
- updateFocusedTime: function updateFocusedTime(col, time) {
- this.focusedColumn = col;
- this.focusedTime = time.slice();
- }
- },
- watch: {
- hours: function hours(val) {
- var _this5 = this;
- if (!this.compiled) return;
- this.scroll('hours', this.hoursList.findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this5);
- return obj.text == val;
- }.bind(this)));
- },
- minutes: function minutes(val) {
- var _this6 = this;
- if (!this.compiled) return;
- this.scroll('minutes', this.minutesList.findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this6);
- return obj.text == val;
- }.bind(this)));
- },
- seconds: function seconds(val) {
- var _this7 = this;
- if (!this.compiled) return;
- this.scroll('seconds', this.secondsList.findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this7);
- return obj.text == val;
- }.bind(this)));
- },
- focusedTime: function focusedTime(updated, old) {
- var _this8 = this;
- timeParts.forEach(function (part, i) {
- (0, _newArrowCheck3.default)(this, _this8);
- if (updated[i] === old[i] || typeof updated[i] === 'undefined') return;
- var valueIndex = this[String(part) + 'List'].findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this8);
- return obj.text === updated[i];
- }.bind(this));
- this.scroll(part, valueIndex);
- }.bind(this));
- }
- },
- mounted: function mounted() {
- var _this9 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this9);
- return this.compiled = true;
- }.bind(this));
- }
- };
- /***/ }),
- /* 170 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker';
- exports.default = {
- mixins: [_locale2.default, _emitter2.default],
- components: { iButton: _button2.default },
- props: {
- showTime: false,
- isTime: false,
- timeDisabled: false
- },
- data: function data() {
- return {
- prefixCls: prefixCls
- };
- },
- computed: {
- timeClasses: function timeClasses() {
- return prefixCls + '-confirm-time';
- },
- labels: function labels() {
- var _this = this;
- var labels = ['time', 'clear', 'ok'];
- var values = [this.isTime ? 'selectDate' : 'selectTime', 'clear', 'ok'];
- return labels.reduce(function (obj, key, i) {
- (0, _newArrowCheck3.default)(this, _this);
- obj[key] = this.t('i.datepicker.' + values[i]);
- return obj;
- }.bind(this), {});
- }
- },
- methods: {
- handleClear: function handleClear() {
- this.$emit('on-pick-clear');
- },
- handleSuccess: function handleSuccess() {
- this.$emit('on-pick-success');
- },
- handleToggleTime: function handleToggleTime() {
- if (this.timeDisabled) return;
- this.$emit('on-pick-toggle-time');
- this.dispatch('CalendarPicker', 'focus-input');
- this.dispatch('CalendarPicker', 'update-popper');
- },
- handleTab: function handleTab(e) {
- var tabbables = [].concat((0, _toConsumableArray3.default)(this.$el.children));
- var expectedFocus = tabbables[e.shiftKey ? 'shift' : 'pop']();
- if (document.activeElement === expectedFocus) {
- e.preventDefault();
- e.stopPropagation();
- this.dispatch('CalendarPicker', 'focus-input');
- }
- }
- }
- };
- /***/ }),
- /* 171 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__ = __webpack_require__(172);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__ = __webpack_require__(420);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 172 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- props: {
- datePanelLabel: Object,
- currentView: String,
- datePrefixCls: String
- }
- };
- /***/ }),
- /* 173 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assist = __webpack_require__(3);
- var _util = __webpack_require__(20);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- props: {
- showTime: {
- type: Boolean,
- default: false
- },
- format: {
- type: String,
- default: 'yyyy-MM-dd'
- },
- selectionMode: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['year', 'month', 'date', 'time']);
- },
- default: 'date'
- },
- shortcuts: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- disabledDate: {
- type: Function,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return false;
- }.bind(undefined)
- },
- value: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [(0, _util.initTimeDate)(), (0, _util.initTimeDate)()];
- }.bind(undefined)
- },
- timePickerOptions: {
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return {};
- }.bind(undefined),
- type: Object
- },
- showWeekNumbers: {
- type: Boolean,
- default: false
- },
- startDate: {
- type: Date
- },
- pickerType: {
- type: String,
- require: true
- },
- focusedDate: {
- type: Date,
- required: true
- }
- },
- computed: {
- isTime: function isTime() {
- return this.currentView === 'time';
- }
- },
- methods: {
- handleToggleTime: function handleToggleTime() {
- this.currentView = this.currentView === 'time' ? 'date' : 'time';
- }
- }
- };
- /***/ }),
- /* 174 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _dateTable = __webpack_require__(160);
- var _dateTable2 = _interopRequireDefault(_dateTable);
- var _yearTable = __webpack_require__(162);
- var _yearTable2 = _interopRequireDefault(_yearTable);
- var _monthTable = __webpack_require__(164);
- var _monthTable2 = _interopRequireDefault(_monthTable);
- var _timeRange = __webpack_require__(175);
- var _timeRange2 = _interopRequireDefault(_timeRange);
- var _confirm = __webpack_require__(59);
- var _confirm2 = _interopRequireDefault(_confirm);
- var _util = __webpack_require__(20);
- var _datePanelLabel = __webpack_require__(171);
- var _datePanelLabel2 = _interopRequireDefault(_datePanelLabel);
- var _panelMixin = __webpack_require__(60);
- var _panelMixin2 = _interopRequireDefault(_panelMixin);
- var _datePanelMixin = __webpack_require__(173);
- var _datePanelMixin2 = _interopRequireDefault(_datePanelMixin);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker-panel';
- var datePrefixCls = 'ivu-date-picker';
- var dateSorter = function (a, b) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (!a || !b) return 0;
- return a.getTime() - b.getTime();
- }.bind(undefined);
- exports.default = {
- name: 'RangeDatePickerPanel',
- mixins: [_panelMixin2.default, _locale2.default, _datePanelMixin2.default],
- components: { Icon: _icon2.default, DateTable: _dateTable2.default, YearTable: _yearTable2.default, MonthTable: _monthTable2.default, TimePicker: _timeRange2.default, Confirm: _confirm2.default, datePanelLabel: _datePanelLabel2.default },
- props: {
- splitPanels: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- var _this = this;
- var _value$map = this.value.map(function (date) {
- (0, _newArrowCheck3.default)(this, _this);
- return date || (0, _util.initTimeDate)();
- }.bind(this)),
- _value$map2 = (0, _slicedToArray3.default)(_value$map, 2),
- minDate = _value$map2[0],
- maxDate = _value$map2[1];
- var leftPanelDate = this.startDate ? this.startDate : minDate;
- return {
- prefixCls: prefixCls,
- datePrefixCls: datePrefixCls,
- dates: this.value,
- rangeState: { from: this.value[0], to: this.value[1], selecting: minDate && !maxDate },
- currentView: this.selectionMode || 'range',
- leftPickerTable: String(this.selectionMode) + '-table',
- rightPickerTable: String(this.selectionMode) + '-table',
- leftPanelDate: leftPanelDate,
- rightPanelDate: new Date(leftPanelDate.getFullYear(), leftPanelDate.getMonth() + 1, 1)
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return [prefixCls + '-body-wrapper', datePrefixCls + '-with-range', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-sidebar', this.shortcuts.length), (0, _defineProperty3.default)(_ref, datePrefixCls + '-with-week-numbers', this.showWeekNumbers), _ref)];
- },
- panelBodyClasses: function panelBodyClasses() {
- var _ref2;
- return [prefixCls + '-body', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-body-time', this.showTime), (0, _defineProperty3.default)(_ref2, prefixCls + '-body-date', !this.showTime), _ref2)];
- },
- leftDatePanelLabel: function leftDatePanelLabel() {
- return this.panelLabelConfig('left');
- },
- rightDatePanelLabel: function rightDatePanelLabel() {
- return this.panelLabelConfig('right');
- },
- leftDatePanelView: function leftDatePanelView() {
- return this.leftPickerTable.split('-').shift();
- },
- rightDatePanelView: function rightDatePanelView() {
- return this.rightPickerTable.split('-').shift();
- },
- timeDisabled: function timeDisabled() {
- return !(this.dates[0] && this.dates[1]);
- },
- preSelecting: function preSelecting() {
- var tableType = String(this.currentView) + '-table';
- return {
- left: this.leftPickerTable !== tableType,
- right: this.rightPickerTable !== tableType
- };
- },
- panelPickerHandlers: function panelPickerHandlers() {
- return {
- left: this.preSelecting.left ? this.handlePreSelection.bind(this, 'left') : this.handleRangePick,
- right: this.preSelecting.right ? this.handlePreSelection.bind(this, 'right') : this.handleRangePick
- };
- }
- },
- watch: {
- value: function value(newVal) {
- var minDate = newVal[0] ? (0, _util.toDate)(newVal[0]) : null;
- var maxDate = newVal[1] ? (0, _util.toDate)(newVal[1]) : null;
- this.dates = [minDate, maxDate].sort(dateSorter);
- this.rangeState = {
- from: this.dates[0],
- to: this.dates[1],
- selecting: false
- };
- this.setPanelDates(this.startDate || this.dates[0] || new Date());
- },
- currentView: function currentView(_currentView) {
- var leftMonth = this.leftPanelDate.getMonth();
- var rightMonth = this.rightPanelDate.getMonth();
- var isSameYear = this.leftPanelDate.getFullYear() === this.rightPanelDate.getFullYear();
- if (_currentView === 'date' && isSameYear && leftMonth === rightMonth) {
- this.changePanelDate('right', 'Month', 1);
- }
- if (_currentView === 'month' && isSameYear) {
- this.changePanelDate('right', 'FullYear', 1);
- }
- if (_currentView === 'year' && isSameYear) {
- this.changePanelDate('right', 'FullYear', 10);
- }
- },
- selectionMode: function selectionMode(type) {
- this.currentView = type || 'range';
- },
- focusedDate: function focusedDate(date) {
- this.setPanelDates(date || new Date());
- }
- },
- methods: {
- reset: function reset() {
- this.currentView = this.selectionMode;
- this.leftPickerTable = String(this.currentView) + '-table';
- this.rightPickerTable = String(this.currentView) + '-table';
- },
- setPanelDates: function setPanelDates(leftPanelDate) {
- this.leftPanelDate = leftPanelDate;
- var rightPanelDate = new Date(leftPanelDate.getFullYear(), leftPanelDate.getMonth() + 1, 1);
- var splitRightPanelDate = this.dates[1] ? this.dates[1].getTime() : this.dates[1];
- this.rightPanelDate = this.splitPanels ? new Date(Math.max(splitRightPanelDate, rightPanelDate.getTime())) : rightPanelDate;
- },
- panelLabelConfig: function panelLabelConfig(direction) {
- var _this2 = this;
- var locale = this.t('i.locale');
- var datePanelLabel = this.t('i.datepicker.datePanelLabel');
- var handler = function (type) {
- (0, _newArrowCheck3.default)(this, _this2);
- var fn = type == 'month' ? this.showMonthPicker : this.showYearPicker;
- return function () {
- (0, _newArrowCheck3.default)(this, _this2);
- return fn(direction);
- }.bind(this);
- }.bind(this);
- var date = this[String(direction) + 'PanelDate'];
- var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date),
- labels = _formatDateLabels.labels,
- separator = _formatDateLabels.separator;
- return {
- separator: separator,
- labels: labels.map(function (obj) {
- (0, _newArrowCheck3.default)(this, _this2);
- return obj.handler = handler(obj.type), obj;
- }.bind(this))
- };
- },
- prevYear: function prevYear(panel) {
- var increment = this.currentView === 'year' ? -10 : -1;
- this.changePanelDate(panel, 'FullYear', increment);
- },
- nextYear: function nextYear(panel) {
- var increment = this.currentView === 'year' ? 10 : 1;
- this.changePanelDate(panel, 'FullYear', increment);
- },
- prevMonth: function prevMonth(panel) {
- this.changePanelDate(panel, 'Month', -1);
- },
- nextMonth: function nextMonth(panel) {
- this.changePanelDate(panel, 'Month', 1);
- },
- changePanelDate: function changePanelDate(panel, type, increment) {
- var updateOtherPanel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- var current = new Date(this[String(panel) + 'PanelDate']);
- if (type === 'FullYear') current['set' + type](current['get' + type]() + increment);else current['set' + type](current['get' + type]() + increment, 1);
- this[String(panel) + 'PanelDate'] = current;
- if (!updateOtherPanel) return;
- if (this.splitPanels) {
- var otherPanel = panel === 'left' ? 'right' : 'left';
- if (panel === 'left' && this.leftPanelDate >= this.rightPanelDate) {
- this.changePanelDate(otherPanel, type, 1);
- }
- if (panel === 'right' && this.rightPanelDate <= this.leftPanelDate) {
- this.changePanelDate(otherPanel, type, -1);
- }
- } else {
- var _otherPanel = panel === 'left' ? 'right' : 'left';
- var currentDate = this[_otherPanel + 'PanelDate'];
- var temp = new Date(currentDate);
- if (type === 'Month') {
- var nextMonthLastDate = new Date(temp.getFullYear(), temp.getMonth() + increment + 1, 0).getDate();
- temp.setDate(Math.min(nextMonthLastDate, temp.getDate()));
- }
- temp['set' + String(type)](temp['get' + String(type)]() + increment);
- this[_otherPanel + 'PanelDate'] = temp;
- }
- },
- showYearPicker: function showYearPicker(panel) {
- this[String(panel) + 'PickerTable'] = 'year-table';
- },
- showMonthPicker: function showMonthPicker(panel) {
- this[String(panel) + 'PickerTable'] = 'month-table';
- },
- handlePreSelection: function handlePreSelection(panel, value) {
- this[String(panel) + 'PanelDate'] = value;
- var currentViewType = this[String(panel) + 'PickerTable'];
- if (currentViewType === 'year-table') this[String(panel) + 'PickerTable'] = 'month-table';else this[String(panel) + 'PickerTable'] = String(this.currentView) + '-table';
- if (!this.splitPanels) {
- var otherPanel = panel === 'left' ? 'right' : 'left';
- this[otherPanel + 'PanelDate'] = value;
- var increment = otherPanel === 'left' ? -1 : 1;
- this.changePanelDate(otherPanel, 'Month', increment, false);
- }
- },
- handleRangePick: function handleRangePick(val, type) {
- if (this.rangeState.selecting || this.currentView === 'time') {
- if (this.currentView === 'time') {
- this.dates = val;
- } else {
- var _sort = [this.rangeState.from, val].sort(dateSorter),
- _sort2 = (0, _slicedToArray3.default)(_sort, 2),
- minDate = _sort2[0],
- maxDate = _sort2[1];
- this.dates = [minDate, maxDate];
- this.rangeState = {
- from: minDate,
- to: maxDate,
- selecting: false
- };
- }
- this.handleConfirm(false, type || 'date');
- } else {
- this.rangeState = {
- from: val,
- to: null,
- selecting: true
- };
- }
- },
- handleChangeRange: function handleChangeRange(val) {
- this.rangeState.to = val;
- }
- }
- };
- /***/ }),
- /* 175 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__ = __webpack_require__(176);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__ = __webpack_require__(423);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 176 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _timeSpinner = __webpack_require__(168);
- var _timeSpinner2 = _interopRequireDefault(_timeSpinner);
- var _confirm = __webpack_require__(59);
- var _confirm2 = _interopRequireDefault(_confirm);
- var _timeMixins = __webpack_require__(58);
- var _timeMixins2 = _interopRequireDefault(_timeMixins);
- var _panelMixin = __webpack_require__(60);
- var _panelMixin2 = _interopRequireDefault(_panelMixin);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _util = __webpack_require__(20);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-picker-panel';
- var timePrefixCls = 'ivu-time-picker';
- var capitalize = function (str) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return str[0].toUpperCase() + str.slice(1);
- }.bind(undefined);
- exports.default = {
- name: 'RangeTimePickerPanel',
- mixins: [_panelMixin2.default, _locale2.default, _timeMixins2.default],
- components: { TimeSpinner: _timeSpinner2.default, Confirm: _confirm2.default },
- props: {
- steps: {
- type: Array,
- default: function _default() {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return [];
- }.bind(undefined)
- },
- format: {
- type: String,
- default: 'HH:mm:ss'
- },
- value: {
- type: Array,
- required: true
- }
- },
- data: function data() {
- var _value$slice = this.value.slice(),
- _value$slice2 = (0, _slicedToArray3.default)(_value$slice, 2),
- dateStart = _value$slice2[0],
- dateEnd = _value$slice2[1];
- return {
- prefixCls: prefixCls,
- timePrefixCls: timePrefixCls,
- showDate: false,
- dateStart: dateStart || (0, _util.initTimeDate)(),
- dateEnd: dateEnd || (0, _util.initTimeDate)()
- };
- },
- computed: {
- classes: function classes() {
- return [prefixCls + '-body-wrapper', timePrefixCls + '-with-range', (0, _defineProperty3.default)({}, timePrefixCls + '-with-seconds', this.showSeconds)];
- },
- showSeconds: function showSeconds() {
- return !!(this.format || '').match(/ss/);
- },
- leftDatePanelLabel: function leftDatePanelLabel() {
- return this.panelLabelConfig(this.date);
- },
- rightDatePanelLabel: function rightDatePanelLabel() {
- return this.panelLabelConfig(this.dateEnd);
- }
- },
- watch: {
- value: function value(dates) {
- var _dates$slice = dates.slice(),
- _dates$slice2 = (0, _slicedToArray3.default)(_dates$slice, 2),
- dateStart = _dates$slice2[0],
- dateEnd = _dates$slice2[1];
- this.dateStart = dateStart || (0, _util.initTimeDate)();
- this.dateEnd = dateEnd || (0, _util.initTimeDate)();
- }
- },
- methods: {
- panelLabelConfig: function panelLabelConfig(date) {
- var locale = this.t('i.locale');
- var datePanelLabel = this.t('i.datepicker.datePanelLabel');
- var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date || (0, _util.initTimeDate)()),
- labels = _formatDateLabels.labels,
- separator = _formatDateLabels.separator;
- return [labels[0].label, separator, labels[1].label].join('');
- },
- handleChange: function handleChange(start, end) {
- var _this = this;
- var emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- var dateStart = new Date(this.dateStart);
- var dateEnd = new Date(this.dateEnd);
- (0, _keys2.default)(start).forEach(function (type) {
- (0, _newArrowCheck3.default)(this, _this);
- dateStart['set' + String(capitalize(type))](start[type]);
- }.bind(this));
- (0, _keys2.default)(end).forEach(function (type) {
- (0, _newArrowCheck3.default)(this, _this);
- dateEnd['set' + String(capitalize(type))](end[type]);
- }.bind(this));
- if (dateEnd < dateStart) dateEnd = dateStart;
- if (emit) this.$emit('on-pick', [dateStart, dateEnd], 'time');
- },
- handleStartChange: function handleStartChange(date) {
- this.handleChange(date, {});
- },
- handleEndChange: function handleEndChange(date) {
- this.handleChange({}, date);
- },
- updateScroll: function updateScroll() {
- this.$refs.timeSpinner.updateScroll();
- this.$refs.timeSpinnerEnd.updateScroll();
- }
- },
- mounted: function mounted() {
- if (this.$parent && this.$parent.$options.name === 'DatePicker') this.showDate = true;
- }
- };
- /***/ }),
- /* 177 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-divider';
- exports.default = {
- name: 'Divider',
- props: {
- type: {
- type: String,
- default: 'horizontal',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
- }
- },
- orientation: {
- type: String,
- default: 'center',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['left', 'right', 'center']);
- }
- },
- dashed: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'default']);
- },
- default: 'default'
- },
- plain: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- hasSlot: function hasSlot() {
- return !!this.$slots.default;
- },
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.type), prefixCls + '-' + String(this.size), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-text', this.hasSlot && this.orientation === 'center'), (0, _defineProperty3.default)(_ref, prefixCls + '-with-text-' + String(this.orientation), this.hasSlot), (0, _defineProperty3.default)(_ref, prefixCls + '-dashed', !!this.dashed), (0, _defineProperty3.default)(_ref, prefixCls + '-plain', this.plain), _ref)];
- },
- slotClasses: function slotClasses() {
- return [prefixCls + '-inner-text'];
- }
- }
- };
- /***/ }),
- /* 178 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _mixinsScrollbar = __webpack_require__(87);
- var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
- var _dom = __webpack_require__(12);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-drawer';
- exports.default = {
- name: 'Drawer',
- mixins: [_emitter2.default, _mixinsScrollbar2.default],
- components: { Icon: _icon2.default },
- directives: { TransferDom: _transferDom2.default },
- props: {
- value: {
- type: Boolean,
- default: false
- },
- title: {
- type: String
- },
- width: {
- type: [Number, String],
- default: 256
- },
- height: {
- type: [Number, String],
- default: 256
- },
- closable: {
- type: Boolean,
- default: true
- },
- maskClosable: {
- type: Boolean,
- default: true
- },
- mask: {
- type: Boolean,
- default: true
- },
- maskStyle: {
- type: Object
- },
- styles: {
- type: Object
- },
- scrollable: {
- type: Boolean,
- default: false
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['left', 'right', 'top', 'bottom']);
- },
- default: 'right'
- },
- zIndex: {
- type: Number,
- default: 1000
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
- }
- },
- className: {
- type: String
- },
- inner: {
- type: Boolean,
- default: false
- },
- draggable: {
- type: Boolean,
- default: false
- },
- beforeClose: Function
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- visible: this.value,
- wrapShow: false,
- showHead: true,
- canMove: false,
- dragWidth: this.width,
- dragHeight: this.height,
- wrapperWidth: this.width,
- wrapperHeight: this.height,
- wrapperLeft: 0,
- minWidth: 256,
- minHeight: 256
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrap', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hidden', !this.wrapShow), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-mask', !this.mask), (0, _defineProperty3.default)(_ref, prefixCls + '-wrap-inner', this.inner), (0, _defineProperty3.default)(_ref, prefixCls + '-wrap-dragging', this.canMove), _ref)];
- },
- mainStyles: function mainStyles() {
- var style = {};
- if (this.placement === 'left' || this.placement === 'right') {
- var width = parseInt(this.dragWidth);
- var styleWidth = {
- width: width <= 100 ? String(width) + '%' : String(width) + 'px'
- };
- (0, _assign2.default)(style, styleWidth);
- } else {
- var height = parseInt(this.dragHeight);
- var styleHeight = {
- height: height <= 100 ? String(height) + '%' : String(height) + 'px'
- };
- (0, _assign2.default)(style, styleHeight);
- }
- return style;
- },
- contentClasses: function contentClasses() {
- return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-no-mask', !this.mask)];
- },
- classes: function classes() {
- var _ref3;
- return ['' + prefixCls, prefixCls + '-' + String(this.placement), (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-no-header', !this.showHead), (0, _defineProperty3.default)(_ref3, prefixCls + '-inner', this.inner), _ref3)];
- },
- maskClasses: function maskClasses() {
- return [prefixCls + '-mask', (0, _defineProperty3.default)({}, prefixCls + '-mask-inner', this.inner)];
- },
- transitionName: function transitionName() {
- if (this.placement === 'left' || this.placement === 'right') return 'move-' + String(this.placement);else if (this.placement === 'top') return 'move-up';else return 'move-down';
- }
- },
- methods: {
- close: function close() {
- var _this = this;
- if (!this.beforeClose) {
- return this.handleClose();
- }
- var before = this.beforeClose();
- if (before && before.then) {
- before.then(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.handleClose();
- }.bind(this));
- } else {
- this.handleClose();
- }
- },
- handleClose: function handleClose() {
- this.visible = false;
- this.$emit('input', false);
- this.$emit('on-close');
- },
- handleMask: function handleMask() {
- if (this.maskClosable && this.mask) {
- this.close();
- }
- },
- handleWrapClick: function handleWrapClick(event) {
- var className = event.target.getAttribute('class');
- if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
- },
- handleMousemove: function handleMousemove(event) {
- if (!this.canMove || !this.draggable) return;
- this.handleSetWrapperWidth();
- var left = event.pageX - this.wrapperLeft;
- var width = this.placement === 'right' ? this.wrapperWidth - left : left;
- width = Math.max(width, parseFloat(this.minWidth));
- event.atMin = width === parseFloat(this.minWidth);
- if (width <= 100) width = width / this.wrapperWidth * 100;
- this.dragWidth = width;
- this.$emit('on-resize-width', parseInt(this.dragWidth));
- },
- handleSetWrapperWidth: function handleSetWrapperWidth() {
- var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
- width = _$el$getBoundingClien.width,
- left = _$el$getBoundingClien.left;
- this.wrapperWidth = width;
- this.wrapperLeft = left;
- },
- handleMouseup: function handleMouseup() {
- if (!this.draggable) return;
- this.canMove = false;
- },
- handleTriggerMousedown: function handleTriggerMousedown() {
- this.canMove = true;
- window.getSelection().removeAllRanges();
- }
- },
- mounted: function mounted() {
- if (this.visible) {
- this.wrapShow = true;
- }
- var showHead = true;
- if (this.$slots.header === undefined && !this.title) {
- showHead = false;
- }
- this.showHead = showHead;
- (0, _dom.on)(document, 'mousemove', this.handleMousemove);
- (0, _dom.on)(document, 'mouseup', this.handleMouseup);
- this.handleSetWrapperWidth();
- },
- beforeDestroy: function beforeDestroy() {
- (0, _dom.off)(document, 'mousemove', this.handleMousemove);
- (0, _dom.off)(document, 'mouseup', this.handleMouseup);
- this.removeScrollEffect();
- },
- watch: {
- value: function value(val) {
- this.visible = val;
- },
- visible: function visible(val) {
- var _this2 = this;
- if (val === false) {
- this.timer = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.wrapShow = false;
- var brotherDrawers = (0, _assist.findBrothersComponents)(this, 'Drawer') || [];
- var parentDrawers = (0, _assist.findComponentsUpward)(this, 'Drawer') || [];
- var otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
- var isScrollDrawer = otherDrawers.some(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- return item.visible && !item.scrollable;
- }.bind(this));
- if (!isScrollDrawer) {
- this.removeScrollEffect();
- }
- }.bind(this), 300);
- } else {
- if (this.timer) clearTimeout(this.timer);
- this.wrapShow = true;
- if (!this.scrollable) {
- this.addScrollEffect();
- }
- }
- this.broadcast('Table', 'on-visible-change', val);
- this.broadcast('Slider', 'on-visible-change', val);
- this.$emit('on-visible-change', val);
- },
- scrollable: function scrollable(val) {
- if (!val) {
- this.addScrollEffect();
- } else {
- this.removeScrollEffect();
- }
- },
- title: function title(val) {
- if (this.$slots.header === undefined) {
- this.showHead = !!val;
- }
- },
- width: function width(val) {
- this.dragWidth = val;
- },
- height: function height(val) {
- this.dragHeight = val;
- }
- }
- };
- /***/ }),
- /* 179 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _clickoutside = __webpack_require__(82);
- var _clickoutside2 = _interopRequireDefault(_clickoutside);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-dropdown';
- exports.default = {
- name: 'Dropdown',
- directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
- components: { Drop: _dropdown2.default },
- props: {
- trigger: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['click', 'hover', 'custom', 'contextMenu']);
- },
- default: 'hover'
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
- },
- default: 'bottom'
- },
- visible: {
- type: Boolean,
- default: false
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- transferClassName: {
- type: String
- },
- stopPropagation: {
- type: Boolean,
- default: false
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? true : this.$IVIEW.capture;
- }
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- transition: function transition() {
- return ['bottom-start', 'bottom', 'bottom-end'].indexOf(this.placement) > -1 ? 'slide-up' : 'fade';
- },
- dropdownCls: function dropdownCls() {
- var _ref;
- return _ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref, this.transferClassName, this.transferClassName), _ref;
- },
- relClasses: function relClasses() {
- return [prefixCls + '-rel', (0, _defineProperty3.default)({}, prefixCls + '-rel-user-select-none', this.trigger === 'contextMenu')];
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- currentVisible: this.visible
- };
- },
- watch: {
- visible: function visible(val) {
- this.currentVisible = val;
- },
- currentVisible: function currentVisible(val) {
- if (val) {
- this.$refs.drop.update();
- } else {
- this.$refs.drop.destroy();
- }
- this.$emit('on-visible-change', val);
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'click') {
- return false;
- }
- var $parent = this.hasParent();
- if (!$parent) this.currentVisible = !this.currentVisible;
- },
- handleRightClick: function handleRightClick() {
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'contextMenu') {
- return false;
- }
- this.currentVisible = !this.currentVisible;
- },
- handleMouseenter: function handleMouseenter() {
- var _this = this;
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'hover') {
- return false;
- }
- if (this.timeout) clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.currentVisible = true;
- }.bind(this), 250);
- },
- handleMouseleave: function handleMouseleave() {
- var _this2 = this;
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'hover') {
- return false;
- }
- if (this.timeout) {
- clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.currentVisible = false;
- }.bind(this), 150);
- }
- },
- onClickoutside: function onClickoutside(e) {
- this.handleClose();
- this.handleRightClose();
- if (this.currentVisible) this.$emit('on-clickoutside', e);
- },
- handleClose: function handleClose() {
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'click') {
- return false;
- }
- this.currentVisible = false;
- },
- handleRightClose: function handleRightClose() {
- if (this.trigger === 'custom') return false;
- if (this.trigger !== 'contextMenu') {
- return false;
- }
- this.currentVisible = false;
- },
- hasParent: function hasParent() {
- var $parent = (0, _assist.findComponentUpward)(this, 'Dropdown');
- if ($parent) {
- return $parent;
- } else {
- return false;
- }
- }
- },
- mounted: function mounted() {
- var _this3 = this;
- this.$on('on-click', function (key) {
- (0, _newArrowCheck3.default)(this, _this3);
- if (this.stopPropagation) return;
- var $parent = this.hasParent();
- if ($parent) $parent.$emit('on-click', key);
- }.bind(this));
- this.$on('on-hover-click', function () {
- (0, _newArrowCheck3.default)(this, _this3);
- var $parent = this.hasParent();
- if ($parent) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- if (this.trigger === 'custom') return false;
- this.currentVisible = false;
- }.bind(this));
- $parent.$emit('on-hover-click');
- } else {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- if (this.trigger === 'custom') return false;
- this.currentVisible = false;
- }.bind(this));
- }
- }.bind(this));
- this.$on('on-haschild-click', function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- if (this.trigger === 'custom') return false;
- this.currentVisible = true;
- }.bind(this));
- var $parent = this.hasParent();
- if ($parent) $parent.$emit('on-haschild-click');
- }.bind(this));
- }
- };
- /***/ }),
- /* 180 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- name: 'DropdownMenu'
- };
- /***/ }),
- /* 181 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-dropdown-item';
- exports.default = {
- name: 'DropdownItem',
- props: {
- name: {
- type: [String, Number]
- },
- disabled: {
- type: Boolean,
- default: false
- },
- selected: {
- type: Boolean,
- default: false
- },
- divided: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected), (0, _defineProperty3.default)(_ref, prefixCls + '-divided', this.divided), _ref)];
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.disabled) return;
- var $parent = (0, _assist.findComponentUpward)(this, 'Dropdown');
- var hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
- if (hasChildren) {
- this.$parent.$emit('on-haschild-click');
- } else {
- if ($parent && $parent.$options.name === 'Dropdown') {
- $parent.$emit('on-hover-click');
- }
- }
- $parent.$emit('on-click', this.name);
- }
- }
- };
- /***/ }),
- /* 182 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__ = __webpack_require__(183);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__ = __webpack_require__(437);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 183 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var prefixCls = 'ivu-layout';
- exports.default = {
- name: 'Footer',
- computed: {
- wrapClasses: function wrapClasses() {
- return prefixCls + '-footer';
- }
- }
- };
- /***/ }),
- /* 184 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _promise = __webpack_require__(185);
- var _promise2 = _interopRequireDefault(_promise);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-form';
- exports.default = {
- name: 'iForm',
- props: {
- model: {
- type: Object
- },
- rules: {
- type: Object
- },
- labelWidth: {
- type: Number
- },
- labelPosition: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['left', 'right', 'top']);
- },
- default: 'right'
- },
- inline: {
- type: Boolean,
- default: false
- },
- showMessage: {
- type: Boolean,
- default: true
- },
- autocomplete: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['on', 'off']);
- },
- default: 'off'
- },
- hideRequiredMark: {
- type: Boolean,
- default: false
- },
- labelColon: {
- type: [Boolean, String],
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- }
- },
- provide: function provide() {
- return { FormInstance: this };
- },
- data: function data() {
- return {
- fields: []
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-label-' + String(this.labelPosition), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-inline', this.inline), (0, _defineProperty3.default)(_ref, prefixCls + '-hide-required-mark', this.hideRequiredMark), _ref)];
- },
- colon: function colon() {
- var colon = '';
- if (this.labelColon) {
- colon = typeof this.labelColon === 'boolean' ? ':' : this.labelColon;
- }
- return colon;
- }
- },
- methods: {
- resetFields: function resetFields() {
- var _this = this;
- this.fields.forEach(function (field) {
- (0, _newArrowCheck3.default)(this, _this);
- field.resetField();
- }.bind(this));
- },
- validate: function validate(callback) {
- var _this2 = this;
- return new _promise2.default(function (resolve) {
- (0, _newArrowCheck3.default)(this, _this2);
- var valid = true;
- var count = 0;
- if (this.fields.length === 0) {
- resolve(valid);
- if (typeof callback === 'function') {
- callback(valid);
- }
- }
- this.fields.forEach(function (field) {
- (0, _newArrowCheck3.default)(this, _this2);
- field.validate('', function (errors) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (errors) {
- valid = false;
- }
- if (++count === this.fields.length) {
- resolve(valid);
- if (typeof callback === 'function') {
- callback(valid);
- }
- }
- }.bind(this));
- }.bind(this));
- }.bind(this));
- },
- validateField: function validateField(prop, cb) {
- var _this3 = this;
- var field = this.fields.filter(function (field) {
- (0, _newArrowCheck3.default)(this, _this3);
- return field.prop === prop;
- }.bind(this))[0];
- if (!field) {
- throw new Error('[iView warn]: must call validateField with valid prop string!');
- }
- field.validate('', cb);
- }
- },
- watch: {
- rules: function rules() {
- this.validate();
- }
- },
- created: function created() {
- var _this4 = this;
- this.$on('on-form-item-add', function (field) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (field) this.fields.push(field);
- return false;
- }.bind(this));
- this.$on('on-form-item-remove', function (field) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (field.prop) this.fields.splice(this.fields.indexOf(field), 1);
- return false;
- }.bind(this));
- }
- };
- /***/ }),
- /* 185 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(440), __esModule: true };
- /***/ }),
- /* 186 */
- /***/ (function(module, exports, __webpack_require__) {
- // 7.3.20 SpeciesConstructor(O, defaultConstructor)
- var anObject = __webpack_require__(22);
- var aFunction = __webpack_require__(43);
- var SPECIES = __webpack_require__(10)('species');
- module.exports = function (O, D) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
- };
- /***/ }),
- /* 187 */
- /***/ (function(module, exports, __webpack_require__) {
- var ctx = __webpack_require__(24);
- var invoke = __webpack_require__(442);
- var html = __webpack_require__(105);
- var cel = __webpack_require__(69);
- var global = __webpack_require__(9);
- var process = global.process;
- var setTask = global.setImmediate;
- var clearTask = global.clearImmediate;
- var MessageChannel = global.MessageChannel;
- var Dispatch = global.Dispatch;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var defer, channel, port;
- var run = function () {
- var id = +this;
- // eslint-disable-next-line no-prototype-builtins
- if (queue.hasOwnProperty(id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var listener = function (event) {
- run.call(event.data);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!setTask || !clearTask) {
- setTask = 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
- invoke(typeof fn == 'function' ? fn : Function(fn), args);
- };
- defer(counter);
- return counter;
- };
- clearTask = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (__webpack_require__(41)(process) == 'process') {
- defer = function (id) {
- process.nextTick(ctx(run, id, 1));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(ctx(run, id, 1));
- };
- // Browsers with MessageChannel, includes WebWorkers
- } else if (MessageChannel) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = ctx(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) {
- defer = function (id) {
- global.postMessage(id + '', '*');
- };
- global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in cel('script')) {
- defer = function (id) {
- html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run.call(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(ctx(run, id, 1), 0);
- };
- }
- }
- module.exports = {
- set: setTask,
- clear: clearTask
- };
- /***/ }),
- /* 188 */
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return { e: false, v: exec() };
- } catch (e) {
- return { e: true, v: e };
- }
- };
- /***/ }),
- /* 189 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(22);
- var isObject = __webpack_require__(18);
- var newPromiseCapability = __webpack_require__(89);
- 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;
- };
- /***/ }),
- /* 190 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(9);
- var core = __webpack_require__(5);
- var dP = __webpack_require__(14);
- var DESCRIPTORS = __webpack_require__(13);
- var SPECIES = __webpack_require__(10)('species');
- module.exports = function (KEY) {
- var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
- if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- };
- /***/ }),
- /* 191 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _asyncValidator = __webpack_require__(449);
- var _asyncValidator2 = _interopRequireDefault(_asyncValidator);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-form-item';
- function getPropByPath(obj, path) {
- var tempObj = obj;
- path = path.replace(/\[(\w+)\]/g, '.$1');
- path = path.replace(/^\./, '');
- var keyArr = path.split('.');
- var i = 0;
- for (var len = keyArr.length; i < len - 1; ++i) {
- var key = keyArr[i];
- if (key in tempObj) {
- tempObj = tempObj[key];
- } else {
- throw new Error('[iView warn]: please transfer a valid prop path to form item!');
- }
- }
- return {
- o: tempObj,
- k: keyArr[i],
- v: tempObj[keyArr[i]]
- };
- }
- exports.default = {
- name: 'FormItem',
- mixins: [_emitter2.default],
- props: {
- label: {
- type: String,
- default: ''
- },
- labelWidth: {
- type: Number
- },
- prop: {
- type: String
- },
- required: {
- type: Boolean,
- default: false
- },
- rules: {
- type: [Object, Array]
- },
- error: {
- type: String
- },
- validateStatus: {
- type: Boolean
- },
- showMessage: {
- type: Boolean,
- default: true
- },
- labelFor: {
- type: String
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- isRequired: false,
- validateState: '',
- validateMessage: '',
- validateDisabled: false,
- validator: {}
- };
- },
- watch: {
- error: {
- handler: function handler(val) {
- this.validateMessage = val;
- this.validateState = val ? 'error' : '';
- },
- immediate: true
- },
- validateStatus: function validateStatus(val) {
- this.validateState = val;
- },
- rules: function rules() {
- this.setRules();
- },
- required: function required(n, o) {
- this.isRequired = n;
- if (o && !n) {
- this.resetField();
- }
- }
- },
- inject: ['FormInstance'],
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-required', this.required || this.isRequired), (0, _defineProperty3.default)(_ref, prefixCls + '-error', this.validateState === 'error'), (0, _defineProperty3.default)(_ref, prefixCls + '-validating', this.validateState === 'validating'), _ref)];
- },
- fieldValue: function fieldValue() {
- var model = this.FormInstance.model;
- if (!model || !this.prop) {
- return;
- }
- var path = this.prop;
- if (path.indexOf(':') !== -1) {
- path = path.replace(/:/, '.');
- }
- return getPropByPath(model, path).v;
- },
- labelStyles: function labelStyles() {
- var style = {};
- var labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.FormInstance.labelWidth;
- if (labelWidth || labelWidth === 0) {
- style.width = String(labelWidth) + 'px';
- }
- return style;
- },
- contentStyles: function contentStyles() {
- var style = {};
- var labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.FormInstance.labelWidth;
- if (labelWidth || labelWidth === 0) {
- style.marginLeft = String(labelWidth) + 'px';
- }
- return style;
- }
- },
- methods: {
- setRules: function setRules() {
- var _this = this;
- var rules = this.getRules();
- if (rules.length && this.required) {
- return;
- } else if (rules.length) {
- rules.every(function (rule) {
- (0, _newArrowCheck3.default)(this, _this);
- this.isRequired = rule.required;
- }.bind(this));
- } else if (this.required) {
- this.isRequired = this.required;
- }
- this.$off('on-form-blur', this.onFieldBlur);
- this.$off('on-form-change', this.onFieldChange);
- this.$on('on-form-blur', this.onFieldBlur);
- this.$on('on-form-change', this.onFieldChange);
- },
- getRules: function getRules() {
- var formRules = this.FormInstance.rules;
- var selfRules = this.rules;
- formRules = formRules ? formRules[this.prop] : [];
- return [].concat(selfRules || formRules || []);
- },
- getFilteredRule: function getFilteredRule(trigger) {
- var _this2 = this;
- var rules = this.getRules();
- return rules.filter(function (rule) {
- (0, _newArrowCheck3.default)(this, _this2);
- return !rule.trigger || rule.trigger.indexOf(trigger) !== -1;
- }.bind(this));
- },
- validate: function validate(trigger) {
- var _this3 = this;
- var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
- var rules = this.getFilteredRule(trigger);
- if (!rules || rules.length === 0) {
- if (!this.required) {
- callback();
- return true;
- } else {
- rules = [{ required: true }];
- }
- }
- this.validateState = 'validating';
- var descriptor = {};
- descriptor[this.prop] = rules;
- var validator = new _asyncValidator2.default(descriptor);
- var model = {};
- model[this.prop] = this.fieldValue;
- validator.validate(model, { firstFields: true }, function (errors) {
- (0, _newArrowCheck3.default)(this, _this3);
- this.validateState = !errors ? 'success' : 'error';
- this.validateMessage = errors ? errors[0].message : '';
- callback(this.validateMessage);
- this.FormInstance && this.FormInstance.$emit('on-validate', this.prop, !errors, this.validateMessage || null);
- }.bind(this));
- this.validateDisabled = false;
- },
- resetField: function resetField() {
- this.validateState = '';
- this.validateMessage = '';
- var model = this.FormInstance.model;
- var value = this.fieldValue;
- var path = this.prop;
- if (path.indexOf(':') !== -1) {
- path = path.replace(/:/, '.');
- }
- var prop = getPropByPath(model, path);
- if (Array.isArray(value) && this.initialValue !== null) {
- this.validateDisabled = true;
- prop.o[prop.k] = [].concat(this.initialValue);
- } else {
- this.validateDisabled = true;
- prop.o[prop.k] = this.initialValue;
- }
- },
- onFieldBlur: function onFieldBlur() {
- this.validate('blur');
- },
- onFieldChange: function onFieldChange() {
- if (this.validateDisabled) {
- this.validateDisabled = false;
- return;
- }
- this.validate('change');
- }
- },
- mounted: function mounted() {
- if (this.prop) {
- this.dispatch('iForm', 'on-form-item-add', this);
- Object.defineProperty(this, 'initialValue', {
- value: this.fieldValue
- });
- this.setRules();
- }
- },
- beforeDestroy: function beforeDestroy() {
- this.dispatch('iForm', 'on-form-item-remove', this);
- }
- };
- /***/ }),
- /* 192 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__ = __webpack_require__(193);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__ = __webpack_require__(453);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 193 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var prefixCls = 'ivu-layout';
- exports.default = {
- name: 'Header',
- computed: {
- wrapClasses: function wrapClasses() {
- return prefixCls + '-header';
- }
- }
- };
- /***/ }),
- /* 194 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__ = __webpack_require__(195);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__ = __webpack_require__(456);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 195 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-input-number';
- var iconPrefixCls = 'ivu-icon';
- function addNum(num1, num2) {
- var sq1 = void 0,
- sq2 = void 0,
- m = void 0;
- try {
- sq1 = num1.toString().split('.')[1].length;
- } catch (e) {
- sq1 = 0;
- }
- try {
- sq2 = num2.toString().split('.')[1].length;
- } catch (e) {
- sq2 = 0;
- }
- m = Math.pow(10, Math.max(sq1, sq2));
- return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
- }
- exports.default = {
- name: 'InputNumber',
- mixins: [_emitter2.default, _form2.default],
- props: {
- max: {
- type: Number,
- default: Infinity
- },
- min: {
- type: Number,
- default: -Infinity
- },
- step: {
- type: Number,
- default: 1
- },
- activeChange: {
- type: Boolean,
- default: true
- },
- value: {
- type: Number,
- default: 1
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- disabled: {
- type: Boolean,
- default: false
- },
- autofocus: {
- type: Boolean,
- default: false
- },
- readonly: {
- type: Boolean,
- default: false
- },
- editable: {
- type: Boolean,
- default: true
- },
- name: {
- type: String
- },
- precision: {
- type: Number
- },
- elementId: {
- type: String
- },
- formatter: {
- type: Function
- },
- parser: {
- type: Function
- },
- placeholder: {
- type: String,
- default: ''
- },
- controlsOutside: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- focused: false,
- upDisabled: false,
- downDisabled: false,
- currentValue: this.value
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-focused', this.focused), (0, _defineProperty3.default)(_ref, prefixCls + '-controls-outside', this.controlsOutside), _ref)];
- },
- handlerClasses: function handlerClasses() {
- return prefixCls + '-handler-wrap';
- },
- upClasses: function upClasses() {
- return [prefixCls + '-handler', prefixCls + '-handler-up', (0, _defineProperty3.default)({}, prefixCls + '-handler-up-disabled', this.upDisabled)];
- },
- innerUpClasses: function innerUpClasses() {
- return prefixCls + '-handler-up-inner ' + iconPrefixCls + ' ' + iconPrefixCls + '-ios-arrow-up';
- },
- downClasses: function downClasses() {
- return [prefixCls + '-handler', prefixCls + '-handler-down', (0, _defineProperty3.default)({}, prefixCls + '-handler-down-disabled', this.downDisabled)];
- },
- innerDownClasses: function innerDownClasses() {
- return prefixCls + '-handler-down-inner ' + iconPrefixCls + ' ' + iconPrefixCls + '-ios-arrow-down';
- },
- inputWrapClasses: function inputWrapClasses() {
- return prefixCls + '-input-wrap';
- },
- inputClasses: function inputClasses() {
- return prefixCls + '-input';
- },
- precisionValue: function precisionValue() {
- if (!this.currentValue) return this.currentValue;
- return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
- },
- formatterValue: function formatterValue() {
- if (this.formatter && this.precisionValue !== null) {
- return this.formatter(this.precisionValue);
- } else {
- return this.precisionValue;
- }
- }
- },
- methods: {
- preventDefault: function preventDefault(e) {
- e.preventDefault();
- },
- up: function up(e) {
- var targetVal = Number(e.target.value);
- if (this.upDisabled && isNaN(targetVal)) {
- return false;
- }
- this.changeStep('up', e);
- },
- down: function down(e) {
- var targetVal = Number(e.target.value);
- if (this.downDisabled && isNaN(targetVal)) {
- return false;
- }
- this.changeStep('down', e);
- },
- changeStep: function changeStep(type, e) {
- if (this.itemDisabled || this.readonly) {
- return false;
- }
- var targetVal = Number(e.target.value);
- var val = Number(this.currentValue);
- var step = Number(this.step);
- if (isNaN(val)) {
- return false;
- }
- if (!isNaN(targetVal)) {
- if (type === 'up') {
- if (addNum(targetVal, step) <= this.max) {
- val = targetVal;
- } else {
- return false;
- }
- } else if (type === 'down') {
- if (addNum(targetVal, -step) >= this.min) {
- val = targetVal;
- } else {
- return false;
- }
- }
- }
- if (type === 'up') {
- val = addNum(val, step);
- } else if (type === 'down') {
- val = addNum(val, -step);
- }
- this.setValue(val);
- },
- setValue: function setValue(val) {
- var _this = this;
- if (val && !isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
- var min = this.min,
- max = this.max;
- if (val !== null) {
- if (val > max) {
- val = max;
- } else if (val < min) {
- val = min;
- }
- }
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.currentValue = val;
- this.$emit('input', val);
- this.$emit('on-change', val);
- this.dispatch('FormItem', 'on-form-change', val);
- }.bind(this));
- },
- focus: function focus(event) {
- this.focused = true;
- this.$emit('on-focus', event);
- },
- blur: function blur() {
- this.focused = false;
- this.$emit('on-blur');
- if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
- this.dispatch('FormItem', 'on-form-blur', this.currentValue);
- }
- },
- keyDown: function keyDown(e) {
- if (e.keyCode === 38) {
- e.preventDefault();
- this.up(e);
- } else if (e.keyCode === 40) {
- e.preventDefault();
- this.down(e);
- }
- },
- change: function change(event) {
- if (event.type == 'change' && this.activeChange) return;
- if (event.type == 'input' && !this.activeChange) return;
- var val = event.target.value.trim();
- if (this.parser) {
- val = this.parser(val);
- }
- var isEmptyString = val.length === 0;
- if (isEmptyString) {
- this.setValue(null);
- return;
- }
- if (event.type == 'input' && val.match(/^\-?\.?$|\.$/)) return;
- val = Number(val);
- if (!isNaN(val)) {
- this.currentValue = val;
- this.setValue(val);
- } else {
- event.target.value = this.currentValue;
- }
- },
- changeVal: function changeVal(val) {
- val = Number(val);
- if (!isNaN(val)) {
- var step = this.step;
- this.upDisabled = val + step > this.max;
- this.downDisabled = val - step < this.min;
- } else {
- this.upDisabled = true;
- this.downDisabled = true;
- }
- }
- },
- mounted: function mounted() {
- this.changeVal(this.currentValue);
- },
- watch: {
- value: function value(val) {
- this.currentValue = val;
- },
- currentValue: function currentValue(val) {
- this.changeVal(val);
- },
- min: function min() {
- this.changeVal(this.currentValue);
- },
- max: function max() {
- this.changeVal(this.currentValue);
- }
- }
- };
- /***/ }),
- /* 196 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _sign = __webpack_require__(459);
- var _sign2 = _interopRequireDefault(_sign);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _promise = __webpack_require__(185);
- var _promise2 = _interopRequireDefault(_promise);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _lodash = __webpack_require__(463);
- var _lodash2 = _interopRequireDefault(_lodash);
- var _loadingComponent = __webpack_require__(464);
- var _loadingComponent2 = _interopRequireDefault(_loadingComponent);
- var _dom = __webpack_require__(12);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-scroll';
- var dragConfig = {
- sensitivity: 10,
- minimumStartDragOffset: 5 };
- var noop = function () {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return _promise2.default.resolve();
- }.bind(undefined);
- exports.default = {
- name: 'Scroll',
- mixins: [_locale2.default],
- components: { loader: _loadingComponent2.default },
- props: {
- height: {
- type: [Number, String],
- default: 300
- },
- onReachTop: {
- type: Function
- },
- onReachBottom: {
- type: Function
- },
- onReachEdge: {
- type: Function
- },
- loadingText: {
- type: String
- },
- distanceToEdge: [Number, Array],
- stopSlide: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- var _this = this;
- var distanceToEdge = this.calculateProximityThreshold();
- return {
- showTopLoader: false,
- showBottomLoader: false,
- showBodyLoader: false,
- lastScroll: 0,
- reachedTopScrollLimit: true,
- reachedBottomScrollLimit: false,
- topRubberPadding: 0,
- bottomRubberPadding: 0,
- rubberRollBackTimeout: false,
- isLoading: false,
- pointerTouchDown: null,
- touchScroll: false,
- handleScroll: function handleScroll() {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this),
- pointerUpHandler: function pointerUpHandler() {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this),
- pointerMoveHandler: function pointerMoveHandler() {
- (0, _newArrowCheck3.default)(this, _this);
- }.bind(this),
- topProximityThreshold: distanceToEdge[0],
- bottomProximityThreshold: distanceToEdge[1]
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- return prefixCls + '-wrapper';
- },
- scrollContainerClasses: function scrollContainerClasses() {
- return [prefixCls + '-container', (0, _defineProperty3.default)({}, prefixCls + '-container-loading', this.showBodyLoader && this.stopSlide)];
- },
- slotContainerClasses: function slotContainerClasses() {
- return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-loading', this.showBodyLoader)];
- },
- loaderClasses: function loaderClasses() {
- return prefixCls + '-loader';
- },
- wrapperPadding: function wrapperPadding() {
- return {
- paddingTop: this.topRubberPadding + 'px',
- paddingBottom: this.bottomRubberPadding + 'px'
- };
- },
- localeLoadingText: function localeLoadingText() {
- if (this.loadingText === undefined) {
- return this.t('i.select.loading');
- } else {
- return this.loadingText;
- }
- }
- },
- methods: {
- waitOneSecond: function waitOneSecond() {
- var _this2 = this;
- return new _promise2.default(function (resolve) {
- (0, _newArrowCheck3.default)(this, _this2);
- setTimeout(resolve, 1000);
- }.bind(this));
- },
- calculateProximityThreshold: function calculateProximityThreshold() {
- var dte = this.distanceToEdge;
- if (typeof dte == 'undefined') return [20, 20];
- return Array.isArray(dte) ? dte : [dte, dte];
- },
- onCallback: function onCallback(dir) {
- var _this3 = this;
- this.isLoading = true;
- this.showBodyLoader = true;
- if (dir > 0) {
- this.showTopLoader = true;
- this.topRubberPadding = 20;
- } else {
- (function () {
- _this3.showBottomLoader = true;
- _this3.bottomRubberPadding = 20;
- var bottomLoaderHeight = 0;
- var container = _this3.$refs.scrollContainer;
- var initialScrollTop = container.scrollTop;
- for (var i = 0; i < 20; i++) {
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- bottomLoaderHeight = Math.max(bottomLoaderHeight, this.$refs.bottomLoader.getBoundingClientRect().height);
- container.scrollTop = initialScrollTop + bottomLoaderHeight;
- }.bind(_this3), i * 50);
- }
- })();
- }
- var callbacks = [this.waitOneSecond(), this.onReachEdge ? this.onReachEdge(dir) : noop()];
- callbacks.push(dir > 0 ? this.onReachTop ? this.onReachTop() : noop() : this.onReachBottom ? this.onReachBottom() : noop());
- var tooSlow = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.reset();
- }.bind(this), 5000);
- _promise2.default.all(callbacks).then(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- clearTimeout(tooSlow);
- this.reset();
- }.bind(this));
- },
- reset: function reset() {
- var _this4 = this;
- ['showTopLoader', 'showBottomLoader', 'showBodyLoader', 'isLoading', 'reachedTopScrollLimit', 'reachedBottomScrollLimit'].forEach(function (prop) {
- (0, _newArrowCheck3.default)(this, _this4);
- return this[prop] = false;
- }.bind(this));
- this.lastScroll = 0;
- this.topRubberPadding = 0;
- this.bottomRubberPadding = 0;
- clearInterval(this.rubberRollBackTimeout);
- if (this.touchScroll) {
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this4);
- (0, _dom.off)(window, 'touchend', this.pointerUpHandler);
- this.$refs.scrollContainer.removeEventListener('touchmove', this.pointerMoveHandler);
- this.touchScroll = false;
- }.bind(this), 500);
- }
- },
- onWheel: function onWheel(event) {
- if (this.isLoading) return;
- var wheelDelta = event.wheelDelta ? event.wheelDelta : -(event.detail || event.deltaY);
- this.stretchEdge(wheelDelta);
- },
- stretchEdge: function stretchEdge(direction) {
- var _this5 = this;
- clearTimeout(this.rubberRollBackTimeout);
- if (!this.onReachEdge) {
- if (direction > 0) {
- if (!this.onReachTop) return;
- } else {
- if (!this.onReachBottom) return;
- }
- }
- this.rubberRollBackTimeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this5);
- if (!this.isLoading) this.reset();
- }.bind(this), 250);
- if (direction > 0 && this.reachedTopScrollLimit) {
- this.topRubberPadding += 5 - this.topRubberPadding / 5;
- if (this.topRubberPadding > this.topProximityThreshold) this.onCallback(1);
- } else if (direction < 0 && this.reachedBottomScrollLimit) {
- this.bottomRubberPadding += 6 - this.bottomRubberPadding / 4;
- if (this.bottomRubberPadding > this.bottomProximityThreshold) this.onCallback(-1);
- } else {
- this.onScroll();
- }
- },
- onScroll: function onScroll() {
- var el = this.$refs.scrollContainer;
- if (this.isLoading || !el) return;
- var scrollDirection = (0, _sign2.default)(this.lastScroll - el.scrollTop);
- var displacement = el.scrollHeight - el.clientHeight - el.scrollTop;
- var topNegativeProximity = this.topProximityThreshold < 0 ? this.topProximityThreshold : 0;
- var bottomNegativeProximity = this.bottomProximityThreshold < 0 ? this.bottomProximityThreshold : 0;
- if (scrollDirection == -1 && displacement + bottomNegativeProximity <= dragConfig.sensitivity) {
- this.reachedBottomScrollLimit = true;
- } else if (scrollDirection >= 0 && el.scrollTop + topNegativeProximity <= 0) {
- this.reachedTopScrollLimit = true;
- } else {
- this.reachedTopScrollLimit = false;
- this.reachedBottomScrollLimit = false;
- this.lastScroll = el.scrollTop;
- }
- },
- getTouchCoordinates: function getTouchCoordinates(e) {
- return {
- x: e.touches[0].pageX,
- y: e.touches[0].pageY
- };
- },
- onPointerDown: function onPointerDown(e) {
- var _this6 = this;
- if (this.isLoading) return;
- if (e.type == 'touchstart') {
- var container = this.$refs.scrollContainer;
- if (this.reachedTopScrollLimit) container.scrollTop = 5;else if (this.reachedBottomScrollLimit) container.scrollTop -= 5;
- }
- if (e.type == 'touchstart' && this.$refs.scrollContainer.scrollTop == 0) this.$refs.scrollContainer.scrollTop = 5;
- this.pointerTouchDown = this.getTouchCoordinates(e);
- (0, _dom.on)(window, 'touchend', this.pointerUpHandler);
- this.$refs.scrollContainer.parentElement.addEventListener('touchmove', function (e) {
- (0, _newArrowCheck3.default)(this, _this6);
- e.stopPropagation();
- this.pointerMoveHandler(e);
- }.bind(this), { passive: false, useCapture: true });
- },
- onPointerMove: function onPointerMove(e) {
- if (!this.pointerTouchDown) return;
- if (this.isLoading) return;
- var pointerPosition = this.getTouchCoordinates(e);
- var yDiff = pointerPosition.y - this.pointerTouchDown.y;
- this.stretchEdge(yDiff);
- if (!this.touchScroll) {
- var wasDragged = Math.abs(yDiff) > dragConfig.minimumStartDragOffset;
- if (wasDragged) this.touchScroll = true;
- }
- },
- onPointerUp: function onPointerUp() {
- this.pointerTouchDown = null;
- }
- },
- created: function created() {
- this.handleScroll = (0, _lodash2.default)(this.onScroll, 150, { leading: false });
- this.pointerUpHandler = this.onPointerUp.bind(this);
- this.pointerMoveHandler = (0, _lodash2.default)(this.onPointerMove, 50, { leading: false });
- }
- };
- /***/ }),
- /* 197 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _spin = __webpack_require__(91);
- var _spin2 = _interopRequireDefault(_spin);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-scroll';
- exports.default = {
- props: ['text', 'active', 'spinnerHeight'],
- components: { Spin: _spin2.default, Icon: _icon2.default },
- computed: {
- wrapperClasses: function wrapperClasses() {
- return [prefixCls + '-loader-wrapper', (0, _defineProperty3.default)({}, prefixCls + '-loader-wrapper-active', this.active)];
- },
- spinnerClasses: function spinnerClasses() {
- return prefixCls + '-spinner';
- },
- iconClasses: function iconClasses() {
- return prefixCls + '-spinner-icon';
- },
- textClasses: function textClasses() {
- return prefixCls + '-loader-text';
- }
- }
- };
- /***/ }),
- /* 198 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _mixinsScrollbar = __webpack_require__(87);
- var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-spin';
- exports.default = {
- name: 'Spin',
- mixins: [_mixinsScrollbar2.default],
- props: {
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- fix: {
- type: Boolean,
- default: false
- },
- fullscreen: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- showText: false,
- visible: false
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-fix', this.fix), (0, _defineProperty3.default)(_ref, prefixCls + '-show-text', this.showText), (0, _defineProperty3.default)(_ref, prefixCls + '-fullscreen', this.fullscreen), _ref)];
- },
- mainClasses: function mainClasses() {
- return prefixCls + '-main';
- },
- dotClasses: function dotClasses() {
- return prefixCls + '-dot';
- },
- textClasses: function textClasses() {
- return prefixCls + '-text';
- },
- fullscreenVisible: function fullscreenVisible() {
- if (this.fullscreen) {
- return this.visible;
- } else {
- return true;
- }
- }
- },
- watch: {
- visible: function visible(val) {
- if (val) {
- this.addScrollEffect();
- } else {
- this.removeScrollEffect();
- }
- }
- },
- mounted: function mounted() {
- this.showText = this.$slots.default !== undefined;
- }
- };
- /***/ }),
- /* 199 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- var _trigger = __webpack_require__(470);
- var _trigger2 = _interopRequireDefault(_trigger);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Split',
- components: {
- Trigger: _trigger2.default
- },
- props: {
- value: {
- type: [Number, String],
- default: 0.5
- },
- mode: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
- },
- default: 'horizontal'
- },
- min: {
- type: [Number, String],
- default: '40px'
- },
- max: {
- type: [Number, String],
- default: '40px'
- }
- },
- data: function data() {
- return {
- prefix: 'ivu-split',
- offset: 0,
- oldOffset: 0,
- isMoving: false,
- computedMin: 0,
- computedMax: 0,
- currentValue: 0.5
- };
- },
- computed: {
- wrapperClasses: function wrapperClasses() {
- return [String(this.prefix) + '-wrapper', this.isMoving ? 'no-select' : ''];
- },
- paneClasses: function paneClasses() {
- return [String(this.prefix) + '-pane', (0, _defineProperty3.default)({}, String(this.prefix) + '-pane-moving', this.isMoving)];
- },
- isHorizontal: function isHorizontal() {
- return this.mode === 'horizontal';
- },
- anotherOffset: function anotherOffset() {
- return 100 - this.offset;
- },
- valueIsPx: function valueIsPx() {
- return typeof this.value === 'string';
- },
- offsetSize: function offsetSize() {
- return this.isHorizontal ? 'offsetWidth' : 'offsetHeight';
- }
- },
- methods: {
- px2percent: function px2percent(numerator, denominator) {
- return parseFloat(numerator) / parseFloat(denominator);
- },
- getComputedThresholdValue: function getComputedThresholdValue(type) {
- var size = this.$refs.outerWrapper[this.offsetSize];
- if (this.valueIsPx) return typeof this[type] === 'string' ? this[type] : size * this[type];else return typeof this[type] === 'string' ? this.px2percent(this[type], size) : this[type];
- },
- getMin: function getMin(value1, value2) {
- if (this.valueIsPx) return String(Math.min(parseFloat(value1), parseFloat(value2))) + 'px';else return Math.min(value1, value2);
- },
- getMax: function getMax(value1, value2) {
- if (this.valueIsPx) return String(Math.max(parseFloat(value1), parseFloat(value2))) + 'px';else return Math.max(value1, value2);
- },
- getAnotherOffset: function getAnotherOffset(value) {
- var res = 0;
- if (this.valueIsPx) res = this.$refs.outerWrapper[this.offsetSize] - parseFloat(value) + 'px';else res = 1 - value;
- return res;
- },
- handleMove: function handleMove(e) {
- var pageOffset = this.isHorizontal ? e.pageX : e.pageY;
- var offset = pageOffset - this.initOffset;
- var outerWidth = this.$refs.outerWrapper[this.offsetSize];
- var value = this.valueIsPx ? String(parseFloat(this.oldOffset) + offset) + 'px' : this.px2percent(outerWidth * this.oldOffset + offset, outerWidth);
- var anotherValue = this.getAnotherOffset(value);
- if (parseFloat(value) <= parseFloat(this.computedMin)) value = this.getMax(value, this.computedMin);
- if (parseFloat(anotherValue) <= parseFloat(this.computedMax)) value = this.getAnotherOffset(this.getMax(anotherValue, this.computedMax));
- e.atMin = this.value === this.computedMin;
- e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5);
- this.$emit('input', value);
- this.$emit('on-moving', e);
- },
- handleUp: function handleUp() {
- this.isMoving = false;
- (0, _dom.off)(document, 'mousemove', this.handleMove);
- (0, _dom.off)(document, 'mouseup', this.handleUp);
- this.$emit('on-move-end');
- },
- handleMousedown: function handleMousedown(e) {
- this.initOffset = this.isHorizontal ? e.pageX : e.pageY;
- this.oldOffset = this.value;
- this.isMoving = true;
- (0, _dom.on)(document, 'mousemove', this.handleMove);
- (0, _dom.on)(document, 'mouseup', this.handleUp);
- this.$emit('on-move-start');
- },
- computeOffset: function computeOffset() {
- var _this = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.computedMin = this.getComputedThresholdValue('min');
- this.computedMax = this.getComputedThresholdValue('max');
- this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
- }.bind(this));
- }
- },
- watch: {
- value: function value(val) {
- if (val !== this.currentValue) {
- this.currentValue = val;
- this.computeOffset();
- }
- }
- },
- mounted: function mounted() {
- var _this2 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.computeOffset();
- }.bind(this));
- (0, _dom.on)(window, 'resize', this.computeOffset);
- },
- beforeDestroy: function beforeDestroy() {
- (0, _dom.off)(window, 'resize', this.computeOffset);
- }
- };
- /***/ }),
- /* 200 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- name: 'Trigger',
- props: {
- mode: String
- },
- data: function data() {
- return {
- prefix: 'ivu-split-trigger',
- initOffset: 0
- };
- },
- computed: {
- isVertical: function isVertical() {
- return this.mode === 'vertical';
- },
- classes: function classes() {
- return [this.prefix, this.isVertical ? String(this.prefix) + '-vertical' : String(this.prefix) + '-horizontal'];
- },
- barConClasses: function barConClasses() {
- return [String(this.prefix) + '-bar-con', this.isVertical ? 'vertical' : 'horizontal'];
- }
- }
- };
- /***/ }),
- /* 201 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-layout';
- exports.default = {
- name: 'Layout',
- data: function data() {
- return {
- hasSider: false
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-has-sider', this.hasSider)];
- }
- },
- methods: {
- findSider: function findSider() {
- var _this = this;
- return this.$children.some(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- return child.$options.name === 'Sider';
- }.bind(this));
- }
- },
- mounted: function mounted() {
- this.hasSider = this.findSider();
- }
- };
- /***/ }),
- /* 202 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__ = __webpack_require__(203);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__ = __webpack_require__(476);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 203 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _dom = __webpack_require__(12);
- var _assist = __webpack_require__(3);
- var prefixCls = 'ivu-layout-sider';
- (0, _assist.setMatchMedia)();
- exports.default = {
- name: 'Sider',
- props: {
- value: {
- type: Boolean,
- default: false
- },
- width: {
- type: [Number, String],
- default: 200
- },
- collapsedWidth: {
- type: [Number, String],
- default: 64
- },
- hideTrigger: {
- type: Boolean,
- default: false
- },
- breakpoint: {
- type: String,
- validator: function validator(val) {
- return (0, _assist.oneOf)(val, ['xs', 'sm', 'md', 'lg', 'xl', 'xxl']);
- }
- },
- collapsible: {
- type: Boolean,
- default: false
- },
- defaultCollapsed: {
- type: Boolean,
- default: false
- },
- reverseArrow: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- mediaMatched: false
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- return ['' + prefixCls, this.siderWidth ? '' : prefixCls + '-zero-width', this.value ? prefixCls + '-collapsed' : ''];
- },
- wrapStyles: function wrapStyles() {
- return {
- width: String(this.siderWidth) + 'px',
- minWidth: String(this.siderWidth) + 'px',
- maxWidth: String(this.siderWidth) + 'px',
- flex: '0 0 ' + String(this.siderWidth) + 'px'
- };
- },
- triggerClasses: function triggerClasses() {
- return [prefixCls + '-trigger', this.value ? prefixCls + '-trigger-collapsed' : ''];
- },
- childClasses: function childClasses() {
- return String(this.prefixCls) + '-children';
- },
- zeroWidthTriggerClasses: function zeroWidthTriggerClasses() {
- return [prefixCls + '-zero-width-trigger', this.reverseArrow ? prefixCls + '-zero-width-trigger-left' : ''];
- },
- triggerIconClasses: function triggerIconClasses() {
- return ['ivu-icon', 'ivu-icon-ios-arrow-' + (this.reverseArrow ? 'forward' : 'back'), prefixCls + '-trigger-icon'];
- },
- siderWidth: function siderWidth() {
- return this.collapsible ? this.value ? this.mediaMatched ? 0 : parseInt(this.collapsedWidth) : parseInt(this.width) : this.width;
- },
- showZeroTrigger: function showZeroTrigger() {
- return this.collapsible ? this.mediaMatched && !this.hideTrigger || parseInt(this.collapsedWidth) === 0 && this.value && !this.hideTrigger : false;
- },
- showBottomTrigger: function showBottomTrigger() {
- return this.collapsible ? !this.mediaMatched && !this.hideTrigger : false;
- }
- },
- methods: {
- toggleCollapse: function toggleCollapse() {
- var value = this.collapsible ? !this.value : false;
- this.$emit('input', value);
- },
- matchMedia: function matchMedia() {
- var matchMedia = void 0;
- if (window.matchMedia) {
- matchMedia = window.matchMedia;
- }
- var mediaMatched = this.mediaMatched;
- this.mediaMatched = matchMedia('(max-width: ' + String(_assist.dimensionMap[this.breakpoint]) + ')').matches;
- if (this.mediaMatched !== mediaMatched) {
- this.$emit('input', this.mediaMatched);
- }
- },
- onWindowResize: function onWindowResize() {
- this.matchMedia();
- }
- },
- watch: {
- value: function value(stat) {
- this.$emit('on-collapse', stat);
- }
- },
- mounted: function mounted() {
- if (this.defaultCollapsed) {
- this.$emit('input', this.defaultCollapsed);
- }
- if (this.breakpoint !== undefined) {
- (0, _dom.on)(window, 'resize', this.onWindowResize);
- this.matchMedia();
- }
- },
- beforeDestroy: function beforeDestroy() {
- if (this.breakpoint !== undefined) {
- (0, _dom.off)(window, 'resize', this.onWindowResize);
- }
- }
- };
- /***/ }),
- /* 204 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-list';
- exports.default = {
- name: 'List',
- provide: function provide() {
- return {
- ListInstance: this
- };
- },
- props: {
- border: {
- type: Boolean,
- default: false
- },
- itemLayout: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
- },
- default: 'horizontal'
- },
- header: {
- type: String,
- default: ''
- },
- footer: {
- type: String,
- default: ''
- },
- loading: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- split: {
- type: Boolean,
- default: true
- }
- },
- data: function data() {
- return {};
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.size), prefixCls + '-' + String(this.itemLayout), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-bordered', this.border), (0, _defineProperty3.default)(_ref, prefixCls + '-split', this.split), _ref)];
- }
- },
- methods: {}
- };
- /***/ }),
- /* 205 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'ListItem',
- inject: ['ListInstance'],
- props: {},
- computed: {
- itemLayout: function itemLayout() {
- return this.ListInstance.itemLayout;
- },
- isItemContainsTextNode: function isItemContainsTextNode() {
- var _this = this;
- var result = void 0;
- this.$slots.default.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- if (typeof item === 'string') {
- result = true;
- }
- }.bind(this));
- return result;
- },
- isFlexMode: function isFlexMode() {
- var extra = this.$slots.extra;
- if (this.itemLayout === 'vertical') {
- return !!extra;
- }
- return !this.isItemContainsTextNode;
- },
- classes: function classes() {
- return [{
- 'ivu-list-item-no-flex': !this.isFlexMode
- }];
- }
- }
- };
- /***/ }),
- /* 206 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _avatar = __webpack_require__(125);
- var _avatar2 = _interopRequireDefault(_avatar);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'ListItemMeta',
- components: { Avatar: _avatar2.default },
- props: {
- avatar: {
- type: String,
- default: ''
- },
- title: {
- type: String,
- default: ''
- },
- description: {
- type: String,
- default: ''
- }
- }
- };
- /***/ }),
- /* 207 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-loading-bar';
- exports.default = {
- name: 'LoadingBar',
- props: {
- color: {
- type: String,
- default: 'primary'
- },
- failedColor: {
- type: String,
- default: 'error'
- },
- height: {
- type: Number,
- default: 2
- }
- },
- data: function data() {
- return {
- percent: 0,
- status: 'success',
- show: false
- };
- },
- computed: {
- classes: function classes() {
- return '' + prefixCls;
- },
- innerClasses: function innerClasses() {
- var _ref;
- return [prefixCls + '-inner', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-inner-color-primary', this.color === 'primary' && this.status === 'success'), (0, _defineProperty3.default)(_ref, prefixCls + '-inner-failed-color-error', this.failedColor === 'error' && this.status === 'error'), _ref)];
- },
- outerStyles: function outerStyles() {
- return {
- height: String(this.height) + 'px'
- };
- },
- styles: function styles() {
- var style = {
- width: String(this.percent) + '%',
- height: String(this.height) + 'px'
- };
- if (this.color !== 'primary' && this.status === 'success') {
- style.backgroundColor = this.color;
- }
- if (this.failedColor !== 'error' && this.status === 'error') {
- style.backgroundColor = this.failedColor;
- }
- return style;
- }
- }
- };
- /***/ }),
- /* 208 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-menu';
- exports.default = {
- name: 'Menu',
- mixins: [_emitter2.default],
- props: {
- mode: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
- },
- default: 'vertical'
- },
- theme: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['light', 'dark', 'primary']);
- },
- default: 'light'
- },
- activeName: {
- type: [String, Number]
- },
- openNames: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- accordion: {
- type: Boolean,
- default: false
- },
- width: {
- type: String,
- default: '240px'
- }
- },
- data: function data() {
- return {
- currentActiveName: this.activeName,
- openedNames: []
- };
- },
- computed: {
- classes: function classes() {
- var theme = this.theme;
- if (this.mode === 'vertical' && this.theme === 'primary') theme = 'light';
- return ['' + prefixCls, prefixCls + '-' + String(theme), (0, _defineProperty3.default)({}, prefixCls + '-' + String(this.mode), this.mode)];
- },
- styles: function styles() {
- var style = {};
- if (this.mode === 'vertical') style.width = this.width;
- return style;
- }
- },
- methods: {
- updateActiveName: function updateActiveName() {
- if (this.currentActiveName === undefined) {
- this.currentActiveName = -1;
- }
- this.broadcast('Submenu', 'on-update-active-name', false);
- this.broadcast('MenuItem', 'on-update-active-name', this.currentActiveName);
- },
- updateOpenKeys: function updateOpenKeys(name) {
- var _this = this;
- var names = [].concat((0, _toConsumableArray3.default)(this.openedNames));
- var index = names.indexOf(name);
- if (this.accordion) (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- item.opened = false;
- }.bind(this));
- if (index >= 0) {
- var currentSubmenu = null;
- (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- if (item.name === name) {
- currentSubmenu = item;
- item.opened = false;
- }
- }.bind(this));
- (0, _assist.findComponentsUpward)(currentSubmenu, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- item.opened = true;
- }.bind(this));
- (0, _assist.findComponentsDownward)(currentSubmenu, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- item.opened = false;
- }.bind(this));
- } else {
- if (this.accordion) {
- var _currentSubmenu = null;
- (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- if (item.name === name) {
- _currentSubmenu = item;
- item.opened = true;
- }
- }.bind(this));
- (0, _assist.findComponentsUpward)(_currentSubmenu, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- item.opened = true;
- }.bind(this));
- } else {
- (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- if (item.name === name) item.opened = true;
- }.bind(this));
- }
- }
- var openedNames = (0, _assist.findComponentsDownward)(this, 'Submenu').filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return item.opened;
- }.bind(this)).map(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return item.name;
- }.bind(this));
- this.openedNames = [].concat((0, _toConsumableArray3.default)(openedNames));
- this.$emit('on-open-change', openedNames);
- },
- updateOpened: function updateOpened() {
- var _this2 = this;
- var items = (0, _assist.findComponentsDownward)(this, 'Submenu');
- if (items.length) {
- items.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (this.openedNames.indexOf(item.name) > -1) item.opened = true;else item.opened = false;
- }.bind(this));
- }
- },
- handleEmitSelectEvent: function handleEmitSelectEvent(name) {
- this.$emit('on-select', name);
- }
- },
- mounted: function mounted() {
- var _this3 = this;
- this.openedNames = [].concat((0, _toConsumableArray3.default)(this.openNames));
- this.updateOpened();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- return this.updateActiveName();
- }.bind(this));
- this.$on('on-menu-item-select', function (name) {
- (0, _newArrowCheck3.default)(this, _this3);
- this.currentActiveName = name;
- this.$emit('on-select', name);
- }.bind(this));
- },
- watch: {
- openNames: function openNames(names) {
- this.openedNames = names;
- },
- activeName: function activeName(val) {
- this.currentActiveName = val;
- },
- currentActiveName: function currentActiveName() {
- this.updateActiveName();
- }
- }
- };
- /***/ }),
- /* 209 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _mixin = __webpack_require__(92);
- var _mixin2 = _interopRequireDefault(_mixin);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-menu';
- exports.default = {
- name: 'MenuGroup',
- mixins: [_mixin2.default],
- props: {
- title: {
- type: String,
- default: ''
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls
- };
- },
- computed: {
- groupStyle: function groupStyle() {
- return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
- paddingLeft: 43 + (this.parentSubmenuNum - 1) * 28 + 'px'
- } : {};
- }
- }
- };
- /***/ }),
- /* 210 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _assist = __webpack_require__(3);
- var _mixin = __webpack_require__(92);
- var _mixin2 = _interopRequireDefault(_mixin);
- var _link = __webpack_require__(48);
- var _link2 = _interopRequireDefault(_link);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-menu';
- exports.default = {
- name: 'MenuItem',
- mixins: [_emitter2.default, _mixin2.default, _link2.default],
- props: {
- name: {
- type: [String, Number],
- required: true
- },
- disabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- active: false
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return [prefixCls + '-item', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-active', this.active), (0, _defineProperty3.default)(_ref, prefixCls + '-item-selected', this.active), (0, _defineProperty3.default)(_ref, prefixCls + '-item-disabled', this.disabled), _ref)];
- },
- itemStyle: function itemStyle() {
- return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
- paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
- } : {};
- }
- },
- methods: {
- handleClickItem: function handleClickItem(event) {
- var new_window = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (this.disabled) return;
- if (new_window || this.target === '_blank') {
- this.handleCheckClick(event, new_window);
- var parentMenu = (0, _assist.findComponentUpward)(this, 'Menu');
- if (parentMenu) parentMenu.handleEmitSelectEvent(this.name);
- } else {
- var parent = (0, _assist.findComponentUpward)(this, 'Submenu');
- if (parent) {
- this.dispatch('Submenu', 'on-menu-item-select', this.name);
- } else {
- this.dispatch('Menu', 'on-menu-item-select', this.name);
- }
- this.handleCheckClick(event, new_window);
- }
- }
- },
- mounted: function mounted() {
- var _this = this;
- this.$on('on-update-active-name', function (name) {
- (0, _newArrowCheck3.default)(this, _this);
- if (this.name === name) {
- this.active = true;
- this.dispatch('Submenu', 'on-update-active-name', name);
- } else {
- this.active = false;
- }
- }.bind(this));
- }
- };
- /***/ }),
- /* 211 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _dropdown = __webpack_require__(36);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _collapseTransition = __webpack_require__(83);
- var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _mixin = __webpack_require__(92);
- var _mixin2 = _interopRequireDefault(_mixin);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-menu';
- exports.default = {
- name: 'Submenu',
- mixins: [_emitter2.default, _mixin2.default],
- components: { Icon: _icon2.default, Drop: _dropdown2.default, CollapseTransition: _collapseTransition2.default },
- props: {
- name: {
- type: [String, Number],
- required: true
- },
- disabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- active: false,
- opened: false,
- dropWidth: parseFloat((0, _assist.getStyle)(this.$el, 'width'))
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return [prefixCls + '-submenu', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-active', this.active && !this.hasParentSubmenu), (0, _defineProperty3.default)(_ref, prefixCls + '-opened', this.opened), (0, _defineProperty3.default)(_ref, prefixCls + '-submenu-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-submenu-has-parent-submenu', this.hasParentSubmenu), (0, _defineProperty3.default)(_ref, prefixCls + '-child-item-active', this.active), _ref)];
- },
- accordion: function accordion() {
- return this.menu.accordion;
- },
- dropStyle: function dropStyle() {
- var style = {};
- if (this.dropWidth) style.minWidth = String(this.dropWidth) + 'px';
- return style;
- },
- titleStyle: function titleStyle() {
- return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
- paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
- } : {};
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-down';
- if (this.$IVIEW) {
- if (this.$IVIEW.menu.customArrow) {
- type = '';
- } else if (this.$IVIEW.menu.arrow) {
- type = this.$IVIEW.menu.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.menu.customArrow) {
- type = this.$IVIEW.menu.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.menu.arrowSize) {
- size = this.$IVIEW.menu.arrowSize;
- }
- }
- return size;
- }
- },
- methods: {
- handleMouseenter: function handleMouseenter() {
- var _this = this;
- if (this.disabled) return;
- if (this.mode === 'vertical') return;
- clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.menu.updateOpenKeys(this.name);
- this.opened = true;
- }.bind(this), 250);
- },
- handleMouseleave: function handleMouseleave() {
- var _this2 = this;
- if (this.disabled) return;
- if (this.mode === 'vertical') return;
- clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.menu.updateOpenKeys(this.name);
- this.opened = false;
- }.bind(this), 150);
- },
- handleClick: function handleClick() {
- var _this3 = this;
- if (this.disabled) return;
- if (this.mode === 'horizontal') return;
- var opened = this.opened;
- if (this.accordion) {
- this.$parent.$children.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- if (item.$options.name === 'Submenu') item.opened = false;
- }.bind(this));
- }
- this.opened = !opened;
- this.menu.updateOpenKeys(this.name);
- }
- },
- watch: {
- mode: function mode(val) {
- if (val === 'horizontal') {
- this.$refs.drop.update();
- }
- },
- opened: function opened(val) {
- if (this.mode === 'vertical') return;
- if (val) {
- this.dropWidth = parseFloat((0, _assist.getStyle)(this.$el, 'width'));
- this.$refs.drop.update();
- } else {
- this.$refs.drop.destroy();
- }
- }
- },
- mounted: function mounted() {
- var _this4 = this;
- this.$on('on-menu-item-select', function (name) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (this.mode === 'horizontal') this.opened = false;
- this.dispatch('Menu', 'on-menu-item-select', name);
- return true;
- }.bind(this));
- this.$on('on-update-active-name', function (status) {
- (0, _newArrowCheck3.default)(this, _this4);
- if ((0, _assist.findComponentUpward)(this, 'Submenu')) this.dispatch('Submenu', 'on-update-active-name', status);
- if ((0, _assist.findComponentsDownward)(this, 'Submenu')) (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this4);
- item.active = false;
- }.bind(this));
- this.active = status;
- }.bind(this));
- }
- };
- /***/ }),
- /* 212 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _notification = __webpack_require__(498);
- var _notification2 = _interopRequireDefault(_notification);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _notification2.default.newInstance = function (properties) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var _props = properties || {};
- var Instance = new _vue2.default({
- render: function render(h) {
- return h(_notification2.default, {
- props: _props
- });
- }
- });
- var component = Instance.$mount();
- document.body.appendChild(component.$el);
- var notification = Instance.$children[0];
- return {
- notice: function notice(noticeProps) {
- notification.add(noticeProps);
- },
- remove: function remove(name) {
- notification.close(name);
- },
- component: notification,
- destroy: function destroy(element) {
- notification.closeAll();
- setTimeout(function () {
- document.body.removeChild(document.getElementsByClassName(element)[0]);
- }, 500);
- }
- };
- }.bind(undefined);
- exports.default = _notification2.default;
- /***/ }),
- /* 213 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _notice2 = __webpack_require__(499);
- var _notice3 = _interopRequireDefault(_notice2);
- var _transferQueue = __webpack_require__(37);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-notification';
- var seed = 0;
- var now = Date.now();
- function getUuid() {
- return 'ivuNotification_' + now + '_' + seed++;
- }
- exports.default = {
- components: { Notice: _notice3.default },
- props: {
- prefixCls: {
- type: String,
- default: prefixCls
- },
- styles: {
- type: Object,
- default: function _default() {
- return {
- top: '65px',
- left: '50%'
- };
- }
- },
- content: {
- type: String
- },
- className: {
- type: String
- }
- },
- data: function data() {
- return {
- notices: [],
- tIndex: this.handleGetIndex()
- };
- },
- computed: {
- classes: function classes() {
- return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
- },
- wrapStyles: function wrapStyles() {
- var styles = (0, _assign2.default)({}, this.styles);
- styles['z-index'] = 1010 + this.tIndex;
- return styles;
- }
- },
- methods: {
- add: function add(notice) {
- var name = notice.name || getUuid();
- var _notice = (0, _assign2.default)({
- styles: {
- right: '50%'
- },
- content: '',
- duration: 1.5,
- closable: false,
- name: name
- }, notice);
- this.notices.push(_notice);
- this.tIndex = this.handleGetIndex();
- },
- close: function close(name) {
- var notices = this.notices;
- for (var i = 0; i < notices.length; i++) {
- if (notices[i].name === name) {
- this.notices.splice(i, 1);
- break;
- }
- }
- },
- closeAll: function closeAll() {
- this.notices = [];
- },
- handleGetIndex: function handleGetIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- }
- }
- };
- /***/ }),
- /* 214 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _render = __webpack_require__(215);
- var _render2 = _interopRequireDefault(_render);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- components: {
- RenderCell: _render2.default
- },
- props: {
- prefixCls: {
- type: String,
- default: ''
- },
- duration: {
- type: Number,
- default: 1.5
- },
- type: {
- type: String
- },
- content: {
- type: String,
- default: ''
- },
- withIcon: Boolean,
- render: {
- type: Function
- },
- hasTitle: Boolean,
- styles: {
- type: Object,
- default: function _default() {
- return {
- right: '50%'
- };
- }
- },
- closable: {
- type: Boolean,
- default: false
- },
- className: {
- type: String
- },
- name: {
- type: String,
- required: true
- },
- onClose: {
- type: Function
- },
- transitionName: {
- type: String
- },
- background: {
- type: Boolean,
- default: false
- },
- msgType: {
- type: String
- }
- },
- data: function data() {
- return {
- withDesc: false
- };
- },
- computed: {
- baseClass: function baseClass() {
- return String(this.prefixCls) + '-notice';
- },
- renderFunc: function renderFunc() {
- return this.render || function () {};
- },
- classes: function classes() {
- var _ref;
- return [this.baseClass, (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-closable', this.closable), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-with-desc', this.withDesc), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-with-background', this.background), _ref)];
- },
- contentClasses: function contentClasses() {
- return [String(this.baseClass) + '-content', this.render !== undefined ? String(this.baseClass) + '-content-with-render' : ''];
- },
- messageContentClasses: function messageContentClasses() {
- var _ref2;
- return [String(this.baseClass) + '-content', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(this.baseClass) + '-content-' + String(this.msgType), this.msgType), (0, _defineProperty3.default)(_ref2, String(this.baseClass) + '-content-background', this.background), _ref2)];
- },
- contentWithIcon: function contentWithIcon() {
- return [this.withIcon ? String(this.prefixCls) + '-content-with-icon' : '', !this.hasTitle && this.withIcon ? String(this.prefixCls) + '-content-with-render-notitle' : ''];
- },
- messageClasses: function messageClasses() {
- return [String(this.baseClass) + '-content', this.render !== undefined ? String(this.baseClass) + '-content-with-render' : ''];
- }
- },
- methods: {
- clearCloseTimer: function clearCloseTimer() {
- if (this.closeTimer) {
- clearTimeout(this.closeTimer);
- this.closeTimer = null;
- }
- },
- close: function close() {
- this.clearCloseTimer();
- this.onClose();
- this.$parent.close(this.name);
- },
- handleEnter: function handleEnter(el) {
- if (this.type === 'message') {
- el.style.height = el.scrollHeight + 'px';
- }
- },
- handleLeave: function handleLeave(el) {
- if (this.type === 'message') {
- if (document.getElementsByClassName('ivu-message-notice').length !== 1) {
- el.style.height = 0;
- el.style.paddingTop = 0;
- el.style.paddingBottom = 0;
- }
- }
- }
- },
- mounted: function mounted() {
- var _this = this;
- this.clearCloseTimer();
- if (this.duration !== 0) {
- this.closeTimer = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.close();
- }.bind(this), this.duration * 1000);
- }
- if (this.prefixCls === 'ivu-notice') {
- var desc = this.$refs.content.querySelectorAll('.' + String(this.prefixCls) + '-desc')[0];
- this.withDesc = this.render ? true : desc ? desc.innerHTML !== '' : false;
- }
- },
- beforeDestroy: function beforeDestroy() {
- this.clearCloseTimer();
- }
- };
- /***/ }),
- /* 215 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'RenderCell',
- functional: true,
- props: {
- render: Function
- },
- render: function render(h, ctx) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return ctx.props.render(h);
- }.bind(undefined)
- };
- /***/ }),
- /* 216 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _mixinsScrollbar = __webpack_require__(87);
- var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
- var _dom = __webpack_require__(12);
- var _assist = __webpack_require__(3);
- var _transferQueue = __webpack_require__(37);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-modal';
- var dragData = {
- x: null,
- y: null,
- dragX: null,
- dragY: null,
- dragging: false,
- rect: null
- };
- exports.default = {
- name: 'Modal',
- mixins: [_locale2.default, _emitter2.default, _mixinsScrollbar2.default],
- components: { Icon: _icon2.default, iButton: _button2.default },
- directives: { TransferDom: _transferDom2.default },
- props: {
- value: {
- type: Boolean,
- default: false
- },
- closable: {
- type: Boolean,
- default: true
- },
- maskClosable: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.modal.maskClosable === '' ? true : this.$IVIEW.modal.maskClosable;
- }
- },
- title: {
- type: String
- },
- width: {
- type: [Number, String],
- default: 520
- },
- okText: {
- type: String
- },
- cancelText: {
- type: String
- },
- loading: {
- type: Boolean,
- default: false
- },
- styles: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- className: {
- type: String
- },
- footerHide: {
- type: Boolean,
- default: false
- },
- scrollable: {
- type: Boolean,
- default: false
- },
- transitionNames: {
- type: Array,
- default: function _default() {
- return ['ease', 'fade'];
- }
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
- }
- },
- fullscreen: {
- type: Boolean,
- default: false
- },
- mask: {
- type: Boolean,
- default: true
- },
- draggable: {
- type: Boolean,
- default: false
- },
- sticky: {
- type: Boolean,
- default: false
- },
- stickyDistance: {
- type: Number,
- default: 10
- },
- resetDragPosition: {
- type: Boolean,
- default: false
- },
- zIndex: {
- type: Number,
- default: 1000
- },
- beforeClose: Function
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- wrapShow: false,
- showHead: true,
- buttonLoading: false,
- visible: this.value,
- dragData: (0, _assist.deepCopy)(dragData),
- modalIndex: this.handleGetModalIndex(),
- isMouseTriggerIn: false };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrap', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hidden', !this.wrapShow), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-mask', !this.showMask), _ref)];
- },
- wrapStyles: function wrapStyles() {
- return {
- zIndex: this.modalIndex + this.zIndex
- };
- },
- maskClasses: function maskClasses() {
- return prefixCls + '-mask';
- },
- classes: function classes() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen', this.fullscreen), (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen-no-header', this.fullscreen && !this.showHead), (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen-no-footer', this.fullscreen && this.footerHide), _ref2)];
- },
- contentClasses: function contentClasses() {
- var _ref3;
- return [prefixCls + '-content', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-content-no-mask', !this.showMask), (0, _defineProperty3.default)(_ref3, prefixCls + '-content-drag', this.draggable && !this.fullscreen), (0, _defineProperty3.default)(_ref3, prefixCls + '-content-dragging', this.draggable && this.dragData.dragging), _ref3)];
- },
- mainStyles: function mainStyles() {
- var style = {};
- var width = parseInt(this.width);
- var styleWidth = this.dragData.x !== null ? {
- top: 0
- } : {
- width: width <= 100 ? String(width) + '%' : String(width) + 'px'
- };
- var customStyle = this.styles ? this.styles : {};
- (0, _assign2.default)(style, styleWidth, customStyle);
- return style;
- },
- contentStyles: function contentStyles() {
- var style = {};
- if (this.draggable && !this.fullscreen) {
- var customTop = this.styles.top ? parseFloat(this.styles.top) : 0;
- var customLeft = this.styles.left ? parseFloat(this.styles.left) : 0;
- if (this.dragData.x !== null) style.left = this.dragData.x - customLeft + 'px';
- if (this.dragData.y !== null) style.top = String(this.dragData.y) + 'px';
- if (this.dragData.y !== null) style.top = this.dragData.y - customTop + 'px';
- var width = parseInt(this.width);
- var styleWidth = {
- width: width <= 100 ? String(width) + '%' : String(width) + 'px'
- };
- (0, _assign2.default)(style, styleWidth);
- }
- return style;
- },
- localeOkText: function localeOkText() {
- if (this.okText === undefined) {
- return this.t('i.modal.okText');
- } else {
- return this.okText;
- }
- },
- localeCancelText: function localeCancelText() {
- if (this.cancelText === undefined) {
- return this.t('i.modal.cancelText');
- } else {
- return this.cancelText;
- }
- },
- showMask: function showMask() {
- return this.mask;
- }
- },
- methods: {
- close: function close() {
- var _this = this;
- if (!this.beforeClose) {
- return this.handleClose();
- }
- var before = this.beforeClose();
- if (before && before.then) {
- before.then(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.handleClose();
- }.bind(this));
- } else {
- this.handleClose();
- }
- },
- handleClose: function handleClose() {
- this.visible = false;
- this.$emit('input', false);
- this.$emit('on-cancel');
- },
- handleMask: function handleMask() {
- if (this.maskClosable && this.showMask) {
- this.close();
- }
- },
- handleWrapClick: function handleWrapClick(event) {
- if (this.isMouseTriggerIn) {
- this.isMouseTriggerIn = false;
- return;
- }
- var className = event.target.getAttribute('class');
- if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
- },
- handleMousedown: function handleMousedown() {
- this.isMouseTriggerIn = true;
- },
- cancel: function cancel() {
- this.close();
- },
- ok: function ok() {
- if (this.loading) {
- this.buttonLoading = true;
- } else {
- this.visible = false;
- this.$emit('input', false);
- }
- this.$emit('on-ok');
- },
- EscClose: function EscClose(e) {
- var _this2 = this;
- if (this.visible && this.closable) {
- if (e.keyCode === 27) {
- var $Modals = (0, _assist.findComponentsDownward)(this.$root, 'Modal').filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- return item.$data.visible && item.$props.closable;
- }.bind(this));
- var $TopModal = $Modals.sort(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this2);
- return a.$data.modalIndex < b.$data.modalIndex ? 1 : -1;
- }.bind(this))[0];
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- $TopModal.close();
- }.bind(this), 0);
- }
- }
- },
- animationFinish: function animationFinish() {
- this.$emit('on-hidden');
- },
- handleMoveStart: function handleMoveStart(event) {
- if (!this.draggable || this.fullscreen) return false;
- var $content = this.$refs.content;
- var rect = $content.getBoundingClientRect();
- this.dragData.rect = rect;
- this.dragData.x = rect.x || rect.left;
- this.dragData.y = rect.y || rect.top;
- var distance = {
- x: event.clientX,
- y: event.clientY
- };
- this.dragData.dragX = distance.x;
- this.dragData.dragY = distance.y;
- this.dragData.dragging = true;
- (0, _dom.on)(window, 'mousemove', this.handleMoveMove);
- (0, _dom.on)(window, 'mouseup', this.handleMoveEnd);
- },
- handleMoveMove: function handleMoveMove(event) {
- if (!this.dragData.dragging || this.fullscreen) return false;
- var distance = {
- x: event.clientX,
- y: event.clientY
- };
- var diff_distance = {
- x: distance.x - this.dragData.dragX,
- y: distance.y - this.dragData.dragY
- };
- if (this.sticky) {
- var clientWidth = document.documentElement.clientWidth;
- var clientHeight = document.documentElement.clientHeight;
- if (this.dragData.x + diff_distance.x <= this.stickyDistance && diff_distance.x < 0) {
- this.dragData.x = 0;
- } else if (this.dragData.x + this.dragData.rect.width - clientWidth > -this.stickyDistance && diff_distance.x > 0) {
- this.dragData.x = clientWidth - this.dragData.rect.width;
- } else {
- this.dragData.x += diff_distance.x;
- }
- if (this.dragData.y + diff_distance.y <= this.stickyDistance && diff_distance.y < 0) {
- this.dragData.y = 0;
- } else if (this.dragData.y + this.dragData.rect.height - clientHeight > -this.stickyDistance && diff_distance.y > 0) {
- this.dragData.y = clientHeight - this.dragData.rect.height;
- } else {
- this.dragData.y += diff_distance.y;
- }
- } else {
- this.dragData.x += diff_distance.x;
- this.dragData.y += diff_distance.y;
- }
- this.dragData.dragX = distance.x;
- this.dragData.dragY = distance.y;
- },
- handleMoveEnd: function handleMoveEnd() {
- this.dragData.dragging = false;
- (0, _dom.off)(window, 'mousemove', this.handleMoveMove);
- (0, _dom.off)(window, 'mouseup', this.handleMoveEnd);
- },
- handleGetModalIndex: function handleGetModalIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- },
- handleClickModal: function handleClickModal() {
- if (this.draggable) {
- if (_transferQueue.lastVisibleIndex !== this.lastVisibleIndex) {
- this.lastVisibleIndex = _transferQueue.lastVisibleIndex;
- return;
- }
- this.modalIndex = this.handleGetModalIndex();
- }
- }
- },
- mounted: function mounted() {
- if (this.visible) {
- this.wrapShow = true;
- }
- var showHead = true;
- if (this.$slots.header === undefined && !this.title) {
- showHead = false;
- }
- this.showHead = showHead;
- document.addEventListener('keydown', this.EscClose);
- },
- beforeDestroy: function beforeDestroy() {
- document.removeEventListener('keydown', this.EscClose);
- this.removeScrollEffect();
- },
- watch: {
- value: function value(val) {
- this.visible = val;
- },
- visible: function visible(val) {
- var _this3 = this;
- if (val === false) {
- this.buttonLoading = false;
- this.timer = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- this.wrapShow = false;
- this.removeScrollEffect();
- }.bind(this), 300);
- } else {
- if (this.lastVisible !== val) {
- this.modalIndex = this.handleGetModalIndex();
- (0, _transferQueue.lastVisibleIncrease)();
- }
- if (this.timer) clearTimeout(this.timer);
- this.wrapShow = true;
- if (!this.scrollable) {
- this.addScrollEffect();
- }
- }
- this.broadcast('Table', 'on-visible-change', val);
- this.broadcast('Slider', 'on-visible-change', val);
- this.$emit('on-visible-change', val);
- this.lastVisible = val;
- this.lastVisibleIndex = _transferQueue.lastVisibleIndex;
- if (val && this.resetDragPosition) {
- this.dragData = (0, _assist.deepCopy)(dragData);
- }
- },
- loading: function loading(val) {
- if (!val) {
- this.buttonLoading = false;
- }
- },
- scrollable: function scrollable(val) {
- if (!val) {
- this.addScrollEffect();
- } else {
- this.removeScrollEffect();
- }
- },
- title: function title(val) {
- if (this.$slots.header === undefined) {
- this.showHead = !!val;
- }
- }
- }
- };
- /***/ }),
- /* 217 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _options = __webpack_require__(509);
- var _options2 = _interopRequireDefault(_options);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-page';
- exports.default = {
- name: 'Page',
- mixins: [_locale2.default],
- components: { Options: _options2.default },
- props: {
- current: {
- type: Number,
- default: 1
- },
- total: {
- type: Number,
- default: 0
- },
- pageSize: {
- type: Number,
- default: 10
- },
- pageSizeOpts: {
- type: Array,
- default: function _default() {
- return [10, 20, 30, 40];
- }
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'bottom']);
- },
- default: 'bottom'
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'default']);
- }
- },
- simple: {
- type: Boolean,
- default: false
- },
- showTotal: {
- type: Boolean,
- default: false
- },
- showElevator: {
- type: Boolean,
- default: false
- },
- showSizer: {
- type: Boolean,
- default: false
- },
- className: {
- type: String
- },
- styles: {
- type: Object
- },
- prevText: {
- type: String,
- default: ''
- },
- nextText: {
- type: String,
- default: ''
- },
- disabled: {
- type: Boolean,
- default: false
- },
- eventsEnabled: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- currentPage: this.current,
- currentPageSize: this.pageSize
- };
- },
- watch: {
- total: function total(val) {
- var maxPage = Math.ceil(val / this.currentPageSize);
- if (maxPage < this.currentPage) {
- this.currentPage = maxPage === 0 ? 1 : maxPage;
- }
- },
- current: function current(val) {
- this.currentPage = val;
- },
- pageSize: function pageSize(val) {
- this.currentPageSize = val;
- }
- },
- computed: {
- isSmall: function isSmall() {
- return this.size === 'small';
- },
- allPages: function allPages() {
- var allPage = Math.ceil(this.total / this.currentPageSize);
- return allPage === 0 ? 1 : allPage;
- },
- simpleWrapClasses: function simpleWrapClasses() {
- return ['' + prefixCls, prefixCls + '-simple', (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
- },
- simplePagerClasses: function simplePagerClasses() {
- return prefixCls + '-simple-pager';
- },
- wrapClasses: function wrapClasses() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-disabled', this.disabled), (0, _defineProperty3.default)(_ref2, 'mini', this.size === 'small'), _ref2)];
- },
- prevClasses: function prevClasses() {
- var _ref3;
- return [prefixCls + '-prev', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-disabled', this.currentPage === 1 || this.disabled), (0, _defineProperty3.default)(_ref3, prefixCls + '-custom-text', this.prevText !== ''), _ref3)];
- },
- nextClasses: function nextClasses() {
- var _ref4;
- return [prefixCls + '-next', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, prefixCls + '-disabled', this.currentPage === this.allPages || this.disabled), (0, _defineProperty3.default)(_ref4, prefixCls + '-custom-text', this.nextText !== ''), _ref4)];
- },
- firstPageClasses: function firstPageClasses() {
- return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.currentPage === 1)];
- },
- lastPageClasses: function lastPageClasses() {
- return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.currentPage === this.allPages)];
- }
- },
- methods: {
- changePage: function changePage(page) {
- if (this.disabled) return;
- if (this.currentPage != page) {
- this.currentPage = page;
- this.$emit('update:current', page);
- this.$emit('on-change', page);
- }
- },
- prev: function prev() {
- if (this.disabled) return;
- var current = this.currentPage;
- if (current <= 1) {
- return false;
- }
- this.changePage(current - 1);
- this.$emit('on-prev', current - 1);
- },
- next: function next() {
- if (this.disabled) return;
- var current = this.currentPage;
- if (current >= this.allPages) {
- return false;
- }
- this.changePage(current + 1);
- this.$emit('on-next', current + 1);
- },
- fastPrev: function fastPrev() {
- if (this.disabled) return;
- var page = this.currentPage - 5;
- if (page > 0) {
- this.changePage(page);
- } else {
- this.changePage(1);
- }
- },
- fastNext: function fastNext() {
- if (this.disabled) return;
- var page = this.currentPage + 5;
- if (page > this.allPages) {
- this.changePage(this.allPages);
- } else {
- this.changePage(page);
- }
- },
- onSize: function onSize(pageSize) {
- if (this.disabled) return;
- this.currentPageSize = pageSize;
- this.$emit('on-page-size-change', pageSize);
- this.changePage(1);
- },
- onPage: function onPage(page) {
- if (this.disabled) return;
- this.changePage(page);
- },
- keyDown: function keyDown(e) {
- var key = e.keyCode;
- var condition = key >= 48 && key <= 57 || key >= 96 && key <= 105 || key === 8 || key === 37 || key === 39;
- if (!condition) {
- e.preventDefault();
- }
- },
- keyUp: function keyUp(e) {
- var key = e.keyCode;
- var val = parseInt(e.target.value);
- if (key === 38) {
- this.prev();
- } else if (key === 40) {
- this.next();
- } else if (key === 13) {
- var page = 1;
- if (val > this.allPages) {
- page = this.allPages;
- } else if (val <= 0 || !val) {
- page = 1;
- } else {
- page = val;
- }
- e.target.value = page;
- this.changePage(page);
- }
- }
- }
- };
- /***/ }),
- /* 218 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _select = __webpack_require__(74);
- var _select2 = _interopRequireDefault(_select);
- var _option = __webpack_require__(81);
- var _option2 = _interopRequireDefault(_option);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-page';
- function isValueNumber(value) {
- return (/^[1-9][0-9]*$/.test(value + '')
- );
- }
- exports.default = {
- name: 'PageOption',
- mixins: [_locale2.default],
- components: { iSelect: _select2.default, iOption: _option2.default },
- props: {
- pageSizeOpts: Array,
- showSizer: Boolean,
- showElevator: Boolean,
- current: Number,
- _current: Number,
- pageSize: Number,
- allPages: Number,
- isSmall: Boolean,
- placement: String,
- transfer: Boolean,
- disabled: Boolean,
- eventsEnabled: Boolean
- },
- data: function data() {
- return {
- currentPageSize: this.pageSize
- };
- },
- watch: {
- pageSize: function pageSize(val) {
- this.currentPageSize = val;
- }
- },
- computed: {
- size: function size() {
- return this.isSmall ? 'small' : 'default';
- },
- optsClasses: function optsClasses() {
- return [prefixCls + '-options'];
- },
- sizerClasses: function sizerClasses() {
- return [prefixCls + '-options-sizer'];
- },
- ElevatorClasses: function ElevatorClasses() {
- return [prefixCls + '-options-elevator'];
- }
- },
- methods: {
- changeSize: function changeSize() {
- this.$emit('on-size', this.currentPageSize);
- },
- changePage: function changePage(event) {
- var val = event.target.value.trim();
- var page = 0;
- if (isValueNumber(val)) {
- val = Number(val);
- if (val != this.current) {
- var allPages = this.allPages;
- if (val > allPages) {
- page = allPages;
- } else {
- page = val;
- }
- }
- } else {
- page = 1;
- }
- if (page) {
- this.$emit('on-page', page);
- event.target.value = page;
- }
- }
- }
- };
- /***/ }),
- /* 219 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__ = __webpack_require__(220);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__ = __webpack_require__(513);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 220 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _popper = __webpack_require__(221);
- var _popper2 = _interopRequireDefault(_popper);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _clickoutside = __webpack_require__(82);
- var _clickoutside2 = _interopRequireDefault(_clickoutside);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- var _transferQueue = __webpack_require__(37);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-poptip';
- exports.default = {
- name: 'Poptip',
- mixins: [_popper2.default, _locale2.default],
- directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
- components: { iButton: _button2.default },
- props: {
- trigger: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['click', 'focus', 'hover']);
- },
- default: 'click'
- },
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
- },
- default: 'top'
- },
- title: {
- type: [String, Number]
- },
- content: {
- type: [String, Number],
- default: ''
- },
- width: {
- type: [String, Number]
- },
- confirm: {
- type: Boolean,
- default: false
- },
- okText: {
- type: String
- },
- cancelText: {
- type: String
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- popperClass: {
- type: String
- },
- wordWrap: {
- type: Boolean,
- default: false
- },
- padding: {
- type: String
- },
- disabled: {
- type: Boolean,
- default: false
- },
- capture: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW ? false : this.$IVIEW.capture;
- }
- },
- transferClassName: {
- type: String
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- showTitle: true,
- isInput: false,
- disableCloseUnderTransfer: false,
- tIndex: this.handleGetIndex()
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-confirm', this.confirm)];
- },
- popperClasses: function popperClasses() {
- var _ref2;
- return [prefixCls + '-popper', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-confirm', this.transfer && this.confirm), (0, _defineProperty3.default)(_ref2, '' + String(this.popperClass), !!this.popperClass), (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2)];
- },
- styles: function styles() {
- var style = {};
- if (this.width) {
- style.width = String(this.width) + 'px';
- }
- if (this.transfer) style['z-index'] = 1060 + this.tIndex;
- return style;
- },
- localeOkText: function localeOkText() {
- if (this.okText === undefined) {
- return this.t('i.poptip.okText');
- } else {
- return this.okText;
- }
- },
- localeCancelText: function localeCancelText() {
- if (this.cancelText === undefined) {
- return this.t('i.poptip.cancelText');
- } else {
- return this.cancelText;
- }
- },
- contentClasses: function contentClasses() {
- return [prefixCls + '-body-content', (0, _defineProperty3.default)({}, prefixCls + '-body-content-word-wrap', this.wordWrap)];
- },
- contentPaddingStyle: function contentPaddingStyle() {
- var styles = {};
- if (this.padding !== '') styles['padding'] = this.padding;
- return styles;
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.disabled) return;
- if (this.confirm) {
- this.visible = !this.visible;
- return true;
- }
- if (this.trigger !== 'click') {
- return false;
- }
- this.visible = !this.visible;
- },
- handleTransferClick: function handleTransferClick() {
- if (this.transfer) this.disableCloseUnderTransfer = true;
- },
- handleClose: function handleClose() {
- if (this.disableCloseUnderTransfer) {
- this.disableCloseUnderTransfer = false;
- return false;
- }
- if (this.confirm) {
- this.visible = false;
- return true;
- }
- if (this.trigger !== 'click') {
- return false;
- }
- this.visible = false;
- },
- handleFocus: function handleFocus() {
- var fromInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- if (this.disabled) return;
- if (this.trigger !== 'focus' || this.confirm || this.isInput && !fromInput) {
- return false;
- }
- this.visible = true;
- },
- handleBlur: function handleBlur() {
- var fromInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- if (this.trigger !== 'focus' || this.confirm || this.isInput && !fromInput) {
- return false;
- }
- this.visible = false;
- },
- handleMouseenter: function handleMouseenter() {
- var _this = this;
- if (this.disabled) return;
- if (this.trigger !== 'hover' || this.confirm) {
- return false;
- }
- if (this.enterTimer) clearTimeout(this.enterTimer);
- this.enterTimer = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.visible = true;
- }.bind(this), 100);
- },
- handleMouseleave: function handleMouseleave() {
- var _this2 = this;
- if (this.trigger !== 'hover' || this.confirm) {
- return false;
- }
- if (this.enterTimer) {
- clearTimeout(this.enterTimer);
- this.enterTimer = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.visible = false;
- }.bind(this), 100);
- }
- },
- cancel: function cancel() {
- this.visible = false;
- this.$emit('on-cancel');
- },
- ok: function ok() {
- this.visible = false;
- this.$emit('on-ok');
- },
- getInputChildren: function getInputChildren() {
- var $input = this.$refs.reference.querySelectorAll('input');
- var $textarea = this.$refs.reference.querySelectorAll('textarea');
- var $children = null;
- if ($input.length) {
- $children = $input[0];
- } else if ($textarea.length) {
- $children = $textarea[0];
- }
- return $children;
- },
- handleGetIndex: function handleGetIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- },
- handleIndexIncrease: function handleIndexIncrease() {
- this.tIndex = this.handleGetIndex();
- }
- },
- mounted: function mounted() {
- var _this3 = this;
- if (!this.confirm) {
- this.showTitle = this.$slots.title !== undefined || this.title;
- }
- if (this.trigger === 'focus') {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- var $children = this.getInputChildren();
- if ($children) {
- this.isInput = true;
- $children.addEventListener('focus', this.handleFocus, false);
- $children.addEventListener('blur', this.handleBlur, false);
- }
- }.bind(this));
- }
- },
- beforeDestroy: function beforeDestroy() {
- var $children = this.getInputChildren();
- if ($children) {
- $children.removeEventListener('focus', this.handleFocus, false);
- $children.removeEventListener('blur', this.handleBlur, false);
- }
- }
- };
- /***/ }),
- /* 221 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- var Popper = isServer ? function () {} : __webpack_require__(116);exports.default = {
- props: {
- eventsEnabled: {
- type: Boolean,
- default: false
- },
- placement: {
- type: String,
- default: 'bottom'
- },
- boundariesPadding: {
- type: Number,
- default: 5
- },
- reference: Object,
- popper: Object,
- offset: {
- default: 0
- },
- value: {
- type: Boolean,
- default: false
- },
- transition: String,
- options: {
- type: Object,
- default: function _default() {
- return {
- modifiers: {
- computeStyle: {
- gpuAcceleration: false
- },
- preventOverflow: {
- boundariesElement: 'window'
- }
- }
- };
- }
- }
- },
- data: function data() {
- return {
- visible: this.value
- };
- },
- watch: {
- value: {
- immediate: true,
- handler: function handler(val) {
- this.visible = val;
- this.$emit('input', val);
- }
- },
- visible: function visible(val) {
- if (val) {
- if (this.handleIndexIncrease) this.handleIndexIncrease();
- this.updatePopper();
- this.$emit('on-popper-show');
- } else {
- this.$emit('on-popper-hide');
- }
- this.$emit('input', val);
- }
- },
- methods: {
- createPopper: function createPopper() {
- var _this = this;
- if (isServer) return;
- if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) {
- return;
- }
- var options = this.options;
- var popper = this.popper || this.$refs.popper;
- var reference = this.reference || this.$refs.reference;
- if (!popper || !reference) return;
- if (this.popperJS && this.popperJS.hasOwnProperty('destroy')) {
- this.popperJS.destroy();
- }
- options.eventsEnabled = this.eventsEnabled;
- options.placement = this.placement;
- if (!options.modifiers.offset) {
- options.modifiers.offset = {};
- }
- options.modifiers.offset.offset = this.offset;
- options.onCreate = function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.$nextTick(this.updatePopper);
- this.$emit('created', this);
- }.bind(this);
- this.popperJS = new Popper(reference, popper, options);
- },
- updatePopper: function updatePopper() {
- if (isServer) return;
- this.popperJS ? this.popperJS.update() : this.createPopper();
- },
- doDestroy: function doDestroy() {
- if (isServer) return;
- if (this.visible) return;
- this.popperJS.destroy();
- this.popperJS = null;
- }
- },
- updated: function updated() {
- var _this2 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.updatePopper();
- }.bind(this));
- },
- beforeDestroy: function beforeDestroy() {
- if (isServer) return;
- if (this.popperJS) {
- this.popperJS.destroy();
- }
- }
- };
- /***/ }),
- /* 222 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__ = __webpack_require__(223);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__ = __webpack_require__(515);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 223 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-progress';
- exports.default = {
- name: 'Progress',
- components: { Icon: _icon2.default },
- props: {
- percent: {
- type: Number,
- default: 0
- },
- successPercent: {
- type: Number,
- default: 0
- },
- status: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['normal', 'active', 'wrong', 'success']);
- },
- default: 'normal'
- },
- hideInfo: {
- type: Boolean,
- default: false
- },
- strokeWidth: {
- type: Number,
- default: 10
- },
- vertical: {
- type: Boolean,
- default: false
- },
- strokeColor: {
- type: [String, Array]
- },
- textInside: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- currentStatus: this.status
- };
- },
- computed: {
- isStatus: function isStatus() {
- return this.currentStatus == 'wrong' || this.currentStatus == 'success';
- },
- statusIcon: function statusIcon() {
- var type = '';
- switch (this.currentStatus) {
- case 'wrong':
- type = 'ios-close-circle';
- break;
- case 'success':
- type = 'ios-checkmark-circle';
- break;
- }
- return type;
- },
- bgStyle: function bgStyle() {
- var style = this.vertical ? {
- height: String(this.percent) + '%',
- width: String(this.strokeWidth) + 'px'
- } : {
- width: String(this.percent) + '%',
- height: String(this.strokeWidth) + 'px'
- };
- if (this.strokeColor) {
- if (typeof this.strokeColor === 'string') {
- style['background-color'] = this.strokeColor;
- } else {
- style['background-image'] = 'linear-gradient(to right, ' + String(this.strokeColor[0]) + ' 0%, ' + String(this.strokeColor[1]) + ' 100%)';
- }
- }
- return style;
- },
- successBgStyle: function successBgStyle() {
- return this.vertical ? {
- height: String(this.successPercent) + '%',
- width: String(this.strokeWidth) + 'px'
- } : {
- width: String(this.successPercent) + '%',
- height: String(this.strokeWidth) + 'px'
- };
- },
- wrapClasses: function wrapClasses() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-' + String(this.currentStatus), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-show-info', !this.hideInfo && !this.textInside), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
- },
- textClasses: function textClasses() {
- return prefixCls + '-text';
- },
- textInnerClasses: function textInnerClasses() {
- return prefixCls + '-text-inner';
- },
- outerClasses: function outerClasses() {
- return prefixCls + '-outer';
- },
- innerClasses: function innerClasses() {
- return prefixCls + '-inner';
- },
- bgClasses: function bgClasses() {
- return prefixCls + '-bg';
- },
- successBgClasses: function successBgClasses() {
- return prefixCls + '-success-bg';
- }
- },
- created: function created() {
- this.handleStatus();
- },
- methods: {
- handleStatus: function handleStatus(isDown) {
- if (isDown) {
- this.currentStatus = 'normal';
- this.$emit('on-status-change', 'normal');
- } else {
- if (parseInt(this.percent, 10) == 100) {
- this.currentStatus = 'success';
- this.$emit('on-status-change', 'success');
- }
- }
- }
- },
- watch: {
- percent: function percent(val, oldVal) {
- if (val < oldVal) {
- this.handleStatus(true);
- } else {
- this.handleStatus();
- }
- },
- status: function status(val) {
- this.currentStatus = val;
- }
- }
- };
- /***/ }),
- /* 224 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-radio';
- exports.default = {
- name: 'Radio',
- mixins: [_emitter2.default, _form2.default],
- props: {
- value: {
- type: [String, Number, Boolean],
- default: false
- },
- trueValue: {
- type: [String, Number, Boolean],
- default: true
- },
- falseValue: {
- type: [String, Number, Boolean],
- default: false
- },
- label: {
- type: [String, Number]
- },
- disabled: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- name: {
- type: String
- },
- border: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- currentValue: this.value,
- group: false,
- groupName: this.name,
- parent: (0, _assist.findComponentUpward)(this, 'RadioGroup'),
- focusWrapper: false,
- focusInner: false
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-group-item', this.group), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-checked', this.currentValue), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-focus', this.focusWrapper), (0, _defineProperty3.default)(_ref, prefixCls + '-border', this.border), _ref)];
- },
- radioClasses: function radioClasses() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-checked', this.currentValue), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), _ref2)];
- },
- innerClasses: function innerClasses() {
- return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-focus', this.focusInner)];
- },
- inputClasses: function inputClasses() {
- return prefixCls + '-input';
- }
- },
- mounted: function mounted() {
- if (this.parent) {
- this.group = true;
- if (this.name && this.name !== this.parent.name) {
- if (console.warn) {
- console.warn('[iview] Name does not match Radio Group name.');
- }
- } else {
- this.groupName = this.parent.name;
- }
- }
- if (this.group) {
- this.parent.updateValue();
- } else {
- this.updateValue();
- }
- },
- methods: {
- change: function change(event) {
- if (this.itemDisabled) {
- return false;
- }
- var checked = event.target.checked;
- this.currentValue = checked;
- var value = checked ? this.trueValue : this.falseValue;
- this.$emit('input', value);
- if (this.group) {
- if (this.label !== undefined) {
- this.parent.change({
- value: this.label,
- checked: this.value
- });
- }
- } else {
- this.$emit('on-change', value);
- this.dispatch('FormItem', 'on-form-change', value);
- }
- },
- updateValue: function updateValue() {
- this.currentValue = this.value === this.trueValue;
- },
- onBlur: function onBlur() {
- this.focusWrapper = false;
- this.focusInner = false;
- },
- onFocus: function onFocus() {
- if (this.group && this.parent.type === 'button') {
- this.focusWrapper = true;
- } else {
- this.focusInner = true;
- }
- }
- },
- watch: {
- value: function value(val) {
- if (val === this.trueValue || val === this.falseValue) {
- this.updateValue();
- } else {
- throw 'Value should be trueValue or falseValue.';
- }
- }
- }
- };
- /***/ }),
- /* 225 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-radio-group';
- var seed = 0;
- var now = Date.now();
- var getUuid = function () {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return 'ivuRadioGroup_' + String(now) + '_' + seed++;
- }.bind(undefined);
- exports.default = {
- name: 'RadioGroup',
- mixins: [_emitter2.default],
- props: {
- value: {
- type: [String, Number],
- default: ''
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['button']);
- }
- },
- vertical: {
- type: Boolean,
- default: false
- },
- name: {
- type: String,
- default: getUuid
- },
- buttonStyle: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['default', 'solid']);
- },
- default: 'default'
- }
- },
- data: function data() {
- return {
- currentValue: this.value,
- children: []
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, 'ivu-radio-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-button-' + String(this.buttonStyle), this.type === 'button' && this.buttonStyle !== 'default'), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
- }
- },
- mounted: function mounted() {
- this.updateValue();
- },
- methods: {
- updateValue: function updateValue() {
- var _this = this;
- this.children = (0, _assist.findComponentsDownward)(this, 'Radio');
- if (this.children) {
- this.children.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- child.currentValue = this.currentValue === child.label;
- child.group = true;
- }.bind(this));
- }
- },
- change: function change(data) {
- this.currentValue = data.value;
- this.updateValue();
- this.$emit('input', data.value);
- this.$emit('on-change', data.value);
- this.dispatch('FormItem', 'on-form-change', data.value);
- }
- },
- watch: {
- value: function value() {
- var _this2 = this;
- if (this.currentValue !== this.value) {
- this.currentValue = this.value;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.updateValue();
- }.bind(this));
- }
- }
- }
- };
- /***/ }),
- /* 226 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-rate';
- exports.default = {
- name: 'Rate',
- mixins: [_locale2.default, _emitter2.default, _form2.default],
- components: { Icon: _icon2.default },
- props: {
- count: {
- type: Number,
- default: 5
- },
- value: {
- type: Number,
- default: 0
- },
- allowHalf: {
- type: Boolean,
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- showText: {
- type: Boolean,
- default: false
- },
- name: {
- type: String
- },
- clearable: {
- type: Boolean,
- default: false
- },
- character: {
- type: String,
- default: ''
- },
- icon: {
- type: String,
- default: ''
- },
- customIcon: {
- type: String,
- default: ''
- }
- },
- data: function data() {
- var value = this.value || 0;
- return {
- prefixCls: prefixCls,
- hoverIndex: -1,
- isHover: false,
- isHalf: this.allowHalf && value.toString().indexOf('.') >= 0,
- currentValue: value
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-disabled', this.itemDisabled)];
- },
- iconClasses: function iconClasses() {
- var _ref2;
- return ['ivu-icon', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, 'ivu-icon-' + String(this.icon), this.icon !== ''), (0, _defineProperty3.default)(_ref2, '' + String(this.customIcon), this.customIcon !== ''), _ref2)];
- },
- showCharacter: function showCharacter() {
- return this.character !== '' || this.icon !== '' || this.customIcon !== '';
- }
- },
- watch: {
- value: function value(val) {
- this.currentValue = val || 0;
- },
- currentValue: function currentValue(val) {
- this.setHalf(val);
- }
- },
- methods: {
- starCls: function starCls(value) {
- var _ref3;
- var hoverIndex = this.hoverIndex;
- var currentIndex = this.isHover ? hoverIndex : this.currentValue;
- var full = false;
- var isLast = false;
- if (currentIndex >= value) full = true;
- if (this.isHover) {
- isLast = currentIndex === value;
- } else {
- isLast = Math.ceil(this.currentValue) === value;
- }
- return [(_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-star', !this.showCharacter), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-chart', this.showCharacter), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-full', !isLast && full || isLast && !this.isHalf), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-half', isLast && this.isHalf), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-zero', !full), _ref3)];
- },
- handleMousemove: function handleMousemove(value, event) {
- if (this.itemDisabled) return;
- this.isHover = true;
- if (this.allowHalf) {
- var type = event.target.getAttribute('type') || false;
- this.isHalf = type === 'half';
- } else {
- this.isHalf = false;
- }
- this.hoverIndex = value;
- },
- handleMouseleave: function handleMouseleave() {
- if (this.itemDisabled) return;
- this.isHover = false;
- this.setHalf(this.currentValue);
- this.hoverIndex = -1;
- },
- setHalf: function setHalf(val) {
- this.isHalf = this.allowHalf && val.toString().indexOf('.') >= 0;
- },
- handleClick: function handleClick(value) {
- if (this.itemDisabled) return;
- if (this.isHalf) value -= 0.5;
- if (this.clearable && Math.abs(value - this.currentValue) < 0.01) {
- value = 0;
- }
- this.currentValue = value;
- this.$emit('input', value);
- this.$emit('on-change', value);
- this.dispatch('FormItem', 'on-form-change', value);
- }
- }
- };
- /***/ }),
- /* 227 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _isFinite = __webpack_require__(75);
- var _isFinite2 = _interopRequireDefault(_isFinite);
- var _slicedToArray2 = __webpack_require__(26);
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _inputNumber = __webpack_require__(194);
- var _inputNumber2 = _interopRequireDefault(_inputNumber);
- var _tooltip = __webpack_require__(93);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- var _marker = __webpack_require__(528);
- var _marker2 = _interopRequireDefault(_marker);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- var _elementResizeDetector = __webpack_require__(94);
- var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-slider';
- exports.default = {
- name: 'Slider',
- mixins: [_emitter2.default, _form2.default],
- components: { InputNumber: _inputNumber2.default, Tooltip: _tooltip2.default, SliderMarker: _marker2.default },
- props: {
- min: {
- type: Number,
- default: 0
- },
- max: {
- type: Number,
- default: 100
- },
- step: {
- type: Number,
- default: 1
- },
- range: {
- type: Boolean,
- default: false
- },
- value: {
- type: [Number, Array],
- default: 0
- },
- disabled: {
- type: Boolean,
- default: false
- },
- showInput: {
- type: Boolean,
- default: false
- },
- inputSize: {
- type: String,
- default: 'default',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- }
- },
- showStops: {
- type: Boolean,
- default: false
- },
- tipFormat: {
- type: Function,
- default: function _default(val) {
- return val;
- }
- },
- showTip: {
- type: String,
- default: 'hover',
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['hover', 'always', 'never']);
- }
- },
- name: {
- type: String
- },
- activeChange: {
- type: Boolean,
- default: true
- },
- marks: {
- type: Object
- }
- },
- data: function data() {
- var val = this.checkLimits(Array.isArray(this.value) ? this.value : [this.value]);
- if (this.range && this.value === null) val = [0, 0];
- return {
- prefixCls: prefixCls,
- currentValue: val,
- dragging: false,
- pointerDown: '',
- startX: 0,
- currentX: 0,
- startPos: 0,
- oldValue: [].concat((0, _toConsumableArray3.default)(val)),
- valueIndex: {
- min: 0,
- max: 1
- },
- sliderWidth: 0,
- isValueNull: false };
- },
- watch: {
- value: function value(val) {
- if (val === null) this.isValueNull = true;
- val = this.checkLimits(Array.isArray(val) ? val : [val]);
- if (!this.dragging && (val[0] !== this.currentValue[0] || val[1] !== this.currentValue[1])) {
- if (this.isValueNull && this.range) this.currentValue = [0, 0];else this.currentValue = val;
- }
- },
- exportValue: function exportValue(values) {
- var _this = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.$refs.minTooltip.updatePopper();
- if (this.range) {
- this.$refs.maxTooltip.updatePopper();
- }
- }.bind(this));
- var value = this.range ? values : values[0];
- if (this.isValueNull) {
- this.isValueNull = false;
- this.$emit('input', null);
- } else {
- this.$emit('input', value);
- }
- this.$emit('on-input', value);
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-input', this.showInput && !this.range), (0, _defineProperty3.default)(_ref, prefixCls + '-range', this.range), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), _ref)];
- },
- minButtonClasses: function minButtonClasses() {
- return [prefixCls + '-button', (0, _defineProperty3.default)({}, prefixCls + '-button-dragging', this.pointerDown === 'min')];
- },
- maxButtonClasses: function maxButtonClasses() {
- return [prefixCls + '-button', (0, _defineProperty3.default)({}, prefixCls + '-button-dragging', this.pointerDown === 'max')];
- },
- exportValue: function exportValue() {
- var _this2 = this;
- var decimalCases = (String(this.step).split('.')[1] || '').length;
- return this.currentValue.map(function (nr) {
- (0, _newArrowCheck3.default)(this, _this2);
- return Number(nr.toFixed(decimalCases));
- }.bind(this));
- },
- minPosition: function minPosition() {
- var val = this.currentValue;
- return (val[0] - this.min) / this.valueRange * 100;
- },
- maxPosition: function maxPosition() {
- var val = this.currentValue;
- return (val[1] - this.min) / this.valueRange * 100;
- },
- barStyle: function barStyle() {
- var style = {
- width: (this.currentValue[0] - this.min) / this.valueRange * 100 + '%'
- };
- if (this.range) {
- style.left = (this.currentValue[0] - this.min) / this.valueRange * 100 + '%';
- style.width = (this.currentValue[1] - this.currentValue[0]) / this.valueRange * 100 + '%';
- }
- return style;
- },
- stops: function stops() {
- var stopCount = this.valueRange / this.step;
- var result = [];
- var stepWidth = 100 * this.step / this.valueRange;
- for (var i = 1; i < stopCount; i++) {
- result.push(i * stepWidth);
- }
- return result;
- },
- markList: function markList() {
- var _this3 = this;
- if (!this.marks) return [];
- var marksKeys = (0, _keys2.default)(this.marks);
- return marksKeys.map(parseFloat).sort(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this3);
- return a - b;
- }.bind(this)).filter(function (point) {
- (0, _newArrowCheck3.default)(this, _this3);
- return point <= this.max && point >= this.min;
- }.bind(this)).map(function (point) {
- (0, _newArrowCheck3.default)(this, _this3);
- return {
- point: point,
- position: (point - this.min) * 100 / (this.max - this.min),
- mark: this.marks[point]
- };
- }.bind(this));
- },
- tipDisabled: function tipDisabled() {
- return this.tipFormat(this.currentValue[0]) === null || this.showTip === 'never';
- },
- valueRange: function valueRange() {
- return this.max - this.min;
- },
- firstPosition: function firstPosition() {
- return this.currentValue[0];
- },
- secondPosition: function secondPosition() {
- return this.currentValue[1];
- }
- },
- methods: {
- getPointerX: function getPointerX(e) {
- return e.type.indexOf('touch') !== -1 ? e.touches[0].clientX : e.clientX;
- },
- checkLimits: function checkLimits(_ref4) {
- var _ref5 = (0, _slicedToArray3.default)(_ref4, 2),
- min = _ref5[0],
- max = _ref5[1];
- min = Math.max(this.min, min);
- min = Math.min(this.max, min);
- max = Math.max(this.min, min, max);
- max = Math.min(this.max, max);
- return [min, max];
- },
- getCurrentValue: function getCurrentValue(event, type) {
- if (this.itemDisabled) {
- return;
- }
- var index = this.valueIndex[type];
- if (typeof index === 'undefined') {
- return;
- }
- return this.currentValue[index];
- },
- onKeyLeft: function onKeyLeft(event, type) {
- var value = this.getCurrentValue(event, type);
- if ((0, _isFinite2.default)(value)) {
- this.changeButtonPosition(value - this.step, type);
- }
- },
- onKeyRight: function onKeyRight(event, type) {
- var value = this.getCurrentValue(event, type);
- if ((0, _isFinite2.default)(value)) {
- this.changeButtonPosition(value + this.step, type);
- }
- },
- onPointerDown: function onPointerDown(event, type) {
- if (this.itemDisabled) return;
- event.preventDefault();
- this.pointerDown = type;
- this.onPointerDragStart(event);
- (0, _dom.on)(window, 'mousemove', this.onPointerDrag);
- (0, _dom.on)(window, 'touchmove', this.onPointerDrag);
- (0, _dom.on)(window, 'mouseup', this.onPointerDragEnd);
- (0, _dom.on)(window, 'touchend', this.onPointerDragEnd);
- },
- onPointerDragStart: function onPointerDragStart(event) {
- this.dragging = false;
- this.startX = this.getPointerX(event);
- this.startPos = this[String(this.pointerDown) + 'Position'] * this.valueRange / 100 + this.min;
- },
- onPointerDrag: function onPointerDrag(event) {
- this.dragging = true;
- this.$refs[String(this.pointerDown) + 'Tooltip'].visible = true;
- this.currentX = this.getPointerX(event);
- var diff = (this.currentX - this.startX) / this.sliderWidth * this.valueRange;
- this.changeButtonPosition(this.startPos + diff);
- },
- onPointerDragEnd: function onPointerDragEnd() {
- if (this.dragging) {
- this.dragging = false;
- this.$refs[String(this.pointerDown) + 'Tooltip'].visible = false;
- this.emitChange();
- }
- this.pointerDown = '';
- (0, _dom.off)(window, 'mousemove', this.onPointerDrag);
- (0, _dom.off)(window, 'touchmove', this.onPointerDrag);
- (0, _dom.off)(window, 'mouseup', this.onPointerDragEnd);
- (0, _dom.off)(window, 'touchend', this.onPointerDragEnd);
- },
- changeButtonPosition: function changeButtonPosition(newPos, forceType) {
- var type = forceType || this.pointerDown;
- var index = type === 'min' ? 0 : 1;
- if (type === 'min') newPos = this.checkLimits([newPos, this.max])[0];else newPos = this.checkLimits([this.min, newPos])[1];
- var modulus = this.handleDecimal(newPos, this.step);
- var value = this.currentValue;
- value[index] = newPos - modulus;
- if (this.range) {
- if (type === 'min' && value[0] > value[1]) value[1] = value[0];
- if (type === 'max' && value[0] > value[1]) value[0] = value[1];
- }
- this.currentValue = [].concat((0, _toConsumableArray3.default)(value));
- if (!this.dragging) {
- if (this.currentValue[index] !== this.oldValue[index]) {
- this.emitChange();
- this.oldValue[index] = this.currentValue[index];
- }
- }
- },
- handleDecimal: function handleDecimal(pos, step) {
- if (step < 1) {
- var sl = step.toString(),
- multiple = 1,
- m = void 0;
- try {
- m = sl.split('.')[1].length;
- } catch (e) {
- m = 0;
- }
- multiple = Math.pow(10, m);
- return pos * multiple % (step * multiple) / multiple;
- } else return pos % step;
- },
- emitChange: function emitChange() {
- var value = this.range ? this.exportValue : this.exportValue[0];
- this.$emit('on-change', value);
- this.dispatch('FormItem', 'on-form-change', value);
- },
- sliderClick: function sliderClick(event) {
- if (this.itemDisabled) return;
- var currentX = this.getPointerX(event);
- var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
- var newPos = (currentX - sliderOffsetLeft) / this.sliderWidth * this.valueRange + this.min;
- var regularNewPos = newPos / this.valueRange * 100;
- if (!this.range || regularNewPos <= this.minPosition) this.changeButtonPosition(newPos, 'min');else if (regularNewPos >= this.maxPosition) this.changeButtonPosition(newPos, 'max');else this.changeButtonPosition(newPos, newPos - this.firstPosition <= this.secondPosition - newPos ? 'min' : 'max');
- },
- handleInputChange: function handleInputChange(val) {
- this.currentValue = [val === 0 ? 0 : val || this.min, this.currentValue[1]];
- this.emitChange();
- },
- handleFocus: function handleFocus(type) {
- this.$refs[String(type) + 'Tooltip'].handleShowPopper();
- },
- handleBlur: function handleBlur(type) {
- this.$refs[String(type) + 'Tooltip'].handleClosePopper();
- },
- handleSetSliderWidth: function handleSetSliderWidth() {
- this.sliderWidth = parseInt((0, _assist.getStyle)(this.$refs.slider, 'width'), 10);
- }
- },
- mounted: function mounted() {
- var _this4 = this;
- this.$on('on-visible-change', function (val) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (val && this.showTip === 'always') {
- this.$refs.minTooltip.doDestroy();
- if (this.range) {
- this.$refs.maxTooltip.doDestroy();
- }
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this4);
- this.$refs.minTooltip.updatePopper();
- if (this.range) {
- this.$refs.maxTooltip.updatePopper();
- }
- }.bind(this));
- }
- }.bind(this));
- this.observer = (0, _elementResizeDetector2.default)();
- this.observer.listenTo(this.$refs.slider, this.handleSetSliderWidth);
- },
- beforeDestroy: function beforeDestroy() {
- this.observer.removeListener(this.$refs.slider, this.handleSetSliderWidth);
- }
- };
- /***/ }),
- /* 228 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _popper = __webpack_require__(221);
- var _popper2 = _interopRequireDefault(_popper);
- var _transferDom = __webpack_require__(23);
- var _transferDom2 = _interopRequireDefault(_transferDom);
- var _assist = __webpack_require__(3);
- var _transferQueue = __webpack_require__(37);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-tooltip';
- exports.default = {
- name: 'Tooltip',
- directives: { TransferDom: _transferDom2.default },
- mixins: [_popper2.default],
- props: {
- placement: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
- },
- default: 'bottom'
- },
- content: {
- type: [String, Number],
- default: ''
- },
- delay: {
- type: Number,
- default: 100
- },
- disabled: {
- type: Boolean,
- default: false
- },
- controlled: {
- type: Boolean,
- default: false
- },
- always: {
- type: Boolean,
- default: false
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
- }
- },
- theme: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['dark', 'light']);
- },
- default: 'dark'
- },
- maxWidth: {
- type: [String, Number]
- },
- transferClassName: {
- type: String
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- tIndex: this.handleGetIndex()
- };
- },
- computed: {
- innerStyles: function innerStyles() {
- var styles = {};
- if (this.maxWidth) styles['max-width'] = String(this.maxWidth) + 'px';
- return styles;
- },
- innerClasses: function innerClasses() {
- return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-inner-with-width', !!this.maxWidth)];
- },
- dropStyles: function dropStyles() {
- var styles = {};
- if (this.transfer) styles['z-index'] = 1060 + this.tIndex;
- return styles;
- },
- dropdownCls: function dropdownCls() {
- var _ref2;
- return [prefixCls + '-popper', prefixCls + '-' + String(this.theme), (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2)];
- }
- },
- watch: {
- content: function content() {
- this.updatePopper();
- }
- },
- methods: {
- handleShowPopper: function handleShowPopper() {
- var _this = this;
- if (this.timeout) clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.visible = true;
- }.bind(this), this.delay);
- this.tIndex = this.handleGetIndex();
- },
- handleClosePopper: function handleClosePopper() {
- var _this2 = this;
- if (this.timeout) {
- clearTimeout(this.timeout);
- if (!this.controlled) {
- this.timeout = setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.visible = false;
- }.bind(this), 100);
- }
- }
- },
- handleGetIndex: function handleGetIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- }
- },
- mounted: function mounted() {
- if (this.always) {
- this.updatePopper();
- }
- }
- };
- /***/ }),
- /* 229 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var utils = module.exports = {};
- /**
- * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
- * @public
- * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
- * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
- * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.
- */
- utils.forEach = function(collection, callback) {
- for(var i = 0; i < collection.length; i++) {
- var result = callback(collection[i]);
- if(result) {
- return result;
- }
- }
- };
- /***/ }),
- /* 230 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var detector = module.exports = {};
- detector.isIE = function(version) {
- function isAnyIeVersion() {
- var agent = navigator.userAgent.toLowerCase();
- return agent.indexOf("msie") !== -1 || agent.indexOf("trident") !== -1 || agent.indexOf(" edge/") !== -1;
- }
- if(!isAnyIeVersion()) {
- return false;
- }
- if(!version) {
- return true;
- }
- //Shamelessly stolen from https://gist.github.com/padolsey/527683
- var ieVersion = (function(){
- var undef,
- v = 3,
- div = document.createElement("div"),
- all = div.getElementsByTagName("i");
- do {
- div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->";
- }
- while (all[0]);
- return v > 4 ? v : undef;
- }());
- return version === ieVersion;
- };
- detector.isLegacyOpera = function() {
- return !!window.opera;
- };
- /***/ }),
- /* 231 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-steps';
- function debounce(fn) {
- var waiting = void 0;
- return function () {
- if (waiting) return;
- waiting = true;
- var context = this,
- args = arguments;
- var later = function later() {
- waiting = false;
- fn.apply(context, args);
- };
- this.$nextTick(later);
- };
- }
- exports.default = {
- name: 'Steps',
- props: {
- current: {
- type: Number,
- default: 0
- },
- status: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['wait', 'process', 'finish', 'error']);
- },
- default: 'process'
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small']);
- }
- },
- direction: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
- },
- default: 'horizontal'
- }
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, prefixCls + '-' + String(this.direction), (0, _defineProperty3.default)({}, prefixCls + '-' + String(this.size), !!this.size)];
- }
- },
- methods: {
- updateChildProps: function updateChildProps(isInit) {
- var _this = this;
- var total = this.$children.length;
- this.$children.forEach(function (child, index) {
- (0, _newArrowCheck3.default)(this, _this);
- child.stepNumber = index + 1;
- if (this.direction === 'horizontal') {
- child.total = total;
- }
- if (!(isInit && child.currentStatus)) {
- if (index === this.current) {
- if (this.status !== 'error') {
- child.currentStatus = 'process';
- }
- } else if (index < this.current) {
- child.currentStatus = 'finish';
- } else {
- child.currentStatus = 'wait';
- }
- }
- if (child.currentStatus !== 'error' && index !== 0) {
- this.$children[index - 1].nextError = false;
- }
- }.bind(this));
- },
- setNextError: function setNextError() {
- var _this2 = this;
- this.$children.forEach(function (child, index) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (child.currentStatus === 'error' && index !== 0) {
- this.$children[index - 1].nextError = true;
- }
- }.bind(this));
- },
- updateCurrent: function updateCurrent(isInit) {
- if (this.current < 0 || this.current >= this.$children.length) {
- return;
- }
- if (isInit) {
- var current_status = this.$children[this.current].currentStatus;
- if (!current_status) {
- this.$children[this.current].currentStatus = this.status;
- }
- } else {
- this.$children[this.current].currentStatus = this.status;
- }
- },
- debouncedAppendRemove: function debouncedAppendRemove() {
- return debounce(function () {
- this.updateSteps();
- });
- },
- updateSteps: function updateSteps() {
- this.updateChildProps(true);
- this.setNextError();
- this.updateCurrent(true);
- }
- },
- mounted: function mounted() {
- this.updateSteps();
- this.$on('append', this.debouncedAppendRemove());
- this.$on('remove', this.debouncedAppendRemove());
- },
- watch: {
- current: function current() {
- this.updateChildProps();
- },
- status: function status() {
- this.updateCurrent();
- }
- }
- };
- /***/ }),
- /* 232 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-steps';
- var iconPrefixCls = 'ivu-icon';
- exports.default = {
- name: 'Step',
- mixins: [_emitter2.default],
- props: {
- status: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['wait', 'process', 'finish', 'error']);
- }
- },
- title: {
- type: String,
- default: ''
- },
- content: {
- type: String
- },
- icon: {
- type: String
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- stepNumber: '',
- nextError: false,
- total: 1,
- currentStatus: ''
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-item', prefixCls + '-status-' + String(this.currentStatus), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-custom', !!this.icon || !!this.$slots.icon), (0, _defineProperty3.default)(_ref, prefixCls + '-next-error', this.nextError), _ref)];
- },
- iconClasses: function iconClasses() {
- var icon = '';
- if (this.icon) {
- icon = this.icon;
- } else {
- if (this.currentStatus === 'finish') {
- icon = 'ios-checkmark';
- } else if (this.currentStatus === 'error') {
- icon = 'ios-close';
- }
- }
- return [prefixCls + '-icon', '' + iconPrefixCls, (0, _defineProperty3.default)({}, iconPrefixCls + '-' + String(icon), icon !== '')];
- }
- },
- watch: {
- status: function status(val) {
- this.currentStatus = val;
- if (this.currentStatus === 'error') {
- this.$parent.setNextError();
- }
- }
- },
- created: function created() {
- this.currentStatus = this.status;
- },
- mounted: function mounted() {
- this.dispatch('Steps', 'append');
- },
- beforeDestroy: function beforeDestroy() {
- this.dispatch('Steps', 'remove');
- }
- };
- /***/ }),
- /* 233 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-switch';
- exports.default = {
- name: 'iSwitch',
- mixins: [_emitter2.default, _form2.default],
- props: {
- value: {
- type: [String, Number, Boolean],
- default: false
- },
- trueValue: {
- type: [String, Number, Boolean],
- default: true
- },
- falseValue: {
- type: [String, Number, Boolean],
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['large', 'small', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- name: {
- type: String
- },
- loading: {
- type: Boolean,
- default: false
- },
- trueColor: {
- type: String
- },
- falseColor: {
- type: String
- },
- beforeChange: Function
- },
- data: function data() {
- return {
- currentValue: this.value
- };
- },
- computed: {
- wrapClasses: function wrapClasses() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-checked', this.currentValue === this.trueValue), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-loading', this.loading), _ref)];
- },
- wrapStyles: function wrapStyles() {
- var style = {};
- if (this.trueColor && this.currentValue === this.trueValue) {
- style['border-color'] = this.trueColor;
- style['background-color'] = this.trueColor;
- } else if (this.falseColor && this.currentValue === this.falseValue) {
- style['border-color'] = this.falseColor;
- style['background-color'] = this.falseColor;
- }
- return style;
- },
- innerClasses: function innerClasses() {
- return prefixCls + '-inner';
- }
- },
- methods: {
- handleToggle: function handleToggle() {
- var checked = this.currentValue === this.trueValue ? this.falseValue : this.trueValue;
- this.currentValue = checked;
- this.$emit('input', checked);
- this.$emit('on-change', checked);
- this.dispatch('FormItem', 'on-form-change', checked);
- },
- toggle: function toggle(event) {
- var _this = this;
- event.preventDefault();
- if (this.itemDisabled || this.loading) {
- return false;
- }
- if (!this.beforeChange) {
- return this.handleToggle();
- }
- var before = this.beforeChange();
- if (before && before.then) {
- before.then(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.handleToggle();
- }.bind(this));
- } else {
- this.handleToggle();
- }
- }
- },
- watch: {
- value: function value(val) {
- if (val !== this.trueValue && val !== this.falseValue && val !== null) {
- throw 'Value should be trueValue or falseValue.';
- }
- this.currentValue = val;
- }
- }
- };
- /***/ }),
- /* 234 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _getIterator2 = __webpack_require__(45);
- var _getIterator3 = _interopRequireDefault(_getIterator2);
- var _set = __webpack_require__(552);
- var _set2 = _interopRequireDefault(_set);
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _stringify = __webpack_require__(57);
- var _stringify2 = _interopRequireDefault(_stringify);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _tableHead = __webpack_require__(567);
- var _tableHead2 = _interopRequireDefault(_tableHead);
- var _tableBody = __webpack_require__(570);
- var _tableBody2 = _interopRequireDefault(_tableBody);
- var _summary = __webpack_require__(576);
- var _summary2 = _interopRequireDefault(_summary);
- var _dropdown = __webpack_require__(61);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _dropdownMenu = __webpack_require__(62);
- var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
- var _spin = __webpack_require__(91);
- var _spin2 = _interopRequireDefault(_spin);
- var _assist = __webpack_require__(3);
- var _dom = __webpack_require__(12);
- var _csv = __webpack_require__(578);
- var _csv2 = _interopRequireDefault(_csv);
- var _exportCsv = __webpack_require__(579);
- var _exportCsv2 = _interopRequireDefault(_exportCsv);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _elementResizeDetector = __webpack_require__(94);
- var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
- var _util = __webpack_require__(580);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-table';
- var rowKey = 1;
- var columnKey = 1;
- exports.default = {
- name: 'Table',
- mixins: [_locale2.default],
- components: { tableHead: _tableHead2.default, tableBody: _tableBody2.default, tableSummary: _summary2.default, Spin: _spin2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
- provide: function provide() {
- return {
- tableRoot: this
- };
- },
- props: {
- data: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- columns: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- width: {
- type: [Number, String]
- },
- height: {
- type: [Number, String]
- },
- maxHeight: {
- type: [Number, String]
- },
- stripe: {
- type: Boolean,
- default: false
- },
- border: {
- type: Boolean,
- default: false
- },
- showHeader: {
- type: Boolean,
- default: true
- },
- highlightRow: {
- type: Boolean,
- default: false
- },
- rowClassName: {
- type: Function,
- default: function _default() {
- return '';
- }
- },
- context: {
- type: Object
- },
- noDataText: {
- type: String
- },
- noFilteredDataText: {
- type: String
- },
- disabledHover: {
- type: Boolean
- },
- loading: {
- type: Boolean,
- default: false
- },
- draggable: {
- type: Boolean,
- default: false
- },
- tooltipTheme: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['dark', 'light']);
- },
- default: 'dark'
- },
- tooltipMaxWidth: {
- type: Number,
- default: 300
- },
- rowKey: {
- type: [Boolean, String],
- default: false
- },
- spanMethod: {
- type: Function
- },
- showSummary: {
- type: Boolean,
- default: false
- },
- summaryMethod: {
- type: Function
- },
- sumText: {
- type: String
- },
- indentSize: {
- type: Number,
- default: 16
- },
- loadData: {
- type: Function
- },
- updateShowChildren: {
- type: Boolean,
- default: false
- },
- contextMenu: {
- type: Boolean,
- default: false
- },
- showContextMenu: {
- type: Boolean,
- default: false
- },
- fixedShadow: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['auto', 'show', 'hide']);
- },
- default: 'show'
- }
- },
- data: function data() {
- var colsWithId = this.makeColumnsId(this.columns);
- return {
- ready: false,
- tableWidth: 0,
- columnsWidth: {},
- prefixCls: prefixCls,
- compiledUids: [],
- objData: this.makeObjData(),
- rebuildData: [],
- cloneColumns: this.makeColumns(colsWithId),
- columnRows: this.makeColumnRows(false, colsWithId),
- leftFixedColumnRows: this.makeColumnRows('left', colsWithId),
- rightFixedColumnRows: this.makeColumnRows('right', colsWithId),
- allColumns: (0, _util.getAllColumns)(colsWithId),
- showSlotHeader: true,
- showSlotFooter: true,
- bodyHeight: 0,
- scrollBarWidth: (0, _assist.getScrollBarSize)(),
- currentContext: this.context,
- cloneData: (0, _assist.deepCopy)(this.data),
- showVerticalScrollBar: false,
- showHorizontalScrollBar: false,
- headerWidth: 0,
- headerHeight: 0,
- showResizeLine: false,
- contextMenuVisible: false,
- contextMenuStyles: {
- top: 0,
- left: 0
- },
- scrollOnTheLeft: false,
- scrollOnTheRight: false
- };
- },
- computed: {
- localeNoDataText: function localeNoDataText() {
- if (this.noDataText === undefined) {
- return this.t('i.table.noDataText');
- } else {
- return this.noDataText;
- }
- },
- localeNoFilteredDataText: function localeNoFilteredDataText() {
- if (this.noFilteredDataText === undefined) {
- return this.t('i.table.noFilteredDataText');
- } else {
- return this.noFilteredDataText;
- }
- },
- localeSumText: function localeSumText() {
- if (this.sumText === undefined) {
- return this.t('i.table.sumText');
- } else {
- return this.sumText;
- }
- },
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hide', !this.ready), (0, _defineProperty3.default)(_ref, prefixCls + '-with-header', this.showSlotHeader), (0, _defineProperty3.default)(_ref, prefixCls + '-with-footer', this.showSlotFooter), (0, _defineProperty3.default)(_ref, prefixCls + '-with-summary', this.showSummary), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-with-border', this.border), _ref)];
- },
- classes: function classes() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref2, prefixCls + '-border', this.border), (0, _defineProperty3.default)(_ref2, prefixCls + '-stripe', this.stripe), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-fixed-top', !!this.height), _ref2)];
- },
- fixedTableClasses: function fixedTableClasses() {
- return [prefixCls + '-fixed', (0, _defineProperty3.default)({}, prefixCls + '-fixed-shadow', this.fixedShadow === 'show' || this.fixedShadow === 'auto' && !this.scrollOnTheLeft)];
- },
- fixedRightTableClasses: function fixedRightTableClasses() {
- return [prefixCls + '-fixed-right', (0, _defineProperty3.default)({}, prefixCls + '-fixed-shadow', this.fixedShadow === 'show' || this.fixedShadow === 'auto' && !this.scrollOnTheRight)];
- },
- fixedHeaderClasses: function fixedHeaderClasses() {
- return [prefixCls + '-fixed-header', (0, _defineProperty3.default)({}, prefixCls + '-fixed-header-with-empty', !this.rebuildData.length)];
- },
- styles: function styles() {
- var style = {};
- var summaryHeight = 0;
- if (this.showSummary) {
- if (this.size === 'small') summaryHeight = 40;else if (this.size === 'large') summaryHeight = 60;else summaryHeight = 48;
- }
- if (this.height) {
- var height = parseInt(this.height) + summaryHeight;
- style.height = String(height) + 'px';
- }
- if (this.maxHeight) {
- var maxHeight = parseInt(this.maxHeight) + summaryHeight;
- style.maxHeight = String(maxHeight) + 'px';
- }
- if (this.width) style.width = String(this.width) + 'px';
- return style;
- },
- tableStyle: function tableStyle() {
- var style = {};
- if (this.tableWidth !== 0) {
- var width = '';
- if (this.bodyHeight === 0) {
- width = this.tableWidth;
- } else {
- width = this.tableWidth - (this.showVerticalScrollBar ? this.scrollBarWidth : 0);
- }
- style.width = String(width) + 'px';
- }
- return style;
- },
- tableHeaderStyle: function tableHeaderStyle() {
- var style = {};
- if (this.tableWidth !== 0) {
- var width = '';
- width = this.tableWidth;
- style.width = String(width) + 'px';
- }
- return style;
- },
- fixedTableStyle: function fixedTableStyle() {
- var _this = this;
- var style = {};
- var width = 0;
- this.leftFixedColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this);
- if (col.fixed && col.fixed === 'left') width += col._width;
- }.bind(this));
- style.width = String(width) + 'px';
- return style;
- },
- fixedRightTableStyle: function fixedRightTableStyle() {
- var _this2 = this;
- var style = {};
- var width = 0;
- this.rightFixedColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (col.fixed && col.fixed === 'right') width += col._width;
- }.bind(this));
- style.width = String(width) + 'px';
- style.right = String(this.showVerticalScrollBar ? this.scrollBarWidth : 0) + 'px';
- return style;
- },
- fixedRightHeaderStyle: function fixedRightHeaderStyle() {
- var style = {};
- var width = 0;
- var height = this.headerHeight + 1;
- if (this.showVerticalScrollBar) {
- width = this.scrollBarWidth;
- }
- style.width = String(width) + 'px';
- style.height = String(height) + 'px';
- return style;
- },
- bodyStyle: function bodyStyle() {
- var style = {};
- if (this.bodyHeight !== 0) {
- var height = this.bodyHeight;
- if (this.height) {
- style.height = String(height) + 'px';
- } else if (this.maxHeight) {
- style.maxHeight = String(height) + 'px';
- }
- }
- return style;
- },
- fixedBodyStyle: function fixedBodyStyle() {
- var style = {};
- if (this.bodyHeight !== 0) {
- var height = this.bodyHeight - (this.showHorizontalScrollBar ? this.scrollBarWidth : 0);
- var bodyHeight = this.showHorizontalScrollBar ? height + 'px' : height - 1 + 'px';
- if (this.height) style.height = bodyHeight;else if (this.maxHeight) style.maxHeight = bodyHeight;
- }
- return style;
- },
- leftFixedColumns: function leftFixedColumns() {
- return (0, _util.convertColumnOrder)(this.cloneColumns, 'left');
- },
- rightFixedColumns: function rightFixedColumns() {
- return (0, _util.convertColumnOrder)(this.cloneColumns, 'right');
- },
- isLeftFixed: function isLeftFixed() {
- var _this3 = this;
- return this.columns.some(function (col) {
- (0, _newArrowCheck3.default)(this, _this3);
- return col.fixed && col.fixed === 'left';
- }.bind(this));
- },
- isRightFixed: function isRightFixed() {
- var _this4 = this;
- return this.columns.some(function (col) {
- (0, _newArrowCheck3.default)(this, _this4);
- return col.fixed && col.fixed === 'right';
- }.bind(this));
- },
- summaryData: function summaryData() {
- var _this5 = this;
- if (!this.showSummary) return {};
- var sums = {};
- if (this.summaryMethod) {
- sums = this.summaryMethod({ columns: this.cloneColumns, data: this.rebuildData });
- } else {
- this.cloneColumns.forEach(function (column, index) {
- (0, _newArrowCheck3.default)(this, _this5);
- var key = column.key;
- if (index === 0) {
- sums[key] = {
- key: column.key,
- value: this.localeSumText
- };
- return;
- }
- var values = this.rebuildData.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this5);
- return Number(item[column.key]);
- }.bind(this));
- var precisions = [];
- var notNumber = true;
- values.forEach(function (value) {
- (0, _newArrowCheck3.default)(this, _this5);
- if (!isNaN(value)) {
- notNumber = false;
- var decimal = ('' + value).split('.')[1];
- precisions.push(decimal ? decimal.length : 0);
- }
- }.bind(this));
- var precision = Math.max.apply(null, precisions);
- if (!notNumber) {
- var currentValue = values.reduce(function (prev, curr) {
- (0, _newArrowCheck3.default)(this, _this5);
- var value = Number(curr);
- if (!isNaN(value)) {
- return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
- } else {
- return prev;
- }
- }.bind(this), 0);
- sums[key] = {
- key: column.key,
- value: currentValue
- };
- } else {
- sums[key] = {
- key: column.key,
- value: ''
- };
- }
- }.bind(this));
- }
- return sums;
- }
- },
- methods: {
- rowClsName: function rowClsName(index) {
- return this.rowClassName(this.data[index], index);
- },
- handleResize: function handleResize() {
- var _this6 = this;
- var tableWidth = this.$el.offsetWidth - 1;
- var columnsWidth = {};
- var sumMinWidth = 0;
- var hasWidthColumns = [];
- var noWidthColumns = [];
- var maxWidthColumns = [];
- var noMaxWidthColumns = [];
- this.cloneColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this6);
- if (col.width) {
- hasWidthColumns.push(col);
- } else {
- noWidthColumns.push(col);
- if (col.minWidth) {
- sumMinWidth += col.minWidth;
- }
- if (col.maxWidth) {
- maxWidthColumns.push(col);
- } else {
- noMaxWidthColumns.push(col);
- }
- }
- col._width = null;
- }.bind(this));
- var unUsableWidth = hasWidthColumns.map(function (cell) {
- (0, _newArrowCheck3.default)(this, _this6);
- return cell.width;
- }.bind(this)).reduce(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this6);
- return a + b;
- }.bind(this), 0);
- var usableWidth = tableWidth - unUsableWidth - sumMinWidth - (this.showVerticalScrollBar ? this.scrollBarWidth : 0) - 1;
- var usableLength = noWidthColumns.length;
- var columnWidth = 0;
- if (usableWidth > 0 && usableLength > 0) {
- columnWidth = parseInt(usableWidth / usableLength);
- }
- for (var i = 0; i < this.cloneColumns.length; i++) {
- var column = this.cloneColumns[i];
- var width = columnWidth + (column.minWidth ? column.minWidth : 0);
- if (column.width) {
- width = column.width;
- } else {
- if (column._width) {
- width = column._width;
- } else {
- if (column.minWidth > width) {
- width = column.minWidth;
- } else if (column.maxWidth < width) {
- width = column.maxWidth;
- }
- if (usableWidth > 0) {
- usableWidth -= width - (column.minWidth ? column.minWidth : 0);
- usableLength--;
- if (usableLength > 0) {
- columnWidth = parseInt(usableWidth / usableLength);
- } else {
- columnWidth = 0;
- }
- } else {
- columnWidth = 0;
- }
- }
- }
- column._width = width;
- columnsWidth[column._index] = {
- width: width
- };
- }
- if (usableWidth > 0) {
- usableLength = noMaxWidthColumns.length;
- columnWidth = parseInt(usableWidth / usableLength);
- for (var _i = 0; _i < noMaxWidthColumns.length; _i++) {
- var _column = noMaxWidthColumns[_i];
- var _width = _column._width + columnWidth;
- if (usableLength > 1) {
- usableLength--;
- usableWidth -= columnWidth;
- columnWidth = parseInt(usableWidth / usableLength);
- } else {
- columnWidth = 0;
- }
- _column._width = _width;
- columnsWidth[_column._index] = {
- width: _width
- };
- }
- }
- this.tableWidth = this.cloneColumns.map(function (cell) {
- (0, _newArrowCheck3.default)(this, _this6);
- return cell._width;
- }.bind(this)).reduce(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this6);
- return a + b;
- }.bind(this), 0) + (this.showVerticalScrollBar ? this.scrollBarWidth : 0) + 1;
- this.columnsWidth = columnsWidth;
- this.fixedHeader();
- if (this.fixedShadow === 'auto') {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this6);
- var $body = this.$refs.body;
- this.scrollOnTheLeft = $body.scrollLeft === 0;
- this.scrollOnTheRight = $body.scrollWidth === $body.scrollLeft + $body.clientWidth;
- }.bind(this));
- }
- },
- handleMouseIn: function handleMouseIn(_index, rowKey) {
- if (this.disabledHover) return;
- var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
- if (objData._isHover) return;
- objData._isHover = true;
- },
- handleMouseOut: function handleMouseOut(_index, rowKey) {
- if (this.disabledHover) return;
- var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
- objData._isHover = false;
- },
- handleCurrentRow: function handleCurrentRow(type, _index, rowKey) {
- var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
- var oldData = null;
- var oldIndex = -1;
- for (var i in this.objData) {
- if (this.objData[i]._isHighlight) {
- oldIndex = parseInt(i);
- this.objData[i]._isHighlight = false;
- break;
- } else if (this.objData[i].children && this.objData[i].children.length) {
- var resetData = this.handleResetChildrenRow(this.objData[i]);
- if (resetData) oldData = JSON.parse((0, _stringify2.default)(resetData));
- }
- }
- if (type === 'highlight') objData._isHighlight = true;
- if (oldIndex >= 0) {
- oldData = JSON.parse((0, _stringify2.default)(this.cloneData[oldIndex]));
- }
- var newData = type === 'highlight' ? rowKey ? JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))) : JSON.parse((0, _stringify2.default)(this.cloneData[_index])) : null;
- this.$emit('on-current-change', newData, oldData);
- },
- handleResetChildrenRow: function handleResetChildrenRow(objData) {
- var data = null;
- if (objData.children && objData.children.length) {
- for (var i = 0; i < objData.children.length; i++) {
- var item = objData.children[i];
- if (item._isHighlight) {
- item._isHighlight = false;
- data = item;
- break;
- } else if (item.children && item.children.length) {
- data = this.handleResetChildrenRow(item);
- }
- }
- }
- return data;
- },
- highlightCurrentRow: function highlightCurrentRow(_index, rowKey) {
- var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
- if (!this.highlightRow || objData._isHighlight) return;
- this.handleCurrentRow('highlight', _index, rowKey);
- },
- clearCurrentRow: function clearCurrentRow() {
- if (!this.highlightRow) return;
- this.handleCurrentRow('clear');
- },
- clickCurrentRow: function clickCurrentRow(_index, rowKey) {
- this.highlightCurrentRow(_index, rowKey);
- if (rowKey) {
- this.$emit('on-row-click', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))));
- } else {
- this.$emit('on-row-click', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), _index);
- }
- },
- dblclickCurrentRow: function dblclickCurrentRow(_index, rowKey) {
- this.highlightCurrentRow(_index, rowKey);
- if (rowKey) {
- this.$emit('on-row-dblclick', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))));
- } else {
- this.$emit('on-row-dblclick', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), _index);
- }
- },
- contextmenuCurrentRow: function contextmenuCurrentRow(_index, rowKey, event) {
- var _this7 = this;
- if (this.contextMenuVisible) this.handleClickContextMenuOutside();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this7);
- var $TableWrap = this.$refs.tableWrap;
- var TableBounding = $TableWrap.getBoundingClientRect();
- var position = {
- left: event.clientX - TableBounding.left + 'px',
- top: event.clientY - TableBounding.top + 'px'
- };
- this.contextMenuStyles = position;
- this.contextMenuVisible = true;
- if (rowKey) {
- this.$emit('on-contextmenu', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))), event, position);
- } else {
- this.$emit('on-contextmenu', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), event, position);
- }
- }.bind(this));
- },
- getSelection: function getSelection() {
- var _this8 = this;
- var selectionIndexes = [];
- var selectionRowKeys = [];
- for (var i in this.objData) {
- var objData = this.objData[i];
- if (objData._isChecked) selectionIndexes.push(parseInt(i));
- if (objData.children && objData.children.length) {
- selectionRowKeys = selectionRowKeys.concat(this.getSelectionChildrenRowKeys(objData, selectionRowKeys));
- }
- }
- selectionRowKeys = [].concat((0, _toConsumableArray3.default)(new _set2.default(selectionRowKeys)));
- var selection = [];
- this.data.forEach(function (item, index) {
- (0, _newArrowCheck3.default)(this, _this8);
- if (selectionIndexes.indexOf(index) > -1) {
- selection = selection.concat(item);
- }
- if (item.children && item.children.length && selectionRowKeys.length) {
- selection = selection.concat(this.getSelectionChildren(item, selection, selectionRowKeys));
- }
- }.bind(this));
- selection = [].concat((0, _toConsumableArray3.default)(new _set2.default(selection)));
- return JSON.parse((0, _stringify2.default)(selection));
- },
- getSelectionChildrenRowKeys: function getSelectionChildrenRowKeys(objData, selectionRowKeys) {
- var _this9 = this;
- if (objData.children && objData.children.length) {
- objData.children.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this9);
- if (item._isChecked) selectionRowKeys.push(item._rowKey);
- if (item.children && item.children.length) {
- selectionRowKeys = selectionRowKeys.concat(this.getSelectionChildrenRowKeys(item, selectionRowKeys));
- }
- }.bind(this));
- }
- return selectionRowKeys;
- },
- getSelectionChildren: function getSelectionChildren(data, selection, selectionRowKeys) {
- var _this10 = this;
- if (data.children && data.children.length) {
- data.children.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this10);
- if (selectionRowKeys.indexOf(item[this.rowKey]) > -1) {
- selection = selection.concat(item);
- }
- if (item.children && item.children.length) {
- selection = selection.concat(this.getSelectionChildren(item, selection, selectionRowKeys));
- }
- }.bind(this));
- }
- return selection;
- },
- toggleSelect: function toggleSelect(_index, rowKey) {
- var data = {};
- if (rowKey) {
- data = this.getDataByRowKey(rowKey);
- } else {
- for (var i in this.objData) {
- if (parseInt(i) === _index) {
- data = this.objData[i];
- break;
- }
- }
- }
- var status = !data._isChecked;
- data._isChecked = status;
- var selection = this.getSelection();
- var selectedData = rowKey ? this.getBaseDataByRowKey(rowKey, this.data) : this.data[_index];
- this.$emit(status ? 'on-select' : 'on-select-cancel', selection, JSON.parse((0, _stringify2.default)(selectedData)));
- this.$emit('on-selection-change', selection);
- },
- toggleExpand: function toggleExpand(_index) {
- var _this11 = this;
- var data = {};
- for (var i in this.objData) {
- if (parseInt(i) === _index) {
- data = this.objData[i];
- break;
- }
- }
- var status = !data._isExpanded;
- this.objData[_index]._isExpanded = status;
- this.$emit('on-expand', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), status);
- if (this.height || this.maxHeight) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this11);
- return this.fixedBody();
- }.bind(this));
- }
- },
- toggleTree: function toggleTree(rowKey) {
- var _this12 = this;
- var data = this.getDataByRowKey(rowKey);
- if ('_loading' in data && data._loading) return;
- if ('_loading' in data && !data._loading && data.children.length === 0) {
- var sourceData = this.getBaseDataByRowKey(rowKey, this.data);
- this.$set(sourceData, '_loading', true);
- this.loadData(sourceData, function (children) {
- (0, _newArrowCheck3.default)(this, _this12);
- this.$set(sourceData, '_loading', false);
- if (children.length) {
- this.$set(sourceData, 'children', children);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this12);
- var newData = this.getDataByRowKey(rowKey);
- newData._isShowChildren = !newData._isShowChildren;
- this.updateDataStatus(rowKey, '_showChildren', newData._isShowChildren);
- }.bind(this));
- }
- }.bind(this));
- return;
- }
- data._isShowChildren = !data._isShowChildren;
- if (this.updateShowChildren) this.updateDataStatus(rowKey, '_showChildren', data._isShowChildren);
- this.$emit('on-expand-tree', rowKey, data._isShowChildren);
- },
- updateDataStatus: function updateDataStatus(rowKey, key, value) {
- var data = this.getBaseDataByRowKey(rowKey, this.data);
- this.$set(data, key, value);
- },
- getDataByRowKey: function getDataByRowKey(rowKey) {
- var objData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.objData;
- var data = null;
- for (var i in objData) {
- var thisData = objData[i];
- if (thisData._rowKey === rowKey) {
- data = thisData;
- break;
- } else if (thisData.children && thisData.children.length) {
- data = this.getChildrenByRowKey(rowKey, thisData);
- if (data) {
- break;
- }
- }
- }
- return data;
- },
- getChildrenByRowKey: function getChildrenByRowKey(rowKey, objData) {
- var data = null;
- if (objData.children && objData.children.length) {
- for (var i = 0; i < objData.children.length; i++) {
- var item = objData.children[i];
- if (item._rowKey === rowKey) {
- data = item;
- break;
- } else if (item.children && item.children.length) {
- data = this.getChildrenByRowKey(rowKey, item);
- if (data) {
- break;
- }
- }
- }
- }
- return data;
- },
- getBaseDataByRowKey: function getBaseDataByRowKey(rowKey) {
- var sourceData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.cloneData;
- var data = null;
- for (var i = 0; i < sourceData.length; i++) {
- var thisData = sourceData[i];
- if (thisData[this.rowKey] === rowKey) {
- data = thisData;
- break;
- } else if (thisData.children && thisData.children.length) {
- data = this.getChildrenDataByRowKey(rowKey, thisData);
- if (data && data[this.rowKey] === rowKey) return data;
- }
- }
- return data;
- },
- getChildrenDataByRowKey: function getChildrenDataByRowKey(rowKey, cloneData) {
- var data = null;
- if (cloneData.children && cloneData.children.length) {
- for (var i = 0; i < cloneData.children.length; i++) {
- var item = cloneData.children[i];
- if (item[this.rowKey] === rowKey) {
- data = item;
- break;
- } else if (item.children && item.children.length) {
- data = this.getChildrenDataByRowKey(rowKey, item);
- if (data) {
- break;
- }
- }
- }
- }
- return data;
- },
- selectAll: function selectAll(status) {
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = (0, _getIterator3.default)(this.rebuildData), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var data = _step.value;
- var objData = this.objData[data._index];
- if (!objData._isDisabled) {
- objData._isChecked = status;
- }
- if (data.children && data.children.length) {
- this.selectAllChildren(objData, status);
- }
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- var selection = this.getSelection();
- if (status) {
- this.$emit('on-select-all', selection);
- } else {
- this.$emit('on-select-all-cancel', selection);
- }
- this.$emit('on-selection-change', selection);
- },
- selectAllChildren: function selectAllChildren(data, status) {
- var _this13 = this;
- if (data.children && data.children.length) {
- data.children.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this13);
- if (!item._isDisabled) {
- item._isChecked = status;
- }
- if (item.children && item.children.length) {
- this.selectAllChildren(item, status);
- }
- }.bind(this));
- }
- },
- fixedHeader: function fixedHeader() {
- var _this14 = this;
- if (this.height || this.maxHeight) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this14);
- var titleHeight = parseInt((0, _assist.getStyle)(this.$refs.title, 'height')) || 0;
- var headerHeight = parseInt((0, _assist.getStyle)(this.$refs.header, 'height')) || 0;
- var footerHeight = parseInt((0, _assist.getStyle)(this.$refs.footer, 'height')) || 0;
- if (this.height) {
- this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
- } else if (this.maxHeight) {
- this.bodyHeight = this.maxHeight - titleHeight - headerHeight - footerHeight;
- }
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this14);
- return this.fixedBody();
- }.bind(this));
- }.bind(this));
- } else {
- this.bodyHeight = 0;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this14);
- return this.fixedBody();
- }.bind(this));
- }
- },
- fixedBody: function fixedBody() {
- if (this.$refs.header) {
- this.headerWidth = this.$refs.header.children[0].offsetWidth;
- this.headerHeight = this.$refs.header.children[0].offsetHeight;
- }
- if (!this.$refs.tbody || !this.data || this.data.length === 0) {
- this.showVerticalScrollBar = false;
- } else {
- var bodyContentEl = this.$refs.tbody.$el;
- var bodyEl = bodyContentEl.parentElement;
- var bodyContentHeight = bodyContentEl.offsetHeight;
- var bodyHeight = bodyEl.offsetHeight;
- this.showHorizontalScrollBar = bodyEl.offsetWidth < bodyContentEl.offsetWidth + (this.showVerticalScrollBar ? this.scrollBarWidth : 0);
- this.showVerticalScrollBar = this.bodyHeight ? bodyHeight - (this.showHorizontalScrollBar ? this.scrollBarWidth : 0) < bodyContentHeight : false;
- if (this.showVerticalScrollBar) {
- bodyEl.classList.add(this.prefixCls + '-overflowY');
- } else {
- bodyEl.classList.remove(this.prefixCls + '-overflowY');
- }
- if (this.showHorizontalScrollBar) {
- bodyEl.classList.add(this.prefixCls + '-overflowX');
- } else {
- bodyEl.classList.remove(this.prefixCls + '-overflowX');
- }
- }
- },
- hideColumnFilter: function hideColumnFilter() {
- var _this15 = this;
- this.cloneColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this15);
- return col._filterVisible = false;
- }.bind(this));
- },
- handleBodyScroll: function handleBodyScroll(event) {
- this.scrollOnTheLeft = event.target.scrollLeft === 0;
- this.scrollOnTheRight = event.target.scrollWidth === event.target.scrollLeft + event.target.clientWidth;
- if (this.showHeader) this.$refs.header.scrollLeft = event.target.scrollLeft;
- if (this.isLeftFixed) this.$refs.fixedBody.scrollTop = event.target.scrollTop;
- if (this.isRightFixed) this.$refs.fixedRightBody.scrollTop = event.target.scrollTop;
- if (this.showSummary && this.$refs.summary) this.$refs.summary.$el.scrollLeft = event.target.scrollLeft;
- this.hideColumnFilter();
- },
- handleFixedMousewheel: function handleFixedMousewheel(event) {
- var _this16 = this;
- var deltaY = event.deltaY;
- if (!deltaY && event.detail) {
- deltaY = event.detail * 40;
- }
- if (!deltaY && event.wheelDeltaY) {
- deltaY = -event.wheelDeltaY;
- }
- if (!deltaY && event.wheelDelta) {
- deltaY = -event.wheelDelta;
- }
- if (!deltaY) return;
- var body = this.$refs.body;
- var currentScrollTop = body.scrollTop;
- if (deltaY < 0 && currentScrollTop !== 0) {
- event.preventDefault();
- }
- if (deltaY > 0 && body.scrollHeight - body.clientHeight > currentScrollTop) {
- event.preventDefault();
- }
- var step = 0;
- var timeId = setInterval(function () {
- (0, _newArrowCheck3.default)(this, _this16);
- step += 5;
- if (deltaY > 0) {
- body.scrollTop += 2;
- } else {
- body.scrollTop -= 2;
- }
- if (step >= Math.abs(deltaY)) {
- clearInterval(timeId);
- }
- }.bind(this), 5);
- },
- handleMouseWheel: function handleMouseWheel(event) {
- var deltaX = event.deltaX;
- var $body = this.$refs.body;
- if (deltaX > 0) {
- $body.scrollLeft = $body.scrollLeft + 10;
- } else {
- $body.scrollLeft = $body.scrollLeft - 10;
- }
- },
- sortData: function sortData(data, type, index) {
- var _this17 = this;
- var key = this.cloneColumns[index].key;
- data.sort(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this17);
- if (this.cloneColumns[index].sortMethod) {
- return this.cloneColumns[index].sortMethod(a[key], b[key], type);
- } else {
- if (type === 'asc') {
- return a[key] > b[key] ? 1 : -1;
- } else if (type === 'desc') {
- return a[key] < b[key] ? 1 : -1;
- }
- }
- }.bind(this));
- for (var i = 0; i < data.length; i++) {
- if (data[i].children && data[i].children.length) {
- data[i].children = this.sortData(data[i].children, type, index);
- }
- }
- return data;
- },
- handleSort: function handleSort(_index, type) {
- var _this18 = this;
- var index = this.GetOriginalIndex(_index);
- this.cloneColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this18);
- return col._sortType = 'normal';
- }.bind(this));
- var key = this.cloneColumns[index].key;
- if (this.cloneColumns[index].sortable !== 'custom') {
- if (type === 'normal') {
- this.rebuildData = this.makeDataWithFilter();
- } else {
- this.rebuildData = this.sortData(this.rebuildData, type, index);
- }
- }
- this.cloneColumns[index]._sortType = type;
- this.$emit('on-sort-change', {
- column: JSON.parse((0, _stringify2.default)(this.allColumns[this.cloneColumns[index]._index])),
- key: key,
- order: type
- });
- },
- handleFilterHide: function handleFilterHide(index) {
- if (!this.cloneColumns[index]._isFiltered) this.cloneColumns[index]._filterChecked = [];
- },
- filterData: function filterData(data, column) {
- var _this19 = this;
- return data.filter(function (row) {
- (0, _newArrowCheck3.default)(this, _this19);
- if (typeof column.filterRemote === 'function') return true;
- var status = !column._filterChecked.length;
- for (var i = 0; i < column._filterChecked.length; i++) {
- status = column.filterMethod(column._filterChecked[i], row);
- if (status) break;
- }
- return status;
- }.bind(this));
- },
- filterOtherData: function filterOtherData(data, index) {
- var _this20 = this;
- var column = this.cloneColumns[index];
- if (typeof column.filterRemote === 'function') {
- column.filterRemote.call(this.$parent, column._filterChecked, column.key, column);
- }
- this.cloneColumns.forEach(function (col, colIndex) {
- (0, _newArrowCheck3.default)(this, _this20);
- if (colIndex !== index) {
- data = this.filterData(data, col);
- }
- }.bind(this));
- return data;
- },
- handleFilter: function handleFilter(index) {
- var column = this.cloneColumns[index];
- var filterData = this.makeDataWithSort();
- filterData = this.filterOtherData(filterData, index);
- this.rebuildData = this.filterData(filterData, column);
- this.cloneColumns[index]._isFiltered = true;
- this.cloneColumns[index]._filterVisible = false;
- this.$emit('on-filter-change', column);
- },
- GetOriginalIndex: function GetOriginalIndex(_index) {
- var _this21 = this;
- return this.cloneColumns.findIndex(function (item) {
- (0, _newArrowCheck3.default)(this, _this21);
- return item._index === _index;
- }.bind(this));
- },
- handleFilterSelect: function handleFilterSelect(_index, value) {
- var index = this.GetOriginalIndex(_index);
- this.cloneColumns[index]._filterChecked = [value];
- this.handleFilter(index);
- },
- handleFilterReset: function handleFilterReset(_index) {
- var index = this.GetOriginalIndex(_index);
- this.cloneColumns[index]._isFiltered = false;
- this.cloneColumns[index]._filterVisible = false;
- this.cloneColumns[index]._filterChecked = [];
- var filterData = this.makeDataWithSort();
- filterData = this.filterOtherData(filterData, index);
- this.rebuildData = filterData;
- this.$emit('on-filter-change', this.cloneColumns[index]);
- },
- makeData: function makeData() {
- var _this22 = this;
- var data = (0, _assist.deepCopy)(this.data);
- data.forEach(function (row, index) {
- (0, _newArrowCheck3.default)(this, _this22);
- row._index = index;
- row._rowKey = typeof this.rowKey === 'string' ? row[this.rowKey] : rowKey++;
- if (row.children && row.children.length) {
- row.children = this.makeChildrenData(row);
- }
- }.bind(this));
- return data;
- },
- makeChildrenData: function makeChildrenData(data) {
- var _this23 = this;
- if (data.children && data.children.length) {
- return data.children.map(function (row, index) {
- (0, _newArrowCheck3.default)(this, _this23);
- var newRow = (0, _assist.deepCopy)(row);
- newRow._index = index;
- newRow._rowKey = typeof this.rowKey === 'string' ? newRow[this.rowKey] : rowKey++;
- if (newRow.children && newRow.children.length) {
- newRow.children = this.makeChildrenData(newRow);
- }
- return newRow;
- }.bind(this));
- } else {
- return data;
- }
- },
- makeDataWithSort: function makeDataWithSort() {
- var data = this.makeData();
- var sortType = 'normal';
- var sortIndex = -1;
- var isCustom = false;
- for (var i = 0; i < this.cloneColumns.length; i++) {
- if (this.cloneColumns[i]._sortType !== 'normal') {
- sortType = this.cloneColumns[i]._sortType;
- sortIndex = i;
- isCustom = this.cloneColumns[i].sortable === 'custom';
- break;
- }
- }
- if (sortType !== 'normal' && !isCustom) data = this.sortData(data, sortType, sortIndex);
- return data;
- },
- makeDataWithFilter: function makeDataWithFilter() {
- var _this24 = this;
- var data = this.makeData();
- this.cloneColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this24);
- return data = this.filterData(data, col);
- }.bind(this));
- return data;
- },
- makeDataWithSortAndFilter: function makeDataWithSortAndFilter() {
- var _this25 = this;
- var data = this.makeDataWithSort();
- this.cloneColumns.forEach(function (col) {
- (0, _newArrowCheck3.default)(this, _this25);
- return data = this.filterData(data, col);
- }.bind(this));
- return data;
- },
- makeObjBaseData: function makeObjBaseData(row) {
- var newRow = (0, _assist.deepCopy)(row);
- if (typeof this.rowKey === 'string') {
- newRow._rowKey = newRow[this.rowKey];
- }
- newRow._isHover = false;
- if (newRow._disabled) {
- newRow._isDisabled = newRow._disabled;
- } else {
- newRow._isDisabled = false;
- }
- if (newRow._checked) {
- newRow._isChecked = newRow._checked;
- } else {
- newRow._isChecked = false;
- }
- if (newRow._expanded) {
- newRow._isExpanded = newRow._expanded;
- } else {
- newRow._isExpanded = false;
- }
- if (newRow._highlight) {
- newRow._isHighlight = newRow._highlight;
- } else {
- newRow._isHighlight = false;
- }
- return newRow;
- },
- makeObjData: function makeObjData() {
- var _this26 = this;
- var data = {};
- this.data.forEach(function (row, index) {
- (0, _newArrowCheck3.default)(this, _this26);
- var newRow = this.makeObjBaseData(row);
- if (newRow.children && newRow.children.length) {
- if (newRow._showChildren) {
- newRow._isShowChildren = newRow._showChildren;
- } else {
- newRow._isShowChildren = false;
- }
- newRow.children = this.makeChildrenObjData(newRow);
- }
- data[index] = newRow;
- }.bind(this));
- return data;
- },
- makeChildrenObjData: function makeChildrenObjData(data) {
- var _this27 = this;
- if (data.children && data.children.length) {
- return data.children.map(function (row) {
- (0, _newArrowCheck3.default)(this, _this27);
- var newRow = this.makeObjBaseData(row);
- if (newRow._showChildren) {
- newRow._isShowChildren = newRow._showChildren;
- } else {
- newRow._isShowChildren = false;
- }
- if (newRow.children && newRow.children.length) {
- newRow.children = this.makeChildrenObjData(newRow);
- }
- return newRow;
- }.bind(this));
- } else {
- return data;
- }
- },
- makeColumnsId: function makeColumnsId(columns) {
- var _this28 = this;
- return columns.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this28);
- if ('children' in item) this.makeColumnsId(item.children);
- item.__id = (0, _util.getRandomStr)(6);
- return item;
- }.bind(this));
- },
- makeColumns: function makeColumns(cols) {
- var _this29 = this;
- var columns = (0, _assist.deepCopy)((0, _util.getAllColumns)(cols));
- var left = [];
- var right = [];
- var center = [];
- columns.forEach(function (column, index) {
- (0, _newArrowCheck3.default)(this, _this29);
- column._index = index;
- column._columnKey = columnKey++;
- column.width = parseInt(column.width);
- column._width = column.width ? column.width : '';
- column._sortType = 'normal';
- column._filterVisible = false;
- column._isFiltered = false;
- column._filterChecked = [];
- if ('filterMultiple' in column) {
- column._filterMultiple = column.filterMultiple;
- } else {
- column._filterMultiple = true;
- }
- if ('filteredValue' in column) {
- column._filterChecked = column.filteredValue;
- column._isFiltered = true;
- }
- if ('sortType' in column) {
- column._sortType = column.sortType;
- }
- if (column.fixed && column.fixed === 'left') {
- left.push(column);
- } else if (column.fixed && column.fixed === 'right') {
- right.push(column);
- } else {
- center.push(column);
- }
- }.bind(this));
- return left.concat(center).concat(right);
- },
- makeColumnRows: function makeColumnRows(fixedType, cols) {
- return (0, _util.convertToRows)(cols, fixedType);
- },
- exportCsv: function exportCsv(params) {
- if (params.filename) {
- if (params.filename.indexOf('.csv') === -1) {
- params.filename += '.csv';
- }
- } else {
- params.filename = 'table.csv';
- }
- var columns = [];
- var datas = [];
- if (params.columns && params.data) {
- columns = params.columns;
- datas = params.data;
- } else {
- columns = this.allColumns;
- if (!('original' in params)) params.original = true;
- datas = params.original ? this.data : this.rebuildData;
- }
- var noHeader = false;
- if ('noHeader' in params) noHeader = params.noHeader;
- var data = (0, _csv2.default)(columns, datas, params, noHeader);
- if (params.callback) params.callback(data);else _exportCsv2.default.download(params.filename, data);
- },
- dragAndDrop: function dragAndDrop(a, b) {
- this.$emit('on-drag-drop', a, b);
- },
- handleClickContextMenuOutside: function handleClickContextMenuOutside() {
- this.contextMenuVisible = false;
- }
- },
- created: function created() {
- if (!this.context) this.currentContext = this.$parent;
- this.showSlotHeader = this.$slots.header !== undefined;
- this.showSlotFooter = this.$slots.footer !== undefined;
- this.rebuildData = this.makeDataWithSortAndFilter();
- },
- mounted: function mounted() {
- var _this30 = this;
- this.handleResize();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this30);
- return this.ready = true;
- }.bind(this));
- (0, _dom.on)(window, 'resize', this.handleResize);
- this.observer = (0, _elementResizeDetector2.default)();
- this.observer.listenTo(this.$el, this.handleResize);
- this.$on('on-visible-change', function (val) {
- (0, _newArrowCheck3.default)(this, _this30);
- if (val) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this30);
- this.handleResize();
- }.bind(this));
- }
- }.bind(this));
- },
- beforeDestroy: function beforeDestroy() {
- this.$off('on-visible-change');
- (0, _dom.off)(window, 'resize', this.handleResize);
- this.observer.removeAllListeners(this.$el);
- this.observer.uninstall(this.$el);
- this.observer = null;
- },
- watch: {
- data: {
- handler: function handler() {
- var _this31 = this;
- var oldDataLen = this.rebuildData.length;
- this.objData = this.makeObjData();
- this.rebuildData = this.makeDataWithSortAndFilter();
- this.handleResize();
- if (!oldDataLen) {
- this.fixedHeader();
- }
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this31);
- this.cloneData = (0, _assist.deepCopy)(this.data);
- }.bind(this), 0);
- },
- deep: true
- },
- columns: {
- handler: function handler() {
- var colsWithId = this.makeColumnsId(this.columns);
- this.allColumns = (0, _util.getAllColumns)(colsWithId);
- this.cloneColumns = this.makeColumns(colsWithId);
- this.columnRows = this.makeColumnRows(false, colsWithId);
- this.leftFixedColumnRows = this.makeColumnRows('left', colsWithId);
- this.rightFixedColumnRows = this.makeColumnRows('right', colsWithId);
- this.rebuildData = this.makeDataWithSortAndFilter();
- this.handleResize();
- },
- deep: true
- },
- height: function height() {
- this.handleResize();
- },
- maxHeight: function maxHeight() {
- this.handleResize();
- },
- showHorizontalScrollBar: function showHorizontalScrollBar() {
- this.handleResize();
- },
- showVerticalScrollBar: function showVerticalScrollBar() {
- this.handleResize();
- }
- }
- };
- /***/ }),
- /* 235 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(18);
- module.exports = function (it, TYPE) {
- if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
- return it;
- };
- /***/ }),
- /* 236 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _checkboxGroup = __webpack_require__(143);
- var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
- var _checkbox = __webpack_require__(49);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- var _poptip = __webpack_require__(219);
- var _poptip2 = _interopRequireDefault(_poptip);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _header = __webpack_require__(568);
- var _header2 = _interopRequireDefault(_header);
- var _mixin = __webpack_require__(95);
- var _mixin2 = _interopRequireDefault(_mixin);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableHead',
- mixins: [_mixin2.default, _locale2.default],
- components: { CheckboxGroup: _checkboxGroup2.default, Checkbox: _checkbox2.default, Poptip: _poptip2.default, iButton: _button2.default, renderHeader: _header2.default },
- props: {
- prefixCls: String,
- styleObject: Object,
- columns: Array,
- objData: Object,
- data: Array,
- columnsWidth: Object,
- fixed: {
- type: [Boolean, String],
- default: false
- },
- columnRows: Array,
- fixedColumnRows: Array
- },
- data: function data() {
- return {
- draggingColumn: null,
- dragging: false,
- dragState: {}
- };
- },
- computed: {
- styles: function styles() {
- var style = (0, _assign2.default)({}, this.styleObject);
- var width = parseInt(this.styleObject.width);
- style.width = String(width) + 'px';
- return style;
- },
- isSelectAll: function isSelectAll() {
- var isSelectAll = true;
- if (!this.data.length) isSelectAll = false;
- var isAllDisabledAndUnSelected = true;
- for (var i in this.objData) {
- var objData = this.objData[i];
- if (!objData._isChecked && !objData._isDisabled) {
- isSelectAll = false;
- break;
- } else if (objData.children && objData.children.length) {
- isSelectAll = this.isChildrenSelected(objData, isSelectAll);
- }
- if (!(objData._isDisabled && !objData._isChecked)) {
- isAllDisabledAndUnSelected = false;
- } else if (objData.children && objData.children.length) {
- isAllDisabledAndUnSelected = this.isChildrenAllDisabledAndUnSelected(objData, isAllDisabledAndUnSelected);
- }
- }
- if (isAllDisabledAndUnSelected) isSelectAll = false;
- return isSelectAll;
- },
- headRows: function headRows() {
- var isGroup = this.columnRows.length > 1;
- if (isGroup) {
- return this.fixed ? this.fixedColumnRows : this.columnRows;
- } else {
- return [this.columns];
- }
- },
- isSelectDisabled: function isSelectDisabled() {
- var isSelectDisabled = true;
- if (this.data.length) {
- for (var i in this.objData) {
- var objData = this.objData[i];
- if (!objData._isDisabled) {
- isSelectDisabled = false;
- } else if (objData.children && objData.children.length) {
- isSelectDisabled = this.isChildrenDisabled(objData, isSelectDisabled);
- }
- }
- }
- return isSelectDisabled;
- }
- },
- methods: {
- cellClasses: function cellClasses(column) {
- var _ref;
- return [String(this.prefixCls) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-selection', column.type === 'selection'), _ref)];
- },
- scrollBarCellClass: function scrollBarCellClass() {
- var hasRightFixed = false;
- for (var i in this.headRows) {
- for (var j in this.headRows[i]) {
- if (this.headRows[i][j].fixed === 'right') {
- hasRightFixed = true;
- break;
- }
- if (hasRightFixed) break;
- }
- }
- return [(0, _defineProperty3.default)({}, String(this.prefixCls) + '-hidden', hasRightFixed)];
- },
- itemClasses: function itemClasses(column, item) {
- return [String(this.prefixCls) + '-filter-select-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-filter-select-item-selected', column._filterChecked[0] === item.value)];
- },
- itemAllClasses: function itemAllClasses(column) {
- return [String(this.prefixCls) + '-filter-select-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-filter-select-item-selected', !column._filterChecked.length)];
- },
- selectAll: function selectAll() {
- var status = !this.isSelectAll;
- this.$parent.selectAll(status);
- },
- handleSort: function handleSort(index, type) {
- var _this = this;
- var column = this.columns.find(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return item._index === index;
- }.bind(this));
- var _index = column._index;
- if (column._sortType === type) {
- type = 'normal';
- }
- this.$parent.handleSort(_index, type);
- },
- handleSortByHead: function handleSortByHead(index) {
- var _this2 = this;
- var column = this.columns.find(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- return item._index === index;
- }.bind(this));
- if (column.sortable) {
- var type = column._sortType;
- if (type === 'normal') {
- this.handleSort(index, 'asc');
- } else if (type === 'asc') {
- this.handleSort(index, 'desc');
- } else {
- this.handleSort(index, 'normal');
- }
- }
- },
- handleFilter: function handleFilter(index) {
- this.$parent.handleFilter(index);
- },
- handleSelect: function handleSelect(index, value) {
- this.$parent.handleFilterSelect(index, value);
- },
- handleReset: function handleReset(index) {
- this.$parent.handleFilterReset(index);
- },
- handleFilterHide: function handleFilterHide(index) {
- this.$parent.handleFilterHide(index);
- },
- getColumn: function getColumn(rowIndex, index) {
- var _this3 = this;
- var isGroup = this.columnRows.length > 1;
- if (isGroup) {
- var id = this.headRows[rowIndex][index].__id;
- return this.columns.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return item.__id === id;
- }.bind(this))[0];
- } else {
- return this.headRows[rowIndex][index];
- }
- },
- handleMouseDown: function handleMouseDown(column, event) {
- var _this4 = this;
- if (this.$isServer) return;
- if (this.draggingColumn) {
- this.dragging = true;
- var table = this.$parent;
- var tableEl = table.$el;
- var tableLeft = tableEl.getBoundingClientRect().left;
- var columnEl = this.$el.querySelector('th.ivu-table-column-' + String(column.__id));
- var columnRect = columnEl.getBoundingClientRect();
- var minLeft = columnRect.left - tableLeft + 30;
- table.showResizeLine = true;
- this.dragState = {
- startMouseLeft: event.clientX,
- startLeft: columnRect.right - tableLeft,
- startColumnLeft: columnRect.left - tableLeft,
- tableLeft: tableLeft
- };
- var resizeProxy = table.$refs.resizeLine;
- resizeProxy.style.left = this.dragState.startLeft + 'px';
- document.onselectstart = function () {
- return false;
- };
- document.ondragstart = function () {
- return false;
- };
- var handleMouseMove = function (event) {
- (0, _newArrowCheck3.default)(this, _this4);
- var deltaLeft = event.clientX - this.dragState.startMouseLeft;
- var proxyLeft = this.dragState.startLeft + deltaLeft;
- resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
- }.bind(this);
- var handleMouseUp = function () {
- (0, _newArrowCheck3.default)(this, _this4);
- if (this.dragging) {
- var _dragState = this.dragState,
- startColumnLeft = _dragState.startColumnLeft,
- startLeft = _dragState.startLeft;
- var finalLeft = parseInt(resizeProxy.style.left, 10);
- var columnWidth = finalLeft - startColumnLeft;
- var _column = table.columns.find(function (item) {
- (0, _newArrowCheck3.default)(this, _this4);
- return item.__id === column.__id;
- }.bind(this));
- if (_column) _column.width = columnWidth;
- table.$emit('on-column-width-resize', _column.width, startLeft - startColumnLeft, column, event);
- document.body.style.cursor = '';
- this.dragging = false;
- this.draggingColumn = null;
- this.dragState = {};
- table.showResizeLine = false;
- }
- document.removeEventListener('mousemove', handleMouseMove);
- document.removeEventListener('mouseup', handleMouseUp);
- document.onselectstart = null;
- document.ondragstart = null;
- }.bind(this);
- document.addEventListener('mousemove', handleMouseMove);
- document.addEventListener('mouseup', handleMouseUp);
- }
- },
- handleMouseMove: function handleMouseMove(column, event) {
- var target = event.target;
- while (target && target.tagName !== 'TH') {
- target = target.parentNode;
- }
- if (!column || !column.resizable) return;
- if (!this.dragging) {
- var rect = target.getBoundingClientRect();
- var bodyStyle = document.body.style;
- if (rect.width > 12 && rect.right - event.pageX < 8) {
- bodyStyle.cursor = 'col-resize';
- this.draggingColumn = column;
- } else if (!this.dragging) {
- bodyStyle.cursor = '';
- this.draggingColumn = null;
- }
- }
- },
- handleMouseOut: function handleMouseOut() {
- if (this.$isServer) return;
- document.body.style.cursor = '';
- },
- isChildrenSelected: function isChildrenSelected(objData, isSelectAll) {
- var _this5 = this;
- var status = isSelectAll;
- if (objData.children && objData.children.length) {
- objData.children.forEach(function (row) {
- (0, _newArrowCheck3.default)(this, _this5);
- if (!row._isChecked && !row._isDisabled) {
- status = false;
- } else if (row.children && row.children.length) {
- status = this.isChildrenSelected(row, status);
- }
- }.bind(this));
- }
- return status;
- },
- isChildrenAllDisabledAndUnSelected: function isChildrenAllDisabledAndUnSelected(objData, isAllDisabledAndUnSelected) {
- var _this6 = this;
- var status = isAllDisabledAndUnSelected;
- if (objData.children && objData.children.length) {
- objData.children.forEach(function (row) {
- (0, _newArrowCheck3.default)(this, _this6);
- if (!(row._isDisabled && !row._isChecked)) {
- status = false;
- } else if (row.children && row.children.length) {
- status = this.isChildrenAllDisabledAndUnSelected(row, status);
- }
- }.bind(this));
- }
- return status;
- },
- isChildrenDisabled: function isChildrenDisabled(objData, isSelectDisabled) {
- var _this7 = this;
- var status = isSelectDisabled;
- if (objData.children && objData.children.length) {
- objData.children.forEach(function (row) {
- (0, _newArrowCheck3.default)(this, _this7);
- if (!row._isDisabled) {
- status = false;
- } else if (row.children && row.children.length) {
- status = this.isChildrenDisabled(row, status);
- }
- }.bind(this));
- }
- return status;
- }
- }
- };
- /***/ }),
- /* 237 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _tableTr = __webpack_require__(571);
- var _tableTr2 = _interopRequireDefault(_tableTr);
- var _cell = __webpack_require__(573);
- var _cell2 = _interopRequireDefault(_cell);
- var _expand = __webpack_require__(240);
- var _expand2 = _interopRequireDefault(_expand);
- var _mixin = __webpack_require__(95);
- var _mixin2 = _interopRequireDefault(_mixin);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableBody',
- mixins: [_mixin2.default],
- components: { TableCell: _cell2.default, Expand: _expand2.default, TableTr: _tableTr2.default },
- props: {
- prefixCls: String,
- styleObject: Object,
- columns: Array,
- data: Array,
- objData: Object,
- columnsWidth: Object,
- fixed: {
- type: [Boolean, String],
- default: false
- },
- draggable: {
- type: Boolean,
- default: false
- },
- rowKey: {
- type: [Boolean, String],
- default: false
- }
- },
- computed: {
- expandRender: function expandRender() {
- var render = function render() {
- return '';
- };
- for (var i = 0; i < this.columns.length; i++) {
- var column = this.columns[i];
- if (column.type && column.type === 'expand') {
- if (column.render) render = column.render;
- }
- }
- return render;
- }
- },
- methods: {
- rowChecked: function rowChecked(_index) {
- return this.objData[_index] && this.objData[_index]._isChecked;
- },
- rowDisabled: function rowDisabled(_index) {
- return this.objData[_index] && this.objData[_index]._isDisabled;
- },
- rowExpanded: function rowExpanded(_index) {
- return this.objData[_index] && this.objData[_index]._isExpanded;
- },
- rowStatusByRowKey: function rowStatusByRowKey(type, rowKey) {
- var data = this.$parent.getDataByRowKey(rowKey);
- return data[type];
- },
- handleMouseIn: function handleMouseIn(_index, event, rowKey) {
- event.stopPropagation();
- this.$parent.handleMouseIn(_index, rowKey);
- },
- handleMouseOut: function handleMouseOut(_index, event, rowKey) {
- event.stopPropagation();
- this.$parent.handleMouseOut(_index, rowKey);
- },
- clickCurrentRow: function clickCurrentRow(_index, event, rowKey) {
- this.$parent.clickCurrentRow(_index, rowKey);
- },
- dblclickCurrentRow: function dblclickCurrentRow(_index, event, rowKey) {
- event.stopPropagation();
- this.$parent.dblclickCurrentRow(_index, rowKey);
- },
- clickCell: function clickCell(row, column, key, event) {
- this.$parent.$emit('on-cell-click', row, column, row[key], event);
- },
- contextmenuCurrentRow: function contextmenuCurrentRow(_index, event, rowKey) {
- event.stopPropagation();
- if (this.$parent.contextMenu) event.preventDefault();
- this.$parent.contextmenuCurrentRow(_index, rowKey, event);
- },
- selectStartCurrentRow: function selectStartCurrentRow() {
- if (this.$parent.contextMenu) {}
- },
- getSpan: function getSpan(row, column, rowIndex, columnIndex) {
- var fn = this.$parent.spanMethod;
- if (typeof fn === 'function') {
- var result = fn({
- row: row,
- column: column,
- rowIndex: rowIndex,
- columnIndex: columnIndex
- });
- var rowspan = 1;
- var colspan = 1;
- if (Array.isArray(result)) {
- rowspan = result[0];
- colspan = result[1];
- } else if ((typeof result === 'undefined' ? 'undefined' : (0, _typeof3.default)(result)) === 'object') {
- rowspan = result.rowspan;
- colspan = result.colspan;
- }
- return {
- rowspan: rowspan,
- colspan: colspan
- };
- } else {
- return {};
- }
- },
- showWithSpan: function showWithSpan(row, column, rowIndex, columnIndex) {
- var result = this.getSpan(row, column, rowIndex, columnIndex);
- return !('rowspan' in result && result.rowspan === 0 || 'colspan' in result && result.colspan === 0);
- },
- isTrShow: function isTrShow(rowKey) {
- var status = true;
- var child = void 0;
- for (var i in this.objData) {
- var row = this.objData[i];
- var showChildren = row._isShowChildren;
- if (row._rowKey === rowKey) {
- status = status && showChildren;
- break;
- } else if (row.children && row.children.length) {
- child = this.getTrStatus(rowKey, row, status && showChildren);
- if (child[0] && child[0]._rowKey === rowKey) {
- return child[1];
- }
- }
- }
- return status;
- },
- getTrStatus: function getTrStatus(rowKey, data, parentStatus) {
- var status = parentStatus;
- var childData = void 0;
- if (data.children && data.children.length) {
- for (var i = 0; i < data.children.length; i++) {
- var row = data.children[i];
- var showChildren = row._isShowChildren;
- if (row._rowKey === rowKey) {
- childData = row;
- status = status && showChildren;
- break;
- } else if (row.children && row.children.length) {
- var child = this.getTrStatus(rowKey, row, status && showChildren);
- if (child[0] && child[0]._rowKey === rowKey) {
- return child;
- }
- }
- }
- }
- return [childData, status];
- },
- getLevel: function getLevel(rowKey) {
- var level = void 0;
- var child = void 0;
- for (var i = 0; i < this.data.length; i++) {
- var row = this.data[i];
- if (row[this.rowKey] === rowKey) {
- level = 0;
- break;
- } else if (row.children && row.children.length) {
- child = this.getChildLevel(row, rowKey, 1);
- if (child[0] && child[0][this.rowKey] === rowKey) {
- return child[1];
- }
- }
- }
- return level;
- },
- getChildLevel: function getChildLevel(data, rowKey, level) {
- var newLevel = void 0;
- var childData = void 0;
- if (data.children && data.children.length) {
- for (var i = 0; i < data.children.length; i++) {
- var row = data.children[i];
- if (row[this.rowKey] === rowKey) {
- childData = row;
- newLevel = level;
- break;
- } else if (row.children && row.children.length) {
- var child = this.getChildLevel(row, rowKey, level + 1);
- if (child[0] && child[0][this.rowKey] === rowKey) {
- return child;
- }
- }
- }
- }
- return [childData, newLevel];
- },
- getChildNode: function getChildNode(h, data, nodes) {
- var _this = this;
- if (data.children && data.children.length) {
- data.children.forEach(function (row, index) {
- (0, _newArrowCheck3.default)(this, _this);
- var $tds = [];
- this.columns.forEach(function (column, colIndex) {
- (0, _newArrowCheck3.default)(this, _this);
- if (this.showWithSpan(row, column, index, colIndex)) {
- var $tableCell = h(_cell2.default, {
- props: {
- fixed: this.fixed,
- 'prefix-cls': this.prefixCls,
- row: row,
- column: column,
- 'natural-index': index,
- index: row._index,
- checked: this.rowStatusByRowKey('_isChecked', row._rowKey),
- disabled: this.rowStatusByRowKey('_isDisabled', row._rowKey),
- expanded: this.rowStatusByRowKey('_isExpanded', row._rowKey),
- treeNode: true,
- treeLevel: this.getLevel(row._rowKey)
- },
- key: column._columnKey
- });
- var $td = h('td', {
- class: this.alignCls(column, row),
- attrs: this.getSpan(row, column, index, colIndex),
- on: {
- click: function click(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.clickCell(row, column, column.key, e);
- }.bind(this)
- }
- }, [$tableCell]);
- $tds.push($td);
- }
- }.bind(this));
- var trStyle = {};
- if (!this.isTrShow(data._rowKey)) trStyle.display = 'none';
- var $tableTr = h(_tableTr2.default, {
- props: {
- draggable: false,
- row: row,
- 'prefix-cls': this.prefixCls,
- isChildren: true
- },
- style: trStyle,
- key: this.rowKey ? row._rowKey : index,
- nativeOn: {
- mouseenter: function mouseenter(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.handleMouseIn(row._index, e, row._rowKey);
- }.bind(this),
- mouseleave: function mouseleave(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.handleMouseOut(row._index, e, row._rowKey);
- }.bind(this),
- click: function click(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.clickCurrentRow(row._index, e, row._rowKey);
- }.bind(this),
- dblclick: function dblclick(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.dblclickCurrentRow(row._index, e, row._rowKey);
- }.bind(this),
- contextmenu: function contextmenu(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.contextmenuCurrentRow(row._index, e, row._rowKey);
- }.bind(this),
- selectstart: function selectstart(e) {
- (0, _newArrowCheck3.default)(this, _this);
- return this.selectStartCurrentRow(row._index, e, row._rowKey);
- }.bind(this)
- }
- }, $tds);
- nodes.push($tableTr);
- if (row.children && row.children.length) {
- this.getChildNode(h, row, nodes);
- }
- }.bind(this));
- return nodes;
- } else {
- return nodes;
- }
- }
- },
- render: function render(h) {
- var _this2 = this;
- var $cols = [];
- this.columns.forEach(function (column) {
- (0, _newArrowCheck3.default)(this, _this2);
- var $col = h('col', {
- attrs: {
- width: this.setCellWidth(column)
- }
- });
- $cols.push($col);
- }.bind(this));
- var $colgroup = h('colgroup', {}, $cols);
- var $tableTrs = [];
- this.data.forEach(function (row, index) {
- (0, _newArrowCheck3.default)(this, _this2);
- var $tds = [];
- this.columns.forEach(function (column, colIndex) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (this.showWithSpan(row, column, index, colIndex)) {
- var $tableCell = h(_cell2.default, {
- props: {
- fixed: this.fixed,
- 'prefix-cls': this.prefixCls,
- row: row,
- column: column,
- 'natural-index': index,
- index: row._index,
- checked: this.rowChecked(row._index),
- disabled: this.rowDisabled(row._index),
- expanded: this.rowExpanded(row._index)
- },
- key: column._columnKey
- });
- var $td = h('td', {
- class: this.alignCls(column, row),
- attrs: this.getSpan(row, column, index, colIndex),
- on: {
- click: function click(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.clickCell(row, column, column.key, e);
- }.bind(this)
- }
- }, [$tableCell]);
- $tds.push($td);
- }
- }.bind(this));
- var $tableTr = h(_tableTr2.default, {
- props: {
- draggable: this.draggable,
- row: row,
- 'prefix-cls': this.prefixCls
- },
- key: this.rowKey ? row._rowKey : index,
- nativeOn: {
- mouseenter: function mouseenter(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.handleMouseIn(row._index, e);
- }.bind(this),
- mouseleave: function mouseleave(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.handleMouseOut(row._index, e);
- }.bind(this),
- click: function click(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.clickCurrentRow(row._index, e);
- }.bind(this),
- dblclick: function dblclick(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.dblclickCurrentRow(row._index, e);
- }.bind(this),
- contextmenu: function contextmenu(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.contextmenuCurrentRow(row._index, e);
- }.bind(this),
- selectstart: function selectstart(e) {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.selectStartCurrentRow(row._index, e);
- }.bind(this)
- }
- }, $tds);
- $tableTrs.push($tableTr);
- if (this.rowExpanded(row._index)) {
- var $Expand = h(_expand2.default, {
- props: {
- row: row,
- render: this.expandRender,
- index: row._index
- },
- key: this.rowKey ? row._rowKey : index
- });
- var $td = h('td', {
- attrs: {
- colspan: this.columns.length
- },
- class: this.prefixCls + '-expanded-cell'
- }, [$Expand]);
- var $tr = h('tr', {
- class: (0, _defineProperty3.default)({}, this.prefixCls + '-expanded-hidden', this.fixed)
- }, [$td]);
- $tableTrs.push($tr);
- }
- if (row.children && row.children.length) {
- var $childNodes = this.getChildNode(h, row, []);
- $childNodes.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this2);
- $tableTrs.push(item);
- }.bind(this));
- }
- }.bind(this));
- var $tbody = h('tbody', {
- class: this.prefixCls + '-tbody'
- }, [$tableTrs]);
- return h('table', {
- attrs: {
- cellspacing: '0',
- cellpadding: '0',
- border: '0'
- },
- style: this.styleObject
- }, [$colgroup, $tbody]);
- }
- };
- /***/ }),
- /* 238 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- props: {
- row: Object,
- prefixCls: String,
- draggable: Boolean,
- isChildren: Boolean },
- computed: {
- objData: function objData() {
- return this.$parent.objData;
- }
- },
- methods: {
- onDrag: function onDrag(e, index) {
- e.dataTransfer.setData('index', index);
- },
- onDrop: function onDrop(e, index) {
- var dragIndex = e.dataTransfer.getData('index');
- this.$parent.$parent.dragAndDrop(dragIndex, index);
- e.preventDefault();
- },
- allowDrop: function allowDrop(e) {
- e.preventDefault();
- },
- rowClasses: function rowClasses(_index) {
- var _ref;
- var objData = this.isChildren ? this.$parent.$parent.getDataByRowKey(this.row._rowKey) : this.objData[_index];
- return [String(this.prefixCls) + '-row', this.rowClsName(_index), (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-row-highlight', objData && objData._isHighlight), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-row-hover', objData && objData._isHover), _ref)];
- },
- rowClsName: function rowClsName(_index) {
- return this.$parent.$parent.rowClassName(this.objData[_index], _index);
- }
- }
- };
- /***/ }),
- /* 239 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _expand = __webpack_require__(240);
- var _expand2 = _interopRequireDefault(_expand);
- var _slot = __webpack_require__(574);
- var _slot2 = _interopRequireDefault(_slot);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _checkbox = __webpack_require__(49);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- var _tooltip = __webpack_require__(93);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableCell',
- components: { Icon: _icon2.default, Checkbox: _checkbox2.default, TableExpand: _expand2.default, TableSlot: _slot2.default, Tooltip: _tooltip2.default },
- inject: ['tableRoot'],
- props: {
- prefixCls: String,
- row: Object,
- column: Object,
- naturalIndex: Number,
- index: Number,
- checked: Boolean,
- disabled: Boolean,
- expanded: Boolean,
- fixed: {
- type: [Boolean, String],
- default: false
- },
- treeNode: Boolean,
- treeLevel: {
- type: Number,
- default: 0
- }
- },
- data: function data() {
- return {
- renderType: '',
- uid: -1,
- context: this.$parent.$parent.$parent.currentContext,
- showTooltip: false };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return [String(this.prefixCls) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right')), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-ellipsis', this.column.ellipsis || false), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-expand', this.renderType === 'expand'), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-selection', this.renderType === 'selection'), _ref)];
- },
- expandCls: function expandCls() {
- return [String(this.prefixCls) + '-cell-expand', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-cell-expand-expanded', this.expanded)];
- },
- showChildren: function showChildren() {
- var status = false;
- if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
- var data = this.row;
- if (data.children && data.children.length || '_loading' in data) {
- if (this.column.tree) status = true;
- }
- }
- return status;
- },
- showTreeNode: function showTreeNode() {
- var status = false;
- if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
- if (this.column.tree && this.treeNode) status = true;
- }
- return status;
- },
- showLevel: function showLevel() {
- var status = false;
- if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
- if (this.column.tree && this.treeNode) status = true;
- }
- return status;
- },
- treeLevelStyle: function treeLevelStyle() {
- return {
- 'padding-left': this.treeLevel * this.tableRoot.indentSize + 'px'
- };
- },
- childrenExpand: function childrenExpand() {
- var data = this.tableRoot.getDataByRowKey(this.row._rowKey);
- return data._isShowChildren;
- },
- childrenLoading: function childrenLoading() {
- var data = this.tableRoot.getDataByRowKey(this.row._rowKey);
- return '_loading' in data && data._loading;
- }
- },
- methods: {
- toggleSelect: function toggleSelect() {
- if (this.treeNode) {
- this.$parent.$parent.$parent.toggleSelect(this.index, this.row._rowKey);
- } else {
- this.$parent.$parent.$parent.toggleSelect(this.index);
- }
- },
- toggleExpand: function toggleExpand() {
- this.$parent.$parent.$parent.toggleExpand(this.index);
- },
- handleClick: function handleClick() {},
- handleTooltipIn: function handleTooltipIn() {
- var $content = this.$refs.content;
- var range = document.createRange();
- range.setStart($content, 0);
- range.setEnd($content, $content.childNodes.length);
- var rangeWidth = range.getBoundingClientRect().width;
- this.showTooltip = rangeWidth > $content.offsetWidth;
- range = null;
- },
- handleToggleTree: function handleToggleTree() {
- this.$parent.$parent.$parent.toggleTree(this.row._rowKey);
- }
- },
- created: function created() {
- if (this.column.type === 'index') {
- this.renderType = 'index';
- } else if (this.column.type === 'selection') {
- this.renderType = 'selection';
- } else if (this.column.type === 'html') {
- this.renderType = 'html';
- } else if (this.column.type === 'expand') {
- this.renderType = 'expand';
- } else if (this.column.render) {
- this.renderType = 'render';
- } else if (this.column.slot) {
- this.renderType = 'slot';
- } else {
- this.renderType = 'normal';
- }
- }
- };
- /***/ }),
- /* 240 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableExpand',
- functional: true,
- props: {
- row: Object,
- render: Function,
- index: Number,
- column: {
- type: Object,
- default: null
- }
- },
- render: function render(h, ctx) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var params = {
- row: ctx.props.row,
- index: ctx.props.index
- };
- if (ctx.props.column) params.column = ctx.props.column;
- return ctx.props.render(h, params);
- }.bind(undefined)
- };
- /***/ }),
- /* 241 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _mixin = __webpack_require__(95);
- var _mixin2 = _interopRequireDefault(_mixin);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableSummary',
- mixins: [_mixin2.default],
- props: {
- prefixCls: String,
- styleObject: Object,
- columns: Array,
- data: Object,
- columnsWidth: Object,
- fixed: {
- type: [Boolean, String],
- default: false
- }
- },
- methods: {
- cellCls: function cellCls(column) {
- return [(0, _defineProperty3.default)({}, 'ivu-table-hidden', this.fixed === 'left' && column.fixed !== 'left' || this.fixed === 'right' && column.fixed !== 'right' || !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right'))];
- }
- }
- };
- /***/ }),
- /* 242 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _getIterator2 = __webpack_require__(45);
- var _getIterator3 = _interopRequireDefault(_getIterator2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _render = __webpack_require__(215);
- var _render2 = _interopRequireDefault(_render);
- var _dropdown = __webpack_require__(61);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _dropdownMenu = __webpack_require__(62);
- var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _elementResizeDetector = __webpack_require__(94);
- var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-tabs';
- var transitionTime = 300;
- var getNextTab = function (list, activeKey, direction, countDisabledAlso) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var currentIndex = list.findIndex(function (tab) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return tab.name === activeKey;
- }.bind(undefined));
- var nextIndex = (currentIndex + direction + list.length) % list.length;
- var nextTab = list[nextIndex];
- if (nextTab.disabled) return getNextTab(list, nextTab.name, direction, countDisabledAlso);else return nextTab;
- }.bind(undefined);
- var focusFirst = function (element, root) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- try {
- element.focus();
- } catch (err) {}
- if (document.activeElement == element && element !== root) return true;
- var candidates = element.children;
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
- try {
- for (var _iterator = (0, _getIterator3.default)(candidates), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var candidate = _step.value;
- if (focusFirst(candidate, root)) return true;
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator.return) {
- _iterator.return();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
- return false;
- }.bind(undefined);
- exports.default = {
- name: 'Tabs',
- mixins: [_emitter2.default],
- components: { Icon: _icon2.default, Render: _render2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
- provide: function provide() {
- return { TabsInstance: this };
- },
- props: {
- value: {
- type: [String, Number]
- },
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['line', 'card']);
- },
- default: 'line'
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['small', 'default']);
- },
- default: 'default'
- },
- animated: {
- type: Boolean,
- default: true
- },
- captureFocus: {
- type: Boolean,
- default: false
- },
- closable: {
- type: Boolean,
- default: false
- },
- beforeRemove: Function,
- name: {
- type: String
- },
- draggable: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- navList: [],
- barWidth: 0,
- barOffset: 0,
- activeKey: this.value,
- focusedKey: this.value,
- showSlot: false,
- navStyle: {
- transform: ''
- },
- scrollable: false,
- transitioning: false,
- contextMenuVisible: false,
- contextMenuStyles: {
- top: 0,
- left: 0
- }
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-card', this.type === 'card'), (0, _defineProperty3.default)(_ref, prefixCls + '-mini', this.size === 'small' && this.type === 'line'), (0, _defineProperty3.default)(_ref, prefixCls + '-no-animation', !this.animated), _ref)];
- },
- contentClasses: function contentClasses() {
- return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-animated', this.animated)];
- },
- barClasses: function barClasses() {
- return [prefixCls + '-ink-bar', (0, _defineProperty3.default)({}, prefixCls + '-ink-bar-animated', this.animated)];
- },
- contentStyle: function contentStyle() {
- var x = this.getTabIndex(this.activeKey);
- var p = x === 0 ? '0%' : '-' + String(x) + '00%';
- var style = {};
- if (x > -1) {
- style = {
- transform: 'translateX(' + p + ') translateZ(0px)'
- };
- }
- return style;
- },
- barStyle: function barStyle() {
- var style = {
- visibility: 'hidden',
- width: String(this.barWidth) + 'px'
- };
- if (this.type === 'line') style.visibility = 'visible';
- if (this.animated) {
- style.transform = 'translate3d(' + String(this.barOffset) + 'px, 0px, 0px)';
- } else {
- style.left = String(this.barOffset) + 'px';
- }
- return style;
- },
- arrowType: function arrowType() {
- var type = 'ios-close';
- if (this.$IVIEW) {
- if (this.$IVIEW.tabs.customCloseIcon) {
- type = '';
- } else if (this.$IVIEW.tabs.closeIcon) {
- type = this.$IVIEW.tabs.closeIcon;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.tabs.customCloseIcon) {
- type = this.$IVIEW.tabs.customCloseIcon;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.tabs.closeIconSize) {
- size = this.$IVIEW.tabs.closeIconSize;
- }
- }
- return size;
- }
- },
- methods: {
- getTabs: function getTabs() {
- var _this = this;
- var AllTabPanes = (0, _assist.findComponentsDownward)(this, 'TabPane');
- var TabPanes = [];
- AllTabPanes.forEach(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- if (item.tab && this.name) {
- if (item.tab === this.name) {
- TabPanes.push(item);
- }
- } else {
- TabPanes.push(item);
- }
- }.bind(this));
- TabPanes.sort(function (a, b) {
- (0, _newArrowCheck3.default)(this, _this);
- if (a.index && b.index) {
- return a.index > b.index ? 1 : -1;
- }
- }.bind(this));
- return TabPanes;
- },
- updateNav: function updateNav() {
- var _this2 = this;
- this.navList = [];
- this.getTabs().forEach(function (pane, index) {
- (0, _newArrowCheck3.default)(this, _this2);
- this.navList.push({
- labelType: (0, _typeof3.default)(pane.label),
- label: pane.label,
- icon: pane.icon || '',
- name: pane.currentName || index,
- disabled: pane.disabled,
- closable: pane.closable,
- contextMenu: pane.contextMenu
- });
- if (!pane.currentName) pane.currentName = index;
- if (index === 0) {
- if (!this.activeKey) this.activeKey = pane.currentName || index;
- }
- }.bind(this));
- this.updateStatus();
- this.updateBar();
- },
- updateBar: function updateBar() {
- var _this3 = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this3);
- var index = this.getTabIndex(this.activeKey);
- if (!this.$refs.nav) return;
- var prevTabs = this.$refs.nav.querySelectorAll('.' + prefixCls + '-tab');
- var tab = prevTabs[index];
- this.barWidth = tab ? parseFloat(tab.offsetWidth) : 0;
- if (index > 0) {
- var offset = 0;
- var gutter = this.size === 'small' ? 0 : 16;
- for (var i = 0; i < index; i++) {
- offset += parseFloat(prevTabs[i].offsetWidth) + gutter;
- }
- this.barOffset = offset;
- } else {
- this.barOffset = 0;
- }
- this.updateNavScroll();
- }.bind(this));
- },
- updateStatus: function updateStatus() {
- var _this4 = this;
- var tabs = this.getTabs();
- tabs.forEach(function (tab) {
- (0, _newArrowCheck3.default)(this, _this4);
- return tab.show = tab.currentName === this.activeKey || this.animated;
- }.bind(this));
- },
- tabCls: function tabCls(item) {
- var _ref4;
- return [prefixCls + '-tab', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-disabled', item.disabled), (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-active', item.name === this.activeKey), (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-focused', item.name === this.focusedKey), _ref4)];
- },
- handleChange: function handleChange(index) {
- var _this5 = this;
- if (this.transitioning) return;
- this.transitioning = true;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this5);
- return this.transitioning = false;
- }.bind(this), transitionTime);
- var nav = this.navList[index];
- if (!nav || nav.disabled) return;
- this.activeKey = nav.name;
- this.$emit('input', nav.name);
- this.$emit('on-click', nav.name);
- },
- handleDblclick: function handleDblclick(index) {
- var nav = this.navList[index];
- if (!nav || nav.disabled) return;
- this.$emit('on-dblclick', nav.name);
- },
- handleContextmenu: function handleContextmenu(index, event) {
- var _this6 = this;
- if (this.contextMenuVisible) this.handleClickContextMenuOutside();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this6);
- var nav = this.navList[index];
- if (!nav || nav.disabled || !nav.contextMenu) return;
- event.preventDefault();
- var $TabsWrap = this.$refs.tabsWrap;
- var TabsBounding = $TabsWrap.getBoundingClientRect();
- var position = {
- left: event.clientX - TabsBounding.left + 'px',
- top: event.clientY - TabsBounding.top + 'px'
- };
- this.contextMenuStyles = position;
- this.contextMenuVisible = true;
- this.$emit('on-contextmenu', nav, event, position);
- }.bind(this));
- },
- handleClickContextMenuOutside: function handleClickContextMenuOutside() {
- this.contextMenuVisible = false;
- },
- handlePreventSelect: function handlePreventSelect(index, event) {
- var nav = this.navList[index];
- if (!nav || nav.disabled || !nav.contextMenu) return;
- event.preventDefault();
- },
- handleTabKeyNavigation: function handleTabKeyNavigation(e) {
- if (e.keyCode !== 37 && e.keyCode !== 39) return;
- var direction = e.keyCode === 39 ? 1 : -1;
- var nextTab = getNextTab(this.navList, this.focusedKey, direction);
- this.focusedKey = nextTab.name;
- },
- handleTabKeyboardSelect: function handleTabKeyboardSelect() {
- var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- if (init) return;
- var focused = this.focusedKey || 0;
- var index = this.getTabIndex(focused);
- this.handleChange(index);
- },
- handleRemove: function handleRemove(index) {
- var _this7 = this;
- if (!this.beforeRemove) {
- return this.handleRemoveTab(index);
- }
- var before = this.beforeRemove(index);
- if (before && before.then) {
- before.then(function () {
- (0, _newArrowCheck3.default)(this, _this7);
- this.handleRemoveTab(index);
- }.bind(this));
- } else {
- this.handleRemoveTab(index);
- }
- },
- handleRemoveTab: function handleRemoveTab(index) {
- var _this8 = this;
- var tabs = this.getTabs();
- var tab = tabs[index];
- tab.$destroy();
- if (tab.currentName === this.activeKey) {
- var newTabs = this.getTabs();
- var activeKey = -1;
- if (newTabs.length) {
- var leftNoDisabledTabs = tabs.filter(function (item, itemIndex) {
- (0, _newArrowCheck3.default)(this, _this8);
- return !item.disabled && itemIndex < index;
- }.bind(this));
- var rightNoDisabledTabs = tabs.filter(function (item, itemIndex) {
- (0, _newArrowCheck3.default)(this, _this8);
- return !item.disabled && itemIndex > index;
- }.bind(this));
- if (rightNoDisabledTabs.length) {
- activeKey = rightNoDisabledTabs[0].currentName;
- } else if (leftNoDisabledTabs.length) {
- activeKey = leftNoDisabledTabs[leftNoDisabledTabs.length - 1].currentName;
- } else {
- activeKey = newTabs[0].currentName;
- }
- }
- this.activeKey = activeKey;
- this.$emit('input', activeKey);
- }
- this.$emit('on-tab-remove', tab.currentName);
- this.updateNav();
- },
- showClose: function showClose(item) {
- if (this.type === 'card') {
- if (item.closable !== null) {
- return item.closable;
- } else {
- return this.closable;
- }
- } else {
- return false;
- }
- },
- scrollPrev: function scrollPrev() {
- var containerWidth = this.$refs.navScroll.offsetWidth;
- var currentOffset = this.getCurrentScrollOffset();
- if (!currentOffset) return;
- var newOffset = currentOffset > containerWidth ? currentOffset - containerWidth : 0;
- this.setOffset(newOffset);
- },
- scrollNext: function scrollNext() {
- var navWidth = this.$refs.nav.offsetWidth;
- var containerWidth = this.$refs.navScroll.offsetWidth;
- var currentOffset = this.getCurrentScrollOffset();
- if (navWidth - currentOffset <= containerWidth) return;
- var newOffset = navWidth - currentOffset > containerWidth * 2 ? currentOffset + containerWidth : navWidth - containerWidth;
- this.setOffset(newOffset);
- },
- getCurrentScrollOffset: function getCurrentScrollOffset() {
- var navStyle = this.navStyle;
- return navStyle.transform ? Number(navStyle.transform.match(/translateX\(-(\d+(\.\d+)*)px\)/)[1]) : 0;
- },
- getTabIndex: function getTabIndex(name) {
- var _this9 = this;
- return this.navList.findIndex(function (nav) {
- (0, _newArrowCheck3.default)(this, _this9);
- return nav.name === name;
- }.bind(this));
- },
- setOffset: function setOffset(value) {
- this.navStyle.transform = 'translateX(-' + String(value) + 'px)';
- },
- scrollToActiveTab: function scrollToActiveTab() {
- if (!this.scrollable) return;
- var nav = this.$refs.nav;
- var activeTab = this.$el.querySelector('.' + prefixCls + '-tab-active');
- if (!activeTab) return;
- var navScroll = this.$refs.navScroll;
- var activeTabBounding = activeTab.getBoundingClientRect();
- var navScrollBounding = navScroll.getBoundingClientRect();
- var navBounding = nav.getBoundingClientRect();
- var currentOffset = this.getCurrentScrollOffset();
- var newOffset = currentOffset;
- if (navBounding.right < navScrollBounding.right) {
- newOffset = nav.offsetWidth - navScrollBounding.width;
- }
- if (activeTabBounding.left < navScrollBounding.left) {
- newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
- } else if (activeTabBounding.right > navScrollBounding.right) {
- newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
- }
- if (currentOffset !== newOffset) {
- this.setOffset(Math.max(newOffset, 0));
- }
- },
- updateNavScroll: function updateNavScroll() {
- var navWidth = this.$refs.nav.offsetWidth;
- var containerWidth = this.$refs.navScroll.offsetWidth;
- var currentOffset = this.getCurrentScrollOffset();
- if (containerWidth < navWidth) {
- this.scrollable = true;
- if (navWidth - currentOffset < containerWidth) {
- this.setOffset(navWidth - containerWidth);
- }
- } else {
- this.scrollable = false;
- if (currentOffset > 0) {
- this.setOffset(0);
- }
- }
- },
- handleScroll: function handleScroll(e) {
- e.preventDefault();
- e.stopPropagation();
- var type = e.type;
- var delta = 0;
- if (type === 'DOMMouseScroll' || type === 'mousewheel') {
- delta = e.wheelDelta ? e.wheelDelta : -(e.detail || 0) * 40;
- }
- if (delta > 0) {
- this.scrollPrev();
- } else {
- this.scrollNext();
- }
- },
- handleResize: function handleResize() {
- this.updateNavScroll();
- },
- isInsideHiddenElement: function isInsideHiddenElement() {
- var parentNode = this.$el.parentNode;
- while (parentNode && parentNode !== document.body) {
- if (parentNode.style && parentNode.style.display === 'none') {
- return parentNode;
- }
- parentNode = parentNode.parentNode;
- }
- return false;
- },
- updateVisibility: function updateVisibility(index) {
- var _this10 = this;
- [].concat((0, _toConsumableArray3.default)(this.$refs.panes.querySelectorAll('.' + prefixCls + '-tabpane'))).forEach(function (el, i) {
- (0, _newArrowCheck3.default)(this, _this10);
- if (index === i) {
- [].concat((0, _toConsumableArray3.default)(el.children)).filter(function (child) {
- (0, _newArrowCheck3.default)(this, _this10);
- return child.classList.contains(prefixCls + '-tabpane');
- }.bind(this)).forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this10);
- return child.style.visibility = 'visible';
- }.bind(this));
- if (this.captureFocus) setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this10);
- return focusFirst(el, el);
- }.bind(this), transitionTime);
- } else {
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this10);
- [].concat((0, _toConsumableArray3.default)(el.children)).filter(function (child) {
- (0, _newArrowCheck3.default)(this, _this10);
- return child.classList.contains(prefixCls + '-tabpane');
- }.bind(this)).forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this10);
- return child.style.visibility = 'hidden';
- }.bind(this));
- }.bind(this), transitionTime);
- }
- }.bind(this));
- },
- handleDrag: function handleDrag(index, event) {
- var nav = this.navList[index];
- if (nav) {
- event.dataTransfer.setData('tab-name', nav.name);
- }
- },
- handleDrop: function handleDrop(index, event) {
- var _this11 = this;
- var nav = this.navList[index];
- if (nav) {
- var dragName = event.dataTransfer.getData('tab-name');
- event.preventDefault();
- var navNames = this.navList.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this11);
- return item.name;
- }.bind(this));
- var a = parseInt(navNames.findIndex(function (item) {
- (0, _newArrowCheck3.default)(this, _this11);
- return item === dragName;
- }.bind(this)));
- var b = parseInt(navNames.findIndex(function (item) {
- (0, _newArrowCheck3.default)(this, _this11);
- return item === nav.name;
- }.bind(this)));
- navNames.splice.apply(navNames, [b, 1].concat((0, _toConsumableArray3.default)(navNames.splice(a, 1, navNames[b]))));
- this.$emit('on-drag-drop', dragName, nav.name, a, b, navNames);
- }
- }
- },
- watch: {
- value: function value(val) {
- this.activeKey = val;
- this.focusedKey = val;
- },
- activeKey: function activeKey(val) {
- var _this12 = this;
- this.focusedKey = val;
- this.updateBar();
- this.updateStatus();
- this.broadcast('Table', 'on-visible-change', true);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this12);
- this.scrollToActiveTab();
- }.bind(this));
- var nextIndex = Math.max(this.getTabIndex(this.focusedKey), 0);
- this.updateVisibility(nextIndex);
- }
- },
- mounted: function mounted() {
- var _this13 = this;
- this.showSlot = this.$slots.extra !== undefined;
- this.observer = (0, _elementResizeDetector2.default)();
- this.observer.listenTo(this.$refs.navWrap, this.handleResize);
- var hiddenParentNode = this.isInsideHiddenElement();
- if (hiddenParentNode) {
- this.mutationObserver = new _assist.MutationObserver(function () {
- (0, _newArrowCheck3.default)(this, _this13);
- if (hiddenParentNode.style.display !== 'none') {
- this.updateBar();
- this.mutationObserver.disconnect();
- }
- }.bind(this));
- this.mutationObserver.observe(hiddenParentNode, { attributes: true, childList: true, characterData: true, attributeFilter: ['style'] });
- }
- this.handleTabKeyboardSelect(true);
- this.updateVisibility(this.getTabIndex(this.activeKey));
- },
- beforeDestroy: function beforeDestroy() {
- this.observer.removeListener(this.$refs.navWrap, this.handleResize);
- if (this.mutationObserver) this.mutationObserver.disconnect();
- }
- };
- /***/ }),
- /* 243 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var prefixCls = 'ivu-tabs-tabpane';
- exports.default = {
- name: 'TabPane',
- inject: ['TabsInstance'],
- props: {
- name: {
- type: String
- },
- label: {
- type: [String, Function],
- default: ''
- },
- icon: {
- type: String
- },
- disabled: {
- type: Boolean,
- default: false
- },
- closable: {
- type: Boolean,
- default: null
- },
- tab: {
- type: String
- },
- index: {
- type: Number
- },
- contextMenu: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- show: true,
- currentName: this.name
- };
- },
- computed: {
- contentStyle: function contentStyle() {
- return {
- visibility: this.TabsInstance.activeKey !== this.currentName ? 'hidden' : 'visible'
- };
- }
- },
- methods: {
- updateNav: function updateNav() {
- this.TabsInstance.updateNav();
- }
- },
- watch: {
- name: function name(val) {
- this.currentName = val;
- this.updateNav();
- },
- label: function label() {
- this.updateNav();
- },
- icon: function icon() {
- this.updateNav();
- },
- disabled: function disabled() {
- this.updateNav();
- }
- },
- mounted: function mounted() {
- this.updateNav();
- },
- destroyed: function destroyed() {
- this.updateNav();
- }
- };
- /***/ }),
- /* 244 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-tag';
- var initColorList = ['default', 'primary', 'success', 'warning', 'error', 'blue', 'green', 'red', 'yellow', 'pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
- var colorList = ['pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
- exports.default = {
- name: 'Tag',
- components: { Icon: _icon2.default },
- props: {
- closable: {
- type: Boolean,
- default: false
- },
- checkable: {
- type: Boolean,
- default: false
- },
- checked: {
- type: Boolean,
- default: true
- },
- color: {
- type: String,
- default: 'default'
- },
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['border', 'dot']);
- }
- },
- name: {
- type: [String, Number]
- },
- fade: {
- type: Boolean,
- default: true
- },
- size: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['default', 'medium', 'large']);
- },
- default: 'default'
- }
- },
- data: function data() {
- return {
- isChecked: this.checked
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, prefixCls + '-size-' + String(this.size), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.color), !!this.color && (0, _assist.oneOf)(this.color, initColorList)), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-closable', this.closable), (0, _defineProperty3.default)(_ref, prefixCls + '-checked', this.isChecked), _ref)];
- },
- wraperStyles: function wraperStyles() {
- return (0, _assist.oneOf)(this.color, initColorList) ? {} : { background: this.isChecked ? this.defaultTypeColor : 'transparent', borderWidth: '1px', borderStyle: 'solid', borderColor: this.type !== 'dot' && this.type !== 'border' && this.isChecked ? this.borderColor : this.lineColor, color: this.lineColor };
- },
- textClasses: function textClasses() {
- return [prefixCls + '-text', this.type === 'border' ? (0, _assist.oneOf)(this.color, initColorList) ? prefixCls + '-color-' + String(this.color) : '' : '', this.type !== 'dot' && this.type !== 'border' && this.color !== 'default' ? this.isChecked && colorList.indexOf(this.color) < 0 ? prefixCls + '-color-white' : '' : ''];
- },
- dotClasses: function dotClasses() {
- return prefixCls + '-dot-inner';
- },
- iconClass: function iconClass() {
- if (this.type === 'dot') {
- return '';
- } else if (this.type === 'border') {
- return (0, _assist.oneOf)(this.color, initColorList) ? prefixCls + '-color-' + String(this.color) : '';
- } else {
- return this.color !== undefined ? this.color === 'default' ? '' : 'rgb(255, 255, 255)' : '';
- }
- },
- showDot: function showDot() {
- return !!this.type && this.type === 'dot';
- },
- lineColor: function lineColor() {
- if (this.type === 'dot') {
- return '';
- } else if (this.type === 'border') {
- return this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '';
- } else {
- return this.color !== undefined ? this.color === 'default' ? '' : 'rgb(255, 255, 255)' : '';
- }
- },
- borderColor: function borderColor() {
- return this.color !== undefined ? this.color === 'default' ? '' : this.color : '';
- },
- dotColor: function dotColor() {
- return this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '';
- },
- textColorStyle: function textColorStyle() {
- return (0, _assist.oneOf)(this.color, initColorList) ? {} : this.type !== 'dot' && this.type !== 'border' ? this.isChecked ? { color: this.lineColor } : {} : { color: this.lineColor };
- },
- bgColorStyle: function bgColorStyle() {
- return (0, _assist.oneOf)(this.color, initColorList) ? {} : { background: this.dotColor };
- },
- defaultTypeColor: function defaultTypeColor() {
- return this.type !== 'dot' && this.type !== 'border' ? this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '' : '';
- }
- },
- methods: {
- close: function close(event) {
- if (this.name === undefined) {
- this.$emit('on-close', event);
- } else {
- this.$emit('on-close', event, this.name);
- }
- },
- check: function check() {
- if (!this.checkable) return;
- var checked = !this.isChecked;
- this.isChecked = checked;
- if (this.name === undefined) {
- this.$emit('on-change', checked);
- } else {
- this.$emit('on-change', checked, this.name);
- }
- }
- },
- watch: {
- checked: function checked(val) {
- this.isChecked = val;
- }
- }
- };
- /***/ }),
- /* 245 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- var _assist = __webpack_require__(3);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _time = __webpack_require__(592);
- var _time2 = _interopRequireDefault(_time);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- var prefixCls = 'ivu-time';
- exports.default = {
- name: 'Time',
- mixins: [_locale2.default],
- props: {
- time: {
- type: [Number, Date, String],
- required: true
- },
- type: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['relative', 'date', 'datetime']);
- },
- default: 'relative'
- },
- hash: {
- type: String,
- default: ''
- },
- interval: {
- type: Number,
- default: 60
- }
- },
- data: function data() {
- return {
- date: ''
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-with-hash', this.hash)];
- }
- },
- watch: {
- time: function time() {
- if (!isServer) this.setTime();
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.hash !== '') window.location.hash = this.hash;
- },
- setTime: function setTime() {
- var type = (0, _typeof3.default)(this.time);
- var time = void 0;
- if (type === 'number') {
- var timestamp = this.time.toString().length > 10 ? this.time : this.time * 1000;
- time = new Date(timestamp).getTime();
- } else if (type === 'object') {
- time = this.time.getTime();
- } else if (type === 'string') {
- time = new Date(this.time).getTime();
- }
- if (this.type === 'relative') {
- this.date = (0, _time2.default)(time, this.t);
- } else {
- var date = new Date(this.time);
- var year = date.getFullYear();
- var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
- var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
- var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
- var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
- var second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
- if (this.type === 'datetime') {
- this.date = String(year) + '-' + String(month) + '-' + String(day) + ' ' + String(hour) + ':' + String(minute) + ':' + String(second);
- } else if (this.type === 'date') {
- this.date = String(year) + '-' + String(month) + '-' + String(day);
- }
- }
- }
- },
- mounted: function mounted() {
- var _this = this;
- this.setTime();
- if (isServer) return;
- this.timer = setInterval(function () {
- (0, _newArrowCheck3.default)(this, _this);
- this.setTime();
- }.bind(this), 1000 * this.interval);
- },
- beforeDestroy: function beforeDestroy() {
- if (this.timer) clearInterval(this.timer);
- }
- };
- /***/ }),
- /* 246 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-timeline';
- exports.default = {
- name: 'Timeline',
- props: {
- pending: {
- type: Boolean,
- default: false
- }
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-pending', this.pending)];
- }
- }
- };
- /***/ }),
- /* 247 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-timeline';
- exports.default = {
- name: 'TimelineItem',
- props: {
- color: {
- type: String,
- default: 'blue'
- }
- },
- data: function data() {
- return {
- dot: false
- };
- },
- mounted: function mounted() {
- this.dot = this.$refs.dot.innerHTML.length ? true : false;
- },
- computed: {
- itemClasses: function itemClasses() {
- return prefixCls + '-item';
- },
- tailClasses: function tailClasses() {
- return prefixCls + '-item-tail';
- },
- headClasses: function headClasses() {
- var _ref;
- return [prefixCls + '-item-head', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-head-custom', this.dot), (0, _defineProperty3.default)(_ref, prefixCls + '-item-head-' + String(this.color), this.headColorShow), _ref)];
- },
- headColorShow: function headColorShow() {
- return this.color == 'blue' || this.color == 'red' || this.color == 'green';
- },
- customColor: function customColor() {
- var style = {};
- if (this.color) {
- if (!this.headColorShow) {
- style = {
- 'color': this.color,
- 'border-color': this.color
- };
- }
- }
- return style;
- },
- contentClasses: function contentClasses() {
- return prefixCls + '-item-content';
- }
- }
- };
- /***/ }),
- /* 248 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _toConsumableArray2 = __webpack_require__(17);
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _list = __webpack_require__(604);
- var _list2 = _interopRequireDefault(_list);
- var _operation = __webpack_require__(608);
- var _operation2 = _interopRequireDefault(_operation);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-transfer';
- exports.default = {
- name: 'Transfer',
- mixins: [_emitter2.default, _locale2.default],
- render: function render(h) {
- var _this2 = this;
- function cloneVNode(vnode) {
- var _this = this;
- var clonedChildren = vnode.children && vnode.children.map(function (vnode) {
- (0, _newArrowCheck3.default)(this, _this);
- return cloneVNode(vnode);
- }.bind(this));
- var cloned = h(vnode.tag, vnode.data, clonedChildren);
- cloned.text = vnode.text;
- cloned.isComment = vnode.isComment;
- cloned.componentOptions = vnode.componentOptions;
- cloned.elm = vnode.elm;
- cloned.context = vnode.context;
- cloned.ns = vnode.ns;
- cloned.isStatic = vnode.isStatic;
- cloned.key = vnode.key;
- return cloned;
- }
- var vNodes = this.$slots.default === undefined ? [] : this.$slots.default;
- var clonedVNodes = this.$slots.default === undefined ? [] : vNodes.map(function (vnode) {
- (0, _newArrowCheck3.default)(this, _this2);
- return cloneVNode(vnode);
- }.bind(this));
- return h('div', {
- 'class': this.classes
- }, [h(_list2.default, {
- ref: 'left',
- props: {
- prefixCls: this.prefixCls + '-list',
- data: this.leftData,
- renderFormat: this.renderFormat,
- checkedKeys: this.leftCheckedKeys,
- validKeysCount: this.leftValidKeysCount,
- listStyle: this.listStyle,
- title: this.localeTitles[0],
- filterable: this.filterable,
- filterPlaceholder: this.localeFilterPlaceholder,
- filterMethod: this.filterMethod,
- notFoundText: this.localeNotFoundText
- },
- on: {
- 'on-checked-keys-change': this.handleLeftCheckedKeysChange
- }
- }, vNodes), h(_operation2.default, {
- props: {
- prefixCls: this.prefixCls,
- operations: this.operations,
- leftActive: this.leftValidKeysCount > 0,
- rightActive: this.rightValidKeysCount > 0,
- reverseOperation: this.reverseOperation
- }
- }), h(_list2.default, {
- ref: 'right',
- props: {
- prefixCls: this.prefixCls + '-list',
- data: this.rightData,
- renderFormat: this.renderFormat,
- checkedKeys: this.rightCheckedKeys,
- validKeysCount: this.rightValidKeysCount,
- listStyle: this.listStyle,
- title: this.localeTitles[1],
- filterable: this.filterable,
- filterPlaceholder: this.localeFilterPlaceholder,
- filterMethod: this.filterMethod,
- notFoundText: this.localeNotFoundText
- },
- on: {
- 'on-checked-keys-change': this.handleRightCheckedKeysChange
- }
- }, clonedVNodes)]);
- },
- props: {
- data: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- renderFormat: {
- type: Function,
- default: function _default(item) {
- return item.label || item.key;
- }
- },
- targetKeys: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- selectedKeys: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- listStyle: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- titles: {
- type: Array
- },
- operations: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- filterable: {
- type: Boolean,
- default: false
- },
- filterPlaceholder: {
- type: String
- },
- filterMethod: {
- type: Function,
- default: function _default(data, query) {
- var type = 'label' in data ? 'label' : 'key';
- return data[type].indexOf(query) > -1;
- }
- },
- notFoundText: {
- type: String
- },
- reverseOperation: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- leftData: [],
- rightData: [],
- leftCheckedKeys: [],
- rightCheckedKeys: []
- };
- },
- computed: {
- classes: function classes() {
- return ['' + prefixCls];
- },
- leftValidKeysCount: function leftValidKeysCount() {
- return this.getValidKeys('left').length;
- },
- rightValidKeysCount: function rightValidKeysCount() {
- return this.getValidKeys('right').length;
- },
- localeFilterPlaceholder: function localeFilterPlaceholder() {
- if (this.filterPlaceholder === undefined) {
- return this.t('i.transfer.filterPlaceholder');
- } else {
- return this.filterPlaceholder;
- }
- },
- localeNotFoundText: function localeNotFoundText() {
- if (this.notFoundText === undefined) {
- return this.t('i.transfer.notFoundText');
- } else {
- return this.notFoundText;
- }
- },
- localeTitles: function localeTitles() {
- if (this.titles === undefined) {
- return [this.t('i.transfer.titles.source'), this.t('i.transfer.titles.target')];
- } else {
- return this.titles;
- }
- }
- },
- methods: {
- getValidKeys: function getValidKeys(direction) {
- var _this3 = this;
- return this[String(direction) + 'Data'].filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this3);
- return !data.disabled && this[String(direction) + 'CheckedKeys'].indexOf(data.key) > -1;
- }.bind(this)).map(function (data) {
- (0, _newArrowCheck3.default)(this, _this3);
- return data.key;
- }.bind(this));
- },
- splitData: function splitData() {
- var _this4 = this;
- var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- this.leftData = [].concat((0, _toConsumableArray3.default)(this.data));
- this.rightData = [];
- if (this.targetKeys.length > 0) {
- this.targetKeys.forEach(function (targetKey) {
- (0, _newArrowCheck3.default)(this, _this4);
- var filteredData = this.leftData.filter(function (data, index) {
- (0, _newArrowCheck3.default)(this, _this4);
- if (data.key === targetKey) {
- this.leftData.splice(index, 1);
- return true;
- }
- return false;
- }.bind(this));
- if (filteredData && filteredData.length > 0) this.rightData.push(filteredData[0]);
- }.bind(this));
- }
- if (init) {
- this.splitSelectedKey();
- }
- },
- splitSelectedKey: function splitSelectedKey() {
- var _this5 = this;
- var selectedKeys = this.selectedKeys;
- if (selectedKeys.length > 0) {
- this.leftCheckedKeys = this.leftData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return selectedKeys.indexOf(data.key) > -1;
- }.bind(this)).map(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return data.key;
- }.bind(this));
- this.rightCheckedKeys = this.rightData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return selectedKeys.indexOf(data.key) > -1;
- }.bind(this)).map(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return data.key;
- }.bind(this));
- }
- },
- moveTo: function moveTo(direction) {
- var _this6 = this;
- var targetKeys = this.targetKeys;
- var opposite = direction === 'left' ? 'right' : 'left';
- var moveKeys = this.getValidKeys(opposite);
- var newTargetKeys = direction === 'right' ? moveKeys.concat(targetKeys) : targetKeys.filter(function (targetKey) {
- (0, _newArrowCheck3.default)(this, _this6);
- return !moveKeys.some(function (checkedKey) {
- (0, _newArrowCheck3.default)(this, _this6);
- return targetKey === checkedKey;
- }.bind(this));
- }.bind(this));
- this.$refs[opposite].toggleSelectAll(false);
- this.$emit('on-change', newTargetKeys, direction, moveKeys);
- this.dispatch('FormItem', 'on-form-change', {
- tarketKeys: newTargetKeys,
- direction: direction,
- moveKeys: moveKeys
- });
- },
- handleLeftCheckedKeysChange: function handleLeftCheckedKeysChange(keys) {
- this.leftCheckedKeys = keys;
- },
- handleRightCheckedKeysChange: function handleRightCheckedKeysChange(keys) {
- this.rightCheckedKeys = keys;
- },
- handleCheckedKeys: function handleCheckedKeys() {
- var sourceSelectedKeys = this.getValidKeys('left');
- var targetSelectedKeys = this.getValidKeys('right');
- this.$emit('on-selected-change', sourceSelectedKeys, targetSelectedKeys);
- }
- },
- watch: {
- targetKeys: function targetKeys() {
- this.splitData(false);
- },
- data: function data() {
- this.splitData(false);
- }
- },
- mounted: function mounted() {
- this.splitData(true);
- }
- };
- /***/ }),
- /* 249 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _search = __webpack_require__(605);
- var _search2 = _interopRequireDefault(_search);
- var _checkbox = __webpack_require__(49);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TransferList',
- components: { Search: _search2.default, Checkbox: _checkbox2.default },
- props: {
- prefixCls: String,
- data: Array,
- renderFormat: Function,
- checkedKeys: Array,
- listStyle: Object,
- title: [String, Number],
- filterable: Boolean,
- filterPlaceholder: String,
- filterMethod: Function,
- notFoundText: String,
- validKeysCount: Number
- },
- data: function data() {
- return {
- showItems: [],
- query: '',
- showFooter: true
- };
- },
- watch: {
- data: function data() {
- this.updateFilteredData();
- }
- },
- computed: {
- classes: function classes() {
- return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-with-footer', this.showFooter)];
- },
- bodyClasses: function bodyClasses() {
- var _ref2;
- return [String(this.prefixCls) + '-body', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(this.prefixCls) + '-body-with-search', this.filterable), (0, _defineProperty3.default)(_ref2, String(this.prefixCls) + '-body-with-footer', this.showFooter), _ref2)];
- },
- count: function count() {
- var validKeysCount = this.validKeysCount;
- return (validKeysCount > 0 ? String(validKeysCount) + '/' : '') + ('' + String(this.data.length));
- },
- checkedAll: function checkedAll() {
- var _this = this;
- return this.filterData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this);
- return !data.disabled;
- }.bind(this)).length === this.validKeysCount && this.validKeysCount !== 0;
- },
- checkedAllDisabled: function checkedAllDisabled() {
- var _this2 = this;
- return this.filterData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this2);
- return !data.disabled;
- }.bind(this)).length <= 0;
- },
- filterData: function filterData() {
- var _this3 = this;
- return this.showItems.filter(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return this.filterMethod(item, this.query);
- }.bind(this));
- }
- },
- methods: {
- itemClasses: function itemClasses(item) {
- return [String(this.prefixCls) + '-content-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-content-item-disabled', item.disabled)];
- },
- showLabel: function showLabel(item) {
- return this.renderFormat(item);
- },
- isCheck: function isCheck(item) {
- var _this4 = this;
- return this.checkedKeys.some(function (key) {
- (0, _newArrowCheck3.default)(this, _this4);
- return key === item.key;
- }.bind(this));
- },
- select: function select(item) {
- if (item.disabled) return;
- var index = this.checkedKeys.indexOf(item.key);
- index > -1 ? this.checkedKeys.splice(index, 1) : this.checkedKeys.push(item.key);
- this.$parent.handleCheckedKeys();
- },
- updateFilteredData: function updateFilteredData() {
- this.showItems = this.data;
- },
- toggleSelectAll: function toggleSelectAll(status) {
- var _this5 = this;
- var keys = status ? this.filterData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return !data.disabled || this.checkedKeys.indexOf(data.key) > -1;
- }.bind(this)).map(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return data.key;
- }.bind(this)) : this.filterData.filter(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return data.disabled && this.checkedKeys.indexOf(data.key) > -1;
- }.bind(this)).map(function (data) {
- (0, _newArrowCheck3.default)(this, _this5);
- return data.key;
- }.bind(this));
- this.$emit('on-checked-keys-change', keys);
- },
- handleQueryClear: function handleQueryClear() {
- this.query = '';
- },
- handleQueryChange: function handleQueryChange(val) {
- this.query = val;
- }
- },
- created: function created() {
- this.updateFilteredData();
- },
- mounted: function mounted() {
- this.showFooter = this.$slots.default !== undefined;
- }
- };
- /***/ }),
- /* 250 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Search',
- components: { iInput: _input2.default },
- props: {
- prefixCls: String,
- placeholder: String,
- query: String
- },
- data: function data() {
- return {
- currentQuery: this.query
- };
- },
- watch: {
- query: function query(val) {
- this.currentQuery = val;
- },
- currentQuery: function currentQuery(val) {
- this.$emit('on-query-change', val);
- }
- },
- computed: {
- icon: function icon() {
- return this.query === '' ? 'ios-search' : 'ios-close-circle';
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.currentQuery === '') return;
- this.currentQuery = '';
- this.$emit('on-query-clear');
- }
- }
- };
- /***/ }),
- /* 251 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'Operation',
- components: { iButton: _button2.default, Icon: _icon2.default },
- props: {
- prefixCls: String,
- operations: Array,
- leftActive: Boolean,
- rightActive: Boolean,
- reverseOperation: Boolean
- },
- methods: {
- moveToLeft: function moveToLeft() {
- this.$parent.moveTo('left');
- },
- moveToRight: function moveToRight() {
- this.$parent.moveTo('right');
- }
- }
- };
- /***/ }),
- /* 252 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _node = __webpack_require__(612);
- var _node2 = _interopRequireDefault(_node);
- var _dropdown = __webpack_require__(61);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _dropdownMenu = __webpack_require__(62);
- var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-tree';
- exports.default = {
- name: 'Tree',
- mixins: [_emitter2.default, _locale2.default],
- components: { TreeNode: _node2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
- provide: function provide() {
- return { TreeInstance: this };
- },
- props: {
- data: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- multiple: {
- type: Boolean,
- default: false
- },
- showCheckbox: {
- type: Boolean,
- default: false
- },
- checkStrictly: {
- type: Boolean,
- default: false
- },
- checkDirectly: {
- type: Boolean,
- default: false
- },
- emptyText: {
- type: String
- },
- childrenKey: {
- type: String,
- default: 'children'
- },
- loadData: {
- type: Function
- },
- render: {
- type: Function
- },
- selectNode: {
- type: Boolean,
- default: true
- },
- expandNode: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- stateTree: this.data,
- flatState: [],
- contextMenuVisible: false,
- contextMenuStyles: {
- top: 0,
- left: 0
- }
- };
- },
- watch: {
- data: {
- deep: true,
- handler: function handler() {
- this.stateTree = this.data;
- this.flatState = this.compileFlatState();
- this.rebuildTree();
- }
- }
- },
- computed: {
- localeEmptyText: function localeEmptyText() {
- if (typeof this.emptyText === 'undefined') {
- return this.t('i.tree.emptyText');
- } else {
- return this.emptyText;
- }
- }
- },
- methods: {
- compileFlatState: function compileFlatState() {
- var _this2 = this;
- var keyCounter = 0;
- var childrenKey = this.childrenKey;
- var flatTree = [];
- function flattenChildren(node, parent) {
- var _this = this;
- node.nodeKey = keyCounter++;
- flatTree[node.nodeKey] = { node: node, nodeKey: node.nodeKey };
- if (typeof parent != 'undefined') {
- flatTree[node.nodeKey].parent = parent.nodeKey;
- flatTree[parent.nodeKey][childrenKey].push(node.nodeKey);
- }
- if (node[childrenKey]) {
- flatTree[node.nodeKey][childrenKey] = [];
- node[childrenKey].forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- return flattenChildren(child, node);
- }.bind(this));
- }
- }
- this.stateTree.forEach(function (rootNode) {
- (0, _newArrowCheck3.default)(this, _this2);
- flattenChildren(rootNode);
- }.bind(this));
- return flatTree;
- },
- updateTreeUp: function updateTreeUp(nodeKey) {
- var _this3 = this;
- var parentKey = this.flatState[nodeKey].parent;
- if (typeof parentKey == 'undefined' || this.checkStrictly) return;
- var node = this.flatState[nodeKey].node;
- var parent = this.flatState[parentKey].node;
- if (node.checked == parent.checked && node.indeterminate == parent.indeterminate) return;
- if (node.checked == true) {
- this.$set(parent, 'checked', parent[this.childrenKey].every(function (node) {
- (0, _newArrowCheck3.default)(this, _this3);
- return node.checked;
- }.bind(this)));
- this.$set(parent, 'indeterminate', !parent.checked);
- } else {
- this.$set(parent, 'checked', false);
- this.$set(parent, 'indeterminate', parent[this.childrenKey].some(function (node) {
- (0, _newArrowCheck3.default)(this, _this3);
- return node.checked || node.indeterminate;
- }.bind(this)));
- }
- this.updateTreeUp(parentKey);
- },
- rebuildTree: function rebuildTree() {
- var _this4 = this;
- var checkedNodes = this.getCheckedNodes();
- checkedNodes.forEach(function (node) {
- (0, _newArrowCheck3.default)(this, _this4);
- this.updateTreeDown(node, { checked: true });
- var parentKey = this.flatState[node.nodeKey].parent;
- if (!parentKey && parentKey !== 0) return;
- var parent = this.flatState[parentKey].node;
- var childHasCheckSetter = typeof node.checked != 'undefined' && node.checked;
- if (childHasCheckSetter && parent.checked != node.checked) {
- this.updateTreeUp(node.nodeKey);
- }
- }.bind(this));
- },
- getSelectedNodes: function getSelectedNodes() {
- var _this5 = this;
- return this.flatState.filter(function (obj) {
- (0, _newArrowCheck3.default)(this, _this5);
- return obj.node.selected;
- }.bind(this)).map(function (obj) {
- (0, _newArrowCheck3.default)(this, _this5);
- return obj.node;
- }.bind(this));
- },
- getCheckedNodes: function getCheckedNodes() {
- var _this6 = this;
- return this.flatState.filter(function (obj) {
- (0, _newArrowCheck3.default)(this, _this6);
- return obj.node.checked;
- }.bind(this)).map(function (obj) {
- (0, _newArrowCheck3.default)(this, _this6);
- return obj.node;
- }.bind(this));
- },
- getCheckedAndIndeterminateNodes: function getCheckedAndIndeterminateNodes() {
- var _this7 = this;
- return this.flatState.filter(function (obj) {
- (0, _newArrowCheck3.default)(this, _this7);
- return obj.node.checked || obj.node.indeterminate;
- }.bind(this)).map(function (obj) {
- (0, _newArrowCheck3.default)(this, _this7);
- return obj.node;
- }.bind(this));
- },
- updateTreeDown: function updateTreeDown(node) {
- var _this8 = this;
- var changes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (this.checkStrictly) return;
- for (var key in changes) {
- this.$set(node, key, changes[key]);
- }
- if (node[this.childrenKey]) {
- node[this.childrenKey].forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this8);
- this.updateTreeDown(child, changes);
- }.bind(this));
- }
- },
- handleSelect: function handleSelect(nodeKey) {
- var _this9 = this;
- if (!this.flatState[nodeKey]) return;
- var node = this.flatState[nodeKey].node;
- if (!this.multiple) {
- var currentSelectedKey = this.flatState.findIndex(function (obj) {
- (0, _newArrowCheck3.default)(this, _this9);
- return obj.node.selected;
- }.bind(this));
- if (currentSelectedKey >= 0 && currentSelectedKey !== nodeKey) this.$set(this.flatState[currentSelectedKey].node, 'selected', false);
- }
- this.$set(node, 'selected', !node.selected);
- this.$emit('on-select-change', this.getSelectedNodes(), node);
- },
- handleCheck: function handleCheck(_ref) {
- var checked = _ref.checked,
- nodeKey = _ref.nodeKey;
- if (!this.flatState[nodeKey]) return;
- var node = this.flatState[nodeKey].node;
- this.$set(node, 'checked', checked);
- this.$set(node, 'indeterminate', false);
- this.updateTreeUp(nodeKey);
- this.updateTreeDown(node, { checked: checked, indeterminate: false });
- this.$emit('on-check-change', this.getCheckedNodes(), node);
- },
- handleContextmenu: function handleContextmenu(_ref2) {
- var _this10 = this;
- var data = _ref2.data,
- event = _ref2.event;
- if (this.contextMenuVisible) this.handleClickContextMenuOutside();
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this10);
- var $TreeWrap = this.$refs.treeWrap;
- var TreeBounding = $TreeWrap.getBoundingClientRect();
- var position = {
- left: event.clientX - TreeBounding.left + 'px',
- top: event.clientY - TreeBounding.top + 'px'
- };
- this.contextMenuStyles = position;
- this.contextMenuVisible = true;
- this.$emit('on-contextmenu', data, event, position);
- }.bind(this));
- },
- handleClickContextMenuOutside: function handleClickContextMenuOutside() {
- this.contextMenuVisible = false;
- }
- },
- created: function created() {
- this.flatState = this.compileFlatState();
- this.rebuildTree();
- },
- mounted: function mounted() {
- var _this11 = this;
- this.$on('on-check', this.handleCheck);
- this.$on('on-selected', this.handleSelect);
- this.$on('toggle-expand', function (node) {
- (0, _newArrowCheck3.default)(this, _this11);
- return this.$emit('on-toggle-expand', node);
- }.bind(this));
- this.$on('contextmenu', this.handleContextmenu);
- }
- };
- /***/ }),
- /* 253 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _checkbox = __webpack_require__(49);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _render = __webpack_require__(613);
- var _render2 = _interopRequireDefault(_render);
- var _collapseTransition = __webpack_require__(83);
- var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-tree';
- exports.default = {
- name: 'TreeNode',
- mixins: [_emitter2.default],
- inject: ['TreeInstance'],
- components: { Checkbox: _checkbox2.default, Icon: _icon2.default, CollapseTransition: _collapseTransition2.default, Render: _render2.default },
- props: {
- data: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- multiple: {
- type: Boolean,
- default: false
- },
- childrenKey: {
- type: String,
- default: 'children'
- },
- showCheckbox: {
- type: Boolean,
- default: false
- },
- appear: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- appearByClickArrow: false
- };
- },
- computed: {
- classes: function classes() {
- return [prefixCls + '-children'];
- },
- selectedCls: function selectedCls() {
- return [(0, _defineProperty3.default)({}, prefixCls + '-node-selected', this.data.selected)];
- },
- arrowClasses: function arrowClasses() {
- var _ref2;
- return [prefixCls + '-arrow', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-arrow-disabled', this.data.disabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-arrow-open', this.data.expand), _ref2)];
- },
- titleClasses: function titleClasses() {
- return [prefixCls + '-title', (0, _defineProperty3.default)({}, prefixCls + '-title-selected', this.data.selected)];
- },
- showArrow: function showArrow() {
- return this.data[this.childrenKey] && this.data[this.childrenKey].length || 'loading' in this.data && !this.data.loading;
- },
- showLoading: function showLoading() {
- return 'loading' in this.data && this.data.loading;
- },
- isParentRender: function isParentRender() {
- var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
- return Tree && Tree.render;
- },
- parentRender: function parentRender() {
- var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
- if (Tree && Tree.render) {
- return Tree.render;
- } else {
- return null;
- }
- },
- node: function node() {
- var _this = this;
- var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
- if (Tree) {
- return [Tree.flatState, Tree.flatState.find(function (item) {
- (0, _newArrowCheck3.default)(this, _this);
- return item.nodeKey === this.data.nodeKey;
- }.bind(this))];
- } else {
- return [];
- }
- },
- children: function children() {
- return this.data[this.childrenKey];
- },
- arrowType: function arrowType() {
- var type = 'ios-arrow-forward';
- if (this.$IVIEW) {
- if (this.$IVIEW.tree.customArrow) {
- type = '';
- } else if (this.$IVIEW.tree.arrow) {
- type = this.$IVIEW.tree.arrow;
- }
- }
- return type;
- },
- customArrowType: function customArrowType() {
- var type = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.tree.customArrow) {
- type = this.$IVIEW.tree.customArrow;
- }
- }
- return type;
- },
- arrowSize: function arrowSize() {
- var size = '';
- if (this.$IVIEW) {
- if (this.$IVIEW.tree.arrowSize) {
- size = this.$IVIEW.tree.arrowSize;
- }
- }
- return size;
- }
- },
- methods: {
- handleExpand: function handleExpand() {
- var _this2 = this;
- var item = this.data;
- this.appearByClickArrow = true;
- if (item[this.childrenKey].length === 0) {
- var tree = (0, _assist.findComponentUpward)(this, 'Tree');
- if (tree && tree.loadData) {
- this.$set(this.data, 'loading', true);
- tree.loadData(item, function (children) {
- (0, _newArrowCheck3.default)(this, _this2);
- this.$set(this.data, 'loading', false);
- if (children.length) {
- this.$set(this.data, this.childrenKey, children);
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- return this.handleExpand();
- }.bind(this));
- }
- }.bind(this));
- return;
- }
- }
- if (item[this.childrenKey] && item[this.childrenKey].length) {
- this.$set(this.data, 'expand', !this.data.expand);
- this.dispatch('Tree', 'toggle-expand', this.data);
- }
- },
- handleClickNode: function handleClickNode() {
- if (this.TreeInstance.expandNode) {
- if (this.showArrow) this.handleExpand();
- } else if (this.TreeInstance.selectNode) {
- this.handleSelect();
- }
- },
- handleSelect: function handleSelect() {
- if (this.data.disabled) return;
- if (this.TreeInstance.showCheckbox && this.TreeInstance.checkDirectly) {
- this.handleCheck();
- } else {
- this.dispatch('Tree', 'on-selected', this.data.nodeKey);
- }
- },
- handleCheck: function handleCheck() {
- if (this.data.disabled) return;
- var changes = {
- checked: !this.data.checked && !this.data.indeterminate,
- nodeKey: this.data.nodeKey
- };
- this.dispatch('Tree', 'on-check', changes);
- },
- handleContextmenu: function handleContextmenu(data, event) {
- if (data.contextmenu) {
- event.preventDefault();
- this.dispatch('Tree', 'contextmenu', { data: data, event: event });
- }
- },
- handlePreventSelect: function handlePreventSelect(data, event) {
- if (data.contextmenu) {
- event.preventDefault();
- }
- }
- }
- };
- /***/ }),
- /* 254 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _uploadList = __webpack_require__(618);
- var _uploadList2 = _interopRequireDefault(_uploadList);
- var _ajax = __webpack_require__(620);
- var _ajax2 = _interopRequireDefault(_ajax);
- var _assist = __webpack_require__(3);
- var _emitter = __webpack_require__(4);
- var _emitter2 = _interopRequireDefault(_emitter);
- var _form = __webpack_require__(11);
- var _form2 = _interopRequireDefault(_form);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-upload';
- exports.default = {
- name: 'Upload',
- mixins: [_emitter2.default, _form2.default],
- components: { UploadList: _uploadList2.default },
- props: {
- action: {
- type: String,
- required: true
- },
- headers: {
- type: Object,
- default: function _default() {
- return {};
- }
- },
- multiple: {
- type: Boolean,
- default: false
- },
- data: {
- type: Object
- },
- name: {
- type: String,
- default: 'file'
- },
- withCredentials: {
- type: Boolean,
- default: false
- },
- showUploadList: {
- type: Boolean,
- default: true
- },
- type: {
- type: String,
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['select', 'drag']);
- },
- default: 'select'
- },
- format: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- accept: {
- type: String
- },
- maxSize: {
- type: Number
- },
- beforeUpload: Function,
- onProgress: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onSuccess: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onError: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onRemove: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onPreview: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onExceededSize: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- onFormatError: {
- type: Function,
- default: function _default() {
- return {};
- }
- },
- defaultFileList: {
- type: Array,
- default: function _default() {
- return [];
- }
- },
- paste: {
- type: Boolean,
- default: false
- },
- disabled: {
- type: Boolean,
- default: false
- },
- webkitdirectory: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- dragOver: false,
- fileList: [],
- tempIndex: 1
- };
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-select', this.type === 'select'), (0, _defineProperty3.default)(_ref, prefixCls + '-drag', this.type === 'drag'), (0, _defineProperty3.default)(_ref, prefixCls + '-dragOver', this.type === 'drag' && this.dragOver), _ref)];
- }
- },
- methods: {
- handleClick: function handleClick() {
- if (this.itemDisabled) return;
- this.$refs.input.click();
- },
- handleChange: function handleChange(e) {
- var files = e.target.files;
- if (!files) {
- return;
- }
- this.uploadFiles(files);
- this.$refs.input.value = null;
- },
- onDrop: function onDrop(e) {
- this.dragOver = false;
- if (this.itemDisabled) return;
- this.uploadFiles(e.dataTransfer.files);
- },
- handlePaste: function handlePaste(e) {
- if (this.itemDisabled) return;
- if (this.paste) {
- this.uploadFiles(e.clipboardData.files);
- }
- },
- uploadFiles: function uploadFiles(files) {
- var _this = this;
- var postFiles = Array.prototype.slice.call(files);
- if (!this.multiple) postFiles = postFiles.slice(0, 1);
- if (postFiles.length === 0) return;
- postFiles.forEach(function (file) {
- (0, _newArrowCheck3.default)(this, _this);
- this.upload(file);
- }.bind(this));
- },
- upload: function upload(file) {
- var _this2 = this;
- if (!this.beforeUpload) {
- return this.post(file);
- }
- var before = this.beforeUpload(file);
- if (before && before.then) {
- before.then(function (processedFile) {
- (0, _newArrowCheck3.default)(this, _this2);
- if (Object.prototype.toString.call(processedFile) === '[object File]') {
- this.post(processedFile);
- } else {
- this.post(file);
- }
- }.bind(this), function () {
- (0, _newArrowCheck3.default)(this, _this2);
- }.bind(this));
- } else if (before !== false) {
- this.post(file);
- } else {}
- },
- post: function post(file) {
- var _this3 = this;
- if (this.format.length) {
- var _file_format = file.name.split('.').pop().toLocaleLowerCase();
- var checked = this.format.some(function (item) {
- (0, _newArrowCheck3.default)(this, _this3);
- return item.toLocaleLowerCase() === _file_format;
- }.bind(this));
- if (!checked) {
- this.onFormatError(file, this.fileList);
- return false;
- }
- }
- if (this.maxSize) {
- if (file.size > this.maxSize * 1024) {
- this.onExceededSize(file, this.fileList);
- return false;
- }
- }
- this.handleStart(file);
- var formData = new FormData();
- formData.append(this.name, file);
- (0, _ajax2.default)({
- headers: this.headers,
- withCredentials: this.withCredentials,
- file: file,
- data: this.data,
- filename: this.name,
- action: this.action,
- onProgress: function onProgress(e) {
- (0, _newArrowCheck3.default)(this, _this3);
- this.handleProgress(e, file);
- }.bind(this),
- onSuccess: function onSuccess(res) {
- (0, _newArrowCheck3.default)(this, _this3);
- this.handleSuccess(res, file);
- }.bind(this),
- onError: function onError(err, response) {
- (0, _newArrowCheck3.default)(this, _this3);
- this.handleError(err, response, file);
- }.bind(this)
- });
- },
- handleStart: function handleStart(file) {
- file.uid = Date.now() + this.tempIndex++;
- var _file = {
- status: 'uploading',
- name: file.name,
- size: file.size,
- percentage: 0,
- uid: file.uid,
- showProgress: true
- };
- this.fileList.push(_file);
- },
- getFile: function getFile(file) {
- var _this4 = this;
- var fileList = this.fileList;
- var target = void 0;
- fileList.every(function (item) {
- (0, _newArrowCheck3.default)(this, _this4);
- target = file.uid === item.uid ? item : null;
- return !target;
- }.bind(this));
- return target;
- },
- handleProgress: function handleProgress(e, file) {
- var _file = this.getFile(file);
- this.onProgress(e, _file, this.fileList);
- _file.percentage = e.percent || 0;
- },
- handleSuccess: function handleSuccess(res, file) {
- var _this5 = this;
- var _file = this.getFile(file);
- if (_file) {
- _file.status = 'finished';
- _file.response = res;
- this.onSuccess(res, _file, this.fileList);
- this.dispatch('FormItem', 'on-form-change', _file);
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this5);
- _file.showProgress = false;
- }.bind(this), 1000);
- }
- },
- handleError: function handleError(err, response, file) {
- var _file = this.getFile(file);
- var fileList = this.fileList;
- _file.status = 'fail';
- fileList.splice(fileList.indexOf(_file), 1);
- this.onError(err, response, file);
- },
- handleRemove: function handleRemove(file) {
- var fileList = this.fileList;
- fileList.splice(fileList.indexOf(file), 1);
- this.onRemove(file, fileList);
- },
- handlePreview: function handlePreview(file) {
- if (file.status === 'finished') {
- this.onPreview(file);
- }
- },
- clearFiles: function clearFiles() {
- this.fileList = [];
- }
- },
- watch: {
- defaultFileList: {
- immediate: true,
- handler: function handler(fileList) {
- var _this6 = this;
- this.fileList = fileList.map(function (item) {
- (0, _newArrowCheck3.default)(this, _this6);
- item.status = 'finished';
- item.percentage = 100;
- item.uid = Date.now() + this.tempIndex++;
- return item;
- }.bind(this));
- }
- }
- }
- };
- /***/ }),
- /* 255 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _icon = __webpack_require__(8);
- var _icon2 = _interopRequireDefault(_icon);
- var _progress = __webpack_require__(222);
- var _progress2 = _interopRequireDefault(_progress);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-upload';
- exports.default = {
- name: 'UploadList',
- components: { Icon: _icon2.default, iProgress: _progress2.default },
- props: {
- files: {
- type: Array,
- default: function _default() {
- return [];
- }
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls
- };
- },
- methods: {
- fileCls: function fileCls(file) {
- return [prefixCls + '-list-file', (0, _defineProperty3.default)({}, prefixCls + '-list-file-finish', file.status === 'finished')];
- },
- handleClick: function handleClick(file) {
- this.$emit('on-file-click', file);
- },
- handlePreview: function handlePreview(file) {
- this.$emit('on-file-preview', file);
- },
- handleRemove: function handleRemove(file) {
- this.$emit('on-file-remove', file);
- },
- format: function format(file) {
- var format = file.name.split('.').pop().toLocaleLowerCase() || '';
- var type = 'ios-document-outline';
- if (['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'].indexOf(format) > -1) {
- type = 'ios-image';
- }
- if (['mp4', 'm3u8', 'rmvb', 'avi', 'swf', '3gp', 'mkv', 'flv'].indexOf(format) > -1) {
- type = 'ios-film';
- }
- if (['mp3', 'wav', 'wma', 'ogg', 'aac', 'flac'].indexOf(format) > -1) {
- type = 'ios-musical-notes';
- }
- if (['doc', 'txt', 'docx', 'pages', 'epub', 'pdf'].indexOf(format) > -1) {
- type = 'md-document';
- }
- if (['numbers', 'csv', 'xls', 'xlsx'].indexOf(format) > -1) {
- type = 'ios-stats';
- }
- if (['keynote', 'ppt', 'pptx'].indexOf(format) > -1) {
- type = 'ios-videocam';
- }
- return type;
- },
- parsePercentage: function parsePercentage(val) {
- return parseInt(val, 10);
- }
- }
- };
- /***/ }),
- /* 256 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-row';
- exports.default = {
- name: 'Row',
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['flex']);
- }
- },
- align: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['top', 'middle', 'bottom']);
- }
- },
- justify: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['start', 'end', 'center', 'space-around', 'space-between']);
- }
- },
- gutter: {
- type: Number,
- default: 0
- },
- className: String,
- wrap: {
- type: Boolean,
- default: true
- }
- },
- computed: {
- classes: function classes() {
- var _ref;
- return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type) + '-' + String(this.align), !!this.align && this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type) + '-' + String(this.justify), !!this.justify && this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.align), !!this.align), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.justify), !!this.justify), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-wrap', !this.wrap), _ref)];
- },
- styles: function styles() {
- var style = {};
- if (this.gutter !== 0) {
- style = {
- marginLeft: this.gutter / -2 + 'px',
- marginRight: this.gutter / -2 + 'px'
- };
- }
- return style;
- }
- },
- methods: {
- updateGutter: function updateGutter(val) {
- var _this = this;
- var Col = (0, _assist.findComponentDownward)(this, 'iCol');
- var Cols = (0, _assist.findBrothersComponents)(Col, 'iCol', false);
- if (Cols.length) {
- Cols.forEach(function (child) {
- (0, _newArrowCheck3.default)(this, _this);
- if (val !== 0) {
- child.gutter = val;
- }
- }.bind(this));
- }
- }
- },
- watch: {
- gutter: function gutter(val) {
- this.updateGutter(val);
- }
- }
- };
- /***/ }),
- /* 257 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _defineProperty2 = __webpack_require__(2);
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-col';
- function parseFlex(flex) {
- if (typeof flex === 'number') {
- return flex + ' ' + flex + ' auto';
- }
- if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
- return '0 0 ' + String(flex);
- }
- return flex;
- }
- exports.default = {
- name: 'iCol',
- props: {
- span: [Number, String],
- order: [Number, String],
- offset: [Number, String],
- push: [Number, String],
- pull: [Number, String],
- className: String,
- xs: [Number, Object],
- sm: [Number, Object],
- md: [Number, Object],
- lg: [Number, Object],
- xl: [Number, Object],
- xxl: [Number, Object],
- flex: {
- type: [Number, String],
- default: ''
- }
- },
- data: function data() {
- return {
- gutter: 0
- };
- },
- computed: {
- classes: function classes() {
- var _ref,
- _this = this;
- var classList = ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-span-' + String(this.span), this.span), (0, _defineProperty3.default)(_ref, prefixCls + '-order-' + String(this.order), this.order), (0, _defineProperty3.default)(_ref, prefixCls + '-offset-' + String(this.offset), this.offset), (0, _defineProperty3.default)(_ref, prefixCls + '-push-' + String(this.push), this.push), (0, _defineProperty3.default)(_ref, prefixCls + '-pull-' + String(this.pull), this.pull), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), _ref)];
- ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach(function (size) {
- (0, _newArrowCheck3.default)(this, _this);
- if (typeof this[size] === 'number') {
- classList.push(prefixCls + '-span-' + String(size) + '-' + String(this[size]));
- } else if ((0, _typeof3.default)(this[size]) === 'object') {
- var props = this[size];
- (0, _keys2.default)(props).forEach(function (prop) {
- (0, _newArrowCheck3.default)(this, _this);
- classList.push(prop !== 'span' ? prefixCls + '-' + String(size) + '-' + String(prop) + '-' + String(props[prop]) : prefixCls + '-span-' + String(size) + '-' + String(props[prop]));
- }.bind(this));
- }
- }.bind(this));
- return classList;
- },
- styles: function styles() {
- var style = {};
- if (this.gutter !== 0) {
- style = {
- paddingLeft: this.gutter / 2 + 'px',
- paddingRight: this.gutter / 2 + 'px'
- };
- }
- if (this.flex) {
- style.flex = parseFlex(this.flex);
- }
- return style;
- }
- },
- methods: {
- updateGutter: function updateGutter() {
- var Row = (0, _assist.findComponentUpward)(this, 'Row');
- if (Row) {
- Row.updateGutter(Row.gutter);
- }
- }
- },
- mounted: function mounted() {
- this.updateGutter();
- },
- beforeDestroy: function beforeDestroy() {
- this.updateGutter();
- }
- };
- /***/ }),
- /* 258 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-select-group';
- exports.default = {
- name: 'OptionGroup',
- props: {
- label: {
- type: String,
- default: ''
- }
- },
- data: function data() {
- return {
- prefixCls: prefixCls,
- hidden: false };
- },
- methods: {
- queryChange: function queryChange() {
- var _this = this;
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- var options = this.$refs.options.querySelectorAll('.ivu-select-item');
- var hasVisibleOption = false;
- for (var i = 0; i < options.length; i++) {
- if (options[i].style.display !== 'none') {
- hasVisibleOption = true;
- break;
- }
- }
- this.hidden = !hasVisibleOption;
- }.bind(this));
- }
- },
- mounted: function mounted() {
- var _this2 = this;
- this.$on('on-query-change', function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.queryChange();
- return true;
- }.bind(this));
- },
- beforeDestroy: function beforeDestroy() {
- this.$off('on-query-change');
- }
- };
- /***/ }),
- /* 259 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _extends2 = __webpack_require__(32);
- var _extends3 = _interopRequireDefault(_extends2);
- var _affix = __webpack_require__(267);
- var _affix2 = _interopRequireDefault(_affix);
- var _alert = __webpack_require__(273);
- var _alert2 = _interopRequireDefault(_alert);
- var _anchor = __webpack_require__(283);
- var _anchor2 = _interopRequireDefault(_anchor);
- var _anchorLink = __webpack_require__(286);
- var _anchorLink2 = _interopRequireDefault(_anchorLink);
- var _autoComplete = __webpack_require__(289);
- var _autoComplete2 = _interopRequireDefault(_autoComplete);
- var _avatar = __webpack_require__(341);
- var _avatar2 = _interopRequireDefault(_avatar);
- var _backTop = __webpack_require__(343);
- var _backTop2 = _interopRequireDefault(_backTop);
- var _badge = __webpack_require__(346);
- var _badge2 = _interopRequireDefault(_badge);
- var _breadcrumb = __webpack_require__(349);
- var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
- var _button = __webpack_require__(354);
- var _button2 = _interopRequireDefault(_button);
- var _card = __webpack_require__(358);
- var _card2 = _interopRequireDefault(_card);
- var _carousel = __webpack_require__(361);
- var _carousel2 = _interopRequireDefault(_carousel);
- var _cascader = __webpack_require__(366);
- var _cascader2 = _interopRequireDefault(_cascader);
- var _cell = __webpack_require__(373);
- var _cell2 = _interopRequireDefault(_cell);
- var _checkbox = __webpack_require__(380);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- var _circle = __webpack_require__(383);
- var _circle2 = _interopRequireDefault(_circle);
- var _collapse = __webpack_require__(387);
- var _collapse2 = _interopRequireDefault(_collapse);
- var _colorPicker = __webpack_require__(392);
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
- var _content = __webpack_require__(403);
- var _content2 = _interopRequireDefault(_content);
- var _datePicker = __webpack_require__(405);
- var _datePicker2 = _interopRequireDefault(_datePicker);
- var _divider = __webpack_require__(425);
- var _divider2 = _interopRequireDefault(_divider);
- var _drawer = __webpack_require__(428);
- var _drawer2 = _interopRequireDefault(_drawer);
- var _dropdown = __webpack_require__(431);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _footer = __webpack_require__(436);
- var _footer2 = _interopRequireDefault(_footer);
- var _form = __webpack_require__(438);
- var _form2 = _interopRequireDefault(_form);
- var _header = __webpack_require__(452);
- var _header2 = _interopRequireDefault(_header);
- var _icon = __webpack_require__(19);
- var _icon2 = _interopRequireDefault(_icon);
- var _input = __webpack_require__(454);
- var _input2 = _interopRequireDefault(_input);
- var _inputNumber = __webpack_require__(455);
- var _inputNumber2 = _interopRequireDefault(_inputNumber);
- var _scroll = __webpack_require__(457);
- var _scroll2 = _interopRequireDefault(_scroll);
- var _split = __webpack_require__(468);
- var _split2 = _interopRequireDefault(_split);
- var _layout = __webpack_require__(473);
- var _layout2 = _interopRequireDefault(_layout);
- var _list = __webpack_require__(477);
- var _list2 = _interopRequireDefault(_list);
- var _loadingBar = __webpack_require__(484);
- var _loadingBar2 = _interopRequireDefault(_loadingBar);
- var _menu = __webpack_require__(488);
- var _menu2 = _interopRequireDefault(_menu);
- var _message = __webpack_require__(497);
- var _message2 = _interopRequireDefault(_message);
- var _modal = __webpack_require__(502);
- var _modal2 = _interopRequireDefault(_modal);
- var _notice = __webpack_require__(506);
- var _notice2 = _interopRequireDefault(_notice);
- var _page = __webpack_require__(507);
- var _page2 = _interopRequireDefault(_page);
- var _poptip = __webpack_require__(512);
- var _poptip2 = _interopRequireDefault(_poptip);
- var _progress = __webpack_require__(514);
- var _progress2 = _interopRequireDefault(_progress);
- var _radio = __webpack_require__(516);
- var _radio2 = _interopRequireDefault(_radio);
- var _rate = __webpack_require__(521);
- var _rate2 = _interopRequireDefault(_rate);
- var _sider = __webpack_require__(524);
- var _sider2 = _interopRequireDefault(_sider);
- var _slider = __webpack_require__(525);
- var _slider2 = _interopRequireDefault(_slider);
- var _spin = __webpack_require__(540);
- var _spin2 = _interopRequireDefault(_spin);
- var _steps = __webpack_require__(542);
- var _steps2 = _interopRequireDefault(_steps);
- var _switch = __webpack_require__(547);
- var _switch2 = _interopRequireDefault(_switch);
- var _table = __webpack_require__(550);
- var _table2 = _interopRequireDefault(_table);
- var _tabs = __webpack_require__(582);
- var _tabs2 = _interopRequireDefault(_tabs);
- var _tag = __webpack_require__(587);
- var _tag2 = _interopRequireDefault(_tag);
- var _time = __webpack_require__(590);
- var _time2 = _interopRequireDefault(_time);
- var _timeline = __webpack_require__(594);
- var _timeline2 = _interopRequireDefault(_timeline);
- var _timePicker = __webpack_require__(599);
- var _timePicker2 = _interopRequireDefault(_timePicker);
- var _tooltip = __webpack_require__(601);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- var _transfer = __webpack_require__(602);
- var _transfer2 = _interopRequireDefault(_transfer);
- var _tree = __webpack_require__(610);
- var _tree2 = _interopRequireDefault(_tree);
- var _upload = __webpack_require__(616);
- var _upload2 = _interopRequireDefault(_upload);
- var _grid = __webpack_require__(622);
- var _select = __webpack_require__(627);
- var _index = __webpack_require__(120);
- var _index2 = _interopRequireDefault(_index);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var components = {
- Affix: _affix2.default,
- Alert: _alert2.default,
- Anchor: _anchor2.default,
- AnchorLink: _anchorLink2.default,
- AutoComplete: _autoComplete2.default,
- Avatar: _avatar2.default,
- BackTop: _backTop2.default,
- Badge: _badge2.default,
- Breadcrumb: _breadcrumb2.default,
- BreadcrumbItem: _breadcrumb2.default.Item,
- Button: _button2.default,
- ButtonGroup: _button2.default.Group,
- Card: _card2.default,
- Carousel: _carousel2.default,
- CarouselItem: _carousel2.default.Item,
- Cascader: _cascader2.default,
- Cell: _cell2.default,
- CellGroup: _cell2.default.Group,
- Checkbox: _checkbox2.default,
- CheckboxGroup: _checkbox2.default.Group,
- Col: _grid.Col,
- Collapse: _collapse2.default,
- ColorPicker: _colorPicker2.default,
- Content: _content2.default,
- DatePicker: _datePicker2.default,
- Divider: _divider2.default,
- Drawer: _drawer2.default,
- Dropdown: _dropdown2.default,
- DropdownItem: _dropdown2.default.Item,
- DropdownMenu: _dropdown2.default.Menu,
- Footer: _footer2.default,
- Form: _form2.default,
- FormItem: _form2.default.Item,
- Header: _header2.default,
- Icon: _icon2.default,
- Input: _input2.default,
- InputNumber: _inputNumber2.default,
- Scroll: _scroll2.default,
- Sider: _sider2.default,
- Split: _split2.default,
- Submenu: _menu2.default.Sub,
- Layout: _layout2.default,
- List: _list2.default,
- ListItem: _list2.default.Item,
- ListItemMeta: _list2.default.Item.Meta,
- LoadingBar: _loadingBar2.default,
- Menu: _menu2.default,
- MenuGroup: _menu2.default.Group,
- MenuItem: _menu2.default.Item,
- Message: _message2.default,
- Modal: _modal2.default,
- Notice: _notice2.default,
- Option: _select.Option,
- OptionGroup: _select.OptionGroup,
- Page: _page2.default,
- Panel: _collapse2.default.Panel,
- Poptip: _poptip2.default,
- Progress: _progress2.default,
- Radio: _radio2.default,
- RadioGroup: _radio2.default.Group,
- Rate: _rate2.default,
- Row: _grid.Row,
- Select: _select.Select,
- Slider: _slider2.default,
- Spin: _spin2.default,
- Step: _steps2.default.Step,
- Steps: _steps2.default,
- Table: _table2.default,
- Tabs: _tabs2.default,
- TabPane: _tabs2.default.Pane,
- Tag: _tag2.default,
- Time: _time2.default,
- Timeline: _timeline2.default,
- TimelineItem: _timeline2.default.Item,
- TimePicker: _timePicker2.default,
- Tooltip: _tooltip2.default,
- Transfer: _transfer2.default,
- Tree: _tree2.default,
- Upload: _upload2.default
- };
- var iview = (0, _extends3.default)({}, components, {
- iButton: _button2.default,
- iCircle: _circle2.default,
- iCol: _grid.Col,
- iContent: _content2.default,
- iForm: _form2.default,
- iFooter: _footer2.default,
- iHeader: _header2.default,
- iInput: _input2.default,
- iMenu: _menu2.default,
- iOption: _select.Option,
- iProgress: _progress2.default,
- iSelect: _select.Select,
- iSwitch: _switch2.default,
- iTable: _table2.default,
- iTime: _time2.default
- });
- var install = function install(Vue) {
- var _this = this;
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (install.installed) return;
- _index2.default.use(opts.locale);
- _index2.default.i18n(opts.i18n);
- (0, _keys2.default)(iview).forEach(function (key) {
- (0, _newArrowCheck3.default)(this, _this);
- Vue.component(key, iview[key]);
- }.bind(this));
- Vue.prototype.$IVIEW = {
- size: opts.size || '',
- transfer: 'transfer' in opts ? opts.transfer : '',
- capture: 'capture' in opts ? opts.capture : true,
- select: {
- arrow: opts.select ? opts.select.arrow ? opts.select.arrow : '' : '',
- customArrow: opts.select ? opts.select.customArrow ? opts.select.customArrow : '' : '',
- arrowSize: opts.select ? opts.select.arrowSize ? opts.select.arrowSize : '' : ''
- },
- cell: {
- arrow: opts.cell ? opts.cell.arrow ? opts.cell.arrow : '' : '',
- customArrow: opts.cell ? opts.cell.customArrow ? opts.cell.customArrow : '' : '',
- arrowSize: opts.cell ? opts.cell.arrowSize ? opts.cell.arrowSize : '' : ''
- },
- menu: {
- arrow: opts.menu ? opts.menu.arrow ? opts.menu.arrow : '' : '',
- customArrow: opts.menu ? opts.menu.customArrow ? opts.menu.customArrow : '' : '',
- arrowSize: opts.menu ? opts.menu.arrowSize ? opts.menu.arrowSize : '' : ''
- },
- tree: {
- arrow: opts.tree ? opts.tree.arrow ? opts.tree.arrow : '' : '',
- customArrow: opts.tree ? opts.tree.customArrow ? opts.tree.customArrow : '' : '',
- arrowSize: opts.tree ? opts.tree.arrowSize ? opts.tree.arrowSize : '' : ''
- },
- cascader: {
- arrow: opts.cascader ? opts.cascader.arrow ? opts.cascader.arrow : '' : '',
- customArrow: opts.cascader ? opts.cascader.customArrow ? opts.cascader.customArrow : '' : '',
- arrowSize: opts.cascader ? opts.cascader.arrowSize ? opts.cascader.arrowSize : '' : '',
- itemArrow: opts.cascader ? opts.cascader.itemArrow ? opts.cascader.itemArrow : '' : '',
- customItemArrow: opts.cascader ? opts.cascader.customItemArrow ? opts.cascader.customItemArrow : '' : '',
- itemArrowSize: opts.cascader ? opts.cascader.itemArrowSize ? opts.cascader.itemArrowSize : '' : ''
- },
- colorPicker: {
- arrow: opts.colorPicker ? opts.colorPicker.arrow ? opts.colorPicker.arrow : '' : '',
- customArrow: opts.colorPicker ? opts.colorPicker.customArrow ? opts.colorPicker.customArrow : '' : '',
- arrowSize: opts.colorPicker ? opts.colorPicker.arrowSize ? opts.colorPicker.arrowSize : '' : ''
- },
- datePicker: {
- icon: opts.datePicker ? opts.datePicker.icon ? opts.datePicker.icon : '' : '',
- customIcon: opts.datePicker ? opts.datePicker.customIcon ? opts.datePicker.customIcon : '' : '',
- iconSize: opts.datePicker ? opts.datePicker.iconSize ? opts.datePicker.iconSize : '' : ''
- },
- timePicker: {
- icon: opts.timePicker ? opts.timePicker.icon ? opts.timePicker.icon : '' : '',
- customIcon: opts.timePicker ? opts.timePicker.customIcon ? opts.timePicker.customIcon : '' : '',
- iconSize: opts.timePicker ? opts.timePicker.iconSize ? opts.timePicker.iconSize : '' : ''
- },
- tabs: {
- closeIcon: opts.tabs ? opts.tabs.closeIcon ? opts.tabs.closeIcon : '' : '',
- customCloseIcon: opts.tabs ? opts.tabs.customCloseIcon ? opts.tabs.customCloseIcon : '' : '',
- closeIconSize: opts.tabs ? opts.tabs.closeIconSize ? opts.tabs.closeIconSize : '' : ''
- },
- modal: {
- maskClosable: opts.modal ? 'maskClosable' in opts.modal ? opts.modal.maskClosable : '' : ''
- }
- };
- Vue.prototype.$Loading = _loadingBar2.default;
- Vue.prototype.$Message = _message2.default;
- Vue.prototype.$Modal = _modal2.default;
- Vue.prototype.$Notice = _notice2.default;
- Vue.prototype.$Spin = _spin2.default;
- };
- if (typeof window !== 'undefined' && window.Vue) {
- install(window.Vue);
- }
- var API = (0, _extends3.default)({
- version: '4.7.0',
- locale: _index2.default.use,
- i18n: _index2.default.i18n,
- install: install,
- Circle: _circle2.default,
- Switch: _switch2.default
- }, components);
- API.lang = function (code) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var langObject = window['iview/locale'].default;
- if (code === langObject.i.locale) _index2.default.use(langObject);else console.log('The ' + String(code) + ' language pack is not loaded.');
- }.bind(undefined);
- module.exports.default = module.exports = API;
- /***/ }),
- /* 260 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(261);
- module.exports = __webpack_require__(5).Object.keys;
- /***/ }),
- /* 261 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.14 Object.keys(O)
- var toObject = __webpack_require__(29);
- var $keys = __webpack_require__(40);
- __webpack_require__(97)('keys', function () {
- return function keys(it) {
- return $keys(toObject(it));
- };
- });
- /***/ }),
- /* 262 */
- /***/ (function(module, exports, __webpack_require__) {
- // false -> Array#indexOf
- // true -> Array#includes
- var toIObject = __webpack_require__(33);
- var toLength = __webpack_require__(52);
- var toAbsoluteIndex = __webpack_require__(263);
- module.exports = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
- if (O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- /***/ }),
- /* 263 */
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__(65);
- var max = Math.max;
- var min = Math.min;
- module.exports = function (index, length) {
- index = toInteger(index);
- return index < 0 ? max(index + length, 0) : min(index, length);
- };
- /***/ }),
- /* 264 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(265);
- module.exports = __webpack_require__(5).Object.assign;
- /***/ }),
- /* 265 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.3.1 Object.assign(target, source)
- var $export = __webpack_require__(7);
- $export($export.S + $export.F, 'Object', { assign: __webpack_require__(266) });
- /***/ }),
- /* 266 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // 19.1.2.1 Object.assign(target, source, ...)
- var DESCRIPTORS = __webpack_require__(13);
- var getKeys = __webpack_require__(40);
- var gOPS = __webpack_require__(71);
- var pIE = __webpack_require__(54);
- var toObject = __webpack_require__(29);
- var IObject = __webpack_require__(64);
- var $assign = Object.assign;
- // should work with symbols and should have deterministic property order (V8 bug)
- module.exports = !$assign || __webpack_require__(31)(function () {
- var A = {};
- var B = {};
- // eslint-disable-next-line no-undef
- var S = Symbol();
- var K = 'abcdefghijklmnopqrst';
- A[S] = 7;
- K.split('').forEach(function (k) { B[k] = k; });
- return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
- var T = toObject(target);
- var aLen = arguments.length;
- var index = 1;
- var getSymbols = gOPS.f;
- var isEnum = pIE.f;
- while (aLen > index) {
- var S = IObject(arguments[index++]);
- var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
- }
- } return T;
- } : $assign;
- /***/ }),
- /* 267 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _affix = __webpack_require__(268);
- var _affix2 = _interopRequireDefault(_affix);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _affix2.default;
- /***/ }),
- /* 268 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__ = __webpack_require__(99);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__ = __webpack_require__(272);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 269 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(270), __esModule: true };
- /***/ }),
- /* 270 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(271);
- var $Object = __webpack_require__(5).Object;
- module.exports = function defineProperty(it, key, desc) {
- return $Object.defineProperty(it, key, desc);
- };
- /***/ }),
- /* 271 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(7);
- // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
- $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperty: __webpack_require__(14).f });
- /***/ }),
- /* 272 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', [_c('div', { ref: "point", class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slot, expression: "slot" }], style: _vm.slotStyle })]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 273 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _alert = __webpack_require__(274);
- var _alert2 = _interopRequireDefault(_alert);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _alert2.default;
- /***/ }),
- /* 274 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__ = __webpack_require__(100);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__ = __webpack_require__(282);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 275 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('i', { class: _vm.classes, style: _vm.styles, on: { "click": _vm.handleClick } });
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 276 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(46);
- __webpack_require__(35);
- module.exports = __webpack_require__(281);
- /***/ }),
- /* 277 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var addToUnscopables = __webpack_require__(278);
- var step = __webpack_require__(102);
- var Iterators = __webpack_require__(34);
- var toIObject = __webpack_require__(33);
- // 22.1.3.4 Array.prototype.entries()
- // 22.1.3.13 Array.prototype.keys()
- // 22.1.3.29 Array.prototype.values()
- // 22.1.3.30 Array.prototype[@@iterator]()
- module.exports = __webpack_require__(72)(Array, 'Array', function (iterated, kind) {
- this._t = toIObject(iterated); // target
- this._i = 0; // next index
- this._k = kind; // kind
- // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
- }, function () {
- var O = this._t;
- var kind = this._k;
- var index = this._i++;
- if (!O || index >= O.length) {
- this._t = undefined;
- return step(1);
- }
- if (kind == 'keys') return step(0, index);
- if (kind == 'values') return step(0, O[index]);
- return step(0, [index, O[index]]);
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
- Iterators.Arguments = Iterators.Array;
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- /***/ }),
- /* 278 */
- /***/ (function(module, exports) {
- module.exports = function () { /* empty */ };
- /***/ }),
- /* 279 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var create = __webpack_require__(55);
- var descriptor = __webpack_require__(44);
- var setToStringTag = __webpack_require__(47);
- var IteratorPrototype = {};
- // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
- __webpack_require__(25)(IteratorPrototype, __webpack_require__(10)('iterator'), function () { return this; });
- module.exports = function (Constructor, NAME, next) {
- Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
- setToStringTag(Constructor, NAME + ' Iterator');
- };
- /***/ }),
- /* 280 */
- /***/ (function(module, exports, __webpack_require__) {
- var toInteger = __webpack_require__(65);
- var defined = __webpack_require__(63);
- // true -> String#at
- // false -> String#codePointAt
- module.exports = function (TO_STRING) {
- return function (that, pos) {
- var s = String(defined(that));
- var i = toInteger(pos);
- var l = s.length;
- var a, b;
- if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
- a = s.charCodeAt(i);
- return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
- ? TO_STRING ? s.charAt(i) : a
- : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
- };
- };
- /***/ }),
- /* 281 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(22);
- var get = __webpack_require__(73);
- module.exports = __webpack_require__(5).getIterator = function (it) {
- var iterFn = get(it);
- if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
- return anObject(iterFn.call(it));
- };
- /***/ }),
- /* 282 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": _vm.fade ? 'fade' : '' } }, [!_vm.closed ? _c('div', { class: _vm.wrapClasses }, [_vm.showIcon ? _c('span', { class: _vm.iconClasses }, [_vm._t("icon", [_c('Icon', { attrs: { "type": _vm.iconType } })])], 2) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.messageClasses }, [_vm._t("default")], 2), _vm._v(" "), _c('span', { class: _vm.descClasses }, [_vm._t("desc")], 2), _vm._v(" "), _vm.closable ? _c('a', { class: _vm.closeClasses, on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e()]) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 283 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _anchor = __webpack_require__(284);
- var _anchor2 = _interopRequireDefault(_anchor);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _anchor2.default;
- /***/ }),
- /* 284 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__ = __webpack_require__(107);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__ = __webpack_require__(285);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 285 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.wrapperComponent, { tag: "component", attrs: { "offset-top": _vm.offsetTop, "offset-bottom": _vm.offsetBottom }, on: { "on-change": _vm.handleAffixStateChange } }, [_c('div', { class: _vm.prefix + "-wrapper", style: _vm.wrapperStyle }, [_c('div', { class: "" + _vm.prefix }, [_c('div', { class: _vm.prefix + "-ink" }, [_c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.showInk, expression: "showInk" }], class: _vm.prefix + "-ink-ball", style: { top: _vm.inkTop + "px" } })]), _vm._v(" "), _vm._t("default")], 2)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 286 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _anchorLink = __webpack_require__(287);
- var _anchorLink2 = _interopRequireDefault(_anchorLink);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _anchorLink2.default;
- /***/ }),
- /* 287 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__ = __webpack_require__(108);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__ = __webpack_require__(288);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 288 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.anchorLinkClasses }, [_c('a', { class: _vm.linkTitleClasses, attrs: { "href": _vm.href, "data-scroll-offset": _vm.scrollOffset, "data-href": _vm.href, "title": _vm.title }, on: { "click": function click($event) {
- $event.preventDefault();return _vm.goAnchor($event);
- } } }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 289 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _autoComplete = __webpack_require__(290);
- var _autoComplete2 = _interopRequireDefault(_autoComplete);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _autoComplete2.default;
- /***/ }),
- /* 290 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__ = __webpack_require__(109);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__ = __webpack_require__(340);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 291 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(292), __esModule: true };
- /***/ }),
- /* 292 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(46);
- __webpack_require__(35);
- module.exports = __webpack_require__(293);
- /***/ }),
- /* 293 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(56);
- var ITERATOR = __webpack_require__(10)('iterator');
- var Iterators = __webpack_require__(34);
- module.exports = __webpack_require__(5).isIterable = function (it) {
- var O = Object(it);
- return O[ITERATOR] !== undefined
- || '@@iterator' in O
- // eslint-disable-next-line no-prototype-builtins
- || Iterators.hasOwnProperty(classof(O));
- };
- /***/ }),
- /* 294 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(295);
- module.exports = __webpack_require__(5).Number.isFinite;
- /***/ }),
- /* 295 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.2 Number.isFinite(number)
- var $export = __webpack_require__(7);
- var _isFinite = __webpack_require__(9).isFinite;
- $export($export.S, 'Number', {
- isFinite: function isFinite(it) {
- return typeof it == 'number' && _isFinite(it);
- }
- });
- /***/ }),
- /* 296 */
- /***/ (function(module, exports, __webpack_require__) {
- var core = __webpack_require__(5);
- var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
- module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
- return $JSON.stringify.apply($JSON, arguments);
- };
- /***/ }),
- /* 297 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(35);
- __webpack_require__(298);
- module.exports = __webpack_require__(5).Array.from;
- /***/ }),
- /* 298 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var ctx = __webpack_require__(24);
- var $export = __webpack_require__(7);
- var toObject = __webpack_require__(29);
- var call = __webpack_require__(112);
- var isArrayIter = __webpack_require__(113);
- var toLength = __webpack_require__(52);
- var createProperty = __webpack_require__(299);
- var getIterFn = __webpack_require__(73);
- $export($export.S + $export.F * !__webpack_require__(114)(function (iter) { Array.from(iter); }), 'Array', {
- // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
- from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var C = typeof this == 'function' ? this : Array;
- var aLen = arguments.length;
- var mapfn = aLen > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- var index = 0;
- var iterFn = getIterFn(O);
- var length, result, step, iterator;
- if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
- // if object isn't iterable or it's array with default iterator - use simple case
- if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
- for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
- createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
- }
- } else {
- length = toLength(O.length);
- for (result = new C(length); length > index; index++) {
- createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- }
- });
- /***/ }),
- /* 299 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $defineProperty = __webpack_require__(14);
- var createDesc = __webpack_require__(44);
- module.exports = function (object, index, value) {
- if (index in object) $defineProperty.f(object, index, createDesc(0, value));
- else object[index] = value;
- };
- /***/ }),
- /* 300 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-select-dropdown", class: _vm.className, style: _vm.styles }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 301 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(302), __esModule: true };
- /***/ }),
- /* 302 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(35);
- __webpack_require__(46);
- module.exports = __webpack_require__(77).f('iterator');
- /***/ }),
- /* 303 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(304), __esModule: true };
- /***/ }),
- /* 304 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(305);
- __webpack_require__(80);
- __webpack_require__(309);
- __webpack_require__(310);
- module.exports = __webpack_require__(5).Symbol;
- /***/ }),
- /* 305 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // ECMAScript 6 symbols shim
- var global = __webpack_require__(9);
- var has = __webpack_require__(30);
- var DESCRIPTORS = __webpack_require__(13);
- var $export = __webpack_require__(7);
- var redefine = __webpack_require__(103);
- var META = __webpack_require__(78).KEY;
- var $fails = __webpack_require__(31);
- var shared = __webpack_require__(67);
- var setToStringTag = __webpack_require__(47);
- var uid = __webpack_require__(53);
- var wks = __webpack_require__(10);
- var wksExt = __webpack_require__(77);
- var wksDefine = __webpack_require__(79);
- var enumKeys = __webpack_require__(306);
- var isArray = __webpack_require__(118);
- var anObject = __webpack_require__(22);
- var isObject = __webpack_require__(18);
- var toObject = __webpack_require__(29);
- var toIObject = __webpack_require__(33);
- var toPrimitive = __webpack_require__(70);
- var createDesc = __webpack_require__(44);
- var _create = __webpack_require__(55);
- var gOPNExt = __webpack_require__(307);
- var $GOPD = __webpack_require__(308);
- var $GOPS = __webpack_require__(71);
- var $DP = __webpack_require__(14);
- var $keys = __webpack_require__(40);
- var gOPD = $GOPD.f;
- var dP = $DP.f;
- var gOPN = gOPNExt.f;
- var $Symbol = global.Symbol;
- var $JSON = global.JSON;
- var _stringify = $JSON && $JSON.stringify;
- var PROTOTYPE = 'prototype';
- var HIDDEN = wks('_hidden');
- var TO_PRIMITIVE = wks('toPrimitive');
- var isEnum = {}.propertyIsEnumerable;
- var SymbolRegistry = shared('symbol-registry');
- var AllSymbols = shared('symbols');
- var OPSymbols = shared('op-symbols');
- var ObjectProto = Object[PROTOTYPE];
- var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
- var QObject = global.QObject;
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDesc = DESCRIPTORS && $fails(function () {
- return _create(dP({}, 'a', {
- get: function () { return dP(this, 'a', { value: 7 }).a; }
- })).a != 7;
- }) ? function (it, key, D) {
- var protoDesc = gOPD(ObjectProto, key);
- if (protoDesc) delete ObjectProto[key];
- dP(it, key, D);
- if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
- } : dP;
- var wrap = function (tag) {
- var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
- sym._k = tag;
- return sym;
- };
- var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
- return typeof it == 'symbol';
- } : function (it) {
- return it instanceof $Symbol;
- };
- var $defineProperty = function defineProperty(it, key, D) {
- if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
- anObject(it);
- key = toPrimitive(key, true);
- anObject(D);
- if (has(AllSymbols, key)) {
- if (!D.enumerable) {
- if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
- it[HIDDEN][key] = true;
- } else {
- if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
- D = _create(D, { enumerable: createDesc(0, false) });
- } return setSymbolDesc(it, key, D);
- } return dP(it, key, D);
- };
- var $defineProperties = function defineProperties(it, P) {
- anObject(it);
- var keys = enumKeys(P = toIObject(P));
- var i = 0;
- var l = keys.length;
- var key;
- while (l > i) $defineProperty(it, key = keys[i++], P[key]);
- return it;
- };
- var $create = function create(it, P) {
- return P === undefined ? _create(it) : $defineProperties(_create(it), P);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(key) {
- var E = isEnum.call(this, key = toPrimitive(key, true));
- if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
- return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
- it = toIObject(it);
- key = toPrimitive(key, true);
- if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
- var D = gOPD(it, key);
- if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
- return D;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(it) {
- var names = gOPN(toIObject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
- } return result;
- };
- var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
- var IS_OP = it === ObjectProto;
- var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
- var result = [];
- var i = 0;
- var key;
- while (names.length > i) {
- if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
- } return result;
- };
- // 19.4.1.1 Symbol([description])
- if (!USE_NATIVE) {
- $Symbol = function Symbol() {
- if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
- var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
- var $set = function (value) {
- if (this === ObjectProto) $set.call(OPSymbols, value);
- if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDesc(this, tag, createDesc(1, value));
- };
- if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
- return wrap(tag);
- };
- redefine($Symbol[PROTOTYPE], 'toString', function toString() {
- return this._k;
- });
- $GOPD.f = $getOwnPropertyDescriptor;
- $DP.f = $defineProperty;
- __webpack_require__(119).f = gOPNExt.f = $getOwnPropertyNames;
- __webpack_require__(54).f = $propertyIsEnumerable;
- $GOPS.f = $getOwnPropertySymbols;
- if (DESCRIPTORS && !__webpack_require__(42)) {
- redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
- }
- wksExt.f = function (name) {
- return wrap(wks(name));
- };
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
- for (var es6Symbols = (
- // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
- 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
- ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
- for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
- $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
- // 19.4.2.1 Symbol.for(key)
- 'for': function (key) {
- return has(SymbolRegistry, key += '')
- ? SymbolRegistry[key]
- : SymbolRegistry[key] = $Symbol(key);
- },
- // 19.4.2.5 Symbol.keyFor(sym)
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
- for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
- },
- useSetter: function () { setter = true; },
- useSimple: function () { setter = false; }
- });
- $export($export.S + $export.F * !USE_NATIVE, 'Object', {
- // 19.1.2.2 Object.create(O [, Properties])
- create: $create,
- // 19.1.2.4 Object.defineProperty(O, P, Attributes)
- defineProperty: $defineProperty,
- // 19.1.2.3 Object.defineProperties(O, Properties)
- defineProperties: $defineProperties,
- // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
- // 19.1.2.7 Object.getOwnPropertyNames(O)
- getOwnPropertyNames: $getOwnPropertyNames,
- // 19.1.2.8 Object.getOwnPropertySymbols(O)
- getOwnPropertySymbols: $getOwnPropertySymbols
- });
- // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
- // https://bugs.chromium.org/p/v8/issues/detail?id=3443
- var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
- $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- return $GOPS.f(toObject(it));
- }
- });
- // 24.3.2 JSON.stringify(value [, replacer [, space]])
- $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
- var S = $Symbol();
- // MS Edge converts symbol values to JSON as {}
- // WebKit converts symbol values to JSON as null
- // V8 throws on boxed symbols
- return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
- })), 'JSON', {
- stringify: function stringify(it) {
- var args = [it];
- var i = 1;
- var replacer, $replacer;
- while (arguments.length > i) args.push(arguments[i++]);
- $replacer = replacer = args[1];
- 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($JSON, args);
- }
- });
- // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
- $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(25)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
- // 19.4.3.5 Symbol.prototype[@@toStringTag]
- setToStringTag($Symbol, 'Symbol');
- // 20.2.1.9 Math[@@toStringTag]
- setToStringTag(Math, 'Math', true);
- // 24.3.3 JSON[@@toStringTag]
- setToStringTag(global.JSON, 'JSON', true);
- /***/ }),
- /* 306 */
- /***/ (function(module, exports, __webpack_require__) {
- // all enumerable object keys, includes symbols
- var getKeys = __webpack_require__(40);
- var gOPS = __webpack_require__(71);
- var pIE = __webpack_require__(54);
- module.exports = function (it) {
- var result = getKeys(it);
- var getSymbols = gOPS.f;
- if (getSymbols) {
- var symbols = getSymbols(it);
- var isEnum = pIE.f;
- var i = 0;
- var key;
- while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
- } return result;
- };
- /***/ }),
- /* 307 */
- /***/ (function(module, exports, __webpack_require__) {
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- var toIObject = __webpack_require__(33);
- var gOPN = __webpack_require__(119).f;
- var toString = {}.toString;
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function (it) {
- try {
- return gOPN(it);
- } catch (e) {
- return windowNames.slice();
- }
- };
- module.exports.f = function getOwnPropertyNames(it) {
- return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
- };
- /***/ }),
- /* 308 */
- /***/ (function(module, exports, __webpack_require__) {
- var pIE = __webpack_require__(54);
- var createDesc = __webpack_require__(44);
- var toIObject = __webpack_require__(33);
- var toPrimitive = __webpack_require__(70);
- var has = __webpack_require__(30);
- var IE8_DOM_DEFINE = __webpack_require__(98);
- var gOPD = Object.getOwnPropertyDescriptor;
- exports.f = __webpack_require__(13) ? gOPD : function getOwnPropertyDescriptor(O, P) {
- O = toIObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE) try {
- return gOPD(O, P);
- } catch (e) { /* empty */ }
- if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
- };
- /***/ }),
- /* 309 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(79)('asyncIterator');
- /***/ }),
- /* 310 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(79)('observable');
- /***/ }),
- /* 311 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(312), __esModule: true };
- /***/ }),
- /* 312 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(313);
- var $Object = __webpack_require__(5).Object;
- module.exports = function defineProperties(T, D) {
- return $Object.defineProperties(T, D);
- };
- /***/ }),
- /* 313 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(7);
- // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
- $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperties: __webpack_require__(104) });
- /***/ }),
- /* 314 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(315), __esModule: true };
- /***/ }),
- /* 315 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(316);
- var $Object = __webpack_require__(5).Object;
- module.exports = function create(P, D) {
- return $Object.create(P, D);
- };
- /***/ }),
- /* 316 */
- /***/ (function(module, exports, __webpack_require__) {
- var $export = __webpack_require__(7);
- // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
- $export($export.S, 'Object', { create: __webpack_require__(55) });
- /***/ }),
- /* 317 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(318), __esModule: true };
- /***/ }),
- /* 318 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(319);
- module.exports = __webpack_require__(5).Object.getPrototypeOf;
- /***/ }),
- /* 319 */
- /***/ (function(module, exports, __webpack_require__) {
- // 19.1.2.9 Object.getPrototypeOf(O)
- var toObject = __webpack_require__(29);
- var $getPrototypeOf = __webpack_require__(106);
- __webpack_require__(97)('getPrototypeOf', function () {
- return function getPrototypeOf(it) {
- return $getPrototypeOf(toObject(it));
- };
- });
- /***/ }),
- /* 320 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _lang = __webpack_require__(321);
- var _lang2 = _interopRequireDefault(_lang);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var lang = {
- i: {
- locale: 'zh-CN',
- select: {
- placeholder: '请选择',
- noMatch: '无匹配数据',
- loading: '加载中'
- },
- table: {
- noDataText: '暂无数据',
- noFilteredDataText: '暂无筛选结果',
- confirmFilter: '筛选',
- resetFilter: '重置',
- clearFilter: '全部',
- sumText: '合计'
- },
- datepicker: {
- selectDate: '选择日期',
- selectTime: '选择时间',
- startTime: '开始时间',
- endTime: '结束时间',
- clear: '清空',
- ok: '确定',
- datePanelLabel: '[yyyy年] [m月]',
- month: '月',
- month1: '1 月',
- month2: '2 月',
- month3: '3 月',
- month4: '4 月',
- month5: '5 月',
- month6: '6 月',
- month7: '7 月',
- month8: '8 月',
- month9: '9 月',
- month10: '10 月',
- month11: '11 月',
- month12: '12 月',
- year: '年',
- weekStartDay: '0',
- weeks: {
- sun: '日',
- mon: '一',
- tue: '二',
- wed: '三',
- thu: '四',
- fri: '五',
- sat: '六'
- },
- months: {
- m1: '1月',
- m2: '2月',
- m3: '3月',
- m4: '4月',
- m5: '5月',
- m6: '6月',
- m7: '7月',
- m8: '8月',
- m9: '9月',
- m10: '10月',
- m11: '11月',
- m12: '12月'
- }
- },
- transfer: {
- titles: {
- source: '源列表',
- target: '目的列表'
- },
- filterPlaceholder: '请输入搜索内容',
- notFoundText: '列表为空'
- },
- modal: {
- okText: '确定',
- cancelText: '取消'
- },
- poptip: {
- okText: '确定',
- cancelText: '取消'
- },
- page: {
- prev: '上一页',
- next: '下一页',
- total: '共',
- item: '条',
- items: '条',
- prev5: '向前 5 页',
- next5: '向后 5 页',
- page: '条/页',
- goto: '跳至',
- p: '页'
- },
- rate: {
- star: '星',
- stars: '星'
- },
- time: {
- before: '前',
- after: '后',
- just: '刚刚',
- seconds: '秒',
- minutes: '分钟',
- hours: '小时',
- days: '天'
- },
- tree: {
- emptyText: '暂无数据'
- }
- }
- };
- (0, _lang2.default)(lang);
- exports.default = lang;
- /***/ }),
- /* 321 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = function (lang) {
- if (!isServer) {
- if (typeof window.iview !== 'undefined') {
- if (!('langs' in iview)) {
- iview.langs = {};
- }
- iview.langs[lang.i.locale] = lang;
- }
- }
- };
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isServer = _vue2.default.prototype.$isServer;
- ;
- /***/ }),
- /* 322 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- var isMergeableObject = function isMergeableObject(value) {
- return isNonNullObject(value)
- && !isSpecial(value)
- };
- function isNonNullObject(value) {
- return !!value && typeof value === 'object'
- }
- function isSpecial(value) {
- var stringValue = Object.prototype.toString.call(value);
- return stringValue === '[object RegExp]'
- || stringValue === '[object Date]'
- || isReactElement(value)
- }
- // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
- var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
- function isReactElement(value) {
- return value.$$typeof === REACT_ELEMENT_TYPE
- }
- function emptyTarget(val) {
- return Array.isArray(val) ? [] : {}
- }
- function cloneUnlessOtherwiseSpecified(value, options) {
- return (options.clone !== false && options.isMergeableObject(value))
- ? deepmerge(emptyTarget(value), value, options)
- : value
- }
- function defaultArrayMerge(target, source, options) {
- return target.concat(source).map(function(element) {
- return cloneUnlessOtherwiseSpecified(element, options)
- })
- }
- function mergeObject(target, source, options) {
- var destination = {};
- if (options.isMergeableObject(target)) {
- Object.keys(target).forEach(function(key) {
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
- });
- }
- Object.keys(source).forEach(function(key) {
- if (!options.isMergeableObject(source[key]) || !target[key]) {
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
- } else {
- destination[key] = deepmerge(target[key], source[key], options);
- }
- });
- return destination
- }
- function deepmerge(target, source, options) {
- options = options || {};
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
- var sourceIsArray = Array.isArray(source);
- var targetIsArray = Array.isArray(target);
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
- if (!sourceAndTargetTypesMatch) {
- return cloneUnlessOtherwiseSpecified(source, options)
- } else if (sourceIsArray) {
- return options.arrayMerge(target, source, options)
- } else {
- return mergeObject(target, source, options)
- }
- }
- deepmerge.all = function deepmergeAll(array, options) {
- if (!Array.isArray(array)) {
- throw new Error('first argument should be an array')
- }
- return array.reduce(function(prev, next) {
- return deepmerge(prev, next, options)
- }, {})
- };
- var deepmerge_1 = deepmerge;
- /* harmony default export */ __webpack_exports__["default"] = (deepmerge_1);
- /***/ }),
- /* 323 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _typeof2 = __webpack_require__(27);
- var _typeof3 = _interopRequireDefault(_typeof2);
- exports.default = function () {
- function hasOwn(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
- }
- function template(string) {
- var _this = this;
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- if (args.length === 1 && (0, _typeof3.default)(args[0]) === 'object') {
- args = args[0];
- }
- if (!args || !args.hasOwnProperty) {
- args = {};
- }
- return string.replace(RE_NARGS, function (match, prefix, i, index) {
- (0, _newArrowCheck3.default)(this, _this);
- var result = void 0;
- if (string[index - 1] === '{' && string[index + match.length] === '}') {
- return i;
- } else {
- result = hasOwn(args, i) ? args[i] : null;
- if (result === null || result === undefined) {
- return '';
- }
- return result;
- }
- }.bind(this));
- }
- return template;
- };
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
- /***/ }),
- /* 324 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__ = __webpack_require__(121);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__ = __webpack_require__(325);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 325 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.headCls, on: { "click": _vm.onHeaderClick } }, [_vm.$slots.prefix || _vm.prefix ? _c('span', { class: [_vm.prefixCls + '-prefix'] }, [_vm._t("prefix", [_vm.prefix ? _c('Icon', { attrs: { "type": _vm.prefix } }) : _vm._e()])], 2) : _vm._e(), _vm._v(" "), _vm._l(_vm.selectedMultiple, function (item, index) {
- return _vm.maxTagCount === undefined || index < _vm.maxTagCount ? _c('div', { staticClass: "ivu-tag ivu-tag-checked" }, [_c('span', { staticClass: "ivu-tag-text", class: { 'ivu-select-multiple-tag-hidden': item.disabled } }, [_vm._v(_vm._s(item.tag !== undefined ? item.tag : item.label))]), _vm._v(" "), !item.disabled ? _c('Icon', { attrs: { "type": "ios-close" }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.removeTag(item);
- } } }) : _vm._e()], 1) : _vm._e();
- }), _vm.maxTagCount !== undefined && _vm.selectedMultiple.length > _vm.maxTagCount ? _c('div', { staticClass: "ivu-tag ivu-tag-checked" }, [_c('span', { staticClass: "ivu-tag-text ivu-select-max-tag" }, [_vm.maxTagPlaceholder ? [_vm._v(_vm._s(_vm.maxTagPlaceholder(_vm.selectedMultiple.length - _vm.maxTagCount)))] : [_vm._v("+ " + _vm._s(_vm.selectedMultiple.length - _vm.maxTagCount) + "...")]], 2)]) : _vm._e(), _vm._v(" "), _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.singleDisplayValue, expression: "singleDisplayValue" }], class: _vm.singleDisplayClasses }, [_vm._v(_vm._s(_vm.singleDisplayValue))]), _vm._v(" "), _vm.filterable ? _c('input', { directives: [{ name: "model", rawName: "v-model", value: _vm.query, expression: "query" }], ref: "input", class: [_vm.prefixCls + '-input'], style: _vm.inputStyle, attrs: { "id": _vm.inputElementId, "type": "text", "disabled": _vm.disabled, "placeholder": _vm.showPlaceholder ? _vm.localePlaceholder : '', "autocomplete": "off", "spellcheck": "false" }, domProps: { "value": _vm.query }, on: { "keydown": [_vm.resetInputState, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) {
- return null;
- }return _vm.handleInputDelete($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleInputEnter($event);
- }], "focus": _vm.onInputFocus, "blur": _vm.onInputBlur, "input": function input($event) {
- if ($event.target.composing) {
- return;
- }_vm.query = $event.target.value;
- } } }) : _vm._e(), _vm._v(" "), _vm.resetSelect ? _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": "ios-close-circle" }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.onClear($event);
- } } }) : _vm._e(), _vm._v(" "), !_vm.resetSelect && !_vm.remote ? _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 326 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__ = __webpack_require__(122);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- var __vue_render__, __vue_static_render_fns__
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue___default.a,
- __vue_render__,
- __vue_static_render_fns__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 327 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture }, { name: "click-outside", rawName: "v-click-outside:[capture].mousedown", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture, modifiers: { "mousedown": true } }, { name: "click-outside", rawName: "v-click-outside:[capture].touchstart", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture, modifiers: { "touchstart": true } }], class: _vm.classes }, [_c('div', { ref: "reference", class: _vm.selectionCls, attrs: { "tabindex": _vm.selectTabindex }, on: { "blur": _vm.toggleHeaderFocus, "focus": _vm.toggleHeaderFocus, "click": _vm.toggleMenu, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.handleKeydown($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleKeydown($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }$event.preventDefault();return _vm.handleKeydown($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }$event.preventDefault();return _vm.handleKeydown($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
- return null;
- }return _vm.handleKeydown($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) {
- return null;
- }return _vm.handleKeydown($event);
- }], "mouseenter": function mouseenter($event) {
- _vm.hasMouseHoverHead = true;
- }, "mouseleave": function mouseleave($event) {
- _vm.hasMouseHoverHead = false;
- } } }, [_vm._t("input", [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.publicValue } }), _vm._v(" "), _c('select-head', { attrs: { "filterable": _vm.filterable, "multiple": _vm.multiple, "values": _vm.values, "clearable": _vm.canBeCleared, "prefix": _vm.prefix, "disabled": _vm.itemDisabled, "remote": _vm.remote, "input-element-id": _vm.elementId, "initial-label": _vm.initialLabel, "placeholder": _vm.placeholder, "query-prop": _vm.query, "max-tag-count": _vm.maxTagCount, "max-tag-placeholder": _vm.maxTagPlaceholder, "allow-create": _vm.allowCreate, "show-create-item": _vm.showCreateItem }, on: { "on-query-change": _vm.onQueryChange, "on-input-focus": function onInputFocus($event) {
- _vm.isFocused = true;
- }, "on-input-blur": function onInputBlur($event) {
- _vm.isFocused = false;
- }, "on-clear": _vm.clearSingleSelect, "on-enter": _vm.handleCreateItem } }, [_vm._t("prefix", null, { "slot": "prefix" })], 2)])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.dropVisible, expression: "dropVisible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "dropdown", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "data-transfer": _vm.transfer, "transfer": _vm.transfer, "eventsEnabled": _vm.eventsEnabled } }, [_c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.showNotFoundLabel && !_vm.allowCreate, expression: "showNotFoundLabel && !allowCreate" }], class: [_vm.prefixCls + '-not-found'] }, [_c('li', [_vm._v(_vm._s(_vm.localeNotFoundText))])]), _vm._v(" "), !_vm.remote || _vm.remote && !_vm.loading ? _c('functional-options', { class: _vm.prefixCls + '-dropdown-list', attrs: { "options": _vm.selectOptions, "slot-update-hook": _vm.updateSlotOptions, "slot-options": _vm.slotOptions } }, [_vm.showCreateItem ? _c('li', { class: _vm.prefixCls + '-item', on: { "click": _vm.handleCreateItem } }, [_vm._v("\n " + _vm._s(_vm.query) + "\n "), _c('Icon', { class: _vm.prefixCls + '-item-enter', attrs: { "type": "md-return-left" } })], 1) : _vm._e()]) : _c('ul', { class: _vm.prefixCls + '-dropdown-list' }, [_vm.showCreateItem ? _c('li', { class: _vm.prefixCls + '-item', on: { "click": _vm.handleCreateItem } }, [_vm._v("\n " + _vm._s(_vm.query) + "\n "), _c('Icon', { class: _vm.prefixCls + '-item-enter', attrs: { "type": "md-return-left" } })], 1) : _vm._e()]), _vm._v(" "), _c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.loading, expression: "loading" }], class: [_vm.prefixCls + '-loading'] }, [_vm._v(_vm._s(_vm.localeLoadingText))])], 1)], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 328 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "click": function click($event) {
- $event.stopPropagation();return _vm.select($event);
- }, "mousedown": function mousedown($event) {
- $event.preventDefault();
- } } }, [_vm._t("default", [_vm._v(_vm._s(_vm.showLabel))])], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 329 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(330), __esModule: true };
- /***/ }),
- /* 330 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(331);
- module.exports = __webpack_require__(5).Number.isNaN;
- /***/ }),
- /* 331 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.4 Number.isNaN(number)
- var $export = __webpack_require__(7);
- $export($export.S, 'Number', {
- isNaN: function isNaN(number) {
- // eslint-disable-next-line no-self-compare
- return number != number;
- }
- });
- /***/ }),
- /* 332 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _maxSafeInteger = __webpack_require__(333);
- var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger);
- var _minSafeInteger = __webpack_require__(336);
- var _minSafeInteger2 = _interopRequireDefault(_minSafeInteger);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- exports.default = calcTextareaHeight;
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var HIDDEN_TEXTAREA_STYLE = '\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
- var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
- var computedStyleCache = {};
- var hiddenTextarea = void 0;
- function calculateNodeStyling(node) {
- var _this = this;
- var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
- if (useCache && computedStyleCache[nodeRef]) {
- return computedStyleCache[nodeRef];
- }
- var style = window.getComputedStyle(node);
- var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
- var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
- var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
- var sizingStyle = SIZING_STYLE.map(function (name) {
- (0, _newArrowCheck3.default)(this, _this);
- return String(name) + ':' + String(style.getPropertyValue(name));
- }.bind(this)).join(';');
- var nodeInfo = {
- sizingStyle: sizingStyle,
- paddingSize: paddingSize,
- borderSize: borderSize,
- boxSizing: boxSizing
- };
- if (useCache && nodeRef) {
- computedStyleCache[nodeRef] = nodeInfo;
- }
- return nodeInfo;
- }
- function calcTextareaHeight(uiTextNode) {
- var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- var useCache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- if (!hiddenTextarea) {
- hiddenTextarea = document.createElement('textarea');
- document.body.appendChild(hiddenTextarea);
- }
- if (uiTextNode.getAttribute('wrap')) {
- hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
- } else {
- hiddenTextarea.removeAttribute('wrap');
- }
- var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
- paddingSize = _calculateNodeStyling.paddingSize,
- borderSize = _calculateNodeStyling.borderSize,
- boxSizing = _calculateNodeStyling.boxSizing,
- sizingStyle = _calculateNodeStyling.sizingStyle;
- hiddenTextarea.setAttribute('style', String(sizingStyle) + ';' + HIDDEN_TEXTAREA_STYLE);
- hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
- var minHeight = _minSafeInteger2.default;
- var maxHeight = _maxSafeInteger2.default;
- var height = hiddenTextarea.scrollHeight;
- var overflowY = void 0;
- if (boxSizing === 'border-box') {
- height = height + borderSize;
- } else if (boxSizing === 'content-box') {
- height = height - paddingSize;
- }
- if (minRows !== null || maxRows !== null) {
- hiddenTextarea.value = ' ';
- var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
- if (minRows !== null) {
- minHeight = singleRowHeight * minRows;
- if (boxSizing === 'border-box') {
- minHeight = minHeight + paddingSize + borderSize;
- }
- height = Math.max(minHeight, height);
- }
- if (maxRows !== null) {
- maxHeight = singleRowHeight * maxRows;
- if (boxSizing === 'border-box') {
- maxHeight = maxHeight + paddingSize + borderSize;
- }
- overflowY = height > maxHeight ? '' : 'hidden';
- height = Math.min(maxHeight, height);
- }
- }
- if (!maxRows) {
- overflowY = 'hidden';
- }
- return {
- height: String(height) + 'px',
- minHeight: String(minHeight) + 'px',
- maxHeight: String(maxHeight) + 'px',
- overflowY: overflowY
- };
- }
- /***/ }),
- /* 333 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(334), __esModule: true };
- /***/ }),
- /* 334 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(335);
- module.exports = 0x1fffffffffffff;
- /***/ }),
- /* 335 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.6 Number.MAX_SAFE_INTEGER
- var $export = __webpack_require__(7);
- $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
- /***/ }),
- /* 336 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(337), __esModule: true };
- /***/ }),
- /* 337 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(338);
- module.exports = -0x1fffffffffffff;
- /***/ }),
- /* 338 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.1.2.10 Number.MIN_SAFE_INTEGER
- var $export = __webpack_require__(7);
- $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
- /***/ }),
- /* 339 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm.type !== 'textarea' ? [_vm.prepend ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slotReady, expression: "slotReady" }], class: [_vm.prefixCls + '-group-prepend'] }, [_vm._t("prepend")], 2) : _vm._e(), _vm._v(" "), _vm.clearable && _vm.currentValue && !_vm.itemDisabled ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-ios-close-circle', _vm.prefixCls + '-icon', _vm.prefixCls + '-icon-clear', _vm.prefixCls + '-icon-normal'], style: _vm.clearableStyles, on: { "click": _vm.handleClear } }) : _vm.icon ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.icon, _vm.prefixCls + '-icon', _vm.prefixCls + '-icon-normal'], on: { "click": _vm.handleIconClick } }) : _vm.search && _vm.enterButton === false ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-search", class: [_vm.prefixCls + '-icon', _vm.prefixCls + '-icon-normal', _vm.prefixCls + '-search-icon'], on: { "click": _vm.handleSearch } }) : _vm.showSuffix ? _c('span', { staticClass: "ivu-input-suffix" }, [_vm._t("suffix", [_vm.suffix ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.suffix] }) : _vm._e()])], 2) : _vm.showWordLimit ? _c('span', { staticClass: "ivu-input-word-count" }, [_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))]) : _vm.password ? _c('span', { staticClass: "ivu-input-suffix", on: { "click": _vm.handleToggleShowPassword } }, [_vm.showPassword ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-eye-outline" }) : _c('i', { staticClass: "ivu-icon ivu-icon-ios-eye-off-outline" })]) : _vm._e(), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [!_vm.icon ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop", class: [_vm.prefixCls + '-icon', _vm.prefixCls + '-icon-validate'] }) : _vm._e()]), _vm._v(" "), _c('input', { ref: "input", class: _vm.inputClasses, attrs: { "id": _vm.elementId, "autocomplete": _vm.autocomplete, "spellcheck": _vm.spellcheck, "type": _vm.currentType, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "maxlength": _vm.maxlength, "readonly": _vm.readonly, "name": _vm.name, "number": _vm.number, "autofocus": _vm.autofocus }, domProps: { "value": _vm.currentValue }, on: { "keyup": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleEnter($event);
- }, _vm.handleKeyup], "keypress": _vm.handleKeypress, "keydown": _vm.handleKeydown, "focus": _vm.handleFocus, "blur": _vm.handleBlur, "compositionstart": _vm.handleComposition, "compositionupdate": _vm.handleComposition, "compositionend": _vm.handleComposition, "input": _vm.handleInput, "change": _vm.handleChange } }), _vm._v(" "), _vm.append ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slotReady, expression: "slotReady" }], class: [_vm.prefixCls + '-group-append'] }, [_vm._t("append")], 2) : _vm.search && _vm.enterButton ? _c('div', { class: [_vm.prefixCls + '-group-append', _vm.prefixCls + '-search'], on: { "click": _vm.handleSearch } }, [_vm.enterButton === true ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-search" }) : [_vm._v(_vm._s(_vm.enterButton))]], 2) : _vm.showPrefix ? _c('span', { staticClass: "ivu-input-prefix" }, [_vm._t("prefix", [_vm.prefix ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.prefix] }) : _vm._e()])], 2) : _vm._e()] : [_c('textarea', { ref: "textarea", class: _vm.textareaClasses, style: _vm.textareaStyles, attrs: { "id": _vm.elementId, "wrap": _vm.wrap, "autocomplete": _vm.autocomplete, "spellcheck": _vm.spellcheck, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "rows": _vm.rows, "maxlength": _vm.maxlength, "readonly": _vm.readonly, "name": _vm.name, "autofocus": _vm.autofocus }, domProps: { "value": _vm.currentValue }, on: { "keyup": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleEnter($event);
- }, _vm.handleKeyup], "keypress": _vm.handleKeypress, "keydown": _vm.handleKeydown, "focus": _vm.handleFocus, "blur": _vm.handleBlur, "compositionstart": _vm.handleComposition, "compositionupdate": _vm.handleComposition, "compositionend": _vm.handleComposition, "input": _vm.handleInput } }), _vm._v(" "), _vm.showWordLimit ? _c('span', { staticClass: "ivu-input-word-count" }, [_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))]) : _vm._e()]], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 340 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('i-select', { ref: "select", staticClass: "ivu-auto-complete", attrs: { "label": _vm.label, "disabled": _vm.itemDisabled, "clearable": _vm.clearable, "placeholder": _vm.placeholder, "size": _vm.size, "placement": _vm.placement, "value": _vm.currentValue, "transfer-class-name": _vm.transferClassName, "filterable": "", "remote": "", "auto-complete": "", "remote-method": _vm.remoteMethod, "transfer": _vm.transfer, "capture": _vm.capture, "eventsEnabled": _vm.eventsEnabled }, on: { "on-select": _vm.handleSelect, "on-clickoutside": _vm.handleClickOutside } }, [_vm._t("input", [_c('i-input', { ref: "input", attrs: { "slot": "input", "element-id": _vm.elementId, "name": _vm.name, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "size": _vm.size, "icon": _vm.inputIcon }, on: { "on-click": _vm.handleClear, "on-focus": _vm.handleFocus, "on-blur": _vm.handleBlur }, slot: "input", model: { value: _vm.currentValue, callback: function callback($$v) {
- _vm.currentValue = $$v;
- }, expression: "currentValue" } })]), _vm._v(" "), _vm._t("default", _vm._l(_vm.filteredData, function (item) {
- return _c('i-option', { key: item, attrs: { "value": item } }, [_vm._v(_vm._s(item))]);
- }))], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 341 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _avatar = __webpack_require__(125);
- var _avatar2 = _interopRequireDefault(_avatar);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _avatar2.default;
- /***/ }),
- /* 342 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.classes, style: _vm.styles }, [_vm.src ? _c('img', { attrs: { "src": _vm.src }, on: { "error": _vm.handleError } }) : _vm.icon || _vm.customIcon ? _c('Icon', { attrs: { "type": _vm.icon, "custom": _vm.customIcon } }) : _c('span', { ref: "children", class: [_vm.prefixCls + '-string'], style: _vm.childrenStyle }, [_vm._t("default")], 2)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 343 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _backTop = __webpack_require__(344);
- var _backTop2 = _interopRequireDefault(_backTop);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _backTop2.default;
- /***/ }),
- /* 344 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__ = __webpack_require__(127);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__ = __webpack_require__(345);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 345 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles, on: { "click": _vm.back } }, [_vm._t("default", [_c('div', { class: _vm.innerClasses }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-up" })])])], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 346 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _badge = __webpack_require__(347);
- var _badge2 = _interopRequireDefault(_badge);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _badge2.default;
- /***/ }),
- /* 347 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__ = __webpack_require__(128);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__ = __webpack_require__(348);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 348 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.dot ? _c('span', { ref: "badge", class: _vm.classes }, [_vm._t("default"), _vm._v(" "), _c('sup', { directives: [{ name: "show", rawName: "v-show", value: _vm.badge, expression: "badge" }], class: _vm.dotClasses, style: _vm.styles })], 2) : _vm.status || _vm.color ? _c('span', { ref: "badge", staticClass: "ivu-badge-status", class: _vm.classes }, [_c('span', { class: _vm.statusClasses, style: _vm.statusStyles }), _vm._v(" "), _c('span', { staticClass: "ivu-badge-status-text" }, [_vm._t("text", [_vm._v(_vm._s(_vm.text))])], 2)]) : _c('span', { ref: "badge", class: _vm.classes }, [_vm._t("default"), _vm._v(" "), _vm.$slots.count ? _c('sup', { class: _vm.customCountClasses, style: _vm.styles }, [_vm._t("count")], 2) : _vm.hasCount ? _c('sup', { directives: [{ name: "show", rawName: "v-show", value: _vm.badge, expression: "badge" }], class: _vm.countClasses, style: _vm.styles }, [_vm._t("text", [_vm._v(_vm._s(_vm.finalCount))])], 2) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 349 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _breadcrumb = __webpack_require__(350);
- var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
- var _breadcrumbItem = __webpack_require__(352);
- var _breadcrumbItem2 = _interopRequireDefault(_breadcrumbItem);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _breadcrumb2.default.Item = _breadcrumbItem2.default;
- exports.default = _breadcrumb2.default;
- /***/ }),
- /* 350 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__ = __webpack_require__(129);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__ = __webpack_require__(351);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 351 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 352 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__ = __webpack_require__(130);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__ = __webpack_require__(353);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 353 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.to ? _c('a', { class: _vm.linkClasses, attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
- if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
- return null;
- }return _vm.handleCheckClick($event, false);
- }, function ($event) {
- if (!$event.ctrlKey) {
- return null;
- }return _vm.handleCheckClick($event, true);
- }, function ($event) {
- if (!$event.metaKey) {
- return null;
- }return _vm.handleCheckClick($event, true);
- }] } }, [_vm._t("default")], 2) : _c('span', { class: _vm.linkClasses }, [_vm._t("default")], 2), _vm._v(" "), !_vm.showSeparator ? _c('span', { class: _vm.separatorClasses, domProps: { "innerHTML": _vm._s(_vm.separator) } }) : _c('span', { class: _vm.separatorClasses }, [_vm._t("separator")], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 354 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _buttonGroup = __webpack_require__(356);
- var _buttonGroup2 = _interopRequireDefault(_buttonGroup);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _button2.default.Group = _buttonGroup2.default;
- exports.default = _button2.default;
- /***/ }),
- /* 355 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.tagName, _vm._b({ tag: "component", class: _vm.classes, attrs: { "disabled": _vm.itemDisabled }, on: { "click": _vm.handleClickLink } }, 'component', _vm.tagProps, false), [_vm.loading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : _vm._e(), _vm._v(" "), (_vm.icon || _vm.customIcon) && !_vm.loading ? _c('Icon', { attrs: { "type": _vm.icon, "custom": _vm.customIcon } }) : _vm._e(), _vm._v(" "), _vm.showSlot ? _c('span', { ref: "slot" }, [_vm._t("default")], 2) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 356 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__ = __webpack_require__(132);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__ = __webpack_require__(357);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 357 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 358 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _card = __webpack_require__(359);
- var _card2 = _interopRequireDefault(_card);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _card2.default;
- /***/ }),
- /* 359 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__ = __webpack_require__(133);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__ = __webpack_require__(360);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 360 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.tagName, _vm._b({ tag: "component", class: _vm.classes, on: { "click": _vm.handleClickLink } }, 'component', _vm.tagProps, false), [_vm.showHead ? _c('div', { class: _vm.headClasses }, [_vm._t("title", [_vm.title ? _c('p', [_vm.icon ? _c('Icon', { attrs: { "type": _vm.icon } }) : _vm._e(), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.title))])], 1) : _vm._e()])], 2) : _vm._e(), _vm._v(" "), _vm.showExtra ? _c('div', { class: _vm.extraClasses }, [_vm._t("extra")], 2) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.bodyClasses, style: _vm.bodyStyles }, [_vm._t("default")], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 361 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _carousel = __webpack_require__(362);
- var _carousel2 = _interopRequireDefault(_carousel);
- var _carouselItem = __webpack_require__(364);
- var _carouselItem2 = _interopRequireDefault(_carouselItem);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _carousel2.default.Item = _carouselItem2.default;
- exports.default = _carousel2.default;
- /***/ }),
- /* 362 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__ = __webpack_require__(134);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__ = __webpack_require__(363);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 363 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('button', { staticClass: "left", class: _vm.arrowClasses, attrs: { "type": "button" }, on: { "click": function click($event) {
- return _vm.arrowEvent(-1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-list'] }, [_c('div', { ref: "originTrack", class: [_vm.prefixCls + '-track', _vm.showCopyTrack ? '' : 'higher'], style: _vm.trackStyles, on: { "click": function click($event) {
- return _vm.handleClick('currentIndex');
- } } }, [_vm._t("default")], 2), _vm._v(" "), _vm.loop ? _c('div', { ref: "copyTrack", class: [_vm.prefixCls + '-track', _vm.showCopyTrack ? 'higher' : ''], style: _vm.copyTrackStyles, on: { "click": function click($event) {
- return _vm.handleClick('copyTrackIndex');
- } } }) : _vm._e()]), _vm._v(" "), _c('button', { staticClass: "right", class: _vm.arrowClasses, attrs: { "type": "button" }, on: { "click": function click($event) {
- return _vm.arrowEvent(1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('ul', { class: _vm.dotsClasses }, [_vm._l(_vm.slides.length, function (n) {
- return [_c('li', { class: [n - 1 === _vm.currentIndex ? _vm.prefixCls + '-active' : ''], on: { "click": function click($event) {
- return _vm.dotsEvent('click', n - 1);
- }, "mouseover": function mouseover($event) {
- return _vm.dotsEvent('hover', n - 1);
- } } }, [_c('button', { class: [_vm.radiusDot ? 'radius' : ''], attrs: { "type": "button" } })])];
- })], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 364 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__ = __webpack_require__(135);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__ = __webpack_require__(365);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 365 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls, style: _vm.styles }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 366 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _cascader = __webpack_require__(367);
- var _cascader2 = _interopRequireDefault(_cascader);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _cascader2.default;
- /***/ }),
- /* 367 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__ = __webpack_require__(136);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__ = __webpack_require__(372);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 368 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__ = __webpack_require__(137);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__ = __webpack_require__(371);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 369 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__ = __webpack_require__(138);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__ = __webpack_require__(370);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 370 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes }, [_vm._v("\n " + _vm._s(_vm.data.label) + "\n "), _vm.showArrow ? _c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e(), _vm._v(" "), _vm.showLoading ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop ivu-cascader-menu-item-loading" }) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 371 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.data && _vm.data.length ? _c('ul', { class: [_vm.prefixCls + '-menu'] }, _vm._l(_vm.data, function (item) {
- return _c('Casitem', { key: _vm.getKey(), attrs: { "prefix-cls": _vm.prefixCls, "data": item, "tmp-item": _vm.tmpItem }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.handleClickItem(item);
- }, "mouseenter": function mouseenter($event) {
- $event.stopPropagation();return _vm.handleHoverItem(item);
- } } });
- }), 1) : _vm._e(), _vm.sublist && _vm.sublist.length ? _c('Caspanel', { attrs: { "prefix-cls": _vm.prefixCls, "data": _vm.sublist, "disabled": _vm.disabled, "trigger": _vm.trigger, "change-on-select": _vm.changeOnSelect } }) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 372 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.handleClose, expression: "handleClose" }], class: _vm.classes }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'], on: { "click": _vm.toggleOpen } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _vm._t("default", [_c('i-input', { ref: "input", attrs: { "element-id": _vm.elementId, "readonly": !_vm.filterable, "disabled": _vm.itemDisabled, "value": _vm.displayInputRender, "size": _vm.size, "placeholder": _vm.inputPlaceholder }, on: { "on-change": _vm.handleInput } }), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query === '', expression: "filterable && query === ''" }], class: [_vm.prefixCls + '-label'], on: { "click": _vm.handleFocus } }, [_vm._v(_vm._s(_vm.displayRender))]), _vm._v(" "), _c('Icon', { directives: [{ name: "show", rawName: "v-show", value: _vm.showCloseIcon, expression: "showCloseIcon" }], class: [_vm.prefixCls + '-arrow'], attrs: { "type": "ios-close-circle" }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.clearSelect($event);
- } } }), _vm._v(" "), _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer } }, [_c('div', [_c('Caspanel', { directives: [{ name: "show", rawName: "v-show", value: !_vm.filterable || _vm.filterable && _vm.query === '', expression: "!filterable || (filterable && query === '')" }], ref: "caspanel", attrs: { "prefix-cls": _vm.prefixCls, "data": _vm.data, "disabled": _vm.itemDisabled, "change-on-select": _vm.changeOnSelect, "trigger": _vm.trigger } }), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query !== '' && _vm.querySelections.length, expression: "filterable && query !== '' && querySelections.length" }], class: [_vm.prefixCls + '-dropdown'] }, [_c('ul', { class: [_vm.selectPrefixCls + '-dropdown-list'] }, _vm._l(_vm.querySelections, function (item, index) {
- var _obj;
- return _c('li', { class: [_vm.selectPrefixCls + '-item', (_obj = {}, _obj[_vm.selectPrefixCls + '-item-disabled'] = item.disabled, _obj)], domProps: { "innerHTML": _vm._s(item.display) }, on: { "click": function click($event) {
- return _vm.handleSelectItem(index);
- } } });
- }), 0)]), _vm._v(" "), _c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query !== '' && !_vm.querySelections.length || !_vm.data.length, expression: "(filterable && query !== '' && !querySelections.length) || !data.length" }], class: [_vm.prefixCls + '-not-found-tip'] }, [_c('li', [_vm._v(_vm._s(_vm.localeNotFoundText))])])], 1)])], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 373 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _cell = __webpack_require__(374);
- var _cell2 = _interopRequireDefault(_cell);
- var _cellGroup = __webpack_require__(378);
- var _cellGroup2 = _interopRequireDefault(_cellGroup);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _cell2.default.Group = _cellGroup2.default;
- exports.default = _cell2.default;
- /***/ }),
- /* 374 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__ = __webpack_require__(139);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__ = __webpack_require__(377);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 375 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__ = __webpack_require__(140);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__ = __webpack_require__(376);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 376 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-cell-item" }, [_c('div', { staticClass: "ivu-cell-icon" }, [_vm._t("icon")], 2), _vm._v(" "), _c('div', { staticClass: "ivu-cell-main" }, [_c('div', { staticClass: "ivu-cell-title" }, [_vm._t("default", [_vm._v(_vm._s(_vm.title))])], 2), _vm._v(" "), _c('div', { staticClass: "ivu-cell-label" }, [_vm._t("label", [_vm._v(_vm._s(_vm.label))])], 2)]), _vm._v(" "), _c('div', { staticClass: "ivu-cell-footer" }, [_c('span', { staticClass: "ivu-cell-extra" }, [_vm._t("extra", [_vm._v(_vm._s(_vm.extra))])], 2)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 377 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.to ? _c('a', { staticClass: "ivu-cell-link", attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
- if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
- return null;
- }return _vm.handleClickItem($event, false);
- }, function ($event) {
- if (!$event.ctrlKey) {
- return null;
- }return _vm.handleClickItem($event, true);
- }, function ($event) {
- if (!$event.metaKey) {
- return null;
- }return _vm.handleClickItem($event, true);
- }] } }, [_c('CellItem', { attrs: { "title": _vm.title, "label": _vm.label, "extra": _vm.extra } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._v(" "), _vm._t("default", null, { "slot": "default" }), _vm._v(" "), _vm._t("extra", null, { "slot": "extra" }), _vm._v(" "), _vm._t("label", null, { "slot": "label" })], 2)], 1) : _c('div', { staticClass: "ivu-cell-link", on: { "click": _vm.handleClickItem } }, [_c('CellItem', { attrs: { "title": _vm.title, "label": _vm.label, "extra": _vm.extra } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._v(" "), _vm._t("default", null, { "slot": "default" }), _vm._v(" "), _vm._t("extra", null, { "slot": "extra" }), _vm._v(" "), _vm._t("label", null, { "slot": "label" })], 2)], 1), _vm._v(" "), _vm.to ? _c('div', { staticClass: "ivu-cell-arrow" }, [_vm._t("arrow", [_c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })])], 2) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 378 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__ = __webpack_require__(141);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__ = __webpack_require__(379);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 379 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-cell-group" }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 380 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _checkbox = __webpack_require__(49);
- var _checkbox2 = _interopRequireDefault(_checkbox);
- var _checkboxGroup = __webpack_require__(143);
- var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _checkbox2.default.Group = _checkboxGroup2.default;
- exports.default = _checkbox2.default;
- /***/ }),
- /* 381 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('label', { class: _vm.wrapClasses }, [_c('span', { class: _vm.checkboxClasses }, [_c('span', { class: _vm.innerClasses }), _vm._v(" "), _vm.group ? _c('input', { directives: [{ name: "model", rawName: "v-model", value: _vm.model, expression: "model" }], class: _vm.inputClasses, attrs: { "type": "checkbox", "disabled": _vm.itemDisabled, "name": _vm.name }, domProps: { "value": _vm.label, "checked": Array.isArray(_vm.model) ? _vm._i(_vm.model, _vm.label) > -1 : _vm.model }, on: { "change": [function ($event) {
- var $$a = _vm.model,
- $$el = $event.target,
- $$c = $$el.checked ? true : false;if (Array.isArray($$a)) {
- var $$v = _vm.label,
- $$i = _vm._i($$a, $$v);if ($$el.checked) {
- $$i < 0 && (_vm.model = $$a.concat([$$v]));
- } else {
- $$i > -1 && (_vm.model = $$a.slice(0, $$i).concat($$a.slice($$i + 1)));
- }
- } else {
- _vm.model = $$c;
- }
- }, _vm.change], "focus": _vm.onFocus, "blur": _vm.onBlur } }) : _c('input', { class: _vm.inputClasses, attrs: { "type": "checkbox", "disabled": _vm.itemDisabled, "name": _vm.name }, domProps: { "checked": _vm.currentValue }, on: { "change": _vm.change, "focus": _vm.onFocus, "blur": _vm.onBlur } })]), _vm._v(" "), _vm._t("default", [_vm.showSlot ? _c('span', [_vm._v(_vm._s(_vm.label))]) : _vm._e()])], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 382 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 383 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _circle = __webpack_require__(384);
- var _circle2 = _interopRequireDefault(_circle);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _circle2.default;
- /***/ }),
- /* 384 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__ = __webpack_require__(145);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__ = __webpack_require__(386);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 385 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = function () {
- var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
- var $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
- var maxPos = $chars.length;
- var str = '';
- for (var i = 0; i < len; i++) {
- str += $chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return str;
- };
- /***/ }),
- /* 386 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, style: _vm.circleSize }, [_c('svg', { attrs: { "viewBox": "0 0 100 100" } }, [_vm.showDefs ? _c('defs', [_c('linearGradient', { attrs: { "id": _vm.id, "x1": "100%", "y1": "0%", "x2": "0%", "y2": "0%" } }, [_c('stop', { attrs: { "offset": "0%", "stop-color": _vm.strokeColor[0] } }), _vm._v(" "), _c('stop', { attrs: { "offset": "100%", "stop-color": _vm.strokeColor[1] } })], 1)], 1) : _vm._e(), _vm._v(" "), _c('path', { style: _vm.trailStyle, attrs: { "d": _vm.pathString, "stroke": _vm.trailColor, "stroke-width": _vm.trailWidth, "fill-opacity": 0, "stroke-linecap": _vm.strokeLinecap } }), _vm._v(" "), _c('path', { style: _vm.pathStyle, attrs: { "d": _vm.pathString, "stroke-linecap": _vm.strokeLinecap, "stroke": _vm.strokeValue, "stroke-width": _vm.computedStrokeWidth, "fill-opacity": "0" } })]), _vm._v(" "), _c('div', { class: _vm.innerClasses }, [_vm._t("default")], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 387 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _collapse = __webpack_require__(388);
- var _collapse2 = _interopRequireDefault(_collapse);
- var _panel = __webpack_require__(390);
- var _panel2 = _interopRequireDefault(_panel);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _collapse2.default.Panel = _panel2.default;
- exports.default = _collapse2.default;
- /***/ }),
- /* 388 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__ = __webpack_require__(146);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__ = __webpack_require__(389);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 389 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 390 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__ = __webpack_require__(147);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__ = __webpack_require__(391);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 391 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.itemClasses }, [_c('div', { class: _vm.headerClasses, on: { "click": _vm.toggle } }, [!_vm.hideArrow ? _c('Icon', { attrs: { "type": "ios-arrow-forward" } }) : _vm._e(), _vm._v(" "), _vm._t("default")], 2), _vm._v(" "), _vm.mounted ? _c('collapse-transition', [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isActive, expression: "isActive" }], class: _vm.contentClasses }, [_c('div', { class: _vm.boxClasses }, [_vm._t("content")], 2)])]) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 392 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _colorPicker = __webpack_require__(393);
- var _colorPicker2 = _interopRequireDefault(_colorPicker);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _colorPicker2.default;
- /***/ }),
- /* 393 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__ = __webpack_require__(148);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__ = __webpack_require__(402);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 394 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__ = __webpack_require__(150);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__ = __webpack_require__(395);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 395 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "reference", attrs: { "tabindex": "0" }, on: { "click": _vm.handleClick, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.handleEscape($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleEnter($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.handleArrow($event, 'x', _vm.left);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.handleArrow($event, 'x', _vm.right);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.handleArrow($event, 'y', _vm.up);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.handleArrow($event, 'y', _vm.down);
- }], "blur": _vm.blurColor, "focus": _vm.focusColor } }, [_vm._l(_vm.list, function (item, index) {
- return [_c('div', { key: item + ':' + index, class: [_vm.prefixCls + '-picker-colors-wrapper'] }, [_c('div', { attrs: { "data-color-id": index } }, [_c('div', { class: [_vm.prefixCls + '-picker-colors-wrapper-color'], style: { background: item } }), _vm._v(" "), _c('div', { ref: 'color-circle-' + index, refInFor: true, class: [_vm.prefixCls + '-picker-colors-wrapper-circle', _vm.hideClass] })])]), _vm._v(" "), _vm.lineBreak(_vm.list, index) ? _c('br') : _vm._e()];
- })], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 396 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__ = __webpack_require__(152);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__ = __webpack_require__(397);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 397 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-saturation-wrapper'], attrs: { "tabindex": "0" }, on: { "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.handleEscape($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.handleLeft($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.handleRight($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.handleUp($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.handleDown($event);
- }], "click": function click($event) {
- return _vm.$el.focus();
- } } }, [_c('div', { ref: "container", class: [_vm.prefixCls + '-saturation'], style: _vm.bgColorStyle, on: { "mousedown": _vm.handleMouseDown } }, [_c('div', { class: [_vm.prefixCls + '-saturation--white'] }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-saturation--black'] }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-saturation-pointer'], style: _vm.pointerStyle }, [_c('div', { class: [_vm.prefixCls + '-saturation-circle'] })])])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 398 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__ = __webpack_require__(153);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__ = __webpack_require__(399);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 399 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-hue'], attrs: { "tabindex": "0" }, on: { "click": function click($event) {
- return _vm.$el.focus();
- }, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.handleEscape($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.handleLeft($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.handleRight($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.handleUp($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.handleDown($event);
- }] } }, [_c('div', { ref: "container", class: [_vm.prefixCls + '-hue-container'], on: { "mousedown": _vm.handleMouseDown, "touchmove": _vm.handleChange, "touchstart": _vm.handleChange } }, [_c('div', { class: [_vm.prefixCls + '-hue-pointer'], style: { top: 0, left: _vm.percent + "%" } }, [_c('div', { class: [_vm.prefixCls + '-hue-picker'] })])])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 400 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__ = __webpack_require__(154);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__ = __webpack_require__(401);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 401 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-alpha'], attrs: { "tabindex": "0" }, on: { "click": function click($event) {
- return _vm.$el.focus();
- }, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.handleEscape($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.handleLeft($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.handleRight($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.handleUp($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.handleDown($event);
- }] } }, [_c('div', { class: [_vm.prefixCls + '-alpha-checkboard-wrap'] }, [_c('div', { class: [_vm.prefixCls + '-alpha-checkerboard'] })]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-alpha-gradient'], style: _vm.gradientStyle }), _vm._v(" "), _c('div', { ref: "container", class: [_vm.prefixCls + '-alpha-container'], on: { "mousedown": _vm.handleMouseDown, "touchmove": _vm.handleChange, "touchstart": _vm.handleChange } }, [_c('div', { class: [_vm.prefixCls + '-alpha-pointer'], style: { top: 0, left: _vm.value.a * 100 + "%" } }, [_c('div', { class: [_vm.prefixCls + '-alpha-picker'] })])])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 402 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture }], class: _vm.classes }, [_c('div', { ref: "reference", class: _vm.wrapClasses, on: { "click": _vm.toggleVisible } }, [_c('input', { attrs: { "name": _vm.name, "type": "hidden" }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _c('Icon', { class: _vm.arrowClasses, attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }), _vm._v(" "), _c('div', { ref: "input", class: _vm.inputClasses, attrs: { "tabindex": _vm.itemDisabled ? undefined : 0 }, on: { "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
- return null;
- }return _vm.onTab($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.onEscape($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.onArrow($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.onArrow($event);
- }] } }, [_c('div', { class: [_vm.prefixCls + '-color'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.value === '' && !_vm.visible, expression: "value === '' && !visible" }], class: [_vm.prefixCls + '-color-empty'] }, [_c('i', { class: [_vm.iconPrefixCls, _vm.iconPrefixCls + '-ios-close'] })]), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.value || _vm.visible, expression: "value || visible" }], style: _vm.displayedColorStyle })])])], 1), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }, { name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], ref: "drop", class: _vm.dropClasses, attrs: { "placement": _vm.placement, "data-transfer": _vm.transfer, "transfer": _vm.transfer, "eventsEnabled": _vm.eventsEnabled } }, [_c('transition', { attrs: { "name": "fade" } }, [_vm.visible ? _c('div', { class: [_vm.prefixCls + '-picker'] }, [_c('div', { class: [_vm.prefixCls + '-picker-wrapper'] }, [_c('div', { class: [_vm.prefixCls + '-picker-panel'] }, [_c('Saturation', { ref: "saturation", attrs: { "focused": _vm.visible }, on: { "change": _vm.childChange }, nativeOn: { "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
- return null;
- }return _vm.handleFirstTab($event);
- } }, model: { value: _vm.saturationColors, callback: function callback($$v) {
- _vm.saturationColors = $$v;
- }, expression: "saturationColors" } })], 1), _vm._v(" "), _vm.hue ? _c('div', { class: [_vm.prefixCls + '-picker-hue-slider'] }, [_c('Hue', { on: { "change": _vm.childChange }, model: { value: _vm.saturationColors, callback: function callback($$v) {
- _vm.saturationColors = $$v;
- }, expression: "saturationColors" } })], 1) : _vm._e(), _vm._v(" "), _vm.alpha ? _c('div', { class: [_vm.prefixCls + '-picker-alpha-slider'] }, [_c('Alpha', { on: { "change": _vm.childChange }, model: { value: _vm.saturationColors, callback: function callback($$v) {
- _vm.saturationColors = $$v;
- }, expression: "saturationColors" } })], 1) : _vm._e(), _vm._v(" "), _vm.colors.length ? _c('recommend-colors', { class: [_vm.prefixCls + '-picker-colors'], attrs: { "list": _vm.colors }, on: { "picker-color": _vm.handleSelectColor } }) : _vm._e(), _vm._v(" "), !_vm.colors.length && _vm.recommend ? _c('recommend-colors', { class: [_vm.prefixCls + '-picker-colors'], attrs: { "list": _vm.recommendedColor }, on: { "picker-color": _vm.handleSelectColor } }) : _vm._e()], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-confirm'] }, [_c('span', { class: _vm.confirmColorClasses }, [_vm.editable ? [_c('i-input', { ref: "editColorInput", attrs: { "value": _vm.formatColor, "size": "small" }, on: { "on-enter": _vm.handleEditColor, "on-blur": _vm.handleEditColor } })] : [_vm._v(_vm._s(_vm.formatColor))]], 2), _vm._v(" "), _c('i-button', { ref: "clear", attrs: { "tabindex": 0, "size": "small" }, on: { "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleClear($event);
- } }, nativeOn: { "click": function click($event) {
- return _vm.handleClear($event);
- }, "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.closer($event);
- } } }, [_vm._v(_vm._s(_vm.t('i.datepicker.clear')))]), _vm._v(" "), _c('i-button', { ref: "ok", attrs: { "tabindex": 0, "size": "small", "type": "primary" }, on: { "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleSuccess($event);
- } }, nativeOn: { "click": function click($event) {
- return _vm.handleSuccess($event);
- }, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
- return null;
- }return _vm.handleLastTab($event);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
- return null;
- }return _vm.closer($event);
- }] } }, [_vm._v(_vm._s(_vm.t('i.datepicker.ok')))])], 1)]) : _vm._e()])], 1)], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 403 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _content = __webpack_require__(155);
- var _content2 = _interopRequireDefault(_content);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _content2.default;
- /***/ }),
- /* 404 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 405 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _datePicker = __webpack_require__(406);
- var _datePicker2 = _interopRequireDefault(_datePicker);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _datePicker2.default;
- /***/ }),
- /* 406 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _picker = __webpack_require__(157);
- var _picker2 = _interopRequireDefault(_picker);
- var _date = __webpack_require__(409);
- var _date2 = _interopRequireDefault(_date);
- var _dateRange = __webpack_require__(422);
- var _dateRange2 = _interopRequireDefault(_dateRange);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'CalendarPicker',
- mixins: [_picker2.default],
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['year', 'month', 'date', 'daterange', 'datetime', 'datetimerange']);
- },
- default: 'date'
- }
- },
- components: { DatePickerPanel: _date2.default, RangeDatePickerPanel: _dateRange2.default },
- computed: {
- panel: function panel() {
- var isRange = this.type === 'daterange' || this.type === 'datetimerange';
- return isRange ? 'RangeDatePickerPanel' : 'DatePickerPanel';
- },
- ownPickerProps: function ownPickerProps() {
- return this.options;
- }
- }
- };
- /***/ }),
- /* 407 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __WEBPACK_AMD_DEFINE_RESULT__;
- (function (main) {
- 'use strict';
- var fecha = {};
- var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
- var twoDigits = /\d\d?/;
- var threeDigits = /\d{3}/;
- var fourDigits = /\d{4}/;
- var word = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
- var noop = function noop() {};
- function shorten(arr, sLen) {
- var newArr = [];
- for (var i = 0, len = arr.length; i < len; i++) {
- newArr.push(arr[i].substr(0, sLen));
- }
- return newArr;
- }
- function monthUpdate(arrName) {
- return function (d, v, i18n) {
- var index = i18n[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());
- if (~index) {
- d.month = index;
- }
- };
- }
- function pad(val, len) {
- val = String(val);
- len = len || 2;
- while (val.length < len) {
- val = '0' + val;
- }
- return val;
- }
- var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
- var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
- var monthNamesShort = shorten(monthNames, 3);
- var dayNamesShort = shorten(dayNames, 3);
- fecha.i18n = {
- dayNamesShort: dayNamesShort,
- dayNames: dayNames,
- monthNamesShort: monthNamesShort,
- monthNames: monthNames,
- amPm: ['am', 'pm'],
- DoFn: function DoFn(D) {
- return D + ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];
- }
- };
- var formatFlags = {
- D: function D(dateObj) {
- return dateObj.getDay();
- },
- DD: function DD(dateObj) {
- return pad(dateObj.getDay());
- },
- Do: function Do(dateObj, i18n) {
- return i18n.DoFn(dateObj.getDate());
- },
- d: function d(dateObj) {
- return dateObj.getDate();
- },
- dd: function dd(dateObj) {
- return pad(dateObj.getDate());
- },
- ddd: function ddd(dateObj, i18n) {
- return i18n.dayNamesShort[dateObj.getDay()];
- },
- dddd: function dddd(dateObj, i18n) {
- return i18n.dayNames[dateObj.getDay()];
- },
- M: function M(dateObj) {
- return dateObj.getMonth() + 1;
- },
- MM: function MM(dateObj) {
- return pad(dateObj.getMonth() + 1);
- },
- MMM: function MMM(dateObj, i18n) {
- return i18n.monthNamesShort[dateObj.getMonth()];
- },
- MMMM: function MMMM(dateObj, i18n) {
- return i18n.monthNames[dateObj.getMonth()];
- },
- yy: function yy(dateObj) {
- return String(dateObj.getFullYear()).substr(2);
- },
- yyyy: function yyyy(dateObj) {
- return dateObj.getFullYear();
- },
- h: function h(dateObj) {
- return dateObj.getHours() % 12 || 12;
- },
- hh: function hh(dateObj) {
- return pad(dateObj.getHours() % 12 || 12);
- },
- H: function H(dateObj) {
- return dateObj.getHours();
- },
- HH: function HH(dateObj) {
- return pad(dateObj.getHours());
- },
- m: function m(dateObj) {
- return dateObj.getMinutes();
- },
- mm: function mm(dateObj) {
- return pad(dateObj.getMinutes());
- },
- s: function s(dateObj) {
- return dateObj.getSeconds();
- },
- ss: function ss(dateObj) {
- return pad(dateObj.getSeconds());
- },
- S: function S(dateObj) {
- return Math.round(dateObj.getMilliseconds() / 100);
- },
- SS: function SS(dateObj) {
- return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
- },
- SSS: function SSS(dateObj) {
- return pad(dateObj.getMilliseconds(), 3);
- },
- a: function a(dateObj, i18n) {
- return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];
- },
- A: function A(dateObj, i18n) {
- return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();
- },
- ZZ: function ZZ(dateObj) {
- var o = dateObj.getTimezoneOffset();
- return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
- }
- };
- var parseFlags = {
- d: [twoDigits, function (d, v) {
- d.day = v;
- }],
- M: [twoDigits, function (d, v) {
- d.month = v - 1;
- }],
- yy: [twoDigits, function (d, v) {
- var da = new Date(),
- cent = +('' + da.getFullYear()).substr(0, 2);
- d.year = '' + (v > 68 ? cent - 1 : cent) + v;
- }],
- h: [twoDigits, function (d, v) {
- d.hour = v;
- }],
- m: [twoDigits, function (d, v) {
- d.minute = v;
- }],
- s: [twoDigits, function (d, v) {
- d.second = v;
- }],
- yyyy: [fourDigits, function (d, v) {
- d.year = v;
- }],
- S: [/\d/, function (d, v) {
- d.millisecond = v * 100;
- }],
- SS: [/\d{2}/, function (d, v) {
- d.millisecond = v * 10;
- }],
- SSS: [threeDigits, function (d, v) {
- d.millisecond = v;
- }],
- D: [twoDigits, noop],
- ddd: [word, noop],
- MMM: [word, monthUpdate('monthNamesShort')],
- MMMM: [word, monthUpdate('monthNames')],
- a: [word, function (d, v, i18n) {
- var val = v.toLowerCase();
- if (val === i18n.amPm[0]) {
- d.isPm = false;
- } else if (val === i18n.amPm[1]) {
- d.isPm = true;
- }
- }],
- ZZ: [/[\+\-]\d\d:?\d\d/, function (d, v) {
- var parts = (v + '').match(/([\+\-]|\d\d)/gi),
- minutes;
- if (parts) {
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
- d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
- }
- }]
- };
- parseFlags.DD = parseFlags.DD;
- parseFlags.dddd = parseFlags.ddd;
- parseFlags.Do = parseFlags.dd = parseFlags.d;
- parseFlags.mm = parseFlags.m;
- parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
- parseFlags.MM = parseFlags.M;
- parseFlags.ss = parseFlags.s;
- parseFlags.A = parseFlags.a;
- fecha.masks = {
- 'default': 'ddd MMM dd yyyy HH:mm:ss',
- shortDate: 'M/D/yy',
- mediumDate: 'MMM d, yyyy',
- longDate: 'MMMM d, yyyy',
- fullDate: 'dddd, MMMM d, yyyy',
- shortTime: 'HH:mm',
- mediumTime: 'HH:mm:ss',
- longTime: 'HH:mm:ss.SSS'
- };
- fecha.format = function (dateObj, mask, i18nSettings) {
- var i18n = i18nSettings || fecha.i18n;
- if (typeof dateObj === 'number') {
- dateObj = new Date(dateObj);
- }
- if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
- throw new Error('Invalid Date in fecha.format');
- }
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
- return mask.replace(token, function ($0) {
- return $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1);
- });
- };
- fecha.parse = function (dateStr, format, i18nSettings) {
- var i18n = i18nSettings || fecha.i18n;
- if (typeof format !== 'string') {
- throw new Error('Invalid format in fecha.parse');
- }
- format = fecha.masks[format] || format;
- if (dateStr.length > 1000) {
- return false;
- }
- var isValid = true;
- var dateInfo = {};
- format.replace(token, function ($0) {
- if (parseFlags[$0]) {
- var info = parseFlags[$0];
- var index = dateStr.search(info[0]);
- if (!~index) {
- isValid = false;
- } else {
- dateStr.replace(info[0], function (result) {
- info[1](dateInfo, result, i18n);
- dateStr = dateStr.substr(index + result.length);
- return result;
- });
- }
- }
- return parseFlags[$0] ? '' : $0.slice(1, $0.length - 1);
- });
- if (!isValid) {
- return false;
- }
- var today = new Date();
- if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
- dateInfo.hour = +dateInfo.hour + 12;
- } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
- dateInfo.hour = 0;
- }
- var date;
- if (dateInfo.timezoneOffset != null) {
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
- date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
- } else {
- date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
- }
- return date;
- };
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = fecha;
- } else if (true) {
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return fecha;
- }).call(exports, __webpack_require__, exports, module),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {
- main.fecha = fecha;
- }
- })(undefined);
- /***/ }),
- /* 408 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture].mousedown", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture, modifiers: { "mousedown": true } }, { name: "click-outside", rawName: "v-click-outside:[capture].touchstart", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture, modifiers: { "touchstart": true } }, { name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture }], class: _vm.wrapperClasses }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'] }, [_vm._t("default", [_c('i-input', { key: _vm.forceInputRerender, ref: "input", class: [_vm.prefixCls + '-editor'], attrs: { "element-id": _vm.elementId, "readonly": !_vm.editable || _vm.readonly, "disabled": _vm.itemDisabled, "size": _vm.size, "placeholder": _vm.placeholder, "value": _vm.visualValue, "name": _vm.name }, on: { "on-input-change": _vm.handleInputChange, "on-focus": _vm.handleFocus, "on-blur": _vm.handleBlur }, nativeOn: { "click": function click($event) {
- return _vm.handleFocus($event);
- }, "keydown": function keydown($event) {
- return _vm.handleKeydown($event);
- }, "mouseenter": function mouseenter($event) {
- return _vm.handleInputMouseenter($event);
- }, "mouseleave": function mouseleave($event) {
- return _vm.handleInputMouseleave($event);
- } } }, [_c('Icon', { attrs: { "slot": "suffix", "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize }, on: { "click": _vm.handleIconClick }, slot: "suffix" })], 1)])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer }, nativeOn: { "click": function click($event) {
- return _vm.handleTransferClick($event);
- } } }, [_c('div', [_c(_vm.panel, _vm._b({ ref: "pickerPanel", tag: "component", attrs: { "visible": _vm.visible, "showTime": _vm.type === 'datetime' || _vm.type === 'datetimerange', "confirm": _vm.isConfirm, "selectionMode": _vm.selectionMode, "steps": _vm.steps, "format": _vm.format, "value": _vm.internalValue, "start-date": _vm.startDate, "split-panels": _vm.splitPanels, "show-week-numbers": _vm.showWeekNumbers, "picker-type": _vm.type, "multiple": _vm.multiple, "focused-date": _vm.focusedDate, "time-picker-options": _vm.timePickerOptions }, on: { "on-pick": _vm.onPick, "on-pick-clear": _vm.handleClear, "on-pick-success": _vm.onPickSuccess, "on-pick-click": function onPickClick($event) {
- _vm.disableClickOutSide = true;
- }, "on-selection-mode-change": _vm.onSelectionModeChange } }, 'component', _vm.ownPickerProps, false))], 1)])], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 409 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__ = __webpack_require__(159);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__ = __webpack_require__(421);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 410 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = {
- Generator: __webpack_require__(411),
- addLabels: __webpack_require__(412)
- }
- /***/ }),
- /* 411 */
- /***/ (function(module, exports) {
- // calendar with 8 column x 7 rows
- var oneDay = 1000 * 60 * 60 * 24;
- function daysInMonth(year, month) {
- return new Date(year, month + 1, 0).getDate();
- }
- function getYear(year, month, weekNr){
- if (month === 0 && weekNr > 50) return year - 1;
- else if(month === 11 && weekNr < 10) return year + 1;
- else return year;
- }
- function getDateInfo(y, m, d, iso) {
- if (m > 11){
- m = 0;
- y++;
- }
- var currentDay = new Date(y, m, d);
- if (iso) currentDay.setDate(currentDay.getDate() + 4 - (currentDay.getDay() || 7));
- var year = iso ? currentDay.getFullYear() : y;
- var firstOfJanuary = new Date(year, 0, 1);
- var numberOfDays = 1 + Math.round((currentDay - firstOfJanuary) / oneDay);
- if (!iso) numberOfDays += firstOfJanuary.getDay();
- var w = Math.ceil(numberOfDays / 7);
- if (!iso) {
- var initialDay = new Date(y, m, d);
- var beginOfNextYear = new Date(y + 1, 0, 1);
- var startDayOfNextYear = beginOfNextYear.getDay();
- if (initialDay.getTime() >= beginOfNextYear.getTime() - (oneDay * startDayOfNextYear)) w = 1;
- }
- return w;
- }
- function getMonthCalender(year, month, iteratorFns){
- // config passed by binding
- var lang = this.lang || 'en';
- var onlyDays = this.onlyDays;
- var weekStart = typeof this.weekStart === 'undefined' ? 1 : this.weekStart;
- var iso = weekStart === 1;
- var cells = [];
- var monthStartDate = new Date(year, month, 1); // make a date object
- var dayOfWeek = monthStartDate.getDay() || (iso ? 7 : 0); // month week day for day 1
- var currentDay = weekStart - dayOfWeek; // starting position of first day in the week
- var weekNr = getDateInfo(year, month, 1, iso); // get week number of month start
- var maxDays = daysInMonth(year, month); // total days in current month
- var lastMonthMaxDays = daysInMonth(year, month - 1);
- var currentMonth, day, dayBefore;
- var currentYear = getYear(year, month, weekNr);
- var returnObject = {
- month: month,
- year: year,
- daysInMonth: maxDays
- };
- for (var i = 0; i < 7; i++){ // 7 rows in the calendar
- dayBefore = currentDay;
- for (var j = 0; j < 8; j++){ // 8 columns: week nr + 7 days p/ week
- if (i > 0 && j > 0) currentDay++; // not first row, not week nr column
- if (currentDay > maxDays || currentDay < 1){ // day belongs to sibling month
- // calculate day in sibling month
- day = currentDay > maxDays ? currentDay - maxDays : lastMonthMaxDays + currentDay;
- currentMonth = currentDay > maxDays ? month + 1 : month - 1;
- } else {
- day = currentDay;
- currentMonth = month;
- }
- var type = (function(){
- if (j === 0) return 'weekLabel';
- else if (i === 0) return 'dayLabel';
- else if (currentDay < 1) return 'prevMonth';
- else if (currentDay > maxDays) return 'nextMonth';
- else return 'monthDay';
- })();
- var isDay = dayBefore !== currentDay && i > 0;
- var dayData = {
- desc: isDay ? day : weekNr,
- week: weekNr,
- type: type,
- format: iso ? 'ISO 8601' : 'US',
- date: isDay ? new Date(Date.UTC(year, currentMonth, day)) : false,
- year: currentYear,
- index: cells.length
- };
- if (iteratorFns){
- if (typeof iteratorFns === "function") dayData = iteratorFns.call(returnObject, dayData, lang);
- else iteratorFns.forEach(function(fn){
- dayData = fn.call(returnObject, dayData, lang);
- });
- }
- if (onlyDays && isDay) cells.push(dayData); // add only days
- else if (!onlyDays) cells.push(dayData); // add also week numbers and labels
- }
- if (i > 0) weekNr = getDateInfo(year, currentMonth, day + 1, iso);
- currentYear = getYear(year, month, weekNr);
- }
- returnObject.cells = cells;
- return returnObject;
- }
- module.exports = function (config){
- return getMonthCalender.bind(config);
- }
- /***/ }),
- /* 412 */
- /***/ (function(module, exports, __webpack_require__) {
- // calendar with 8 column x 7 rows
- var labels = __webpack_require__(413);
- function isIterable(variable){
- if (variable == null) return false;
- if (variable.constructor === Array) return true;
- if (variable.constructor === Object) return true;
- return false;
- }
- function merge(_new, _old){
- for (var prop in _new){
- if (!_old[prop]) _old[prop] = _new[prop];
- else if (isIterable(_new[prop])) merge(_new[prop], _old[prop]);
- }
- }
- function addLabels(dayObject, lang){
- var cssClass = [labels.classes[dayObject.type]];
- if (dayObject.class) dayObject.class = (typeof dayObject.class == 'string' ? [dayObject.class] : dayObject.class).concat(cssClass);
- else dayObject.class = cssClass;
- if (dayObject.type.indexOf('Label') > 0){
- if (dayObject.index == 0 && labels.weekPlaceholder) dayObject.desc = labels.weekPlaceholder;
- else if (dayObject.index < 8) dayObject.desc = labels.columnNames[lang][dayObject.index];
- else if (dayObject.index % 8 == 0) dayObject.desc = dayObject.week;
- }
- if (dayObject.date) dayObject.monthName = labels.monthNames[lang][dayObject.date.getMonth()];
- if (!this.monthName) this.monthName = labels.monthNames[lang][this.month];
- if (!this.labels) this.labels = {
- monthNames: labels.monthNames[lang],
- columnNames: labels.columnNames[lang],
- classes: labels.classes
- }
- return dayObject;
- }
- addLabels.setLabels = function(newOptions){
- merge(newOptions, labels);
- };
- module.exports = addLabels;
- /***/ }),
- /* 413 */
- /***/ (function(module, exports) {
- module.exports = {
- weekPlaceholder: '',
- columnNames: {
- en: {
- 0: 'w',
- 1: 'monday',
- 2: 'tuesday',
- 3: 'wednesday',
- 4: 'thursday',
- 5: 'friday',
- 6: 'saturday',
- 7: 'sunday'
- },
- sv: {
- 0: 'v',
- 1: 'måndag',
- 2: 'tisdag',
- 3: 'onsdag',
- 4: 'torsdag',
- 5: 'fredag',
- 6: 'lördag',
- 7: 'söndag'
- },
- pt: {
- 0: 's',
- 1: 'segunda',
- 2: 'terça',
- 3: 'quarta',
- 4: 'quinta',
- 5: 'sexta',
- 6: 'sábado',
- 7: 'domingo'
- }
- },
- monthNames: {
- en: [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- ],
- sv: [
- "januari",
- "februari",
- "mars",
- "april",
- "maj",
- "juni",
- "juli",
- "augusti",
- "september",
- "oktober",
- "november",
- "december"
- ],
- pt: [
- "Janeiro",
- "Fevereiro",
- "Março",
- "Abril",
- "Maio",
- "Junho",
- "Julho",
- "Agosto",
- "Setembro",
- "Outubro",
- "Novembro",
- "Dezembro"
- ]
- },
- classes: {
- dayLabel: 'day-of-week',
- weekLabel: 'week-number',
- prevMonth: 'inactive',
- nextMonth: 'inactive',
- monthDay: 'day-in-month'
- }
- };
- /***/ }),
- /* 414 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { class: [_vm.prefixCls + '-header'] }, _vm._l(_vm.headerDays, function (day) {
- return _c('span', { key: day }, [_vm._v("\n " + _vm._s(day) + "\n ")]);
- }), 0), _vm._v(" "), _vm._l(_vm.cells, function (cell, i) {
- return _c('span', { key: String(cell.date) + i, class: _vm.getCellCls(cell), on: { "click": function click($event) {
- return _vm.handleClick(cell, $event);
- }, "mouseenter": function mouseenter($event) {
- return _vm.handleMouseMove(cell);
- } } }, [_c('em', [_vm._v(_vm._s(cell.desc))])]);
- })], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 415 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, _vm._l(_vm.cells, function (cell) {
- return _c('span', { class: _vm.getCellCls(cell), on: { "click": function click($event) {
- return _vm.handleClick(cell, $event);
- }, "mouseenter": function mouseenter($event) {
- return _vm.handleMouseMove(cell);
- } } }, [_c('em', [_vm._v(_vm._s(cell.date.getFullYear()))])]);
- }), 0);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 416 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, _vm._l(_vm.cells, function (cell) {
- return _c('span', { class: _vm.getCellCls(cell), on: { "click": function click($event) {
- return _vm.handleClick(cell, $event);
- }, "mouseenter": function mouseenter($event) {
- return _vm.handleMouseMove(cell);
- } } }, [_c('em', [_vm._v(_vm._s(cell.text))])]);
- }), 0);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 417 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { ref: "hours", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.hoursList, function (item) {
- return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
- return _vm.handleClick('hours', item);
- } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
- }), 0)]), _vm._v(" "), _c('div', { ref: "minutes", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.minutesList, function (item) {
- return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
- return _vm.handleClick('minutes', item);
- } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
- }), 0)]), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showSeconds, expression: "showSeconds" }], ref: "seconds", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.secondsList, function (item) {
- return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
- return _vm.handleClick('seconds', item);
- } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
- }), 0)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 418 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-confirm'], on: { "!keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
- return null;
- }return _vm.handleTab($event);
- } } }, [_vm.showTime ? _c('i-button', { class: _vm.timeClasses, attrs: { "size": "small", "type": "text", "disabled": _vm.timeDisabled }, on: { "click": _vm.handleToggleTime } }, [_vm._v("\n " + _vm._s(_vm.labels.time) + "\n ")]) : _vm._e(), _vm._v(" "), _c('i-button', { attrs: { "size": "small" }, nativeOn: { "click": function click($event) {
- return _vm.handleClear($event);
- }, "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleClear($event);
- } } }, [_vm._v("\n " + _vm._s(_vm.labels.clear) + "\n ")]), _vm._v(" "), _c('i-button', { attrs: { "size": "small", "type": "primary" }, nativeOn: { "click": function click($event) {
- return _vm.handleSuccess($event);
- }, "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.handleSuccess($event);
- } } }, [_vm._v("\n " + _vm._s(_vm.labels.ok) + "\n ")])], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 419 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-body-wrapper'], on: { "mousedown": function mousedown($event) {
- $event.preventDefault();
- } } }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_vm.showDate ? _c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm._v(_vm._s(_vm.visibleDate))]) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'] }, [_c('time-spinner', { ref: "timeSpinner", attrs: { "show-seconds": _vm.showSeconds, "steps": _vm.steps, "hours": _vm.timeSlots[0], "minutes": _vm.timeSlots[1], "seconds": _vm.timeSlots[2], "disabled-hours": _vm.disabledHMS.disabledHours, "disabled-minutes": _vm.disabledHMS.disabledMinutes, "disabled-seconds": _vm.disabledHMS.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { on: { "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 420 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.datePanelLabel ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.datePanelLabel.labels[0].type === 'year' || _vm.currentView === 'date', expression: "datePanelLabel.labels[0].type === 'year' || currentView === 'date'" }], class: [_vm.datePrefixCls + '-header-label'], on: { "click": _vm.datePanelLabel.labels[0].handler } }, [_vm._v(_vm._s(_vm.datePanelLabel.labels[0].label))]) : _vm._e(), _vm._v(" "), _vm.datePanelLabel && _vm.currentView === 'date' ? [_vm._v(_vm._s(_vm.datePanelLabel.separator))] : _vm._e(), _vm._v(" "), _vm.datePanelLabel ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.datePanelLabel.labels[1].type === 'year' || _vm.currentView === 'date', expression: "datePanelLabel.labels[1].type === 'year' || currentView === 'date'" }], class: [_vm.datePrefixCls + '-header-label'], on: { "click": _vm.datePanelLabel.labels[1].handler } }, [_vm._v(_vm._s(_vm.datePanelLabel.labels[1].label))]) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 421 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
- $event.preventDefault();
- } } }, [_vm.shortcuts.length ? _c('div', { class: [_vm.prefixCls + '-sidebar'] }, _vm._l(_vm.shortcuts, function (shortcut) {
- return _c('div', { class: [_vm.prefixCls + '-shortcut'], on: { "click": function click($event) {
- return _vm.handleShortcutClick(shortcut);
- } } }, [_vm._v(_vm._s(shortcut.text))]);
- }), 0) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
- return _vm.changeYear(-1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _vm.pickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
- return _vm.changeMonth(-1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.datePanelLabel, "current-view": _vm.pickerTable.split('-').shift(), "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
- return _vm.changeYear(+1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _vm.pickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
- return _vm.changeMonth(+1);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'] }, [_vm.currentView !== 'time' ? _c(_vm.pickerTable, { ref: "pickerTable", tag: "component", attrs: { "table-date": _vm.panelDate, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.dates, "selection-mode": _vm.selectionMode, "disabled-date": _vm.disabledDate, "focused-date": _vm.focusedDate }, on: { "on-pick": _vm.panelPickerHandlers, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isTime, expression: "isTime" }], class: [_vm.prefixCls + '-content'] }, [_vm.currentView === 'time' ? _c('time-picker', _vm._b({ ref: "timePicker", attrs: { "value": _vm.dates, "format": _vm.format, "time-disabled": _vm.timeDisabled, "disabled-date": _vm.disabledDate, "focused-date": _vm.focusedDate }, on: { "on-pick": _vm.handlePick, "on-pick-click": _vm.handlePickClick, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess, "on-pick-toggle-time": _vm.handleToggleTime } }, 'time-picker', _vm.timePickerOptions, false)) : _vm._e()], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { attrs: { "show-time": _vm.showTime, "is-time": _vm.isTime }, on: { "on-pick-toggle-time": _vm.handleToggleTime, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 422 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__ = __webpack_require__(174);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__ = __webpack_require__(424);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 423 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
- $event.preventDefault();
- } } }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_c('div', { class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-left'] }, [_c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm.showDate ? [_vm._v(_vm._s(_vm.leftDatePanelLabel))] : [_vm._v(_vm._s(_vm.t('i.datepicker.startTime')))]], 2), _vm._v(" "), _c('time-spinner', { ref: "timeSpinner", attrs: { "steps": _vm.steps, "show-seconds": _vm.showSeconds, "hours": _vm.value[0] && _vm.dateStart.getHours(), "minutes": _vm.value[0] && _vm.dateStart.getMinutes(), "seconds": _vm.value[0] && _vm.dateStart.getSeconds(), "disabled-hours": _vm.disabledHours, "disabled-minutes": _vm.disabledMinutes, "disabled-seconds": _vm.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleStartChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-right'] }, [_c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm.showDate ? [_vm._v(_vm._s(_vm.rightDatePanelLabel))] : [_vm._v(_vm._s(_vm.t('i.datepicker.endTime')))]], 2), _vm._v(" "), _c('time-spinner', { ref: "timeSpinnerEnd", attrs: { "steps": _vm.steps, "show-seconds": _vm.showSeconds, "hours": _vm.value[1] && _vm.dateEnd.getHours(), "minutes": _vm.value[1] && _vm.dateEnd.getMinutes(), "seconds": _vm.value[1] && _vm.dateEnd.getSeconds(), "disabled-hours": _vm.disabledHours, "disabled-minutes": _vm.disabledMinutes, "disabled-seconds": _vm.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleEndChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { on: { "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 424 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
- $event.preventDefault();
- } } }, [_vm.shortcuts.length ? _c('div', { class: [_vm.prefixCls + '-sidebar'] }, _vm._l(_vm.shortcuts, function (shortcut) {
- return _c('div', { class: [_vm.prefixCls + '-shortcut'], on: { "click": function click($event) {
- return _vm.handleShortcutClick(shortcut);
- } } }, [_vm._v(_vm._s(shortcut.text))]);
- }), 0) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.panelBodyClasses }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.isTime, expression: "!isTime" }], class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-left'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
- return _vm.prevYear('left');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _vm.leftPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
- return _vm.prevMonth('left');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.leftDatePanelLabel, "current-view": _vm.leftDatePanelView, "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _vm.splitPanels || _vm.leftPickerTable !== 'date-table' ? _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
- return _vm.nextYear('left');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e(), _vm._v(" "), _vm.splitPanels && _vm.leftPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
- return _vm.nextMonth('left');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _vm.currentView !== 'time' ? _c(_vm.leftPickerTable, { ref: "leftYearTable", tag: "component", attrs: { "table-date": _vm.leftPanelDate, "selection-mode": "range", "disabled-date": _vm.disabledDate, "range-state": _vm.rangeState, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.preSelecting.left ? [_vm.dates[0]] : _vm.dates, "focused-date": _vm.focusedDate }, on: { "on-change-range": _vm.handleChangeRange, "on-pick": _vm.panelPickerHandlers.left, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.isTime, expression: "!isTime" }], class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-right'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_vm.splitPanels || _vm.rightPickerTable !== 'date-table' ? _c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
- return _vm.prevYear('right');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _vm.splitPanels && _vm.rightPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
- return _vm.prevMonth('right');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.rightDatePanelLabel, "current-view": _vm.rightDatePanelView, "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
- return _vm.nextYear('right');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _vm.rightPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
- return _vm.nextMonth('right');
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _vm.currentView !== 'time' ? _c(_vm.rightPickerTable, { ref: "rightYearTable", tag: "component", attrs: { "table-date": _vm.rightPanelDate, "selection-mode": "range", "range-state": _vm.rangeState, "disabled-date": _vm.disabledDate, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.preSelecting.right ? [_vm.dates[_vm.dates.length - 1]] : _vm.dates, "focused-date": _vm.focusedDate }, on: { "on-change-range": _vm.handleChangeRange, "on-pick": _vm.panelPickerHandlers.right, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isTime, expression: "isTime" }], class: [_vm.prefixCls + '-content'] }, [_vm.currentView === 'time' ? _c('time-picker', _vm._b({ ref: "timePicker", attrs: { "value": _vm.dates, "format": _vm.format, "time-disabled": _vm.timeDisabled }, on: { "on-pick": _vm.handleRangePick, "on-pick-click": _vm.handlePickClick, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess, "on-pick-toggle-time": _vm.handleToggleTime } }, 'time-picker', _vm.timePickerOptions, false)) : _vm._e()], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { attrs: { "show-time": _vm.showTime, "is-time": _vm.isTime, "time-disabled": _vm.timeDisabled }, on: { "on-pick-toggle-time": _vm.handleToggleTime, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 425 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _divider = __webpack_require__(426);
- var _divider2 = _interopRequireDefault(_divider);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _divider2.default;
- /***/ }),
- /* 426 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__ = __webpack_require__(177);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__ = __webpack_require__(427);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 427 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.hasSlot ? _c('span', { class: _vm.slotClasses }, [_vm._t("default")], 2) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 428 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _drawer = __webpack_require__(429);
- var _drawer2 = _interopRequireDefault(_drawer);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _drawer2.default;
- /***/ }),
- /* 429 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__ = __webpack_require__(178);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__ = __webpack_require__(430);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 430 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }], attrs: { "data-transfer": _vm.transfer } }, [_c('transition', { attrs: { "name": "fade" } }, [_vm.mask ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.maskClasses, style: _vm.maskStyle, on: { "click": _vm.handleMask } }) : _vm._e()]), _vm._v(" "), _c('div', { class: _vm.wrapClasses, on: { "click": _vm.handleWrapClick } }, [_c('transition', { attrs: { "name": _vm.transitionName } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.classes, style: _vm.mainStyles }, [_c('div', { ref: "content", class: _vm.contentClasses }, [_vm.closable ? _c('a', { staticClass: "ivu-drawer-close", on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e(), _vm._v(" "), _vm.showHead ? _c('div', { class: [_vm.prefixCls + '-header'] }, [_vm._t("header", [_c('div', { class: [_vm.prefixCls + '-header-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'], style: _vm.styles }, [_vm._t("default")], 2)]), _vm._v(" "), _vm.draggable && (_vm.placement === 'left' || _vm.placement === 'right') ? _c('div', { staticClass: "ivu-drawer-drag", class: 'ivu-drawer-drag-' + _vm.placement, on: { "mousedown": _vm.handleTriggerMousedown } }, [_vm._t("trigger", [_c('div', { staticClass: "ivu-drawer-drag-move-trigger" }, [_c('div', { staticClass: "ivu-drawer-drag-move-trigger-point" }, [_c('i'), _c('i'), _c('i'), _c('i'), _c('i')])])])], 2) : _vm._e()])])], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 431 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _dropdown = __webpack_require__(61);
- var _dropdown2 = _interopRequireDefault(_dropdown);
- var _dropdownMenu = __webpack_require__(62);
- var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
- var _dropdownItem = __webpack_require__(434);
- var _dropdownItem2 = _interopRequireDefault(_dropdownItem);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _dropdown2.default.Menu = _dropdownMenu2.default;
- _dropdown2.default.Item = _dropdownItem2.default;
- exports.default = _dropdown2.default;
- /***/ }),
- /* 432 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.onClickoutside, expression: "onClickoutside" }], class: [_vm.prefixCls], on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: _vm.relClasses, on: { "click": _vm.handleClick, "contextmenu": function contextmenu($event) {
- $event.preventDefault();return _vm.handleRightClick($event);
- } } }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentVisible, expression: "currentVisible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer }, nativeOn: { "mouseenter": function mouseenter($event) {
- return _vm.handleMouseenter($event);
- }, "mouseleave": function mouseleave($event) {
- return _vm.handleMouseleave($event);
- } } }, [_vm._t("list")], 2)], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 433 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { staticClass: "ivu-dropdown-menu" }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 434 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__ = __webpack_require__(181);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__ = __webpack_require__(435);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 435 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "click": _vm.handleClick } }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 436 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _footer = __webpack_require__(182);
- var _footer2 = _interopRequireDefault(_footer);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _footer2.default;
- /***/ }),
- /* 437 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 438 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _form = __webpack_require__(439);
- var _form2 = _interopRequireDefault(_form);
- var _formItem = __webpack_require__(448);
- var _formItem2 = _interopRequireDefault(_formItem);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _form2.default.Item = _formItem2.default;
- exports.default = _form2.default;
- /***/ }),
- /* 439 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__ = __webpack_require__(184);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__ = __webpack_require__(447);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 440 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(80);
- __webpack_require__(35);
- __webpack_require__(46);
- __webpack_require__(441);
- __webpack_require__(445);
- __webpack_require__(446);
- module.exports = __webpack_require__(5).Promise;
- /***/ }),
- /* 441 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var LIBRARY = __webpack_require__(42);
- var global = __webpack_require__(9);
- var ctx = __webpack_require__(24);
- var classof = __webpack_require__(56);
- var $export = __webpack_require__(7);
- var isObject = __webpack_require__(18);
- var aFunction = __webpack_require__(43);
- var anInstance = __webpack_require__(88);
- var forOf = __webpack_require__(51);
- var speciesConstructor = __webpack_require__(186);
- var task = __webpack_require__(187).set;
- var microtask = __webpack_require__(443)();
- var newPromiseCapabilityModule = __webpack_require__(89);
- var perform = __webpack_require__(188);
- var userAgent = __webpack_require__(444);
- var promiseResolve = __webpack_require__(189);
- var PROMISE = 'Promise';
- var TypeError = global.TypeError;
- var process = global.process;
- var versions = process && process.versions;
- var v8 = versions && versions.v8 || '';
- var $Promise = global[PROMISE];
- var isNode = classof(process) == 'process';
- var empty = function () { /* empty */ };
- var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
- var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
- var USE_NATIVE = !!function () {
- try {
- // correct subclassing with @@species support
- var promise = $Promise.resolve(1);
- var FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function (exec) {
- exec(empty, empty);
- };
- // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- return (isNode || typeof PromiseRejectionEvent == 'function')
- && promise.then(empty) instanceof FakePromise
- // 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
- && v8.indexOf('6.6') !== 0
- && userAgent.indexOf('Chrome/66') === -1;
- } catch (e) { /* empty */ }
- }();
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
- };
- var notify = function (promise, isReject) {
- if (promise._n) return;
- promise._n = true;
- var chain = promise._c;
- microtask(function () {
- var value = promise._v;
- var ok = promise._s == 1;
- var i = 0;
- var run = function (reaction) {
- 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 (promise._h == 2) onHandleUnhandled(promise);
- promise._h = 1;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // may 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 (e) {
- if (domain && !exited) domain.exit();
- reject(e);
- }
- };
- while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
- promise._c = [];
- promise._n = false;
- if (isReject && !promise._h) onUnhandled(promise);
- });
- };
- var onUnhandled = function (promise) {
- task.call(global, function () {
- var value = promise._v;
- var unhandled = isUnhandled(promise);
- var result, handler, console;
- if (unhandled) {
- result = perform(function () {
- if (isNode) {
- process.emit('unhandledRejection', value, promise);
- } else if (handler = global.onunhandledrejection) {
- handler({ promise: promise, reason: value });
- } else if ((console = global.console) && console.error) {
- console.error('Unhandled promise rejection', value);
- }
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- promise._h = isNode || isUnhandled(promise) ? 2 : 1;
- } promise._a = undefined;
- if (unhandled && result.e) throw result.v;
- });
- };
- var isUnhandled = function (promise) {
- return promise._h !== 1 && (promise._a || promise._c).length === 0;
- };
- var onHandleUnhandled = function (promise) {
- task.call(global, function () {
- var handler;
- if (isNode) {
- process.emit('rejectionHandled', promise);
- } else if (handler = global.onrejectionhandled) {
- handler({ promise: promise, reason: promise._v });
- }
- });
- };
- var $reject = function (value) {
- var promise = this;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- promise._v = value;
- promise._s = 2;
- if (!promise._a) promise._a = promise._c.slice();
- notify(promise, true);
- };
- var $resolve = function (value) {
- var promise = this;
- var then;
- if (promise._d) return;
- promise._d = true;
- promise = promise._w || promise; // unwrap
- try {
- if (promise === value) throw TypeError("Promise can't be resolved itself");
- if (then = isThenable(value)) {
- microtask(function () {
- var wrapper = { _w: promise, _d: false }; // wrap
- try {
- then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
- } catch (e) {
- $reject.call(wrapper, e);
- }
- });
- } else {
- promise._v = value;
- promise._s = 1;
- notify(promise, false);
- }
- } catch (e) {
- $reject.call({ _w: promise, _d: false }, e); // wrap
- }
- };
- // constructor polyfill
- if (!USE_NATIVE) {
- // 25.4.3.1 Promise(executor)
- $Promise = function Promise(executor) {
- anInstance(this, $Promise, PROMISE, '_h');
- aFunction(executor);
- Internal.call(this);
- try {
- executor(ctx($resolve, this, 1), ctx($reject, this, 1));
- } catch (err) {
- $reject.call(this, err);
- }
- };
- // eslint-disable-next-line no-unused-vars
- Internal = function Promise(executor) {
- this._c = []; // <- awaiting reactions
- this._a = undefined; // <- checked in isUnhandled reactions
- this._s = 0; // <- state
- this._d = false; // <- done
- this._v = undefined; // <- value
- this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
- this._n = false; // <- notify
- };
- Internal.prototype = __webpack_require__(90)($Promise.prototype, {
- // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
- then: function then(onFulfilled, onRejected) {
- var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
- reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
- reaction.fail = typeof onRejected == 'function' && onRejected;
- reaction.domain = isNode ? process.domain : undefined;
- this._c.push(reaction);
- if (this._a) this._a.push(reaction);
- if (this._s) notify(this, false);
- return reaction.promise;
- },
- // 25.4.5.1 Promise.prototype.catch(onRejected)
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- this.promise = promise;
- this.resolve = ctx($resolve, promise, 1);
- this.reject = ctx($reject, promise, 1);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === $Promise || C === Wrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- }
- $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
- __webpack_require__(47)($Promise, PROMISE);
- __webpack_require__(190)(PROMISE);
- Wrapper = __webpack_require__(5)[PROMISE];
- // statics
- $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
- // 25.4.4.5 Promise.reject(r)
- reject: function reject(r) {
- var capability = newPromiseCapability(this);
- var $$reject = capability.reject;
- $$reject(r);
- return capability.promise;
- }
- });
- $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
- // 25.4.4.6 Promise.resolve(x)
- resolve: function resolve(x) {
- return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
- }
- });
- $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(114)(function (iter) {
- $Promise.all(iter)['catch'](empty);
- })), PROMISE, {
- // 25.4.4.1 Promise.all(iterable)
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var values = [];
- var index = 0;
- var remaining = 1;
- forOf(iterable, false, function (promise) {
- var $index = index++;
- var alreadyCalled = false;
- values.push(undefined);
- remaining++;
- C.resolve(promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[$index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.e) reject(result.v);
- return capability.promise;
- },
- // 25.4.4.4 Promise.race(iterable)
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapability(C);
- var reject = capability.reject;
- var result = perform(function () {
- forOf(iterable, false, function (promise) {
- C.resolve(promise).then(capability.resolve, reject);
- });
- });
- if (result.e) reject(result.v);
- return capability.promise;
- }
- });
- /***/ }),
- /* 442 */
- /***/ (function(module, exports) {
- // fast apply, http://jsperf.lnkit.com/fast-apply/5
- module.exports = function (fn, args, that) {
- var un = that === undefined;
- switch (args.length) {
- case 0: return un ? fn()
- : fn.call(that);
- case 1: return un ? fn(args[0])
- : fn.call(that, args[0]);
- case 2: return un ? fn(args[0], args[1])
- : fn.call(that, args[0], args[1]);
- case 3: return un ? fn(args[0], args[1], args[2])
- : fn.call(that, args[0], args[1], args[2]);
- case 4: return un ? fn(args[0], args[1], args[2], args[3])
- : fn.call(that, args[0], args[1], args[2], args[3]);
- } return fn.apply(that, args);
- };
- /***/ }),
- /* 443 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(9);
- var macrotask = __webpack_require__(187).set;
- var Observer = global.MutationObserver || global.WebKitMutationObserver;
- var process = global.process;
- var Promise = global.Promise;
- var isNode = __webpack_require__(41)(process) == 'process';
- module.exports = function () {
- var head, last, notify;
- var flush = function () {
- var parent, fn;
- if (isNode && (parent = process.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (e) {
- if (head) notify();
- else last = undefined;
- throw e;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
- // Node.js
- if (isNode) {
- notify = function () {
- process.nextTick(flush);
- };
- // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
- } else if (Observer && !(global.navigator && global.navigator.standalone)) {
- var toggle = true;
- var node = document.createTextNode('');
- new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
- 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
- var promise = Promise.resolve(undefined);
- notify = function () {
- promise.then(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);
- };
- }
- return function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- };
- /***/ }),
- /* 444 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(9);
- var navigator = global.navigator;
- module.exports = navigator && navigator.userAgent || '';
- /***/ }),
- /* 445 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/proposal-promise-finally
- var $export = __webpack_require__(7);
- var core = __webpack_require__(5);
- var global = __webpack_require__(9);
- var speciesConstructor = __webpack_require__(186);
- var promiseResolve = __webpack_require__(189);
- $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
- var C = speciesConstructor(this, core.Promise || global.Promise);
- var isFunction = typeof onFinally == 'function';
- return this.then(
- isFunction ? function (x) {
- return promiseResolve(C, onFinally()).then(function () { return x; });
- } : onFinally,
- isFunction ? function (e) {
- return promiseResolve(C, onFinally()).then(function () { throw e; });
- } : onFinally
- );
- } });
- /***/ }),
- /* 446 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://github.com/tc39/proposal-promise-try
- var $export = __webpack_require__(7);
- var newPromiseCapability = __webpack_require__(89);
- var perform = __webpack_require__(188);
- $export($export.S, 'Promise', { 'try': function (callbackfn) {
- var promiseCapability = newPromiseCapability.f(this);
- var result = perform(callbackfn);
- (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
- return promiseCapability.promise;
- } });
- /***/ }),
- /* 447 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('form', { class: _vm.classes, attrs: { "autocomplete": _vm.autocomplete } }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 448 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__ = __webpack_require__(191);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__ = __webpack_require__(451);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 449 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* WEBPACK VAR INJECTION */(function(process) {function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- return _extends.apply(this, arguments);
- }
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
- function _getPrototypeOf(o) {
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
- return o.__proto__ || Object.getPrototypeOf(o);
- };
- return _getPrototypeOf(o);
- }
- function _setPrototypeOf(o, p) {
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- };
- return _setPrototypeOf(o, p);
- }
- function _isNativeReflectConstruct() {
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
- if (Reflect.construct.sham) return false;
- if (typeof Proxy === "function") return true;
- try {
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
- return true;
- } catch (e) {
- return false;
- }
- }
- function _construct(Parent, args, Class) {
- if (_isNativeReflectConstruct()) {
- _construct = Reflect.construct;
- } else {
- _construct = function _construct(Parent, args, Class) {
- var a = [null];
- a.push.apply(a, args);
- var Constructor = Function.bind.apply(Parent, a);
- var instance = new Constructor();
- if (Class) _setPrototypeOf(instance, Class.prototype);
- return instance;
- };
- }
- return _construct.apply(null, arguments);
- }
- function _isNativeFunction(fn) {
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
- }
- function _wrapNativeSuper(Class) {
- var _cache = typeof Map === "function" ? new Map() : undefined;
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
- if (Class === null || !_isNativeFunction(Class)) return Class;
- if (typeof Class !== "function") {
- throw new TypeError("Super expression must either be null or a function");
- }
- if (typeof _cache !== "undefined") {
- if (_cache.has(Class)) return _cache.get(Class);
- _cache.set(Class, Wrapper);
- }
- function Wrapper() {
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
- }
- Wrapper.prototype = Object.create(Class.prototype, {
- constructor: {
- value: Wrapper,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- return _setPrototypeOf(Wrapper, Class);
- };
- return _wrapNativeSuper(Class);
- }
- /* eslint no-console:0 */
- var formatRegExp = /%[sdj%]/g;
- var warning = function warning() {}; // don't print warning message when in production env or node runtime
- if (typeof process !== 'undefined' && Object({"NODE_ENV":"production"}) && "production" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
- warning = function warning(type, errors) {
- if (typeof console !== 'undefined' && console.warn) {
- if (errors.every(function (e) {
- return typeof e === 'string';
- })) {
- console.warn(type, errors);
- }
- }
- };
- }
- function convertFieldsError(errors) {
- if (!errors || !errors.length) return null;
- var fields = {};
- errors.forEach(function (error) {
- var field = error.field;
- fields[field] = fields[field] || [];
- fields[field].push(error);
- });
- return fields;
- }
- function format() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var i = 1;
- var f = args[0];
- var len = args.length;
- if (typeof f === 'function') {
- return f.apply(null, args.slice(1));
- }
- if (typeof f === 'string') {
- var str = String(f).replace(formatRegExp, function (x) {
- if (x === '%%') {
- return '%';
- }
- if (i >= len) {
- return x;
- }
- switch (x) {
- case '%s':
- return String(args[i++]);
- case '%d':
- return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- break;
- default:
- return x;
- }
- });
- for (var arg = args[i]; i < len; arg = args[++i]) {
- str += " " + arg;
- }
- return str;
- }
- return f;
- }
- function isNativeStringType(type) {
- return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
- }
- function isEmptyValue(value, type) {
- if (value === undefined || value === null) {
- return true;
- }
- if (type === 'array' && Array.isArray(value) && !value.length) {
- return true;
- }
- if (isNativeStringType(type) && typeof value === 'string' && !value) {
- return true;
- }
- return false;
- }
- function asyncParallelArray(arr, func, callback) {
- var results = [];
- var total = 0;
- var arrLength = arr.length;
- function count(errors) {
- results.push.apply(results, errors);
- total++;
- if (total === arrLength) {
- callback(results);
- }
- }
- arr.forEach(function (a) {
- func(a, count);
- });
- }
- function asyncSerialArray(arr, func, callback) {
- var index = 0;
- var arrLength = arr.length;
- function next(errors) {
- if (errors && errors.length) {
- callback(errors);
- return;
- }
- var original = index;
- index = index + 1;
- if (original < arrLength) {
- func(arr[original], next);
- } else {
- callback([]);
- }
- }
- next([]);
- }
- function flattenObjArr(objArr) {
- var ret = [];
- Object.keys(objArr).forEach(function (k) {
- ret.push.apply(ret, objArr[k]);
- });
- return ret;
- }
- var AsyncValidationError = /*#__PURE__*/function (_Error) {
- _inheritsLoose(AsyncValidationError, _Error);
- function AsyncValidationError(errors, fields) {
- var _this;
- _this = _Error.call(this, 'Async Validation Error') || this;
- _this.errors = errors;
- _this.fields = fields;
- return _this;
- }
- return AsyncValidationError;
- }( /*#__PURE__*/_wrapNativeSuper(Error));
- function asyncMap(objArr, option, func, callback) {
- if (option.first) {
- var _pending = new Promise(function (resolve, reject) {
- var next = function next(errors) {
- callback(errors);
- return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve();
- };
- var flattenArr = flattenObjArr(objArr);
- asyncSerialArray(flattenArr, func, next);
- });
- _pending["catch"](function (e) {
- return e;
- });
- return _pending;
- }
- var firstFields = option.firstFields || [];
- if (firstFields === true) {
- firstFields = Object.keys(objArr);
- }
- var objArrKeys = Object.keys(objArr);
- var objArrLength = objArrKeys.length;
- var total = 0;
- var results = [];
- var pending = new Promise(function (resolve, reject) {
- var next = function next(errors) {
- results.push.apply(results, errors);
- total++;
- if (total === objArrLength) {
- callback(results);
- return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve();
- }
- };
- if (!objArrKeys.length) {
- callback(results);
- resolve();
- }
- objArrKeys.forEach(function (key) {
- var arr = objArr[key];
- if (firstFields.indexOf(key) !== -1) {
- asyncSerialArray(arr, func, next);
- } else {
- asyncParallelArray(arr, func, next);
- }
- });
- });
- pending["catch"](function (e) {
- return e;
- });
- return pending;
- }
- function complementError(rule) {
- return function (oe) {
- if (oe && oe.message) {
- oe.field = oe.field || rule.fullField;
- return oe;
- }
- return {
- message: typeof oe === 'function' ? oe() : oe,
- field: oe.field || rule.fullField
- };
- };
- }
- function deepMerge(target, source) {
- if (source) {
- for (var s in source) {
- if (source.hasOwnProperty(s)) {
- var value = source[s];
- if (typeof value === 'object' && typeof target[s] === 'object') {
- target[s] = _extends(_extends({}, target[s]), value);
- } else {
- target[s] = value;
- }
- }
- }
- }
- return target;
- }
- /**
- * Rule for validating required fields.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function required(rule, value, source, errors, options, type) {
- if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
- errors.push(format(options.messages.required, rule.fullField));
- }
- }
- /**
- * Rule for validating whitespace.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function whitespace(rule, value, source, errors, options) {
- if (/^\s+$/.test(value) || value === '') {
- errors.push(format(options.messages.whitespace, rule.fullField));
- }
- }
- /* eslint max-len:0 */
- var pattern = {
- // http://emailregex.com/
- email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
- url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
- hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
- };
- var types = {
- integer: function integer(value) {
- return types.number(value) && parseInt(value, 10) === value;
- },
- "float": function float(value) {
- return types.number(value) && !types.integer(value);
- },
- array: function array(value) {
- return Array.isArray(value);
- },
- regexp: function regexp(value) {
- if (value instanceof RegExp) {
- return true;
- }
- try {
- return !!new RegExp(value);
- } catch (e) {
- return false;
- }
- },
- date: function date(value) {
- return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
- },
- number: function number(value) {
- if (isNaN(value)) {
- return false;
- }
- return typeof value === 'number';
- },
- object: function object(value) {
- return typeof value === 'object' && !types.array(value);
- },
- method: function method(value) {
- return typeof value === 'function';
- },
- email: function email(value) {
- return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
- },
- url: function url(value) {
- return typeof value === 'string' && !!value.match(pattern.url);
- },
- hex: function hex(value) {
- return typeof value === 'string' && !!value.match(pattern.hex);
- }
- };
- /**
- * Rule for validating the type of a value.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function type(rule, value, source, errors, options) {
- if (rule.required && value === undefined) {
- required(rule, value, source, errors, options);
- return;
- }
- var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
- var ruleType = rule.type;
- if (custom.indexOf(ruleType) > -1) {
- if (!types[ruleType](value)) {
- errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
- } // straight typeof check
- } else if (ruleType && typeof value !== rule.type) {
- errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
- }
- }
- /**
- * Rule for validating minimum and maximum allowed values.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function range(rule, value, source, errors, options) {
- var len = typeof rule.len === 'number';
- var min = typeof rule.min === 'number';
- var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
- var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var val = value;
- var key = null;
- var num = typeof value === 'number';
- var str = typeof value === 'string';
- var arr = Array.isArray(value);
- if (num) {
- key = 'number';
- } else if (str) {
- key = 'string';
- } else if (arr) {
- key = 'array';
- } // if the value is not of a supported type for range validation
- // the validation rule rule should use the
- // type property to also test for a particular type
- if (!key) {
- return false;
- }
- if (arr) {
- val = value.length;
- }
- if (str) {
- // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
- val = value.replace(spRegexp, '_').length;
- }
- if (len) {
- if (val !== rule.len) {
- errors.push(format(options.messages[key].len, rule.fullField, rule.len));
- }
- } else if (min && !max && val < rule.min) {
- errors.push(format(options.messages[key].min, rule.fullField, rule.min));
- } else if (max && !min && val > rule.max) {
- errors.push(format(options.messages[key].max, rule.fullField, rule.max));
- } else if (min && max && (val < rule.min || val > rule.max)) {
- errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
- }
- }
- var ENUM = 'enum';
- /**
- * Rule for validating a value exists in an enumerable list.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function enumerable(rule, value, source, errors, options) {
- rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
- if (rule[ENUM].indexOf(value) === -1) {
- errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
- }
- }
- /**
- * Rule for validating a regular expression pattern.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param source The source object being validated.
- * @param errors An array of errors that this rule may add
- * validation errors to.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function pattern$1(rule, value, source, errors, options) {
- if (rule.pattern) {
- if (rule.pattern instanceof RegExp) {
- // if a RegExp instance is passed, reset `lastIndex` in case its `global`
- // flag is accidentally set to `true`, which in a validation scenario
- // is not necessary and the result might be misleading
- rule.pattern.lastIndex = 0;
- if (!rule.pattern.test(value)) {
- errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
- }
- } else if (typeof rule.pattern === 'string') {
- var _pattern = new RegExp(rule.pattern);
- if (!_pattern.test(value)) {
- errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
- }
- }
- }
- }
- var rules = {
- required: required,
- whitespace: whitespace,
- type: type,
- range: range,
- "enum": enumerable,
- pattern: pattern$1
- };
- /**
- * Performs validation for string types.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function string(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, 'string') && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options, 'string');
- if (!isEmptyValue(value, 'string')) {
- rules.type(rule, value, source, errors, options);
- rules.range(rule, value, source, errors, options);
- rules.pattern(rule, value, source, errors, options);
- if (rule.whitespace === true) {
- rules.whitespace(rule, value, source, errors, options);
- }
- }
- }
- callback(errors);
- }
- /**
- * Validates a function.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function method(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates a number.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function number(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (value === '') {
- value = undefined;
- }
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- rules.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates a boolean.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function _boolean(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates the regular expression type.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function regexp(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (!isEmptyValue(value)) {
- rules.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates a number is an integer.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function integer(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- rules.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates a number is a floating point number.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function floatFn(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- rules.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates an array.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function array(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, 'array') && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options, 'array');
- if (!isEmptyValue(value, 'array')) {
- rules.type(rule, value, source, errors, options);
- rules.range(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates an object.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function object(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- var ENUM$1 = 'enum';
- /**
- * Validates an enumerable list.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function enumerable$1(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (value !== undefined) {
- rules[ENUM$1](rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Validates a regular expression pattern.
- *
- * Performs validation when a rule only contains
- * a pattern property but is not declared as a string type.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function pattern$2(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, 'string') && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (!isEmptyValue(value, 'string')) {
- rules.pattern(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- function date(rule, value, callback, source, options) {
- // console.log('integer rule called %j', rule);
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- if (!isEmptyValue(value)) {
- var dateObject;
- if (typeof value === 'number') {
- dateObject = new Date(value);
- } else {
- dateObject = value;
- }
- rules.type(rule, dateObject, source, errors, options);
- if (dateObject) {
- rules.range(rule, dateObject.getTime(), source, errors, options);
- }
- }
- }
- callback(errors);
- }
- function required$1(rule, value, callback, source, options) {
- var errors = [];
- var type = Array.isArray(value) ? 'array' : typeof value;
- rules.required(rule, value, source, errors, options, type);
- callback(errors);
- }
- function type$1(rule, value, callback, source, options) {
- var ruleType = rule.type;
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value, ruleType) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options, ruleType);
- if (!isEmptyValue(value, ruleType)) {
- rules.type(rule, value, source, errors, options);
- }
- }
- callback(errors);
- }
- /**
- * Performs validation for any type.
- *
- * @param rule The validation rule.
- * @param value The value of the field on the source object.
- * @param callback The callback function.
- * @param source The source object being validated.
- * @param options The validation options.
- * @param options.messages The validation messages.
- */
- function any(rule, value, callback, source, options) {
- var errors = [];
- var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
- if (validate) {
- if (isEmptyValue(value) && !rule.required) {
- return callback();
- }
- rules.required(rule, value, source, errors, options);
- }
- callback(errors);
- }
- var validators = {
- string: string,
- method: method,
- number: number,
- "boolean": _boolean,
- regexp: regexp,
- integer: integer,
- "float": floatFn,
- array: array,
- object: object,
- "enum": enumerable$1,
- pattern: pattern$2,
- date: date,
- url: type$1,
- hex: type$1,
- email: type$1,
- required: required$1,
- any: any
- };
- function newMessages() {
- return {
- "default": 'Validation error on field %s',
- required: '%s is required',
- "enum": '%s must be one of %s',
- whitespace: '%s cannot be empty',
- date: {
- format: '%s date %s is invalid for format %s',
- parse: '%s date could not be parsed, %s is invalid ',
- invalid: '%s date %s is invalid'
- },
- types: {
- string: '%s is not a %s',
- method: '%s is not a %s (function)',
- array: '%s is not an %s',
- object: '%s is not an %s',
- number: '%s is not a %s',
- date: '%s is not a %s',
- "boolean": '%s is not a %s',
- integer: '%s is not an %s',
- "float": '%s is not a %s',
- regexp: '%s is not a valid %s',
- email: '%s is not a valid %s',
- url: '%s is not a valid %s',
- hex: '%s is not a valid %s'
- },
- string: {
- len: '%s must be exactly %s characters',
- min: '%s must be at least %s characters',
- max: '%s cannot be longer than %s characters',
- range: '%s must be between %s and %s characters'
- },
- number: {
- len: '%s must equal %s',
- min: '%s cannot be less than %s',
- max: '%s cannot be greater than %s',
- range: '%s must be between %s and %s'
- },
- array: {
- len: '%s must be exactly %s in length',
- min: '%s cannot be less than %s in length',
- max: '%s cannot be greater than %s in length',
- range: '%s must be between %s and %s in length'
- },
- pattern: {
- mismatch: '%s value %s does not match pattern %s'
- },
- clone: function clone() {
- var cloned = JSON.parse(JSON.stringify(this));
- cloned.clone = this.clone;
- return cloned;
- }
- };
- }
- var messages = newMessages();
- /**
- * Encapsulates a validation schema.
- *
- * @param descriptor An object declaring validation rules
- * for this schema.
- */
- function Schema(descriptor) {
- this.rules = null;
- this._messages = messages;
- this.define(descriptor);
- }
- Schema.prototype = {
- messages: function messages(_messages) {
- if (_messages) {
- this._messages = deepMerge(newMessages(), _messages);
- }
- return this._messages;
- },
- define: function define(rules) {
- if (!rules) {
- throw new Error('Cannot configure a schema with no rules');
- }
- if (typeof rules !== 'object' || Array.isArray(rules)) {
- throw new Error('Rules must be an object');
- }
- this.rules = {};
- var z;
- var item;
- for (z in rules) {
- if (rules.hasOwnProperty(z)) {
- item = rules[z];
- this.rules[z] = Array.isArray(item) ? item : [item];
- }
- }
- },
- validate: function validate(source_, o, oc) {
- var _this = this;
- if (o === void 0) {
- o = {};
- }
- if (oc === void 0) {
- oc = function oc() {};
- }
- var source = source_;
- var options = o;
- var callback = oc;
- if (typeof options === 'function') {
- callback = options;
- options = {};
- }
- if (!this.rules || Object.keys(this.rules).length === 0) {
- if (callback) {
- callback();
- }
- return Promise.resolve();
- }
- function complete(results) {
- var i;
- var errors = [];
- var fields = {};
- function add(e) {
- if (Array.isArray(e)) {
- var _errors;
- errors = (_errors = errors).concat.apply(_errors, e);
- } else {
- errors.push(e);
- }
- }
- for (i = 0; i < results.length; i++) {
- add(results[i]);
- }
- if (!errors.length) {
- errors = null;
- fields = null;
- } else {
- fields = convertFieldsError(errors);
- }
- callback(errors, fields);
- }
- if (options.messages) {
- var messages$1 = this.messages();
- if (messages$1 === messages) {
- messages$1 = newMessages();
- }
- deepMerge(messages$1, options.messages);
- options.messages = messages$1;
- } else {
- options.messages = this.messages();
- }
- var arr;
- var value;
- var series = {};
- var keys = options.keys || Object.keys(this.rules);
- keys.forEach(function (z) {
- arr = _this.rules[z];
- value = source[z];
- arr.forEach(function (r) {
- var rule = r;
- if (typeof rule.transform === 'function') {
- if (source === source_) {
- source = _extends({}, source);
- }
- value = source[z] = rule.transform(value);
- }
- if (typeof rule === 'function') {
- rule = {
- validator: rule
- };
- } else {
- rule = _extends({}, rule);
- }
- rule.validator = _this.getValidationMethod(rule);
- rule.field = z;
- rule.fullField = rule.fullField || z;
- rule.type = _this.getType(rule);
- if (!rule.validator) {
- return;
- }
- series[z] = series[z] || [];
- series[z].push({
- rule: rule,
- value: value,
- source: source,
- field: z
- });
- });
- });
- var errorFields = {};
- return asyncMap(series, options, function (data, doIt) {
- var rule = data.rule;
- var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField === 'object');
- deep = deep && (rule.required || !rule.required && data.value);
- rule.field = data.field;
- function addFullfield(key, schema) {
- return _extends(_extends({}, schema), {}, {
- fullField: rule.fullField + "." + key
- });
- }
- function cb(e) {
- if (e === void 0) {
- e = [];
- }
- var errors = e;
- if (!Array.isArray(errors)) {
- errors = [errors];
- }
- if (!options.suppressWarning && errors.length) {
- Schema.warning('async-validator:', errors);
- }
- if (errors.length && rule.message) {
- errors = [].concat(rule.message);
- }
- errors = errors.map(complementError(rule));
- if (options.first && errors.length) {
- errorFields[rule.field] = 1;
- return doIt(errors);
- }
- if (!deep) {
- doIt(errors);
- } else {
- // if rule is required but the target object
- // does not exist fail at the rule level and don't
- // go deeper
- if (rule.required && !data.value) {
- if (rule.message) {
- errors = [].concat(rule.message).map(complementError(rule));
- } else if (options.error) {
- errors = [options.error(rule, format(options.messages.required, rule.field))];
- }
- return doIt(errors);
- }
- var fieldsSchema = {};
- if (rule.defaultField) {
- for (var k in data.value) {
- if (data.value.hasOwnProperty(k)) {
- fieldsSchema[k] = rule.defaultField;
- }
- }
- }
- fieldsSchema = _extends(_extends({}, fieldsSchema), data.rule.fields);
- for (var f in fieldsSchema) {
- if (fieldsSchema.hasOwnProperty(f)) {
- var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
- fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
- }
- }
- var schema = new Schema(fieldsSchema);
- schema.messages(options.messages);
- if (data.rule.options) {
- data.rule.options.messages = options.messages;
- data.rule.options.error = options.error;
- }
- schema.validate(data.value, data.rule.options || options, function (errs) {
- var finalErrors = [];
- if (errors && errors.length) {
- finalErrors.push.apply(finalErrors, errors);
- }
- if (errs && errs.length) {
- finalErrors.push.apply(finalErrors, errs);
- }
- doIt(finalErrors.length ? finalErrors : null);
- });
- }
- }
- var res;
- if (rule.asyncValidator) {
- res = rule.asyncValidator(rule, data.value, cb, data.source, options);
- } else if (rule.validator) {
- res = rule.validator(rule, data.value, cb, data.source, options);
- if (res === true) {
- cb();
- } else if (res === false) {
- cb(rule.message || rule.field + " fails");
- } else if (res instanceof Array) {
- cb(res);
- } else if (res instanceof Error) {
- cb(res.message);
- }
- }
- if (res && res.then) {
- res.then(function () {
- return cb();
- }, function (e) {
- return cb(e);
- });
- }
- }, function (results) {
- complete(results);
- });
- },
- getType: function getType(rule) {
- if (rule.type === undefined && rule.pattern instanceof RegExp) {
- rule.type = 'pattern';
- }
- if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
- throw new Error(format('Unknown rule type %s', rule.type));
- }
- return rule.type || 'string';
- },
- getValidationMethod: function getValidationMethod(rule) {
- if (typeof rule.validator === 'function') {
- return rule.validator;
- }
- var keys = Object.keys(rule);
- var messageIndex = keys.indexOf('message');
- if (messageIndex !== -1) {
- keys.splice(messageIndex, 1);
- }
- if (keys.length === 1 && keys[0] === 'required') {
- return validators.required;
- }
- return validators[this.getType(rule)] || false;
- }
- };
- Schema.register = function register(type, validator) {
- if (typeof validator !== 'function') {
- throw new Error('Cannot register a validator by type, validator is not a function');
- }
- validators[type] = validator;
- };
- Schema.warning = warning;
- Schema.messages = messages;
- Schema.validators = validators;
- /* harmony default export */ __webpack_exports__["default"] = (Schema);
- //# sourceMappingURL=index.js.map
- /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(450)))
- /***/ }),
- /* 450 */
- /***/ (function(module, exports) {
- // shim for using process in browser
- var process = module.exports = {};
- // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
- var cachedSetTimeout;
- var cachedClearTimeout;
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- } ())
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
- function noop() {}
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
- process.listeners = function (name) { return [] }
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
- /***/ }),
- /* 451 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.label || _vm.$slots.label ? _c('label', { class: [_vm.prefixCls + '-label'], style: _vm.labelStyles, attrs: { "for": _vm.labelFor } }, [_vm._t("label", [_vm._v(_vm._s(_vm.label) + _vm._s(_vm.FormInstance.colon))])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'], style: _vm.contentStyles }, [_vm._t("default"), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_vm.validateState === 'error' && _vm.showMessage && _vm.FormInstance.showMessage ? _c('div', { class: [_vm.prefixCls + '-error-tip'] }, [_vm._v(_vm._s(_vm.validateMessage))]) : _vm._e()])], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 452 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _header = __webpack_require__(192);
- var _header2 = _interopRequireDefault(_header);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _header2.default;
- /***/ }),
- /* 453 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 454 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _input = __webpack_require__(38);
- var _input2 = _interopRequireDefault(_input);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _input2.default;
- /***/ }),
- /* 455 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _inputNumber = __webpack_require__(194);
- var _inputNumber2 = _interopRequireDefault(_inputNumber);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _inputNumber2.default;
- /***/ }),
- /* 456 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [!_vm.controlsOutside ? _c('div', { class: _vm.handlerClasses }, [_c('a', { class: _vm.upClasses, on: { "click": _vm.up } }, [_c('span', { class: _vm.innerUpClasses, on: { "click": _vm.preventDefault } })]), _vm._v(" "), _c('a', { class: _vm.downClasses, on: { "click": _vm.down } }, [_c('span', { class: _vm.innerDownClasses, on: { "click": _vm.preventDefault } })])]) : _vm._e(), _vm._v(" "), _vm.controlsOutside ? _c('div', { staticClass: "ivu-input-number-controls-outside-btn ivu-input-number-controls-outside-down", class: { 'ivu-input-number-controls-outside-btn-disabled': _vm.downDisabled }, on: { "click": _vm.down } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-remove" })]) : _vm._e(), _vm._v(" "), _vm.controlsOutside ? _c('div', { staticClass: "ivu-input-number-controls-outside-btn ivu-input-number-controls-outside-up", class: { 'ivu-input-number-controls-outside-btn-disabled': _vm.upDisabled }, on: { "click": _vm.up } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-add" })]) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.inputWrapClasses }, [_c('input', { class: _vm.inputClasses, attrs: { "id": _vm.elementId, "disabled": _vm.itemDisabled, "autocomplete": "off", "spellcheck": "false", "autofocus": _vm.autofocus, "readonly": _vm.readonly || !_vm.editable, "name": _vm.name, "placeholder": _vm.placeholder }, domProps: { "value": _vm.formatterValue }, on: { "focus": _vm.focus, "blur": _vm.blur, "keydown": function keydown($event) {
- $event.stopPropagation();return _vm.keyDown($event);
- }, "input": _vm.change, "mouseup": _vm.preventDefault, "change": _vm.change } })])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 457 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _scroll = __webpack_require__(458);
- var _scroll2 = _interopRequireDefault(_scroll);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _scroll2.default;
- /***/ }),
- /* 458 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__ = __webpack_require__(196);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__ = __webpack_require__(467);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 459 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(460), __esModule: true };
- /***/ }),
- /* 460 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(461);
- module.exports = __webpack_require__(5).Math.sign;
- /***/ }),
- /* 461 */
- /***/ (function(module, exports, __webpack_require__) {
- // 20.2.2.28 Math.sign(x)
- var $export = __webpack_require__(7);
- $export($export.S, 'Math', { sign: __webpack_require__(462) });
- /***/ }),
- /* 462 */
- /***/ (function(module, exports) {
- // 20.2.2.28 Math.sign(x)
- module.exports = Math.sign || function sign(x) {
- // eslint-disable-next-line no-self-compare
- return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
- };
- /***/ }),
- /* 463 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- /** Used as the `TypeError` message for "Functions" methods. */
- var FUNC_ERROR_TEXT = 'Expected a function';
- /** Used as references for various `Number` constants. */
- var NAN = 0 / 0;
- /** `Object#toString` result references. */
- var symbolTag = '[object Symbol]';
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g;
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
- /** Built-in method references without a dependency on `root`. */
- var freeParseInt = parseInt;
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objectToString = objectProto.toString;
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeMax = Math.max,
- nativeMin = Math.min;
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = function() {
- return root.Date.now();
- };
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- result = wait - timeSinceLastCall;
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
- }
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
- function trailingEdge(time) {
- timerId = undefined;
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
- }
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return !!value && typeof value == 'object';
- }
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
- }
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
- module.exports = throttle;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(117)))
- /***/ }),
- /* 464 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__ = __webpack_require__(197);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__ = __webpack_require__(466);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 465 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": "fade" } }, [_vm.fullscreenVisible ? _c('div', { class: _vm.classes }, [_c('div', { class: _vm.mainClasses }, [_c('span', { class: _vm.dotClasses }), _vm._v(" "), _c('div', { class: _vm.textClasses }, [_vm._t("default")], 2)])]) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 466 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapperClasses }, [_c('div', { class: _vm.spinnerClasses }, [_c('Spin', { attrs: { "fix": "" } }, [_c('Icon', { class: _vm.iconClasses, attrs: { "type": "ios-loading", "size": "18" } }), _vm._v(" "), _vm.text ? _c('div', { class: _vm.textClasses }, [_vm._v(_vm._s(_vm.text))]) : _vm._e()], 1)], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 467 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, staticStyle: { "touch-action": "none" } }, [_c('div', { ref: "scrollContainer", class: _vm.scrollContainerClasses, style: { height: _vm.height + 'px' }, on: { "scroll": _vm.handleScroll, "wheel": _vm.onWheel, "touchstart": _vm.onPointerDown } }, [_c('div', { ref: "toploader", class: _vm.loaderClasses, style: { paddingTop: _vm.wrapperPadding.paddingTop } }, [_c('loader', { attrs: { "text": _vm.localeLoadingText, "active": _vm.showTopLoader } })], 1), _vm._v(" "), _c('div', { ref: "scrollContent", class: _vm.slotContainerClasses }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "bottomLoader", class: _vm.loaderClasses, style: { paddingBottom: _vm.wrapperPadding.paddingBottom } }, [_c('loader', { attrs: { "text": _vm.localeLoadingText, "active": _vm.showBottomLoader } })], 1)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 468 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _split = __webpack_require__(469);
- var _split2 = _interopRequireDefault(_split);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _split2.default;
- /***/ }),
- /* 469 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__ = __webpack_require__(199);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__ = __webpack_require__(472);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 470 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__ = __webpack_require__(200);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__ = __webpack_require__(471);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 471 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { class: _vm.barConClasses }, _vm._m(0), 0)]);
- };
- var staticRenderFns = [function () {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm._l(8, function (i) {
- return _c('i', { key: "trigger-" + i, class: _vm.prefix + "-bar" });
- });
- }];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 472 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "outerWrapper", class: _vm.wrapperClasses }, [_vm.isHorizontal ? _c('div', { class: _vm.prefix + "-horizontal" }, [_c('div', { staticClass: "left-pane", class: _vm.paneClasses, style: { right: _vm.anotherOffset + "%" } }, [_vm._t("left")], 2), _vm._v(" "), _c('div', { class: _vm.prefix + "-trigger-con", style: { left: _vm.offset + "%" }, on: { "mousedown": _vm.handleMousedown } }, [_vm._t("trigger", [_c('trigger', { attrs: { "mode": "vertical" } })])], 2), _vm._v(" "), _c('div', { staticClass: "right-pane", class: _vm.paneClasses, style: { left: _vm.offset + "%" } }, [_vm._t("right")], 2)]) : _c('div', { class: _vm.prefix + "-vertical" }, [_c('div', { staticClass: "top-pane", class: _vm.paneClasses, style: { bottom: _vm.anotherOffset + "%" } }, [_vm._t("top")], 2), _vm._v(" "), _c('div', { class: _vm.prefix + "-trigger-con", style: { top: _vm.offset + "%" }, on: { "mousedown": _vm.handleMousedown } }, [_vm._t("trigger", [_c('trigger', { attrs: { "mode": "horizontal" } })])], 2), _vm._v(" "), _c('div', { staticClass: "bottom-pane", class: _vm.paneClasses, style: { top: _vm.offset + "%" } }, [_vm._t("bottom")], 2)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 473 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _layout = __webpack_require__(474);
- var _layout2 = _interopRequireDefault(_layout);
- var _header = __webpack_require__(192);
- var _header2 = _interopRequireDefault(_header);
- var _sider = __webpack_require__(202);
- var _sider2 = _interopRequireDefault(_sider);
- var _content = __webpack_require__(155);
- var _content2 = _interopRequireDefault(_content);
- var _footer = __webpack_require__(182);
- var _footer2 = _interopRequireDefault(_footer);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _layout2.default.Header = _header2.default;
- _layout2.default.Sider = _sider2.default;
- _layout2.default.Content = _content2.default;
- _layout2.default.Footer = _footer2.default;
- exports.default = _layout2.default;
- /***/ }),
- /* 474 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__ = __webpack_require__(201);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__ = __webpack_require__(475);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 475 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 476 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, style: _vm.wrapStyles }, [_c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.showZeroTrigger, expression: "showZeroTrigger" }], class: _vm.zeroWidthTriggerClasses, on: { "click": _vm.toggleCollapse } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-menu" })]), _vm._v(" "), _c('div', { class: _vm.childClasses }, [_vm._t("default")], 2), _vm._v(" "), _vm._t("trigger", [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showBottomTrigger, expression: "showBottomTrigger" }], class: _vm.triggerClasses, style: { width: _vm.siderWidth + 'px' }, on: { "click": _vm.toggleCollapse } }, [_c('i', { class: _vm.triggerIconClasses })])])], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 477 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _list = __webpack_require__(478);
- var _list2 = _interopRequireDefault(_list);
- var _listItem = __webpack_require__(480);
- var _listItem2 = _interopRequireDefault(_listItem);
- var _listItemMeta = __webpack_require__(482);
- var _listItemMeta2 = _interopRequireDefault(_listItemMeta);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _list2.default.Item = _listItem2.default;
- _list2.default.Item.Meta = _listItemMeta2.default;
- exports.default = _list2.default;
- /***/ }),
- /* 478 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__ = __webpack_require__(204);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__ = __webpack_require__(479);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 479 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.header || _vm.$slots.header ? _c('div', { staticClass: "ivu-list-header" }, [_vm._t("header", [_vm._v(_vm._s(_vm.header))])], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-container" }, [_c('ul', { staticClass: "ivu-list-items" }, [_vm._t("default")], 2)]), _vm._v(" "), _vm.loading ? _c('Spin', { attrs: { "fix": "", "size": "large" } }, [_vm._t("spin")], 2) : _vm._e(), _vm._v(" "), _vm.footer || _vm.$slots.footer ? _c('div', { staticClass: "ivu-list-footer" }, [_vm._t("footer", [_vm._v(_vm._s(_vm.footer))])], 2) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 480 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__ = __webpack_require__(205);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__ = __webpack_require__(481);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 481 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { staticClass: "ivu-list-item", class: _vm.classes }, [_vm.itemLayout === 'vertical' && _vm.$slots.extra ? [_c('div', { staticClass: "ivu-list-item-main" }, [_vm._t("default"), _vm._v(" "), _vm.$slots.action ? _c('ul', { staticClass: "ivu-list-item-action" }, [_vm._t("action")], 2) : _vm._e()], 2), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-extra" }, [_vm._t("extra")], 2)] : [_vm._t("default"), _vm._v(" "), _vm.$slots.action ? _c('ul', { staticClass: "ivu-list-item-action" }, [_vm._t("action")], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-extra" }, [_vm._t("extra")], 2)]], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 482 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__ = __webpack_require__(206);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__ = __webpack_require__(483);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 483 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-list-item-meta" }, [_vm.avatar || _vm.$slots.avatar ? _c('div', { staticClass: "ivu-list-item-meta-avatar" }, [_vm._t("avatar", [_c('Avatar', { attrs: { "src": _vm.avatar } })])], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-meta-content" }, [_vm.title || _vm.$slots.title ? _c('div', { staticClass: "ivu-list-item-meta-title" }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2) : _vm._e(), _vm._v(" "), _vm.description || _vm.$slots.description ? _c('div', { staticClass: "ivu-list-item-meta-description" }, [_vm._t("description", [_vm._v(_vm._s(_vm.description))])], 2) : _vm._e()])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 484 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _loadingBar = __webpack_require__(485);
- var _loadingBar2 = _interopRequireDefault(_loadingBar);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var loadingBarInstance = void 0;
- var color = 'primary';
- var duration = 800;
- var failedColor = 'error';
- var height = 2;
- var timer = void 0;
- function getLoadingBarInstance() {
- loadingBarInstance = loadingBarInstance || _loadingBar2.default.newInstance({
- color: color,
- failedColor: failedColor,
- height: height
- });
- return loadingBarInstance;
- }
- function _update(options) {
- var instance = getLoadingBarInstance();
- instance.update(options);
- }
- function hide() {
- var _this = this;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- _update({
- show: false
- });
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this);
- _update({
- percent: 0
- });
- }.bind(this), 200);
- }.bind(this), duration);
- }
- function clearTimer() {
- if (timer) {
- clearInterval(timer);
- timer = null;
- }
- }
- exports.default = {
- start: function start() {
- var _this2 = this;
- if (timer) return;
- var percent = 0;
- _update({
- percent: percent,
- status: 'success',
- show: true
- });
- timer = setInterval(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- percent += Math.floor(Math.random() * 3 + 1);
- if (percent > 95) {
- clearTimer();
- }
- _update({
- percent: percent,
- status: 'success',
- show: true
- });
- }.bind(this), 200);
- },
- update: function update(percent) {
- clearTimer();
- _update({
- percent: percent,
- status: 'success',
- show: true
- });
- },
- finish: function finish() {
- clearTimer();
- _update({
- percent: 100,
- status: 'success',
- show: true
- });
- hide();
- },
- error: function error() {
- clearTimer();
- _update({
- percent: 100,
- status: 'error',
- show: true
- });
- hide();
- },
- config: function config(options) {
- if (options.color) {
- color = options.color;
- }
- if (options.duration) {
- duration = options.duration;
- }
- if (options.failedColor) {
- failedColor = options.failedColor;
- }
- if (options.height) {
- height = options.height;
- }
- },
- destroy: function destroy() {
- clearTimer();
- var instance = getLoadingBarInstance();
- loadingBarInstance = null;
- instance.destroy();
- }
- };
- /***/ }),
- /* 485 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _loadingBar = __webpack_require__(486);
- var _loadingBar2 = _interopRequireDefault(_loadingBar);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _loadingBar2.default.newInstance = function (properties) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var _props = properties || {};
- var Instance = new _vue2.default({
- data: _props,
- render: function render(h) {
- return h(_loadingBar2.default, {
- props: _props
- });
- }
- });
- var component = Instance.$mount();
- document.body.appendChild(component.$el);
- var loading_bar = Instance.$children[0];
- return {
- update: function update(options) {
- if ('percent' in options) {
- loading_bar.percent = options.percent;
- }
- if (options.status) {
- loading_bar.status = options.status;
- }
- if ('show' in options) {
- loading_bar.show = options.show;
- }
- },
- component: loading_bar,
- destroy: function destroy() {
- document.body.removeChild(document.getElementsByClassName('ivu-loading-bar')[0]);
- }
- };
- }.bind(undefined);
- exports.default = _loadingBar2.default;
- /***/ }),
- /* 486 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__ = __webpack_require__(207);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__ = __webpack_require__(487);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 487 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.show, expression: "show" }], class: _vm.classes, style: _vm.outerStyles }, [_c('div', { class: _vm.innerClasses, style: _vm.styles })])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 488 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _menu = __webpack_require__(489);
- var _menu2 = _interopRequireDefault(_menu);
- var _menuGroup = __webpack_require__(491);
- var _menuGroup2 = _interopRequireDefault(_menuGroup);
- var _menuItem = __webpack_require__(493);
- var _menuItem2 = _interopRequireDefault(_menuItem);
- var _submenu = __webpack_require__(495);
- var _submenu2 = _interopRequireDefault(_submenu);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _menu2.default.Group = _menuGroup2.default;
- _menu2.default.Item = _menuItem2.default;
- _menu2.default.Sub = _submenu2.default;
- exports.default = _menu2.default;
- /***/ }),
- /* 489 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__ = __webpack_require__(208);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__ = __webpack_require__(490);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 490 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 491 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__ = __webpack_require__(209);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__ = __webpack_require__(492);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 492 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: [_vm.prefixCls + '-item-group'] }, [_c('div', { class: [_vm.prefixCls + '-item-group-title'], style: _vm.groupStyle }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c('ul', [_vm._t("default")], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 493 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__ = __webpack_require__(210);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__ = __webpack_require__(494);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 494 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.to ? _c('a', { class: _vm.classes, style: _vm.itemStyle, attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
- if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
- return null;
- }return _vm.handleClickItem($event, false);
- }, function ($event) {
- if (!$event.ctrlKey) {
- return null;
- }return _vm.handleClickItem($event, true);
- }, function ($event) {
- if (!$event.metaKey) {
- return null;
- }return _vm.handleClickItem($event, true);
- }] } }, [_vm._t("default")], 2) : _c('li', { class: _vm.classes, style: _vm.itemStyle, on: { "click": function click($event) {
- $event.stopPropagation();return _vm.handleClickItem($event);
- } } }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 495 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__ = __webpack_require__(211);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__ = __webpack_require__(496);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 496 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-submenu-title'], style: _vm.titleStyle, on: { "click": function click($event) {
- $event.stopPropagation();return _vm.handleClick($event);
- } } }, [_vm._t("title"), _vm._v(" "), _c('Icon', { class: [_vm.prefixCls + '-submenu-title-icon'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })], 2), _vm._v(" "), _vm.mode === 'vertical' ? _c('collapse-transition', [_c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }], class: [_vm.prefixCls] }, [_vm._t("default")], 2)]) : _c('transition', { attrs: { "name": "slide-up" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }], ref: "drop", style: _vm.dropStyle, attrs: { "placement": "bottom" } }, [_c('ul', { class: [_vm.prefixCls + '-drop-list'] }, [_vm._t("default")], 2)])], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 497 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _notification = __webpack_require__(212);
- var _notification2 = _interopRequireDefault(_notification);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-message';
- var iconPrefixCls = 'ivu-icon';
- var prefixKey = 'ivu_message_key_';
- var defaults = {
- top: 24,
- duration: 1.5
- };
- var messageInstance = void 0;
- var name = 1;
- var iconTypes = {
- 'info': 'ios-information-circle',
- 'success': 'ios-checkmark-circle',
- 'warning': 'ios-alert',
- 'error': 'ios-close-circle',
- 'loading': 'ios-loading'
- };
- function getMessageInstance() {
- messageInstance = messageInstance || _notification2.default.newInstance({
- prefixCls: prefixCls,
- styles: {
- top: String(defaults.top) + 'px'
- }
- });
- return messageInstance;
- }
- function notice() {
- var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaults.duration;
- var type = arguments[2];
- var onClose = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
- var closable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- var render = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function () {};
- var background = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
- var iconType = iconTypes[type];
- var loadCls = type === 'loading' ? ' ivu-load-loop' : '';
- var instance = getMessageInstance();
- instance.notice({
- name: '' + prefixKey + name,
- duration: duration,
- styles: {},
- transitionName: 'move-up',
- content: '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-' + String(type) + '">\n <i class="' + iconPrefixCls + ' ' + iconPrefixCls + '-' + String(iconType) + ' ' + loadCls + '"></i>\n <span>' + String(content) + '</span>\n </div>\n ',
- render: render,
- onClose: onClose,
- closable: closable,
- type: 'message',
- msgType: type,
- background: background
- });
- return function () {
- var target = name++;
- return function () {
- instance.remove('' + prefixKey + target);
- };
- }();
- }
- exports.default = {
- name: 'Message',
- info: function info(options) {
- return this.message('info', options);
- },
- success: function success(options) {
- return this.message('success', options);
- },
- warning: function warning(options) {
- return this.message('warning', options);
- },
- error: function error(options) {
- return this.message('error', options);
- },
- loading: function loading(options) {
- return this.message('loading', options);
- },
- message: function message(type, options) {
- if (typeof options === 'string') {
- options = {
- content: options
- };
- }
- return notice(options.content, options.duration, type, options.onClose, options.closable, options.render, options.background);
- },
- config: function config(options) {
- if (options.top || options.top === 0) {
- defaults.top = options.top;
- }
- if (options.duration || options.duration === 0) {
- defaults.duration = options.duration;
- }
- },
- destroy: function destroy() {
- var instance = getMessageInstance();
- messageInstance = null;
- instance.destroy('ivu-message');
- }
- };
- /***/ }),
- /* 498 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__ = __webpack_require__(213);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__ = __webpack_require__(501);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 499 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__ = __webpack_require__(214);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__ = __webpack_require__(500);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 500 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": _vm.transitionName, "appear": "" }, on: { "enter": _vm.handleEnter, "leave": _vm.handleLeave } }, [_c('div', { class: _vm.classes, style: _vm.styles }, [_vm.type === 'notice' ? [_c('div', { ref: "content", class: _vm.contentClasses, domProps: { "innerHTML": _vm._s(_vm.content) } }), _vm._v(" "), _c('div', { class: _vm.contentWithIcon }, [_c('render-cell', { attrs: { "render": _vm.renderFunc } })], 1), _vm._v(" "), _vm.closable ? _c('a', { class: [_vm.baseClass + '-close'], on: { "click": _vm.close } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-close" })]) : _vm._e()] : _vm._e(), _vm._v(" "), _vm.type === 'message' ? [_c('div', { ref: "content", class: _vm.messageContentClasses }, [_c('div', { class: [_vm.baseClass + '-content-text'], domProps: { "innerHTML": _vm._s(_vm.content) } }), _vm._v(" "), _c('div', { class: [_vm.baseClass + '-content-text'] }, [_c('render-cell', { attrs: { "render": _vm.renderFunc } })], 1), _vm._v(" "), _vm.closable ? _c('a', { class: [_vm.baseClass + '-close'], on: { "click": _vm.close } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-close" })]) : _vm._e()])] : _vm._e()], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 501 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.wrapStyles }, _vm._l(_vm.notices, function (notice) {
- return _c('Notice', { key: notice.name, attrs: { "prefix-cls": _vm.prefixCls, "styles": notice.styles, "type": notice.type, "content": notice.content, "duration": notice.duration, "render": notice.render, "has-title": notice.hasTitle, "withIcon": notice.withIcon, "closable": notice.closable, "name": notice.name, "transition-name": notice.transitionName, "background": notice.background, "msg-type": notice.msgType, "on-close": notice.onClose } });
- }), 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 502 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _confirm = __webpack_require__(503);
- var _confirm2 = _interopRequireDefault(_confirm);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var modalInstance = void 0;
- function getModalInstance() {
- var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
- var lockScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- modalInstance = modalInstance || _confirm2.default.newInstance({
- closable: false,
- maskClosable: false,
- footerHide: true,
- render: render,
- lockScroll: lockScroll
- });
- return modalInstance;
- }
- function confirm(options) {
- var render = 'render' in options ? options.render : undefined;
- var lockScroll = 'lockScroll' in options ? options.lockScroll : true;
- var instance = getModalInstance(render, lockScroll);
- options.onRemove = function () {
- modalInstance = null;
- };
- instance.show(options);
- }
- _confirm2.default.info = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- props.icon = 'info';
- props.showCancel = false;
- return confirm(props);
- };
- _confirm2.default.success = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- props.icon = 'success';
- props.showCancel = false;
- return confirm(props);
- };
- _confirm2.default.warning = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- props.icon = 'warning';
- props.showCancel = false;
- return confirm(props);
- };
- _confirm2.default.error = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- props.icon = 'error';
- props.showCancel = false;
- return confirm(props);
- };
- _confirm2.default.confirm = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- props.icon = 'confirm';
- props.showCancel = true;
- return confirm(props);
- };
- _confirm2.default.remove = function () {
- if (!modalInstance) {
- return false;
- }
- var instance = getModalInstance();
- instance.remove();
- };
- exports.default = _confirm2.default;
- /***/ }),
- /* 503 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- var _modal = __webpack_require__(504);
- var _modal2 = _interopRequireDefault(_modal);
- var _button = __webpack_require__(28);
- var _button2 = _interopRequireDefault(_button);
- var _locale = __webpack_require__(6);
- var _locale2 = _interopRequireDefault(_locale);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-modal-confirm';
- _modal2.default.newInstance = function (properties) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var _props = properties || {};
- var Instance = new _vue2.default({
- mixins: [_locale2.default],
- data: (0, _assign2.default)({}, _props, {
- visible: false,
- width: 416,
- title: '',
- body: '',
- iconType: '',
- iconName: '',
- okText: undefined,
- cancelText: undefined,
- showCancel: false,
- loading: false,
- buttonLoading: false,
- scrollable: false,
- closable: false,
- closing: false }),
- render: function render(h) {
- var _this = this;
- var footerVNodes = [];
- if (this.showCancel) {
- footerVNodes.push(h(_button2.default, {
- props: {
- type: 'text'
- },
- on: {
- click: this.cancel
- }
- }, this.localeCancelText));
- }
- footerVNodes.push(h(_button2.default, {
- props: {
- type: 'primary',
- loading: this.buttonLoading
- },
- on: {
- click: this.ok
- }
- }, this.localeOkText));
- var body_render = void 0;
- if (this.render) {
- body_render = h('div', {
- attrs: {
- class: prefixCls + '-body ' + prefixCls + '-body-render'
- }
- }, [this.render(h)]);
- } else {
- body_render = h('div', {
- attrs: {
- class: prefixCls + '-body'
- }
- }, [h('div', {
- domProps: {
- innerHTML: this.body
- }
- })]);
- }
- var head_render = void 0;
- if (this.title) {
- head_render = h('div', {
- attrs: {
- class: prefixCls + '-head'
- }
- }, [h('div', {
- class: this.iconTypeCls
- }, [h('i', {
- class: this.iconNameCls
- })]), h('div', {
- attrs: {
- class: prefixCls + '-head-title'
- },
- domProps: {
- innerHTML: this.title
- }
- })]);
- }
- return h(_modal2.default, {
- props: (0, _assign2.default)({}, _props, {
- width: this.width,
- scrollable: this.scrollable,
- closable: this.closable
- }),
- domProps: {
- value: this.visible
- },
- on: {
- input: function input(status) {
- (0, _newArrowCheck3.default)(this, _this);
- this.visible = status;
- }.bind(this),
- 'on-cancel': this.cancel
- }
- }, [h('div', {
- attrs: {
- class: prefixCls
- }
- }, [head_render, body_render, h('div', {
- attrs: {
- class: prefixCls + '-footer'
- }
- }, footerVNodes)])]);
- },
- computed: {
- iconTypeCls: function iconTypeCls() {
- return [prefixCls + '-head-icon', prefixCls + '-head-icon-' + String(this.iconType)];
- },
- iconNameCls: function iconNameCls() {
- return ['ivu-icon', 'ivu-icon-' + String(this.iconName)];
- },
- localeOkText: function localeOkText() {
- if (this.okText) {
- return this.okText;
- } else {
- return this.t('i.modal.okText');
- }
- },
- localeCancelText: function localeCancelText() {
- if (this.cancelText) {
- return this.cancelText;
- } else {
- return this.t('i.modal.cancelText');
- }
- }
- },
- methods: {
- cancel: function cancel() {
- if (this.closing) return;
- this.$children[0].visible = false;
- this.buttonLoading = false;
- this.onCancel();
- this.remove();
- },
- ok: function ok() {
- if (this.closing) return;
- if (this.loading) {
- this.buttonLoading = true;
- } else {
- this.$children[0].visible = false;
- this.remove();
- }
- this.onOk();
- },
- remove: function remove() {
- var _this2 = this;
- this.closing = true;
- setTimeout(function () {
- (0, _newArrowCheck3.default)(this, _this2);
- this.closing = false;
- this.destroy();
- }.bind(this), 300);
- },
- destroy: function destroy() {
- this.$destroy();
- if (this.$el) document.body.removeChild(this.$el);
- this.onRemove();
- },
- onOk: function onOk() {},
- onCancel: function onCancel() {},
- onRemove: function onRemove() {}
- }
- });
- var component = Instance.$mount();
- document.body.appendChild(component.$el);
- var modal = Instance.$children[0];
- return {
- show: function show(props) {
- modal.$parent.showCancel = props.showCancel;
- modal.$parent.iconType = props.icon;
- switch (props.icon) {
- case 'info':
- modal.$parent.iconName = 'ios-information-circle';
- break;
- case 'success':
- modal.$parent.iconName = 'ios-checkmark-circle';
- break;
- case 'warning':
- modal.$parent.iconName = 'ios-alert';
- break;
- case 'error':
- modal.$parent.iconName = 'ios-close-circle';
- break;
- case 'confirm':
- modal.$parent.iconName = 'ios-help-circle';
- break;
- }
- if ('width' in props) {
- modal.$parent.width = props.width;
- }
- if ('closable' in props) {
- modal.$parent.closable = props.closable;
- }
- if ('title' in props) {
- modal.$parent.title = props.title;
- }
- if ('content' in props) {
- modal.$parent.body = props.content;
- }
- if ('okText' in props) {
- modal.$parent.okText = props.okText;
- }
- if ('cancelText' in props) {
- modal.$parent.cancelText = props.cancelText;
- }
- if ('onCancel' in props) {
- modal.$parent.onCancel = props.onCancel;
- }
- if ('onOk' in props) {
- modal.$parent.onOk = props.onOk;
- }
- if ('loading' in props) {
- modal.$parent.loading = props.loading;
- }
- if ('scrollable' in props) {
- modal.$parent.scrollable = props.scrollable;
- }
- modal.$parent.onRemove = props.onRemove;
- modal.visible = true;
- },
- remove: function remove() {
- modal.visible = false;
- modal.$parent.buttonLoading = false;
- modal.$parent.remove();
- },
- component: modal
- };
- }.bind(undefined);
- exports.default = _modal2.default;
- /***/ }),
- /* 504 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__ = __webpack_require__(216);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__ = __webpack_require__(505);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 505 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }], attrs: { "data-transfer": _vm.transfer } }, [_c('transition', { attrs: { "name": _vm.transitionNames[1] } }, [_vm.showMask ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.maskClasses, style: _vm.wrapStyles, on: { "click": _vm.handleMask } }) : _vm._e()]), _vm._v(" "), _c('div', { class: _vm.wrapClasses, style: _vm.wrapStyles, on: { "click": _vm.handleWrapClick } }, [_c('transition', { attrs: { "name": _vm.transitionNames[0] }, on: { "after-leave": _vm.animationFinish } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.classes, style: _vm.mainStyles, on: { "mousedown": _vm.handleMousedown } }, [_c('div', { ref: "content", class: _vm.contentClasses, style: _vm.contentStyles, on: { "click": _vm.handleClickModal } }, [_vm.closable ? _c('a', { class: [_vm.prefixCls + '-close'], on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e(), _vm._v(" "), _vm.showHead ? _c('div', { class: [_vm.prefixCls + '-header'], on: { "mousedown": _vm.handleMoveStart } }, [_vm._t("header", [_c('div', { class: [_vm.prefixCls + '-header-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'] }, [_vm._t("default")], 2), _vm._v(" "), !_vm.footerHide ? _c('div', { class: [_vm.prefixCls + '-footer'] }, [_vm._t("footer", [_c('i-button', { attrs: { "type": "text" }, nativeOn: { "click": function click($event) {
- return _vm.cancel($event);
- } } }, [_vm._v(_vm._s(_vm.localeCancelText))]), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "loading": _vm.buttonLoading }, nativeOn: { "click": function click($event) {
- return _vm.ok($event);
- } } }, [_vm._v(_vm._s(_vm.localeOkText))])])], 2) : _vm._e()])])])], 1)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 506 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _notification = __webpack_require__(212);
- var _notification2 = _interopRequireDefault(_notification);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var prefixCls = 'ivu-notice';
- var iconPrefixCls = 'ivu-icon';
- var prefixKey = 'ivu_notice_key_';
- var top = 24;
- var defaultDuration = 4.5;
- var noticeInstance = void 0;
- var name = 1;
- var iconTypes = {
- 'info': 'ios-information-circle',
- 'success': 'ios-checkmark-circle',
- 'warning': 'ios-alert',
- 'error': 'ios-close-circle'
- };
- function getNoticeInstance() {
- noticeInstance = noticeInstance || _notification2.default.newInstance({
- prefixCls: prefixCls,
- styles: {
- top: top + 'px',
- right: 0
- }
- });
- return noticeInstance;
- }
- function notice(type, options) {
- var title = options.title || '';
- var desc = options.desc || '';
- var noticeKey = options.name || '' + prefixKey + name;
- var onClose = options.onClose || function () {};
- var render = options.render;
- var duration = options.duration === 0 ? 0 : options.duration || defaultDuration;
- name++;
- var instance = getNoticeInstance();
- var content = void 0;
- var withIcon = void 0;
- var with_desc = options.render && !title ? '' : desc || options.render ? ' ' + prefixCls + '-with-desc' : '';
- if (type == 'normal') {
- withIcon = false;
- content = '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-with-normal ' + with_desc + '">\n <div class="' + prefixCls + '-title">' + String(title) + '</div>\n <div class="' + prefixCls + '-desc">' + String(desc) + '</div>\n </div>\n ';
- } else {
- var iconType = iconTypes[type];
- var outlineIcon = with_desc === '' ? '' : '-outline';
- withIcon = true;
- content = '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-with-icon ' + prefixCls + '-with-' + String(type) + ' ' + with_desc + '">\n <span class="' + prefixCls + '-icon ' + prefixCls + '-icon-' + String(type) + '">\n <i class="' + iconPrefixCls + ' ' + iconPrefixCls + '-' + String(iconType) + outlineIcon + '"></i>\n </span>\n <div class="' + prefixCls + '-title">' + String(title) + '</div>\n <div class="' + prefixCls + '-desc">' + String(desc) + '</div>\n </div>\n ';
- }
- instance.notice({
- name: noticeKey.toString(),
- duration: duration,
- styles: {},
- transitionName: 'move-notice',
- content: content,
- withIcon: withIcon,
- render: render,
- hasTitle: !!title,
- onClose: onClose,
- closable: true,
- type: 'notice'
- });
- }
- exports.default = {
- open: function open(options) {
- return notice('normal', options);
- },
- info: function info(options) {
- return notice('info', options);
- },
- success: function success(options) {
- return notice('success', options);
- },
- warning: function warning(options) {
- return notice('warning', options);
- },
- error: function error(options) {
- return notice('error', options);
- },
- config: function config(options) {
- if (options.top) {
- top = options.top;
- }
- if (options.duration || options.duration === 0) {
- defaultDuration = options.duration;
- }
- },
- close: function close(name) {
- if (name) {
- name = name.toString();
- if (noticeInstance) {
- noticeInstance.remove(name);
- }
- } else {
- return false;
- }
- },
- destroy: function destroy() {
- var instance = getNoticeInstance();
- noticeInstance = null;
- instance.destroy('ivu-notice');
- }
- };
- /***/ }),
- /* 507 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _page = __webpack_require__(508);
- var _page2 = _interopRequireDefault(_page);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _page2.default;
- /***/ }),
- /* 508 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__ = __webpack_require__(217);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__ = __webpack_require__(511);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 509 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__ = __webpack_require__(218);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__ = __webpack_require__(510);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 510 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.showSizer || _vm.showElevator ? _c('div', { class: _vm.optsClasses }, [_vm.showSizer ? _c('div', { class: _vm.sizerClasses }, [_c('i-select', { attrs: { "size": _vm.size, "placement": _vm.placement, "transfer": _vm.transfer, "disabled": _vm.disabled, "eventsEnabled": _vm.eventsEnabled }, on: { "on-change": _vm.changeSize }, model: { value: _vm.currentPageSize, callback: function callback($$v) {
- _vm.currentPageSize = $$v;
- }, expression: "currentPageSize" } }, _vm._l(_vm.pageSizeOpts, function (item) {
- return _c('i-option', { key: item, staticStyle: { "text-align": "center" }, attrs: { "value": item } }, [_vm._v(_vm._s(item) + " " + _vm._s(_vm.t('i.page.page')))]);
- }), 1)], 1) : _vm._e(), _vm._v(" "), _vm.showElevator ? _c('div', { class: _vm.ElevatorClasses }, [_vm._v("\n " + _vm._s(_vm.t('i.page.goto')) + "\n "), _c('input', { attrs: { "type": "text", "autocomplete": "off", "spellcheck": "false", "disabled": _vm.disabled }, domProps: { "value": _vm._current }, on: { "keyup": function keyup($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
- return null;
- }return _vm.changePage($event);
- } } }), _vm._v("\n " + _vm._s(_vm.t('i.page.p')) + "\n ")]) : _vm._e()]) : _vm._e();
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 511 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.simple ? _c('ul', { class: _vm.simpleWrapClasses, style: _vm.styles }, [_c('li', { class: _vm.prevClasses, attrs: { "title": _vm.t('i.page.prev') }, on: { "click": _vm.prev } }, [_vm._m(0)]), _vm._v(" "), _c('div', { class: _vm.simplePagerClasses, attrs: { "title": _vm.currentPage + '/' + _vm.allPages } }, [_c('input', { attrs: { "type": "text", "autocomplete": "off", "spellcheck": "false", "disabled": _vm.disabled }, domProps: { "value": _vm.currentPage }, on: { "keydown": _vm.keyDown, "keyup": _vm.keyUp, "change": _vm.keyUp } }), _vm._v(" "), _c('span', [_vm._v("/")]), _vm._v("\n " + _vm._s(_vm.allPages) + "\n ")]), _vm._v(" "), _c('li', { class: _vm.nextClasses, attrs: { "title": _vm.t('i.page.next') }, on: { "click": _vm.next } }, [_vm._m(1)])]) : _c('ul', { class: _vm.wrapClasses, style: _vm.styles }, [_vm.showTotal ? _c('span', { class: [_vm.prefixCls + '-total'] }, [_vm._t("default", [_vm._v(_vm._s(_vm.t('i.page.total')) + " " + _vm._s(_vm.total) + " "), _vm.total <= 1 ? [_vm._v(_vm._s(_vm.t('i.page.item')))] : [_vm._v(_vm._s(_vm.t('i.page.items')))]])], 2) : _vm._e(), _vm._v(" "), _c('li', { class: _vm.prevClasses, attrs: { "title": _vm.t('i.page.prev') }, on: { "click": _vm.prev } }, [_c('a', [_vm.prevText !== '' ? [_vm._v(_vm._s(_vm.prevText))] : _c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" })], 2)]), _vm._v(" "), _c('li', { class: _vm.firstPageClasses, attrs: { "title": "1" }, on: { "click": function click($event) {
- return _vm.changePage(1);
- } } }, [_c('a', [_vm._v("1")])]), _vm._v(" "), _vm.currentPage > 5 ? _c('li', { class: [_vm.prefixCls + '-item-jump-prev'], attrs: { "title": _vm.t('i.page.prev5') }, on: { "click": _vm.fastPrev } }, [_vm._m(2)]) : _vm._e(), _vm._v(" "), _vm.currentPage === 5 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 3 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage - 3);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 3))])]) : _vm._e(), _vm._v(" "), _vm.currentPage - 2 > 1 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 2 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage - 2);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 2))])]) : _vm._e(), _vm._v(" "), _vm.currentPage - 1 > 1 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 1 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage - 1);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 1))])]) : _vm._e(), _vm._v(" "), _vm.currentPage != 1 && _vm.currentPage != _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item', _vm.prefixCls + '-item-active'], attrs: { "title": _vm.currentPage } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage))])]) : _vm._e(), _vm._v(" "), _vm.currentPage + 1 < _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 1 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage + 1);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 1))])]) : _vm._e(), _vm._v(" "), _vm.currentPage + 2 < _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 2 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage + 2);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 2))])]) : _vm._e(), _vm._v(" "), _vm.allPages - _vm.currentPage === 4 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 3 }, on: { "click": function click($event) {
- return _vm.changePage(_vm.currentPage + 3);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 3))])]) : _vm._e(), _vm._v(" "), _vm.allPages - _vm.currentPage >= 5 ? _c('li', { class: [_vm.prefixCls + '-item-jump-next'], attrs: { "title": _vm.t('i.page.next5') }, on: { "click": _vm.fastNext } }, [_vm._m(3)]) : _vm._e(), _vm._v(" "), _vm.allPages > 1 ? _c('li', { class: _vm.lastPageClasses, attrs: { "title": _vm.allPages }, on: { "click": function click($event) {
- return _vm.changePage(_vm.allPages);
- } } }, [_c('a', [_vm._v(_vm._s(_vm.allPages))])]) : _vm._e(), _vm._v(" "), _c('li', { class: _vm.nextClasses, attrs: { "title": _vm.t('i.page.next') }, on: { "click": _vm.next } }, [_c('a', [_vm.nextText !== '' ? [_vm._v(_vm._s(_vm.nextText))] : _c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" })], 2)]), _vm._v(" "), _c('Options', { attrs: { "show-sizer": _vm.showSizer, "page-size": _vm.currentPageSize, "page-size-opts": _vm.pageSizeOpts, "placement": _vm.placement, "transfer": _vm.transfer, "show-elevator": _vm.showElevator, "_current": _vm.currentPage, "current": _vm.currentPage, "disabled": _vm.disabled, "all-pages": _vm.allPages, "is-small": _vm.isSmall, "eventsEnabled": _vm.eventsEnabled }, on: { "on-size": _vm.onSize, "on-page": _vm.onPage } })], 1);
- };
- var staticRenderFns = [function () {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" })]);
- }, function () {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" })]);
- }, function () {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" }), _c('i', { staticClass: "ivu-icon ivu-icon-ios-more" })]);
- }, function () {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" }), _c('i', { staticClass: "ivu-icon ivu-icon-ios-more" })]);
- }];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 512 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _poptip = __webpack_require__(219);
- var _poptip2 = _interopRequireDefault(_poptip);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _poptip2.default;
- /***/ }),
- /* 513 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.handleClose, expression: "handleClose" }], class: _vm.classes, on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'], on: { "click": _vm.handleClick, "mousedown": function mousedown($event) {
- return _vm.handleFocus(false);
- }, "mouseup": function mouseup($event) {
- return _vm.handleBlur(false);
- } } }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "popper", class: _vm.popperClasses, style: _vm.styles, attrs: { "data-transfer": _vm.transfer }, on: { "click": _vm.handleTransferClick, "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { class: [_vm.prefixCls + '-content'] }, [_c('div', { class: [_vm.prefixCls + '-arrow'] }), _vm._v(" "), _vm.confirm ? _c('div', { class: [_vm.prefixCls + '-inner'] }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-help-circle" }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body-message'] }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2)]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-footer'] }, [_c('i-button', { attrs: { "type": "text", "size": "small" }, nativeOn: { "click": function click($event) {
- return _vm.cancel($event);
- } } }, [_vm._v(_vm._s(_vm.localeCancelText))]), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small" }, nativeOn: { "click": function click($event) {
- return _vm.ok($event);
- } } }, [_vm._v(_vm._s(_vm.localeOkText))])], 1)]) : _vm._e(), _vm._v(" "), !_vm.confirm ? _c('div', { class: [_vm.prefixCls + '-inner'] }, [_vm.showTitle ? _c('div', { ref: "title", class: [_vm.prefixCls + '-title'], style: _vm.contentPaddingStyle }, [_vm._t("title", [_c('div', { class: [_vm.prefixCls + '-title-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'], style: _vm.contentPaddingStyle }, [_c('div', { class: _vm.contentClasses }, [_vm._t("content", [_c('div', { class: [_vm.prefixCls + '-body-content-inner'] }, [_vm._v(_vm._s(_vm.content))])])], 2)])]) : _vm._e()])])])], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 514 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _progress = __webpack_require__(222);
- var _progress2 = _interopRequireDefault(_progress);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _progress2.default;
- /***/ }),
- /* 515 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_c('div', { class: _vm.outerClasses }, [_c('div', { class: _vm.innerClasses }, [_c('div', { class: _vm.bgClasses, style: _vm.bgStyle }, [_vm.textInside ? _c('div', { staticClass: "ivu-progress-inner-text" }, [_vm._v(_vm._s(_vm.percent) + "%")]) : _vm._e()]), _c('div', { class: _vm.successBgClasses, style: _vm.successBgStyle })])]), _vm._v(" "), !_vm.hideInfo && !_vm.textInside ? _c('span', { class: _vm.textClasses }, [_vm._t("default", [_vm.isStatus ? _c('span', { class: _vm.textInnerClasses }, [_c('Icon', { attrs: { "type": _vm.statusIcon } })], 1) : _c('span', { class: _vm.textInnerClasses }, [_vm._v("\n " + _vm._s(_vm.percent) + "%\n ")])])], 2) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 516 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _radio = __webpack_require__(517);
- var _radio2 = _interopRequireDefault(_radio);
- var _radioGroup = __webpack_require__(519);
- var _radioGroup2 = _interopRequireDefault(_radioGroup);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _radio2.default.Group = _radioGroup2.default;
- exports.default = _radio2.default;
- /***/ }),
- /* 517 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__ = __webpack_require__(224);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__ = __webpack_require__(518);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 518 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('label', { class: _vm.wrapClasses }, [_c('span', { class: _vm.radioClasses }, [_c('span', { class: _vm.innerClasses }), _vm._v(" "), _c('input', { class: _vm.inputClasses, attrs: { "type": "radio", "disabled": _vm.itemDisabled, "name": _vm.groupName }, domProps: { "checked": _vm.currentValue }, on: { "change": _vm.change, "focus": _vm.onFocus, "blur": _vm.onBlur } })]), _vm._t("default", [_vm._v(_vm._s(_vm.label))])], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 519 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__ = __webpack_require__(225);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__ = __webpack_require__(520);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 520 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, attrs: { "name": _vm.name } }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 521 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _rate = __webpack_require__(522);
- var _rate2 = _interopRequireDefault(_rate);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _rate2.default;
- /***/ }),
- /* 522 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__ = __webpack_require__(226);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__ = __webpack_require__(523);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 523 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mouseleave": _vm.handleMouseleave } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _vm._l(_vm.count, function (item) {
- return _c('div', { key: item, class: _vm.starCls(item), on: { "mousemove": function mousemove($event) {
- return _vm.handleMousemove(item, $event);
- }, "click": function click($event) {
- return _vm.handleClick(item);
- } } }, [!_vm.showCharacter ? [_c('span', { class: [_vm.prefixCls + '-star-content'], attrs: { "type": "half" } })] : [_c('span', { class: [_vm.prefixCls + '-star-first'], attrs: { "type": "half" } }, [_vm.character !== '' ? [_vm._v(_vm._s(_vm.character))] : _c('i', { class: _vm.iconClasses, attrs: { "type": "half" } })], 2), _vm._v(" "), _c('span', { class: [_vm.prefixCls + '-star-second'] }, [_vm.character !== '' ? [_vm._v(_vm._s(_vm.character))] : _c('i', { class: _vm.iconClasses })], 2)]], 2);
- }), _vm._v(" "), _vm.showText ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentValue > 0, expression: "currentValue > 0" }], class: [_vm.prefixCls + '-text'] }, [_vm._t("default", [_c('span', [_vm._v(_vm._s(_vm.currentValue))]), _vm._v(" "), _vm.currentValue <= 1 ? _c('span', [_vm._v(_vm._s(_vm.t('i.rate.star')))]) : _c('span', [_vm._v(_vm._s(_vm.t('i.rate.stars')))])])], 2) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 524 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _sider = __webpack_require__(202);
- var _sider2 = _interopRequireDefault(_sider);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _sider2.default;
- /***/ }),
- /* 525 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _slider = __webpack_require__(526);
- var _slider2 = _interopRequireDefault(_slider);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _slider2.default;
- /***/ }),
- /* 526 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__ = __webpack_require__(227);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__ = __webpack_require__(539);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 527 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls], on: { "mouseenter": _vm.handleShowPopper, "mouseleave": _vm.handleClosePopper } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'] }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.disabled && (_vm.visible || _vm.always), expression: "!disabled && (visible || always)" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "popper", class: _vm.dropdownCls, style: _vm.dropStyles, attrs: { "data-transfer": _vm.transfer }, on: { "mouseenter": _vm.handleShowPopper, "mouseleave": _vm.handleClosePopper } }, [_c('div', { class: [_vm.prefixCls + '-content'] }, [_c('div', { class: [_vm.prefixCls + '-arrow'] }), _vm._v(" "), _c('div', { class: _vm.innerClasses, style: _vm.innerStyles }, [_vm._t("content", [_vm._v(_vm._s(_vm.content))])], 2)])])])], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 528 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = {
- name: 'SliderMarker',
- props: {
- mark: {
- type: [String, Object]
- }
- },
- render: function render(h) {
- var label = typeof this.mark === 'string' ? this.mark : [this.mark.label];
- return h('div', {
- class: 'ivu-slider-marks-item',
- style: this.mark.style || {}
- }, label);
- }
- };
- /***/ }),
- /* 529 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function(options) {
- var getState = options.stateHandler.getState;
- /**
- * Tells if the element has been made detectable and ready to be listened for resize events.
- * @public
- * @param {element} The element to check.
- * @returns {boolean} True or false depending on if the element is detectable or not.
- */
- function isDetectable(element) {
- var state = getState(element);
- return state && !!state.isDetectable;
- }
- /**
- * Marks the element that it has been made detectable and ready to be listened for resize events.
- * @public
- * @param {element} The element to mark.
- */
- function markAsDetectable(element) {
- getState(element).isDetectable = true;
- }
- /**
- * Tells if the element is busy or not.
- * @public
- * @param {element} The element to check.
- * @returns {boolean} True or false depending on if the element is busy or not.
- */
- function isBusy(element) {
- return !!getState(element).busy;
- }
- /**
- * Marks the object is busy and should not be made detectable.
- * @public
- * @param {element} element The element to mark.
- * @param {boolean} busy If the element is busy or not.
- */
- function markBusy(element, busy) {
- getState(element).busy = !!busy;
- }
- return {
- isDetectable: isDetectable,
- markAsDetectable: markAsDetectable,
- isBusy: isBusy,
- markBusy: markBusy
- };
- };
- /***/ }),
- /* 530 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function(idHandler) {
- var eventListeners = {};
- /**
- * Gets all listeners for the given element.
- * @public
- * @param {element} element The element to get all listeners for.
- * @returns All listeners for the given element.
- */
- function getListeners(element) {
- var id = idHandler.get(element);
- if (id === undefined) {
- return [];
- }
- return eventListeners[id] || [];
- }
- /**
- * Stores the given listener for the given element. Will not actually add the listener to the element.
- * @public
- * @param {element} element The element that should have the listener added.
- * @param {function} listener The callback that the element has added.
- */
- function addListener(element, listener) {
- var id = idHandler.get(element);
- if(!eventListeners[id]) {
- eventListeners[id] = [];
- }
- eventListeners[id].push(listener);
- }
- function removeListener(element, listener) {
- var listeners = getListeners(element);
- for (var i = 0, len = listeners.length; i < len; ++i) {
- if (listeners[i] === listener) {
- listeners.splice(i, 1);
- break;
- }
- }
- }
- function removeAllListeners(element) {
- var listeners = getListeners(element);
- if (!listeners) { return; }
- listeners.length = 0;
- }
- return {
- get: getListeners,
- add: addListener,
- removeListener: removeListener,
- removeAllListeners: removeAllListeners
- };
- };
- /***/ }),
- /* 531 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function() {
- var idCount = 1;
- /**
- * Generates a new unique id in the context.
- * @public
- * @returns {number} A unique id in the context.
- */
- function generate() {
- return idCount++;
- }
- return {
- generate: generate
- };
- };
- /***/ }),
- /* 532 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function(options) {
- var idGenerator = options.idGenerator;
- var getState = options.stateHandler.getState;
- /**
- * Gets the resize detector id of the element.
- * @public
- * @param {element} element The target element to get the id of.
- * @returns {string|number|null} The id of the element. Null if it has no id.
- */
- function getId(element) {
- var state = getState(element);
- if (state && state.id !== undefined) {
- return state.id;
- }
- return null;
- }
- /**
- * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.
- * @public
- * @param {element} element The target element to set the id of.
- * @returns {string|number|null} The id of the element.
- */
- function setId(element) {
- var state = getState(element);
- if (!state) {
- throw new Error("setId required the element to have a resize detection state.");
- }
- var id = idGenerator.generate();
- state.id = id;
- return id;
- }
- return {
- get: getId,
- set: setId
- };
- };
- /***/ }),
- /* 533 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* global console: false */
- /**
- * Reporter that handles the reporting of logs, warnings and errors.
- * @public
- * @param {boolean} quiet Tells if the reporter should be quiet or not.
- */
- module.exports = function(quiet) {
- function noop() {
- //Does nothing.
- }
- var reporter = {
- log: noop,
- warn: noop,
- error: noop
- };
- if(!quiet && window.console) {
- var attachFunction = function(reporter, name) {
- //The proxy is needed to be able to call the method with the console context,
- //since we cannot use bind.
- reporter[name] = function reporterProxy() {
- var f = console[name];
- if (f.apply) { //IE9 does not support console.log.apply :)
- f.apply(console, arguments);
- } else {
- for (var i = 0; i < arguments.length; i++) {
- f(arguments[i]);
- }
- }
- };
- };
- attachFunction(reporter, "log");
- attachFunction(reporter, "warn");
- attachFunction(reporter, "error");
- }
- return reporter;
- };
- /***/ }),
- /* 534 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var utils = __webpack_require__(535);
- module.exports = function batchProcessorMaker(options) {
- options = options || {};
- var reporter = options.reporter;
- var asyncProcess = utils.getOption(options, "async", true);
- var autoProcess = utils.getOption(options, "auto", true);
- if(autoProcess && !asyncProcess) {
- reporter && reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");
- asyncProcess = true;
- }
- var batch = Batch();
- var asyncFrameHandler;
- var isProcessing = false;
- function addFunction(level, fn) {
- if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {
- // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.
- // This needs to be done before, since we're checking the size of the batch to be 0.
- processBatchAsync();
- }
- batch.add(level, fn);
- }
- function processBatch() {
- // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.
- // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).
- isProcessing = true;
- while (batch.size()) {
- var processingBatch = batch;
- batch = Batch();
- processingBatch.process();
- }
- isProcessing = false;
- }
- function forceProcessBatch(localAsyncProcess) {
- if (isProcessing) {
- return;
- }
- if(localAsyncProcess === undefined) {
- localAsyncProcess = asyncProcess;
- }
- if(asyncFrameHandler) {
- cancelFrame(asyncFrameHandler);
- asyncFrameHandler = null;
- }
- if(localAsyncProcess) {
- processBatchAsync();
- } else {
- processBatch();
- }
- }
- function processBatchAsync() {
- asyncFrameHandler = requestFrame(processBatch);
- }
- function clearBatch() {
- batch = {};
- batchSize = 0;
- topLevel = 0;
- bottomLevel = 0;
- }
- function cancelFrame(listener) {
- // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
- var cancel = clearTimeout;
- return cancel(listener);
- }
- function requestFrame(callback) {
- // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };
- var raf = function(fn) { return setTimeout(fn, 0); };
- return raf(callback);
- }
- return {
- add: addFunction,
- force: forceProcessBatch
- };
- };
- function Batch() {
- var batch = {};
- var size = 0;
- var topLevel = 0;
- var bottomLevel = 0;
- function add(level, fn) {
- if(!fn) {
- fn = level;
- level = 0;
- }
- if(level > topLevel) {
- topLevel = level;
- } else if(level < bottomLevel) {
- bottomLevel = level;
- }
- if(!batch[level]) {
- batch[level] = [];
- }
- batch[level].push(fn);
- size++;
- }
- function process() {
- for(var level = bottomLevel; level <= topLevel; level++) {
- var fns = batch[level];
- for(var i = 0; i < fns.length; i++) {
- var fn = fns[i];
- fn();
- }
- }
- }
- function getSize() {
- return size;
- }
- return {
- add: add,
- process: process,
- size: getSize
- };
- }
- /***/ }),
- /* 535 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var utils = module.exports = {};
- utils.getOption = getOption;
- function getOption(options, name, defaultValue) {
- var value = options[name];
- if((value === undefined || value === null) && defaultValue !== undefined) {
- return defaultValue;
- }
- return value;
- }
- /***/ }),
- /* 536 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var prop = "_erd";
- function initState(element) {
- element[prop] = {};
- return getState(element);
- }
- function getState(element) {
- return element[prop];
- }
- function cleanState(element) {
- delete element[prop];
- }
- module.exports = {
- initState: initState,
- getState: getState,
- cleanState: cleanState
- };
- /***/ }),
- /* 537 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * Resize detection strategy that injects objects to elements in order to detect resize events.
- * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/
- */
- var browserDetector = __webpack_require__(230);
- module.exports = function(options) {
- options = options || {};
- var reporter = options.reporter;
- var batchProcessor = options.batchProcessor;
- var getState = options.stateHandler.getState;
- if(!reporter) {
- throw new Error("Missing required dependency: reporter.");
- }
- /**
- * Adds a resize event listener to the element.
- * @public
- * @param {element} element The element that should have the listener added.
- * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
- */
- function addListener(element, listener) {
- function listenerProxy() {
- listener(element);
- }
- if(browserDetector.isIE(8)) {
- //IE 8 does not support object, but supports the resize event directly on elements.
- getState(element).object = {
- proxy: listenerProxy
- };
- element.attachEvent("onresize", listenerProxy);
- } else {
- var object = getObject(element);
- if(!object) {
- throw new Error("Element is not detectable by this strategy.");
- }
- object.contentDocument.defaultView.addEventListener("resize", listenerProxy);
- }
- }
- function buildCssTextString(rules) {
- var seperator = options.important ? " !important; " : "; ";
- return (rules.join(seperator) + seperator).trim();
- }
- /**
- * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
- * @private
- * @param {object} options Optional options object.
- * @param {element} element The element to make detectable
- * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
- */
- function makeDetectable(options, element, callback) {
- if (!callback) {
- callback = element;
- element = options;
- options = null;
- }
- options = options || {};
- var debug = options.debug;
- function injectObject(element, callback) {
- var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]);
- //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.
- // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.
- var positionCheckPerformed = false;
- // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.
- // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.
- var style = window.getComputedStyle(element);
- var width = element.offsetWidth;
- var height = element.offsetHeight;
- getState(element).startSize = {
- width: width,
- height: height
- };
- function mutateDom() {
- function alterPositionStyles() {
- if(style.position === "static") {
- element.style.setProperty("position", "relative", options.important ? "important" : "");
- var removeRelativeStyles = function(reporter, element, style, property) {
- function getNumericalValue(value) {
- return value.replace(/[^-\d\.]/g, "");
- }
- var value = style[property];
- if(value !== "auto" && getNumericalValue(value) !== "0") {
- reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
- element.style.setProperty(property, "0", options.important ? "important" : "");
- }
- };
- //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
- //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
- removeRelativeStyles(reporter, element, style, "top");
- removeRelativeStyles(reporter, element, style, "right");
- removeRelativeStyles(reporter, element, style, "bottom");
- removeRelativeStyles(reporter, element, style, "left");
- }
- }
- function onObjectLoad() {
- // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.
- if (!positionCheckPerformed) {
- alterPositionStyles();
- }
- /*jshint validthis: true */
- function getDocument(element, callback) {
- //Opera 12 seem to call the object.onload before the actual document has been created.
- //So if it is not present, poll it with an timeout until it is present.
- //TODO: Could maybe be handled better with object.onreadystatechange or similar.
- if(!element.contentDocument) {
- setTimeout(function checkForObjectDocument() {
- getDocument(element, callback);
- }, 100);
- return;
- }
- callback(element.contentDocument);
- }
- //Mutating the object element here seems to fire another load event.
- //Mutating the inner document of the object element is fine though.
- var objectElement = this;
- //Create the style element to be added to the object.
- getDocument(objectElement, function onObjectDocumentReady(objectDocument) {
- //Notify that the element is ready to be listened to.
- callback(element);
- });
- }
- // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.
- // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.
- if (style.position !== "") {
- alterPositionStyles(style);
- positionCheckPerformed = true;
- }
- //Add an object element as a child to the target element that will be listened to for resize events.
- var object = document.createElement("object");
- object.style.cssText = OBJECT_STYLE;
- object.tabIndex = -1;
- object.type = "text/html";
- object.onload = onObjectLoad;
- //Safari: This must occur before adding the object to the DOM.
- //IE: Does not like that this happens before, even if it is also added after.
- if(!browserDetector.isIE()) {
- object.data = "about:blank";
- }
- if (!getState(element)) {
- // The element has been uninstalled before the actual loading happened.
- return;
- }
- element.appendChild(object);
- getState(element).object = object;
- //IE: This must occur after adding the object to the DOM.
- if(browserDetector.isIE()) {
- object.data = "about:blank";
- }
- }
- if(batchProcessor) {
- batchProcessor.add(mutateDom);
- } else {
- mutateDom();
- }
- }
- if(browserDetector.isIE(8)) {
- //IE 8 does not support objects properly. Luckily they do support the resize event.
- //So do not inject the object and notify that the element is already ready to be listened to.
- //The event handler for the resize event is attached in the utils.addListener instead.
- callback(element);
- } else {
- injectObject(element, callback);
- }
- }
- /**
- * Returns the child object of the target element.
- * @private
- * @param {element} element The target element.
- * @returns The object element of the target.
- */
- function getObject(element) {
- return getState(element).object;
- }
- function uninstall(element) {
- if (!getState(element)) {
- return;
- }
- var object = getObject(element);
- if (!object) {
- return;
- }
- if (browserDetector.isIE(8)) {
- element.detachEvent("onresize", object.proxy);
- } else {
- element.removeChild(object);
- }
- delete getState(element).object;
- }
- return {
- makeDetectable: makeDetectable,
- addListener: addListener,
- uninstall: uninstall
- };
- };
- /***/ }),
- /* 538 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
- * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
- */
- var forEach = __webpack_require__(229).forEach;
- module.exports = function(options) {
- options = options || {};
- var reporter = options.reporter;
- var batchProcessor = options.batchProcessor;
- var getState = options.stateHandler.getState;
- var hasState = options.stateHandler.hasState;
- var idHandler = options.idHandler;
- if (!batchProcessor) {
- throw new Error("Missing required dependency: batchProcessor");
- }
- if (!reporter) {
- throw new Error("Missing required dependency: reporter.");
- }
- //TODO: Could this perhaps be done at installation time?
- var scrollbarSizes = getScrollbarSizes();
- var styleId = "erd_scroll_detection_scrollbar_style";
- var detectionContainerClass = "erd_scroll_detection_container";
- function initDocument(targetDocument) {
- // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
- // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
- injectScrollStyle(targetDocument, styleId, detectionContainerClass);
- }
- initDocument(window.document);
- function buildCssTextString(rules) {
- var seperator = options.important ? " !important; " : "; ";
- return (rules.join(seperator) + seperator).trim();
- }
- function getScrollbarSizes() {
- var width = 500;
- var height = 500;
- var child = document.createElement("div");
- child.style.cssText = buildCssTextString(["position: absolute", "width: " + width*2 + "px", "height: " + height*2 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
- var container = document.createElement("div");
- container.style.cssText = buildCssTextString(["position: absolute", "width: " + width + "px", "height: " + height + "px", "overflow: scroll", "visibility: none", "top: " + -width*3 + "px", "left: " + -height*3 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
- container.appendChild(child);
- document.body.insertBefore(container, document.body.firstChild);
- var widthSize = width - container.clientWidth;
- var heightSize = height - container.clientHeight;
- document.body.removeChild(container);
- return {
- width: widthSize,
- height: heightSize
- };
- }
- function injectScrollStyle(targetDocument, styleId, containerClass) {
- function injectStyle(style, method) {
- method = method || function (element) {
- targetDocument.head.appendChild(element);
- };
- var styleElement = targetDocument.createElement("style");
- styleElement.innerHTML = style;
- styleElement.id = styleId;
- method(styleElement);
- return styleElement;
- }
- if (!targetDocument.getElementById(styleId)) {
- var containerAnimationClass = containerClass + "_animation";
- var containerAnimationActiveClass = containerClass + "_animation_active";
- var style = "/* Created by the element-resize-detector library. */\n";
- style += "." + containerClass + " > div::-webkit-scrollbar { " + buildCssTextString(["display: none"]) + " }\n\n";
- style += "." + containerAnimationActiveClass + " { " + buildCssTextString(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + containerAnimationClass, "animation-name: " + containerAnimationClass]) + " }\n";
- style += "@-webkit-keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";
- style += "@keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";
- injectStyle(style);
- }
- }
- function addAnimationClass(element) {
- element.className += " " + detectionContainerClass + "_animation_active";
- }
- function addEvent(el, name, cb) {
- if (el.addEventListener) {
- el.addEventListener(name, cb);
- } else if(el.attachEvent) {
- el.attachEvent("on" + name, cb);
- } else {
- return reporter.error("[scroll] Don't know how to add event listeners.");
- }
- }
- function removeEvent(el, name, cb) {
- if (el.removeEventListener) {
- el.removeEventListener(name, cb);
- } else if(el.detachEvent) {
- el.detachEvent("on" + name, cb);
- } else {
- return reporter.error("[scroll] Don't know how to remove event listeners.");
- }
- }
- function getExpandElement(element) {
- return getState(element).container.childNodes[0].childNodes[0].childNodes[0];
- }
- function getShrinkElement(element) {
- return getState(element).container.childNodes[0].childNodes[0].childNodes[1];
- }
- /**
- * Adds a resize event listener to the element.
- * @public
- * @param {element} element The element that should have the listener added.
- * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
- */
- function addListener(element, listener) {
- var listeners = getState(element).listeners;
- if (!listeners.push) {
- throw new Error("Cannot add listener to an element that is not detectable.");
- }
- getState(element).listeners.push(listener);
- }
- /**
- * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
- * @private
- * @param {object} options Optional options object.
- * @param {element} element The element to make detectable
- * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
- */
- function makeDetectable(options, element, callback) {
- if (!callback) {
- callback = element;
- element = options;
- options = null;
- }
- options = options || {};
- function debug() {
- if (options.debug) {
- var args = Array.prototype.slice.call(arguments);
- args.unshift(idHandler.get(element), "Scroll: ");
- if (reporter.log.apply) {
- reporter.log.apply(null, args);
- } else {
- for (var i = 0; i < args.length; i++) {
- reporter.log(args[i]);
- }
- }
- }
- }
- function isDetached(element) {
- function isInDocument(element) {
- return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);
- }
- if (!isInDocument(element)) {
- return true;
- }
- // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520
- if (window.getComputedStyle(element) === null) {
- return true;
- }
- return false;
- }
- function isUnrendered(element) {
- // Check the absolute positioned container since the top level container is display: inline.
- var container = getState(element).container.childNodes[0];
- var style = window.getComputedStyle(container);
- return !style.width || style.width.indexOf("px") === -1; //Can only compute pixel value when rendered.
- }
- function getStyle() {
- // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,
- // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).
- var elementStyle = window.getComputedStyle(element);
- var style = {};
- style.position = elementStyle.position;
- style.width = element.offsetWidth;
- style.height = element.offsetHeight;
- style.top = elementStyle.top;
- style.right = elementStyle.right;
- style.bottom = elementStyle.bottom;
- style.left = elementStyle.left;
- style.widthCSS = elementStyle.width;
- style.heightCSS = elementStyle.height;
- return style;
- }
- function storeStartSize() {
- var style = getStyle();
- getState(element).startSize = {
- width: style.width,
- height: style.height
- };
- debug("Element start size", getState(element).startSize);
- }
- function initListeners() {
- getState(element).listeners = [];
- }
- function storeStyle() {
- debug("storeStyle invoked.");
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- var style = getStyle();
- getState(element).style = style;
- }
- function storeCurrentSize(element, width, height) {
- getState(element).lastWidth = width;
- getState(element).lastHeight = height;
- }
- function getExpandChildElement(element) {
- return getExpandElement(element).childNodes[0];
- }
- function getWidthOffset() {
- return 2 * scrollbarSizes.width + 1;
- }
- function getHeightOffset() {
- return 2 * scrollbarSizes.height + 1;
- }
- function getExpandWidth(width) {
- return width + 10 + getWidthOffset();
- }
- function getExpandHeight(height) {
- return height + 10 + getHeightOffset();
- }
- function getShrinkWidth(width) {
- return width * 2 + getWidthOffset();
- }
- function getShrinkHeight(height) {
- return height * 2 + getHeightOffset();
- }
- function positionScrollbars(element, width, height) {
- var expand = getExpandElement(element);
- var shrink = getShrinkElement(element);
- var expandWidth = getExpandWidth(width);
- var expandHeight = getExpandHeight(height);
- var shrinkWidth = getShrinkWidth(width);
- var shrinkHeight = getShrinkHeight(height);
- expand.scrollLeft = expandWidth;
- expand.scrollTop = expandHeight;
- shrink.scrollLeft = shrinkWidth;
- shrink.scrollTop = shrinkHeight;
- }
- function injectContainerElement() {
- var container = getState(element).container;
- if (!container) {
- container = document.createElement("div");
- container.className = detectionContainerClass;
- container.style.cssText = buildCssTextString(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]);
- getState(element).container = container;
- addAnimationClass(container);
- element.appendChild(container);
- var onAnimationStart = function () {
- getState(element).onRendered && getState(element).onRendered();
- };
- addEvent(container, "animationstart", onAnimationStart);
- // Store the event handler here so that they may be removed when uninstall is called.
- // See uninstall function for an explanation why it is needed.
- getState(element).onAnimationStart = onAnimationStart;
- }
- return container;
- }
- function injectScrollElements() {
- function alterPositionStyles() {
- var style = getState(element).style;
- if(style.position === "static") {
- element.style.setProperty("position", "relative",options.important ? "important" : "");
- var removeRelativeStyles = function(reporter, element, style, property) {
- function getNumericalValue(value) {
- return value.replace(/[^-\d\.]/g, "");
- }
- var value = style[property];
- if(value !== "auto" && getNumericalValue(value) !== "0") {
- reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
- element.style[property] = 0;
- }
- };
- //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
- //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
- removeRelativeStyles(reporter, element, style, "top");
- removeRelativeStyles(reporter, element, style, "right");
- removeRelativeStyles(reporter, element, style, "bottom");
- removeRelativeStyles(reporter, element, style, "left");
- }
- }
- function getLeftTopBottomRightCssText(left, top, bottom, right) {
- left = (!left ? "0" : (left + "px"));
- top = (!top ? "0" : (top + "px"));
- bottom = (!bottom ? "0" : (bottom + "px"));
- right = (!right ? "0" : (right + "px"));
- return ["left: " + left, "top: " + top, "right: " + right, "bottom: " + bottom];
- }
- debug("Injecting elements");
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- alterPositionStyles();
- var rootContainer = getState(element).container;
- if (!rootContainer) {
- rootContainer = injectContainerElement();
- }
- // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),
- // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than
- // the targeted element.
- // When the bug is resolved, "containerContainer" may be removed.
- // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).
- // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.
- var scrollbarWidth = scrollbarSizes.width;
- var scrollbarHeight = scrollbarSizes.height;
- var containerContainerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]);
- var containerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));
- var expandStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
- var shrinkStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
- var expandChildStyle = buildCssTextString(["position: absolute", "left: 0", "top: 0"]);
- var shrinkChildStyle = buildCssTextString(["position: absolute", "width: 200%", "height: 200%"]);
- var containerContainer = document.createElement("div");
- var container = document.createElement("div");
- var expand = document.createElement("div");
- var expandChild = document.createElement("div");
- var shrink = document.createElement("div");
- var shrinkChild = document.createElement("div");
- // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56
- // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.
- containerContainer.dir = "ltr";
- containerContainer.style.cssText = containerContainerStyle;
- containerContainer.className = detectionContainerClass;
- container.className = detectionContainerClass;
- container.style.cssText = containerStyle;
- expand.style.cssText = expandStyle;
- expandChild.style.cssText = expandChildStyle;
- shrink.style.cssText = shrinkStyle;
- shrinkChild.style.cssText = shrinkChildStyle;
- expand.appendChild(expandChild);
- shrink.appendChild(shrinkChild);
- container.appendChild(expand);
- container.appendChild(shrink);
- containerContainer.appendChild(container);
- rootContainer.appendChild(containerContainer);
- function onExpandScroll() {
- getState(element).onExpand && getState(element).onExpand();
- }
- function onShrinkScroll() {
- getState(element).onShrink && getState(element).onShrink();
- }
- addEvent(expand, "scroll", onExpandScroll);
- addEvent(shrink, "scroll", onShrinkScroll);
- // Store the event handlers here so that they may be removed when uninstall is called.
- // See uninstall function for an explanation why it is needed.
- getState(element).onExpandScroll = onExpandScroll;
- getState(element).onShrinkScroll = onShrinkScroll;
- }
- function registerListenersAndPositionElements() {
- function updateChildSizes(element, width, height) {
- var expandChild = getExpandChildElement(element);
- var expandWidth = getExpandWidth(width);
- var expandHeight = getExpandHeight(height);
- expandChild.style.setProperty("width", expandWidth + "px", options.important ? "important" : "");
- expandChild.style.setProperty("height", expandHeight + "px", options.important ? "important" : "");
- }
- function updateDetectorElements(done) {
- var width = element.offsetWidth;
- var height = element.offsetHeight;
- // Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.
- var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;
- debug("Storing current size", width, height);
- // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.
- // Otherwise the if-check in handleScroll is useless.
- storeCurrentSize(element, width, height);
- // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.
- // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.
- batchProcessor.add(0, function performUpdateChildSizes() {
- if (!sizeChanged) {
- return;
- }
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- if (!areElementsInjected()) {
- debug("Aborting because element container has not been initialized");
- return;
- }
- if (options.debug) {
- var w = element.offsetWidth;
- var h = element.offsetHeight;
- if (w !== width || h !== height) {
- reporter.warn(idHandler.get(element), "Scroll: Size changed before updating detector elements.");
- }
- }
- updateChildSizes(element, width, height);
- });
- batchProcessor.add(1, function updateScrollbars() {
- // This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then
- // been restored to the original size, which will have changed the scrollbar positions.
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- if (!areElementsInjected()) {
- debug("Aborting because element container has not been initialized");
- return;
- }
- positionScrollbars(element, width, height);
- });
- if (sizeChanged && done) {
- batchProcessor.add(2, function () {
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- if (!areElementsInjected()) {
- debug("Aborting because element container has not been initialized");
- return;
- }
- done();
- });
- }
- }
- function areElementsInjected() {
- return !!getState(element).container;
- }
- function notifyListenersIfNeeded() {
- function isFirstNotify() {
- return getState(element).lastNotifiedWidth === undefined;
- }
- debug("notifyListenersIfNeeded invoked");
- var state = getState(element);
- // Don't notify if the current size is the start size, and this is the first notification.
- if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {
- return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");
- }
- // Don't notify if the size already has been notified.
- if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {
- return debug("Not notifying: Size already notified");
- }
- debug("Current size not notified, notifying...");
- state.lastNotifiedWidth = state.lastWidth;
- state.lastNotifiedHeight = state.lastHeight;
- forEach(getState(element).listeners, function (listener) {
- listener(element);
- });
- }
- function handleRender() {
- debug("startanimation triggered.");
- if (isUnrendered(element)) {
- debug("Ignoring since element is still unrendered...");
- return;
- }
- debug("Element rendered.");
- var expand = getExpandElement(element);
- var shrink = getShrinkElement(element);
- if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {
- debug("Scrollbars out of sync. Updating detector elements...");
- updateDetectorElements(notifyListenersIfNeeded);
- }
- }
- function handleScroll() {
- debug("Scroll detected.");
- if (isUnrendered(element)) {
- // Element is still unrendered. Skip this scroll event.
- debug("Scroll event fired while unrendered. Ignoring...");
- return;
- }
- updateDetectorElements(notifyListenersIfNeeded);
- }
- debug("registerListenersAndPositionElements invoked.");
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- getState(element).onRendered = handleRender;
- getState(element).onExpand = handleScroll;
- getState(element).onShrink = handleScroll;
- var style = getState(element).style;
- updateChildSizes(element, style.width, style.height);
- }
- function finalizeDomMutation() {
- debug("finalizeDomMutation invoked.");
- if (!getState(element)) {
- debug("Aborting because element has been uninstalled");
- return;
- }
- var style = getState(element).style;
- storeCurrentSize(element, style.width, style.height);
- positionScrollbars(element, style.width, style.height);
- }
- function ready() {
- callback(element);
- }
- function install() {
- debug("Installing...");
- initListeners();
- storeStartSize();
- batchProcessor.add(0, storeStyle);
- batchProcessor.add(1, injectScrollElements);
- batchProcessor.add(2, registerListenersAndPositionElements);
- batchProcessor.add(3, finalizeDomMutation);
- batchProcessor.add(4, ready);
- }
- debug("Making detectable...");
- if (isDetached(element)) {
- debug("Element is detached");
- injectContainerElement();
- debug("Waiting until element is attached...");
- getState(element).onRendered = function () {
- debug("Element is now attached");
- install();
- };
- } else {
- install();
- }
- }
- function uninstall(element) {
- var state = getState(element);
- if (!state) {
- // Uninstall has been called on a non-erd element.
- return;
- }
- // Uninstall may have been called in the following scenarios:
- // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).
- // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).
- // (3) After the installation process (here, state.busy = false and all the stuff has been injected).
- // So to be on the safe side, let's check for each thing before removing.
- // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.
- state.onExpandScroll && removeEvent(getExpandElement(element), "scroll", state.onExpandScroll);
- state.onShrinkScroll && removeEvent(getShrinkElement(element), "scroll", state.onShrinkScroll);
- state.onAnimationStart && removeEvent(state.container, "animationstart", state.onAnimationStart);
- state.container && element.removeChild(state.container);
- }
- return {
- makeDetectable: makeDetectable,
- addListener: addListener,
- uninstall: uninstall,
- initDocument: initDocument
- };
- };
- /***/ }),
- /* 539 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [!_vm.range && _vm.showInput ? _c('Input-number', { attrs: { "min": _vm.min, "size": _vm.inputSize, "max": _vm.max, "step": _vm.step, "value": _vm.exportValue[0], "disabled": _vm.itemDisabled, "active-change": _vm.activeChange }, on: { "on-change": _vm.handleInputChange } }) : _vm._e(), _vm._v(" "), _c('div', { ref: "slider", class: [_vm.prefixCls + '-wrap'], on: { "click": function click($event) {
- if ($event.target !== $event.currentTarget) {
- return null;
- }return _vm.sliderClick($event);
- } } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.exportValue } }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-bar'], style: _vm.barStyle, on: { "click": function click($event) {
- if ($event.target !== $event.currentTarget) {
- return null;
- }return _vm.sliderClick($event);
- } } }), _vm._v(" "), _vm.showStops ? _vm._l(_vm.stops, function (item) {
- return _c('div', { class: [_vm.prefixCls + '-stop'], style: { 'left': item + '%' }, on: { "click": function click($event) {
- if ($event.target !== $event.currentTarget) {
- return null;
- }return _vm.sliderClick($event);
- } } });
- }) : _vm._e(), _vm._v(" "), _vm.markList.length > 0 ? [_vm._l(_vm.markList, function (item, key) {
- return _c('div', { key: key, class: [_vm.prefixCls + '-stop'], style: { 'left': item.position + '%' }, on: { "click": function click($event) {
- if ($event.target !== $event.currentTarget) {
- return null;
- }return _vm.sliderClick($event);
- } } });
- }), _vm._v(" "), _c('div', { staticClass: "ivu-slider-marks" }, _vm._l(_vm.markList, function (item, key) {
- return _c('SliderMarker', { key: key, style: { 'left': item.position + '%' }, attrs: { "mark": item.mark }, nativeOn: { "click": function click($event) {
- return _vm.sliderClick($event);
- } } });
- }), 1)] : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-button-wrap'], style: { left: _vm.minPosition + '%' }, on: { "touchstart": function touchstart($event) {
- return _vm.onPointerDown($event, 'min');
- }, "mousedown": function mousedown($event) {
- return _vm.onPointerDown($event, 'min');
- } } }, [_c('Tooltip', { ref: "minTooltip", attrs: { "controlled": _vm.pointerDown === 'min', "placement": "top", "content": _vm.tipFormat(_vm.exportValue[0]), "disabled": _vm.tipDisabled, "always": _vm.showTip === 'always' } }, [_c('div', { class: _vm.minButtonClasses, attrs: { "tabindex": "0" }, on: { "focus": function focus($event) {
- return _vm.handleFocus('min');
- }, "blur": function blur($event) {
- return _vm.handleBlur('min');
- }, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.onKeyLeft($event, 'min');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.onKeyLeft($event, 'min');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.onKeyRight($event, 'min');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.onKeyRight($event, 'min');
- }] } })])], 1), _vm._v(" "), _vm.range ? _c('div', { class: [_vm.prefixCls + '-button-wrap'], style: { left: _vm.maxPosition + '%' }, on: { "touchstart": function touchstart($event) {
- return _vm.onPointerDown($event, 'max');
- }, "mousedown": function mousedown($event) {
- return _vm.onPointerDown($event, 'max');
- } } }, [_c('Tooltip', { ref: "maxTooltip", attrs: { "controlled": _vm.pointerDown === 'max', "placement": "top", "content": _vm.tipFormat(_vm.exportValue[1]), "disabled": _vm.tipDisabled, "always": _vm.showTip === 'always' } }, [_c('div', { class: _vm.maxButtonClasses, attrs: { "tabindex": "0" }, on: { "focus": function focus($event) {
- return _vm.handleFocus('max');
- }, "blur": function blur($event) {
- return _vm.handleBlur('max');
- }, "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
- return null;
- }if ('button' in $event && $event.button !== 0) {
- return null;
- }return _vm.onKeyLeft($event, 'max');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
- return null;
- }return _vm.onKeyLeft($event, 'max');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
- return null;
- }if ('button' in $event && $event.button !== 2) {
- return null;
- }return _vm.onKeyRight($event, 'max');
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
- return null;
- }return _vm.onKeyRight($event, 'max');
- }] } })])], 1) : _vm._e()], 2)], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 540 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _spin = __webpack_require__(541);
- var _spin2 = _interopRequireDefault(_spin);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var spinInstance = void 0;
- function getSpinInstance() {
- var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
- spinInstance = spinInstance || _spin2.default.newInstance({
- render: render
- });
- return spinInstance;
- }
- function loading(options) {
- var render = 'render' in options ? options.render : undefined;
- var instance = getSpinInstance(render);
- instance.show(options);
- }
- _spin2.default.show = function () {
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- return loading(props);
- };
- _spin2.default.hide = function () {
- var _this = this;
- if (!spinInstance) return false;
- var instance = getSpinInstance();
- instance.remove(function () {
- (0, _newArrowCheck3.default)(this, _this);
- spinInstance = null;
- }.bind(this));
- };
- exports.default = _spin2.default;
- /***/ }),
- /* 541 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _vue = __webpack_require__(16);
- var _vue2 = _interopRequireDefault(_vue);
- var _spin = __webpack_require__(91);
- var _spin2 = _interopRequireDefault(_spin);
- var _transferQueue = __webpack_require__(37);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function handleGetIndex() {
- (0, _transferQueue.transferIncrease)();
- return _transferQueue.transferIndex;
- }
- var tIndex = handleGetIndex();
- _spin2.default.newInstance = function (properties) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var _props = properties || {};
- var Instance = new _vue2.default({
- data: (0, _assign2.default)({}, _props, {}),
- render: function render(h) {
- var vnode = '';
- if (this.render) {
- vnode = h(_spin2.default, {
- props: {
- fix: true,
- fullscreen: true
- }
- }, [this.render(h)]);
- } else {
- vnode = h(_spin2.default, {
- props: {
- size: 'large',
- fix: true,
- fullscreen: true
- }
- });
- }
- return h('div', {
- 'class': 'ivu-spin-fullscreen ivu-spin-fullscreen-wrapper',
- 'style': {
- 'z-index': 2010 + tIndex
- }
- }, [vnode]);
- }
- });
- var component = Instance.$mount();
- document.body.appendChild(component.$el);
- var spin = Instance.$children[0];
- return {
- show: function show() {
- spin.visible = true;
- tIndex = handleGetIndex();
- },
- remove: function remove(cb) {
- spin.visible = false;
- setTimeout(function () {
- spin.$parent.$destroy();
- if (document.getElementsByClassName('ivu-spin-fullscreen')[0] !== undefined) {
- document.body.removeChild(document.getElementsByClassName('ivu-spin-fullscreen')[0]);
- }
- cb();
- }, 500);
- },
- component: spin
- };
- }.bind(undefined);
- exports.default = _spin2.default;
- /***/ }),
- /* 542 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _steps = __webpack_require__(543);
- var _steps2 = _interopRequireDefault(_steps);
- var _step = __webpack_require__(545);
- var _step2 = _interopRequireDefault(_step);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _steps2.default.Step = _step2.default;
- exports.default = _steps2.default;
- /***/ }),
- /* 543 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__ = __webpack_require__(231);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__ = __webpack_require__(544);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 544 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 545 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__ = __webpack_require__(232);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__ = __webpack_require__(546);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 546 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_c('div', { class: [_vm.prefixCls + '-tail'] }, [_c('i')]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-head'] }, [_c('div', { class: [_vm.prefixCls + '-head-inner'] }, [!_vm.icon && !_vm.$slots.icon && _vm.currentStatus !== 'finish' && _vm.currentStatus !== 'error' ? _c('span', [_vm._v(_vm._s(_vm.stepNumber))]) : _vm.$slots.icon ? _c('span', { staticClass: "ivu-steps-icon" }, [_vm._t("icon")], 2) : _c('span', { class: _vm.iconClasses })])]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-main'] }, [_c('div', { class: [_vm.prefixCls + '-title'] }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2), _vm._v(" "), _vm.content || _vm.$slots.content ? _c('div', { class: [_vm.prefixCls + '-content'] }, [_vm._t("content", [_vm._v(_vm._s(_vm.content))])], 2) : _vm._e()])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 547 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _switch = __webpack_require__(548);
- var _switch2 = _interopRequireDefault(_switch);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _switch2.default;
- /***/ }),
- /* 548 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__ = __webpack_require__(233);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__ = __webpack_require__(549);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 549 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.wrapClasses, style: _vm.wrapStyles, attrs: { "tabindex": "0" }, on: { "click": _vm.toggle, "keydown": function keydown($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])) {
- return null;
- }return _vm.toggle($event);
- } } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _c('span', { class: _vm.innerClasses }, [_vm.currentValue === _vm.trueValue ? _vm._t("open") : _vm._e(), _vm._v(" "), _vm.currentValue === _vm.falseValue ? _vm._t("close") : _vm._e()], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 550 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _table = __webpack_require__(551);
- var _table2 = _interopRequireDefault(_table);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _table2.default;
- /***/ }),
- /* 551 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__ = __webpack_require__(234);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__ = __webpack_require__(581);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 552 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = { "default": __webpack_require__(553), __esModule: true };
- /***/ }),
- /* 553 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(80);
- __webpack_require__(35);
- __webpack_require__(46);
- __webpack_require__(554);
- __webpack_require__(560);
- __webpack_require__(563);
- __webpack_require__(565);
- module.exports = __webpack_require__(5).Set;
- /***/ }),
- /* 554 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var strong = __webpack_require__(555);
- var validate = __webpack_require__(235);
- var SET = 'Set';
- // 23.2 Set Objects
- module.exports = __webpack_require__(556)(SET, function (get) {
- return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
- }, {
- // 23.2.3.1 Set.prototype.add(value)
- add: function add(value) {
- return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
- }
- }, strong);
- /***/ }),
- /* 555 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var dP = __webpack_require__(14).f;
- var create = __webpack_require__(55);
- var redefineAll = __webpack_require__(90);
- var ctx = __webpack_require__(24);
- var anInstance = __webpack_require__(88);
- var forOf = __webpack_require__(51);
- var $iterDefine = __webpack_require__(72);
- var step = __webpack_require__(102);
- var setSpecies = __webpack_require__(190);
- var DESCRIPTORS = __webpack_require__(13);
- var fastKey = __webpack_require__(78).fastKey;
- var validate = __webpack_require__(235);
- var SIZE = DESCRIPTORS ? '_s' : 'size';
- var getEntry = function (that, key) {
- // fast case
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return that._i[index];
- // frozen object case
- for (entry = that._f; entry; entry = entry.n) {
- if (entry.k == key) return entry;
- }
- };
- module.exports = {
- getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
- var C = wrapper(function (that, iterable) {
- anInstance(that, C, NAME, '_i');
- that._t = NAME; // collection type
- that._i = create(null); // index
- that._f = undefined; // first entry
- that._l = undefined; // last entry
- that[SIZE] = 0; // size
- if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
- });
- redefineAll(C.prototype, {
- // 23.1.3.1 Map.prototype.clear()
- // 23.2.3.2 Set.prototype.clear()
- clear: function clear() {
- for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
- entry.r = true;
- if (entry.p) entry.p = entry.p.n = undefined;
- delete data[entry.i];
- }
- that._f = that._l = undefined;
- that[SIZE] = 0;
- },
- // 23.1.3.3 Map.prototype.delete(key)
- // 23.2.3.4 Set.prototype.delete(value)
- 'delete': function (key) {
- var that = validate(this, NAME);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.n;
- var prev = entry.p;
- delete that._i[entry.i];
- entry.r = true;
- if (prev) prev.n = next;
- if (next) next.p = prev;
- if (that._f == entry) that._f = next;
- if (that._l == entry) that._l = prev;
- 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 */) {
- validate(this, NAME);
- var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
- var entry;
- while (entry = entry ? entry.n : this._f) {
- f(entry.v, entry.k, this);
- // revert to the last existing entry
- while (entry && entry.r) entry = entry.p;
- }
- },
- // 23.1.3.7 Map.prototype.has(key)
- // 23.2.3.7 Set.prototype.has(value)
- has: function has(key) {
- return !!getEntry(validate(this, NAME), key);
- }
- });
- if (DESCRIPTORS) dP(C.prototype, 'size', {
- get: function () {
- return validate(this, NAME)[SIZE];
- }
- });
- return C;
- },
- def: function (that, key, value) {
- var entry = getEntry(that, key);
- var prev, index;
- // change existing entry
- if (entry) {
- entry.v = value;
- // create new entry
- } else {
- that._l = entry = {
- i: index = fastKey(key, true), // <- index
- k: key, // <- key
- v: value, // <- value
- p: prev = that._l, // <- previous entry
- n: undefined, // <- next entry
- r: false // <- removed
- };
- if (!that._f) that._f = entry;
- if (prev) prev.n = entry;
- that[SIZE]++;
- // add to index
- if (index !== 'F') that._i[index] = entry;
- } return that;
- },
- getEntry: getEntry,
- setStrong: function (C, NAME, IS_MAP) {
- // 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
- $iterDefine(C, NAME, function (iterated, kind) {
- this._t = validate(iterated, NAME); // target
- this._k = kind; // kind
- this._l = undefined; // previous
- }, function () {
- var that = this;
- var kind = that._k;
- var entry = that._l;
- // revert to the last existing entry
- while (entry && entry.r) entry = entry.p;
- // get next entry
- if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
- // or finish the iteration
- that._t = undefined;
- return step(1);
- }
- // return step by kind
- if (kind == 'keys') return step(0, entry.k);
- if (kind == 'values') return step(0, entry.v);
- return step(0, [entry.k, entry.v]);
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
- // add [@@species], 23.1.2.2, 23.2.2.2
- setSpecies(NAME);
- }
- };
- /***/ }),
- /* 556 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(9);
- var $export = __webpack_require__(7);
- var meta = __webpack_require__(78);
- var fails = __webpack_require__(31);
- var hide = __webpack_require__(25);
- var redefineAll = __webpack_require__(90);
- var forOf = __webpack_require__(51);
- var anInstance = __webpack_require__(88);
- var isObject = __webpack_require__(18);
- var setToStringTag = __webpack_require__(47);
- var dP = __webpack_require__(14).f;
- var each = __webpack_require__(557)(0);
- var DESCRIPTORS = __webpack_require__(13);
- module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
- var Base = global[NAME];
- var C = Base;
- var ADDER = IS_MAP ? 'set' : 'add';
- var proto = C && C.prototype;
- var O = {};
- if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
- new C().entries().next();
- }))) {
- // create collection constructor
- C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
- redefineAll(C.prototype, methods);
- meta.NEED = true;
- } else {
- C = wrapper(function (target, iterable) {
- anInstance(target, C, NAME, '_c');
- target._c = new Base();
- if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
- });
- each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
- var IS_ADDER = KEY == 'add' || KEY == 'set';
- if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
- anInstance(this, C, KEY);
- if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
- var result = this._c[KEY](a === 0 ? 0 : a, b);
- return IS_ADDER ? this : result;
- });
- });
- IS_WEAK || dP(C.prototype, 'size', {
- get: function () {
- return this._c.size;
- }
- });
- }
- setToStringTag(C, NAME);
- O[NAME] = C;
- $export($export.G + $export.W + $export.F, O);
- if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
- return C;
- };
- /***/ }),
- /* 557 */
- /***/ (function(module, exports, __webpack_require__) {
- // 0 -> Array#forEach
- // 1 -> Array#map
- // 2 -> Array#filter
- // 3 -> Array#some
- // 4 -> Array#every
- // 5 -> Array#find
- // 6 -> Array#findIndex
- var ctx = __webpack_require__(24);
- var IObject = __webpack_require__(64);
- var toObject = __webpack_require__(29);
- var toLength = __webpack_require__(52);
- var asc = __webpack_require__(558);
- module.exports = function (TYPE, $create) {
- 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 NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- var create = $create || asc;
- return function ($this, callbackfn, that) {
- var O = toObject($this);
- var self = IObject(O);
- var f = ctx(callbackfn, that, 3);
- var length = toLength(self.length);
- var index = 0;
- var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
- var val, res;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- val = self[index];
- res = f(val, index, O);
- if (TYPE) {
- if (IS_MAP) result[index] = res; // map
- else if (res) switch (TYPE) {
- case 3: return true; // some
- case 5: return val; // find
- case 6: return index; // findIndex
- case 2: result.push(val); // filter
- } else if (IS_EVERY) return false; // every
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
- };
- };
- /***/ }),
- /* 558 */
- /***/ (function(module, exports, __webpack_require__) {
- // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
- var speciesConstructor = __webpack_require__(559);
- module.exports = function (original, length) {
- return new (speciesConstructor(original))(length);
- };
- /***/ }),
- /* 559 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(18);
- var isArray = __webpack_require__(118);
- var SPECIES = __webpack_require__(10)('species');
- module.exports = function (original) {
- var C;
- if (isArray(original)) {
- C = original.constructor;
- // cross-realm fallback
- if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
- if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return C === undefined ? Array : C;
- };
- /***/ }),
- /* 560 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/DavidBruant/Map-Set.prototype.toJSON
- var $export = __webpack_require__(7);
- $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(561)('Set') });
- /***/ }),
- /* 561 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://github.com/DavidBruant/Map-Set.prototype.toJSON
- var classof = __webpack_require__(56);
- var from = __webpack_require__(562);
- module.exports = function (NAME) {
- return function toJSON() {
- if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
- return from(this);
- };
- };
- /***/ }),
- /* 562 */
- /***/ (function(module, exports, __webpack_require__) {
- var forOf = __webpack_require__(51);
- module.exports = function (iter, ITERATOR) {
- var result = [];
- forOf(iter, false, result.push, result, ITERATOR);
- return result;
- };
- /***/ }),
- /* 563 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
- __webpack_require__(564)('Set');
- /***/ }),
- /* 564 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://tc39.github.io/proposal-setmap-offrom/
- var $export = __webpack_require__(7);
- module.exports = function (COLLECTION) {
- $export($export.S, COLLECTION, { of: function of() {
- var length = arguments.length;
- var A = new Array(length);
- while (length--) A[length] = arguments[length];
- return new this(A);
- } });
- };
- /***/ }),
- /* 565 */
- /***/ (function(module, exports, __webpack_require__) {
- // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
- __webpack_require__(566)('Set');
- /***/ }),
- /* 566 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // https://tc39.github.io/proposal-setmap-offrom/
- var $export = __webpack_require__(7);
- var aFunction = __webpack_require__(43);
- var ctx = __webpack_require__(24);
- var forOf = __webpack_require__(51);
- module.exports = function (COLLECTION) {
- $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
- var mapFn = arguments[1];
- var mapping, A, n, cb;
- aFunction(this);
- mapping = mapFn !== undefined;
- if (mapping) aFunction(mapFn);
- if (source == undefined) return new this();
- A = [];
- if (mapping) {
- n = 0;
- cb = ctx(mapFn, arguments[2], 2);
- forOf(source, false, function (nextItem) {
- A.push(cb(nextItem, n++));
- });
- } else {
- forOf(source, false, A.push, A);
- }
- return new this(A);
- } });
- };
- /***/ }),
- /* 567 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__ = __webpack_require__(236);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__ = __webpack_require__(569);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 568 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableRenderHeader',
- functional: true,
- props: {
- render: Function,
- column: Object,
- index: Number
- },
- render: function render(h, ctx) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var params = {
- column: ctx.props.column,
- index: ctx.props.index
- };
- return ctx.props.render(h, params);
- }.bind(undefined)
- };
- /***/ }),
- /* 569 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('table', { style: _vm.styles, attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('colgroup', [_vm._l(_vm.columns, function (column, index) {
- return _c('col', { attrs: { "width": _vm.setCellWidth(column) } });
- }), _vm._v(" "), _vm.$parent.showVerticalScrollBar ? _c('col', { attrs: { "width": _vm.$parent.scrollBarWidth } }) : _vm._e()], 2), _vm._v(" "), _c('thead', _vm._l(_vm.headRows, function (cols, rowIndex) {
- return _c('tr', [_vm._l(cols, function (column, index) {
- var _obj;
- return _c('th', { class: _vm.alignCls(column), attrs: { "colspan": column.colSpan, "rowspan": column.rowSpan } }, [_c('div', { class: _vm.cellClasses(column) }, [column.type === 'expand' ? [!column.renderHeader ? _c('span', [_vm._v(_vm._s(column.title || ''))]) : _c('render-header', { attrs: { "render": column.renderHeader, "column": column, "index": index } })] : column.type === 'selection' ? [!column.hideSelectAll ? _c('Checkbox', { attrs: { "value": _vm.isSelectAll, "disabled": _vm.isSelectDisabled }, on: { "on-change": _vm.selectAll } }) : _vm._e()] : [!column.renderHeader ? _c('span', { class: (_obj = {}, _obj[_vm.prefixCls + '-cell-sort'] = column.sortable, _obj), on: { "click": function click($event) {
- column.sortable && _vm.handleSortByHead(_vm.getColumn(rowIndex, index)._index);
- } } }, [_vm._v(_vm._s(column.title || '#'))]) : _c('render-header', { attrs: { "render": column.renderHeader, "column": column, "index": index } }), _vm._v(" "), column.sortable ? _c('span', { class: [_vm.prefixCls + '-sort'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-md-arrow-dropup", class: { on: _vm.getColumn(rowIndex, index)._sortType === 'asc' }, on: { "click": function click($event) {
- _vm.handleSort(_vm.getColumn(rowIndex, index)._index, 'asc');
- } } }), _vm._v(" "), _c('i', { staticClass: "ivu-icon ivu-icon-md-arrow-dropdown", class: { on: _vm.getColumn(rowIndex, index)._sortType === 'desc' }, on: { "click": function click($event) {
- _vm.handleSort(_vm.getColumn(rowIndex, index)._index, 'desc');
- } } })]) : _vm._e(), _vm._v(" "), _vm.isPopperShow(column) ? _c('Poptip', { attrs: { "placement": "bottom", "popper-class": "ivu-table-popper", "transfer": "", "capture": false }, on: { "on-popper-hide": function onPopperHide($event) {
- _vm.handleFilterHide(_vm.getColumn(rowIndex, index)._index);
- } }, model: { value: _vm.getColumn(rowIndex, index)._filterVisible, callback: function callback($$v) {
- _vm.$set(_vm.getColumn(rowIndex, index), "_filterVisible", $$v);
- }, expression: "getColumn(rowIndex, index)._filterVisible" } }, [_c('span', { class: [_vm.prefixCls + '-filter'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-funnel", class: { on: _vm.getColumn(rowIndex, index)._isFiltered } })]), _vm._v(" "), _vm.getColumn(rowIndex, index)._filterMultiple ? _c('div', { class: [_vm.prefixCls + '-filter-list'], attrs: { "slot": "content" }, slot: "content" }, [_c('div', { class: [_vm.prefixCls + '-filter-list-item'] }, [_c('checkbox-group', { model: { value: _vm.getColumn(rowIndex, index)._filterChecked, callback: function callback($$v) {
- _vm.$set(_vm.getColumn(rowIndex, index), "_filterChecked", $$v);
- }, expression: "getColumn(rowIndex, index)._filterChecked" } }, _vm._l(column.filters, function (item, index) {
- return _c('checkbox', { key: index, attrs: { "label": item.value } }, [_vm._v(_vm._s(item.label))]);
- }), 1)], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-filter-footer'] }, [_c('i-button', { attrs: { "type": "text", "size": "small", "disabled": !_vm.getColumn(rowIndex, index)._filterChecked.length }, nativeOn: { "click": function click($event) {
- _vm.handleFilter(_vm.getColumn(rowIndex, index)._index);
- } } }, [_vm._v(_vm._s(_vm.t('i.table.confirmFilter')))]), _vm._v(" "), _c('i-button', { attrs: { "type": "text", "size": "small" }, nativeOn: { "click": function click($event) {
- _vm.handleReset(_vm.getColumn(rowIndex, index)._index);
- } } }, [_vm._v(_vm._s(_vm.t('i.table.resetFilter')))])], 1)]) : _c('div', { class: [_vm.prefixCls + '-filter-list'], attrs: { "slot": "content" }, slot: "content" }, [_c('ul', { class: [_vm.prefixCls + '-filter-list-single'] }, [_c('li', { class: _vm.itemAllClasses(_vm.getColumn(rowIndex, index)), on: { "click": function click($event) {
- _vm.handleReset(_vm.getColumn(rowIndex, index)._index);
- } } }, [_vm._v(_vm._s(_vm.t('i.table.clearFilter')))]), _vm._v(" "), _vm._l(column.filters, function (item) {
- return _c('li', { class: _vm.itemClasses(_vm.getColumn(rowIndex, index), item), on: { "click": function click($event) {
- _vm.handleSelect(_vm.getColumn(rowIndex, index)._index, item.value);
- } } }, [_vm._v(_vm._s(item.label))]);
- })], 2)])]) : _vm._e()]], 2), _vm._v(" "), column.resizable ? _c('div', { staticClass: "ivu-table-header-resizable", on: { "mousedown": function mousedown($event) {
- return _vm.handleMouseDown(column, $event);
- }, "mousemove": function mousemove($event) {
- return _vm.handleMouseMove(column, $event);
- }, "mouseout": _vm.handleMouseOut } }) : _vm._e()]);
- }), _vm._v(" "), _vm.$parent.showVerticalScrollBar && rowIndex === 0 ? _c('th', { class: _vm.scrollBarCellClass(), attrs: { "rowspan": _vm.headRows.length } }) : _vm._e()], 2);
- }), 0)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 570 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__ = __webpack_require__(237);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- var __vue_render__, __vue_static_render_fns__
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue___default.a,
- __vue_render__,
- __vue_static_render_fns__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 571 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__ = __webpack_require__(238);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__ = __webpack_require__(572);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 572 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.draggable ? _c('tr', { class: _vm.rowClasses(_vm.row._index), attrs: { "draggable": _vm.draggable }, on: { "dragstart": function dragstart($event) {
- return _vm.onDrag($event, _vm.row._index);
- }, "drop": function drop($event) {
- return _vm.onDrop($event, _vm.row._index);
- }, "dragover": function dragover($event) {
- return _vm.allowDrop($event);
- } } }, [_vm._t("default")], 2) : _c('tr', { class: _vm.rowClasses(_vm.row._index), attrs: { "draggable": false } }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 573 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__ = __webpack_require__(239);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__ = __webpack_require__(575);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 574 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'TableSlot',
- functional: true,
- inject: ['tableRoot'],
- props: {
- row: Object,
- index: Number,
- column: {
- type: Object,
- default: null
- },
- display: {
- type: String,
- default: 'block'
- }
- },
- render: function render(h, ctx) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return h('div', {
- 'class': {
- 'ivu-table-cell-slot': true,
- 'ivu-table-cell-slot-inline': ctx.props.display === 'inline',
- 'ivu-table-cell-slot-inline-block': ctx.props.display === 'inline-block'
- }
- }, ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
- row: ctx.props.row,
- column: ctx.props.column,
- index: ctx.props.index
- }));
- }.bind(undefined)
- };
- /***/ }),
- /* 575 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "cell", class: _vm.classes }, [_vm.renderType === 'index' ? [_c('span', [_vm._v(_vm._s(_vm.column.indexMethod ? _vm.column.indexMethod(_vm.row, _vm.naturalIndex) : _vm.naturalIndex + 1))])] : _vm._e(), _vm._v(" "), _vm.renderType === 'selection' ? [_c('Checkbox', { attrs: { "value": _vm.checked, "disabled": _vm.disabled }, on: { "on-change": _vm.toggleSelect }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.handleClick($event);
- } } })] : _vm._e(), _vm._v(" "), _vm.showLevel ? _c('div', { staticClass: "ivu-table-cell-tree-level", style: _vm.treeLevelStyle }) : _vm._e(), _vm._v(" "), _vm.showChildren ? _c('div', { staticClass: "ivu-table-cell-tree", class: { 'ivu-table-cell-tree-loading': _vm.childrenLoading }, on: { "click": function click($event) {
- $event.preventDefault();$event.stopPropagation();return _vm.handleToggleTree($event);
- } } }, [_vm.childrenLoading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : !_vm.childrenExpand ? _c('Icon', { attrs: { "type": "ios-add" } }) : _c('Icon', { attrs: { "type": "ios-remove" } })], 1) : _vm.showTreeNode ? _c('div', { staticClass: "ivu-table-cell-tree ivu-table-cell-tree-empty" }) : _vm._e(), _vm._v(" "), _vm.renderType === 'html' ? [_c('span', { domProps: { "innerHTML": _vm._s(_vm.row[_vm.column.key]) } })] : _vm._e(), _vm._v(" "), _vm.renderType === 'normal' ? [_vm.column.tooltip ? [_c('Tooltip', { staticClass: "ivu-table-cell-tooltip", attrs: { "transfer": "", "content": _vm.row[_vm.column.key], "theme": _vm.column.tooltipTheme ? _vm.column.tooltipTheme : _vm.tableRoot.tooltipTheme, "disabled": !_vm.showTooltip, "max-width": _vm.column.tooltipMaxWidth ? _vm.column.tooltipMaxWidth : _vm.tableRoot.tooltipMaxWidth } }, [_c('span', { ref: "content", staticClass: "ivu-table-cell-tooltip-content", on: { "mouseenter": _vm.handleTooltipIn } }, [_vm._v(_vm._s(_vm.row[_vm.column.key]))])])] : _c('span', [_vm._v(_vm._s(_vm.row[_vm.column.key]))])] : _vm._e(), _vm._v(" "), _vm.renderType === 'expand' && !_vm.row._disableExpand ? [_c('div', { class: _vm.expandCls, on: { "click": _vm.toggleExpand } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1)] : _vm._e(), _vm._v(" "), _vm.renderType === 'render' ? _c('table-expand', { attrs: { "row": _vm.row, "column": _vm.column, "index": _vm.index, "render": _vm.column.render } }) : _vm._e(), _vm._v(" "), _vm.renderType === 'slot' ? _c('table-slot', { attrs: { "row": _vm.row, "column": _vm.column, "display": _vm.column.display || 'block', "index": _vm.index } }) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 576 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__ = __webpack_require__(241);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__ = __webpack_require__(577);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 577 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticStyle: { "overflow": "hidden" } }, [_c('table', { staticClass: "ivu-table-summary", style: _vm.styleObject, attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('colgroup', _vm._l(_vm.columns, function (column, index) {
- return _c('col', { attrs: { "width": _vm.setCellWidth(column) } });
- }), 0), _vm._v(" "), _c('tbody', { class: [_vm.prefixCls + '-tbody'] }, [_c('tr', { staticClass: "ivu-table-row" }, _vm._l(_vm.columns, function (column, index) {
- return _c('td', { class: _vm.alignCls(column) }, [_c('div', { staticClass: "ivu-table-cell", class: _vm.cellCls(column) }, [_c('span', [_vm._v(_vm._s(_vm.data[column.key].value))])])]);
- }), 0)])])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 578 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- var _assign = __webpack_require__(15);
- var _assign2 = _interopRequireDefault(_assign);
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- exports.default = csv;
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var newLine = '\r\n';
- var appendLine = function (content, row, _ref) {
- var separator = _ref.separator,
- quoted = _ref.quoted;
- (0, _newArrowCheck3.default)(undefined, undefined);
- var line = row.map(function (data) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (!quoted) return data;
- data = typeof data === 'string' ? data.replace(/"/g, '"') : data;
- return '"' + String(data) + '"';
- }.bind(undefined));
- content.push(line.join(separator));
- }.bind(undefined);
- var defaults = {
- separator: ',',
- quoted: false
- };
- function csv(columns, datas, options) {
- var _this = this;
- var noHeader = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- options = (0, _assign2.default)({}, defaults, options);
- var columnOrder = void 0;
- var content = [];
- var column = [];
- if (columns) {
- columnOrder = columns.map(function (v) {
- (0, _newArrowCheck3.default)(this, _this);
- if (typeof v === 'string') return v;
- if (!noHeader) {
- column.push(typeof v.title !== 'undefined' ? v.title : v.key);
- }
- return v.key;
- }.bind(this));
- if (column.length > 0) appendLine(content, column, options);
- } else {
- columnOrder = [];
- datas.forEach(function (v) {
- (0, _newArrowCheck3.default)(this, _this);
- if (!Array.isArray(v)) {
- columnOrder = columnOrder.concat((0, _keys2.default)(v));
- }
- }.bind(this));
- if (columnOrder.length > 0) {
- columnOrder = columnOrder.filter(function (value, index, self) {
- (0, _newArrowCheck3.default)(this, _this);
- return self.indexOf(value) === index;
- }.bind(this));
- if (!noHeader) appendLine(content, columnOrder, options);
- }
- }
- if (Array.isArray(datas)) {
- datas.forEach(function (row) {
- (0, _newArrowCheck3.default)(this, _this);
- if (!Array.isArray(row)) {
- row = columnOrder.map(function (k) {
- (0, _newArrowCheck3.default)(this, _this);
- return typeof row[k] !== 'undefined' ? row[k] : '';
- }.bind(this));
- }
- appendLine(content, row, options);
- }.bind(this));
- }
- return content.join(newLine);
- }
- /***/ }),
- /* 579 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- function has(browser) {
- var ua = navigator.userAgent;
- if (browser === 'ie') {
- var isIE = ua.indexOf('compatible') > -1 && ua.indexOf('MSIE') > -1;
- if (isIE) {
- var reIE = new RegExp('MSIE (\\d+\\.\\d+);');
- reIE.test(ua);
- return parseFloat(RegExp['$1']);
- } else {
- return false;
- }
- } else {
- return ua.indexOf(browser) > -1;
- }
- }
- var csv = {
- _isIE11: function _isIE11() {
- var iev = 0;
- var ieold = /MSIE (\d+\.\d+);/.test(navigator.userAgent);
- var trident = !!navigator.userAgent.match(/Trident\/7.0/);
- var rv = navigator.userAgent.indexOf('rv:11.0');
- if (ieold) {
- iev = Number(RegExp.$1);
- }
- if (navigator.appVersion.indexOf('MSIE 10') !== -1) {
- iev = 10;
- }
- if (trident && rv !== -1) {
- iev = 11;
- }
- return iev === 11;
- },
- _isEdge: function _isEdge() {
- return (/Edge/.test(navigator.userAgent)
- );
- },
- _getDownloadUrl: function _getDownloadUrl(text) {
- var BOM = '\uFEFF';
- if (window.Blob && window.URL && window.URL.createObjectURL) {
- var csvData = new Blob([BOM + text], { type: 'text/csv' });
- return URL.createObjectURL(csvData);
- } else {
- return 'data:attachment/csv;charset=utf-8,' + BOM + encodeURIComponent(text);
- }
- },
- download: function download(filename, text) {
- if (has('ie') && has('ie') < 10) {
- var oWin = window.top.open('about:blank', '_blank');
- oWin.document.charset = 'utf-8';
- oWin.document.write(text);
- oWin.document.close();
- oWin.document.execCommand('SaveAs', filename);
- oWin.close();
- } else if (has('ie') === 10 || this._isIE11() || this._isEdge()) {
- var BOM = '\uFEFF';
- var csvData = new Blob([BOM + text], { type: 'text/csv' });
- navigator.msSaveBlob(csvData, filename);
- } else {
- var link = document.createElement('a');
- link.download = filename;
- link.href = this._getDownloadUrl(text);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- }
- }
- };
- exports.default = csv;
- /***/ }),
- /* 580 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getRandomStr = exports.convertToRows = exports.getAllColumns = exports.convertColumnOrder = undefined;
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var convertColumnOrder = function (columns, fixedType) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var list = [];
- var other = [];
- columns.forEach(function (col) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (col.fixed && col.fixed === fixedType) {
- list.push(col);
- } else {
- other.push(col);
- }
- }.bind(undefined));
- return list.concat(other);
- }.bind(undefined);
- exports.convertColumnOrder = convertColumnOrder;
- var getAllColumns = function (cols) {
- var forTableHead = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- (0, _newArrowCheck3.default)(undefined, undefined);
- var columns = (0, _assist.deepCopy)(cols);
- var result = [];
- columns.forEach(function (column) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (column.children) {
- if (forTableHead) result.push(column);
- result.push.apply(result, getAllColumns(column.children, forTableHead));
- } else {
- result.push(column);
- }
- }.bind(undefined));
- return result;
- }.bind(undefined);
- exports.getAllColumns = getAllColumns;
- var convertToRows = function (columns) {
- var fixedType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- (0, _newArrowCheck3.default)(undefined, undefined);
- var originColumns = fixedType ? fixedType === 'left' ? (0, _assist.deepCopy)(convertColumnOrder(columns, 'left')) : (0, _assist.deepCopy)(convertColumnOrder(columns, 'right')) : (0, _assist.deepCopy)(columns);
- var maxLevel = 1;
- var traverse = function (column, parent) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (parent) {
- column.level = parent.level + 1;
- if (maxLevel < column.level) {
- maxLevel = column.level;
- }
- }
- if (column.children) {
- var colSpan = 0;
- column.children.forEach(function (subColumn) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- traverse(subColumn, column);
- colSpan += subColumn.colSpan;
- }.bind(undefined));
- column.colSpan = colSpan;
- } else {
- column.colSpan = 1;
- }
- }.bind(undefined);
- originColumns.forEach(function (column) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- column.level = 1;
- traverse(column);
- }.bind(undefined));
- var rows = [];
- for (var i = 0; i < maxLevel; i++) {
- rows.push([]);
- }
- var allColumns = getAllColumns(originColumns, true);
- allColumns.forEach(function (column) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- if (!column.children) {
- column.rowSpan = maxLevel - column.level + 1;
- } else {
- column.rowSpan = 1;
- }
- rows[column.level - 1].push(column);
- }.bind(undefined));
- return rows;
- }.bind(undefined);
- exports.convertToRows = convertToRows;
- var getRandomStr = function getRandomStr() {
- var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
- var $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
- var maxPos = $chars.length;
- var str = '';
- for (var i = 0; i < len; i++) {
- str += $chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return str;
- };
- exports.getRandomStr = getRandomStr;
- /***/ }),
- /* 581 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "tableWrap", class: _vm.wrapClasses, style: _vm.styles }, [_c('div', { class: _vm.classes }, [_vm.showSlotHeader ? _c('div', { ref: "title", class: [_vm.prefixCls + '-title'] }, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _vm.showHeader ? _c('div', { ref: "header", class: [_vm.prefixCls + '-header'], on: { "mousewheel": _vm.handleMouseWheel } }, [_c('table-head', { attrs: { "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableHeaderStyle, "columns": _vm.cloneColumns, "column-rows": _vm.columnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !(!!_vm.localeNoDataText && (!_vm.data || _vm.data.length === 0) || !!_vm.localeNoFilteredDataText && (!_vm.rebuildData || _vm.rebuildData.length === 0)), expression: "!((!!localeNoDataText && (!data || data.length === 0)) || (!!localeNoFilteredDataText && (!rebuildData || rebuildData.length === 0)))" }], ref: "body", class: [_vm.prefixCls + '-body'], style: _vm.bodyStyle, on: { "scroll": _vm.handleBodyScroll } }, [_c('table-body', { ref: "tbody", attrs: { "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableStyle, "columns": _vm.cloneColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { ref: "summary", attrs: { "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableStyle, "columns": _vm.cloneColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e(), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !!_vm.localeNoDataText && (!_vm.data || _vm.data.length === 0) || !!_vm.localeNoFilteredDataText && (!_vm.rebuildData || _vm.rebuildData.length === 0), expression: "((!!localeNoDataText && (!data || data.length === 0)) || (!!localeNoFilteredDataText && (!rebuildData || rebuildData.length === 0)))" }], class: [_vm.prefixCls + '-tip'], style: _vm.bodyStyle, on: { "scroll": _vm.handleBodyScroll } }, [_c('table', { attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('tbody', [_c('tr', [_c('td', { style: { 'height': _vm.bodyStyle.height, 'width': this.headerWidth + "px" } }, [!_vm.data || _vm.data.length === 0 ? _c('span', { domProps: { "innerHTML": _vm._s(_vm.localeNoDataText) } }) : _c('span', { domProps: { "innerHTML": _vm._s(_vm.localeNoFilteredDataText) } })])])])])]), _vm._v(" "), _vm.isLeftFixed ? _c('div', { class: _vm.fixedTableClasses, style: _vm.fixedTableStyle }, [_vm.showHeader ? _c('div', { class: _vm.fixedHeaderClasses }, [_c('table-head', { attrs: { "fixed": "left", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "column-rows": _vm.columnRows, "fixed-column-rows": _vm.leftFixedColumnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { ref: "fixedBody", class: [_vm.prefixCls + '-fixed-body'], style: _vm.fixedBodyStyle, on: { "mousewheel": _vm.handleFixedMousewheel, "DOMMouseScroll": _vm.handleFixedMousewheel } }, [_c('table-body', { attrs: { "fixed": "left", "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { style: { 'margin-top': _vm.showHorizontalScrollBar ? _vm.scrollBarWidth + 'px' : 0 }, attrs: { "fixed": "left", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.isRightFixed ? _c('div', { class: _vm.fixedRightTableClasses, style: _vm.fixedRightTableStyle }, [_vm.showHeader ? _c('div', { class: _vm.fixedHeaderClasses }, [_c('table-head', { attrs: { "fixed": "right", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "column-rows": _vm.columnRows, "fixed-column-rows": _vm.rightFixedColumnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { ref: "fixedRightBody", class: [_vm.prefixCls + '-fixed-body'], style: _vm.fixedBodyStyle, on: { "mousewheel": _vm.handleFixedMousewheel, "DOMMouseScroll": _vm.handleFixedMousewheel } }, [_c('table-body', { attrs: { "fixed": "right", "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { style: { 'margin-top': _vm.showHorizontalScrollBar ? _vm.scrollBarWidth + 'px' : 0 }, attrs: { "fixed": "right", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.isRightFixed ? _c('div', { class: [_vm.prefixCls + '-fixed-right-header'], style: _vm.fixedRightHeaderStyle }) : _vm._e(), _vm._v(" "), _vm.showSlotFooter ? _c('div', { ref: "footer", class: [_vm.prefixCls + '-footer'] }, [_vm._t("footer")], 2) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showResizeLine, expression: "showResizeLine" }], ref: "resizeLine", staticClass: "ivu-table-resize-line" }), _vm._v(" "), _vm.showContextMenu ? _c('div', { staticClass: "ivu-table-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1) : _vm._e(), _vm._v(" "), _vm.loading ? _c('Spin', { attrs: { "fix": "", "size": "large" } }, [_vm._t("loading")], 2) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 582 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _tabs = __webpack_require__(583);
- var _tabs2 = _interopRequireDefault(_tabs);
- var _pane = __webpack_require__(585);
- var _pane2 = _interopRequireDefault(_pane);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _tabs2.default.Pane = _pane2.default;
- exports.default = _tabs2.default;
- /***/ }),
- /* 583 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__ = __webpack_require__(242);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__ = __webpack_require__(584);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 584 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "tabsWrap", class: _vm.classes }, [_c('div', { class: [_vm.prefixCls + '-bar'] }, [_vm.showSlot ? _c('div', { class: [_vm.prefixCls + '-nav-right'] }, [_vm._t("extra")], 2) : _vm._e(), _vm._v(" "), _c('div', { ref: "navContainer", class: [_vm.prefixCls + '-nav-container'], attrs: { "tabindex": "0" }, on: { "keydown": [_vm.handleTabKeyNavigation, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])) {
- return null;
- }$event.preventDefault();return _vm.handleTabKeyboardSelect(false);
- }] } }, [_c('div', { ref: "navWrap", class: [_vm.prefixCls + '-nav-wrap', _vm.scrollable ? _vm.prefixCls + '-nav-scrollable' : ''] }, [_c('span', { class: [_vm.prefixCls + '-nav-prev', _vm.scrollable ? '' : _vm.prefixCls + '-nav-scroll-disabled'], on: { "click": _vm.scrollPrev } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _c('span', { class: [_vm.prefixCls + '-nav-next', _vm.scrollable ? '' : _vm.prefixCls + '-nav-scroll-disabled'], on: { "click": _vm.scrollNext } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('div', { ref: "navScroll", class: [_vm.prefixCls + '-nav-scroll'], on: { "DOMMouseScroll": _vm.handleScroll, "mousewheel": _vm.handleScroll } }, [_c('div', { ref: "nav", class: [_vm.prefixCls + '-nav'], style: _vm.navStyle }, [_c('div', { class: _vm.barClasses, style: _vm.barStyle }), _vm._v(" "), _vm._l(_vm.navList, function (item, index) {
- return _c('div', { class: _vm.tabCls(item), attrs: { "draggable": _vm.draggable }, on: { "click": function click($event) {
- return _vm.handleChange(index);
- }, "dblclick": function dblclick($event) {
- return _vm.handleDblclick(index);
- }, "contextmenu": function contextmenu($event) {
- $event.stopPropagation();return _vm.handleContextmenu(index, $event);
- }, "selectstart": function selectstart($event) {
- $event.stopPropagation();return _vm.handlePreventSelect(index, $event);
- }, "dragstart": function dragstart($event) {
- return _vm.handleDrag(index, $event);
- }, "drop": function drop($event) {
- return _vm.handleDrop(index, $event);
- }, "dragover": function dragover($event) {
- $event.preventDefault();
- } } }, [item.icon !== '' ? _c('Icon', { attrs: { "type": item.icon } }) : _vm._e(), _vm._v(" "), item.labelType === 'function' ? _c('Render', { attrs: { "render": item.label } }) : [_vm._v(_vm._s(item.label))], _vm._v(" "), _vm.showClose(item) ? _c('Icon', { class: [_vm.prefixCls + '-close'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.handleRemove(index);
- } } }) : _vm._e()], 2);
- })], 2)])])])]), _vm._v(" "), _c('div', { ref: "panes", class: _vm.contentClasses, style: _vm.contentStyle }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { staticClass: "ivu-tabs-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 585 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__ = __webpack_require__(243);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__ = __webpack_require__(586);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 586 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.show, expression: "show" }], class: _vm.prefixCls, style: _vm.contentStyle }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 587 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _tag = __webpack_require__(588);
- var _tag2 = _interopRequireDefault(_tag);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _tag2.default;
- /***/ }),
- /* 588 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__ = __webpack_require__(244);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__ = __webpack_require__(589);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 589 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.fade ? _c('transition', { attrs: { "name": "fade" } }, [_c('div', { class: _vm.classes, style: _vm.wraperStyles, on: { "click": function click($event) {
- $event.stopPropagation();return _vm.check($event);
- } } }, [_vm.showDot ? _c('span', { class: _vm.dotClasses, style: _vm.bgColorStyle }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.textClasses, style: _vm.textColorStyle }, [_vm._t("default")], 2), _vm._v(" "), _vm.closable ? _c('Icon', { class: _vm.iconClass, attrs: { "color": _vm.lineColor, "type": "ios-close" }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.close($event);
- } } }) : _vm._e()], 1)]) : _c('div', { class: _vm.classes, style: _vm.wraperStyles, on: { "click": function click($event) {
- $event.stopPropagation();return _vm.check($event);
- } } }, [_vm.showDot ? _c('span', { class: _vm.dotClasses, style: _vm.bgColorStyle }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.textClasses, style: _vm.textColorStyle }, [_vm._t("default")], 2), _vm._v(" "), _vm.closable ? _c('Icon', { class: _vm.iconClass, attrs: { "color": _vm.lineColor, "type": "ios-close" }, nativeOn: { "click": function click($event) {
- $event.stopPropagation();return _vm.close($event);
- } } }) : _vm._e()], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 590 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _time = __webpack_require__(591);
- var _time2 = _interopRequireDefault(_time);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _time2.default;
- /***/ }),
- /* 591 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(245);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(593);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 592 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getRelativeTime = undefined;
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- exports.default = function (timestamp, locale) {
- return getRelativeTime(timestamp, locale);
- };
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- var isEarly = function (timeStamp, currentTime) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return timeStamp <= currentTime;
- }.bind(undefined);
- var getHandledValue = function (num) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- return num < 10 ? '0' + num : num;
- }.bind(undefined);
- var getDate = function (timeStamp, startType) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var d = new Date(timeStamp);
- var year = d.getFullYear();
- var month = getHandledValue(d.getMonth() + 1);
- var date = getHandledValue(d.getDate());
- var hours = getHandledValue(d.getHours());
- var minutes = getHandledValue(d.getMinutes());
- var second = getHandledValue(d.getSeconds());
- var resStr = '';
- if (startType === 'year') resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second;else resStr = month + '-' + date + ' ' + hours + ':' + minutes;
- return resStr;
- }.bind(undefined);
- var getRelativeTime = exports.getRelativeTime = function (timeStamp, locale) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var currentTime = new Date().getTime();
- var IS_EARLY = isEarly(timeStamp, currentTime);
- var diff = currentTime - timeStamp;
- if (!IS_EARLY) diff = -diff;
- var resStr = '';
- var dirStr = IS_EARLY ? locale('i.time.before') || '前' : locale('i.time.after') || '后';
- if (diff < 1000) resStr = locale('i.time.just') || '刚刚';else if (diff < 60000) resStr = parseInt(diff / 1000) + (locale('i.time.seconds') || '秒') + dirStr;else if (diff >= 60000 && diff < 3600000) resStr = Math.floor(diff / 60000) + (locale('i.time.minutes') || '分钟') + dirStr;else if (diff >= 3600000 && diff < 86400000) resStr = Math.floor(diff / 3600000) + (locale('i.time.hours') || '小时') + dirStr;else if (diff >= 86400000 && diff < 2623860000) resStr = Math.floor(diff / 86400000) + (locale('i.time.days') || '天') + dirStr;else if (diff >= 2623860000 && diff <= 31567860000 && IS_EARLY) resStr = getDate(timeStamp);else resStr = getDate(timeStamp, 'year');
- return resStr;
- }.bind(undefined);
- /***/ }),
- /* 593 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.classes, on: { "click": _vm.handleClick } }, [_vm._v(_vm._s(_vm.date))]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 594 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _timeline = __webpack_require__(595);
- var _timeline2 = _interopRequireDefault(_timeline);
- var _timelineItem = __webpack_require__(597);
- var _timelineItem2 = _interopRequireDefault(_timelineItem);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- _timeline2.default.Item = _timelineItem2.default;
- exports.default = _timeline2.default;
- /***/ }),
- /* 595 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__ = __webpack_require__(246);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__ = __webpack_require__(596);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 596 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: _vm.classes }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 597 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__ = __webpack_require__(247);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__ = __webpack_require__(598);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 598 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.itemClasses }, [_c('div', { class: _vm.tailClasses }), _vm._v(" "), _c('div', { ref: "dot", class: _vm.headClasses, style: _vm.customColor }, [_vm._t("dot")], 2), _vm._v(" "), _c('div', { class: _vm.contentClasses }, [_vm._t("default")], 2)]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 599 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _timePicker = __webpack_require__(600);
- var _timePicker2 = _interopRequireDefault(_timePicker);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _timePicker2.default;
- /***/ }),
- /* 600 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _picker = __webpack_require__(157);
- var _picker2 = _interopRequireDefault(_picker);
- var _time = __webpack_require__(166);
- var _time2 = _interopRequireDefault(_time);
- var _timeRange = __webpack_require__(175);
- var _timeRange2 = _interopRequireDefault(_timeRange);
- var _timeMixins = __webpack_require__(58);
- var _timeMixins2 = _interopRequireDefault(_timeMixins);
- var _assist = __webpack_require__(3);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- mixins: [_picker2.default, _timeMixins2.default],
- components: { TimePickerPanel: _time2.default, RangeTimePickerPanel: _timeRange2.default },
- props: {
- type: {
- validator: function validator(value) {
- return (0, _assist.oneOf)(value, ['time', 'timerange']);
- },
- default: 'time'
- }
- },
- computed: {
- panel: function panel() {
- var isRange = this.type === 'timerange';
- return isRange ? 'RangeTimePickerPanel' : 'TimePickerPanel';
- },
- ownPickerProps: function ownPickerProps() {
- return {
- disabledHours: this.disabledHours,
- disabledMinutes: this.disabledMinutes,
- disabledSeconds: this.disabledSeconds,
- hideDisabledOptions: this.hideDisabledOptions
- };
- }
- },
- watch: {
- visible: function visible(_visible) {
- var _this = this;
- if (_visible) {
- this.$nextTick(function () {
- (0, _newArrowCheck3.default)(this, _this);
- var spinners = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
- spinners.forEach(function (instance) {
- (0, _newArrowCheck3.default)(this, _this);
- return instance.updateScroll();
- }.bind(this));
- }.bind(this));
- }
- }
- }
- };
- /***/ }),
- /* 601 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _tooltip = __webpack_require__(93);
- var _tooltip2 = _interopRequireDefault(_tooltip);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _tooltip2.default;
- /***/ }),
- /* 602 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _transfer = __webpack_require__(603);
- var _transfer2 = _interopRequireDefault(_transfer);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _transfer2.default;
- /***/ }),
- /* 603 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__ = __webpack_require__(248);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- var __vue_render__, __vue_static_render_fns__
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default.a,
- __vue_render__,
- __vue_static_render_fns__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 604 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__ = __webpack_require__(249);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__ = __webpack_require__(607);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 605 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__ = __webpack_require__(250);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__ = __webpack_require__(606);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 606 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls }, [_c('i-input', { attrs: { "size": "small", "icon": _vm.icon, "placeholder": _vm.placeholder }, on: { "on-click": _vm.handleClick }, model: { value: _vm.currentQuery, callback: function callback($$v) {
- _vm.currentQuery = $$v;
- }, expression: "currentQuery" } })], 1);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 607 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.listStyle }, [_c('div', { class: _vm.prefixCls + '-header' }, [_c('Checkbox', { attrs: { "value": _vm.checkedAll, "disabled": _vm.checkedAllDisabled }, on: { "on-change": _vm.toggleSelectAll } }), _vm._v(" "), _c('span', { class: _vm.prefixCls + '-header-title', on: { "click": function click($event) {
- return _vm.toggleSelectAll(!_vm.checkedAll);
- } } }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c('span', { class: _vm.prefixCls + '-header-count' }, [_vm._v(_vm._s(_vm.count))])], 1), _vm._v(" "), _c('div', { class: _vm.bodyClasses }, [_vm.filterable ? _c('div', { class: _vm.prefixCls + '-body-search-wrapper' }, [_c('Search', { attrs: { "prefix-cls": _vm.prefixCls + '-search', "query": _vm.query, "placeholder": _vm.filterPlaceholder }, on: { "on-query-clear": _vm.handleQueryClear, "on-query-change": _vm.handleQueryChange } })], 1) : _vm._e(), _vm._v(" "), _c('ul', { class: _vm.prefixCls + '-content' }, [_vm._l(_vm.filterData, function (item) {
- return _c('li', { class: _vm.itemClasses(item), on: { "click": function click($event) {
- $event.preventDefault();return _vm.select(item);
- } } }, [_c('Checkbox', { attrs: { "value": _vm.isCheck(item), "disabled": item.disabled } }), _vm._v(" "), _c('span', { domProps: { "innerHTML": _vm._s(_vm.showLabel(item)) } })], 1);
- }), _vm._v(" "), _c('li', { class: _vm.prefixCls + '-content-not-found' }, [_vm._v(_vm._s(_vm.notFoundText))])], 2)]), _vm._v(" "), _vm.showFooter ? _c('div', { class: _vm.prefixCls + '-footer' }, [_vm._t("default")], 2) : _vm._e()]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 608 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__ = __webpack_require__(251);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__ = __webpack_require__(609);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 609 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls + '-operation' }, [_vm.reverseOperation ? [_c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.leftActive }, nativeOn: { "click": function click($event) {
- return _vm.moveToRight($event);
- } } }, [_c('span', [_vm._v(_vm._s(_vm.operations[1]))]), _vm._v(" "), _c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.rightActive }, nativeOn: { "click": function click($event) {
- return _vm.moveToLeft($event);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.operations[0]))])], 1)] : [_c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.rightActive }, nativeOn: { "click": function click($event) {
- return _vm.moveToLeft($event);
- } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.operations[0]))])], 1), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.leftActive }, nativeOn: { "click": function click($event) {
- return _vm.moveToRight($event);
- } } }, [_c('span', [_vm._v(_vm._s(_vm.operations[1]))]), _vm._v(" "), _c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1)]], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 610 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _tree = __webpack_require__(611);
- var _tree2 = _interopRequireDefault(_tree);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _tree2.default;
- /***/ }),
- /* 611 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__ = __webpack_require__(252);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__ = __webpack_require__(615);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 612 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__ = __webpack_require__(253);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__ = __webpack_require__(614);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 613 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = {
- name: 'RenderCell',
- functional: true,
- props: {
- render: Function,
- data: Object,
- node: Array
- },
- render: function render(h, ctx) {
- (0, _newArrowCheck3.default)(undefined, undefined);
- var params = {
- root: ctx.props.node[0],
- node: ctx.props.node[1],
- data: ctx.props.data
- };
- return ctx.props.render(h, params);
- }.bind(undefined)
- };
- /***/ }),
- /* 614 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('collapse-transition', { attrs: { "appear": _vm.appear } }, [_c('ul', { class: _vm.classes }, [_c('li', { on: { "contextmenu": function contextmenu($event) {
- $event.stopPropagation();return _vm.handleContextmenu(_vm.data, $event);
- }, "selectstart": function selectstart($event) {
- $event.stopPropagation();return _vm.handlePreventSelect(_vm.data, $event);
- } } }, [_c('span', { class: _vm.arrowClasses, on: { "click": _vm.handleExpand } }, [_vm.showArrow ? _c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e(), _vm._v(" "), _vm.showLoading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : _vm._e()], 1), _vm._v(" "), _vm.showCheckbox ? _c('Checkbox', { attrs: { "value": _vm.data.checked, "indeterminate": _vm.data.indeterminate, "disabled": _vm.data.disabled || _vm.data.disableCheckbox }, nativeOn: { "click": function click($event) {
- $event.preventDefault();return _vm.handleCheck($event);
- } } }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.titleClasses, on: { "click": _vm.handleClickNode } }, [_vm.data.render ? _c('Render', { attrs: { "render": _vm.data.render, "data": _vm.data, "node": _vm.node } }) : _vm.isParentRender ? _c('Render', { attrs: { "render": _vm.parentRender, "data": _vm.data, "node": _vm.node } }) : [_vm._v(_vm._s(_vm.data.title))]], 2), _vm._v(" "), _vm._l(_vm.children, function (item, i) {
- return _vm.data.expand ? _c('Tree-node', { key: i, attrs: { "appear": _vm.appearByClickArrow, "data": item, "multiple": _vm.multiple, "show-checkbox": _vm.showCheckbox, "children-key": _vm.childrenKey } }) : _vm._e();
- })], 2)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 615 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "treeWrap", class: _vm.prefixCls }, [_vm._l(_vm.stateTree, function (item, i) {
- return _c('Tree-node', { key: i, attrs: { "data": item, "visible": "", "multiple": _vm.multiple, "show-checkbox": _vm.showCheckbox, "children-key": _vm.childrenKey } });
- }), _vm._v(" "), !_vm.stateTree.length ? _c('div', { class: [_vm.prefixCls + '-empty'] }, [_vm._v(_vm._s(_vm.localeEmptyText))]) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-tree-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1)], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 616 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _upload = __webpack_require__(617);
- var _upload2 = _interopRequireDefault(_upload);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.default = _upload2.default;
- /***/ }),
- /* 617 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__ = __webpack_require__(254);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__ = __webpack_require__(621);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 618 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__ = __webpack_require__(255);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__ = __webpack_require__(619);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 619 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: [_vm.prefixCls + '-list'] }, _vm._l(_vm.files, function (file) {
- return _c('li', { class: _vm.fileCls(file), on: { "click": function click($event) {
- return _vm.handleClick(file);
- } } }, [_c('span', { on: { "click": function click($event) {
- return _vm.handlePreview(file);
- } } }, [_c('Icon', { attrs: { "type": _vm.format(file) } }), _vm._v(" " + _vm._s(file.name) + "\n ")], 1), _vm._v(" "), _c('Icon', { directives: [{ name: "show", rawName: "v-show", value: file.status === 'finished', expression: "file.status === 'finished'" }], class: [_vm.prefixCls + '-list-remove'], attrs: { "type": "ios-close" }, nativeOn: { "click": function click($event) {
- return _vm.handleRemove(file);
- } } }), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [file.showProgress ? _c('i-progress', { attrs: { "stroke-width": 2, "percent": _vm.parsePercentage(file.percentage), "status": file.status === 'finished' && file.showProgress ? 'success' : 'normal' } }) : _vm._e()], 1)], 1);
- }), 0);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 620 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _newArrowCheck2 = __webpack_require__(1);
- var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
- var _keys = __webpack_require__(21);
- var _keys2 = _interopRequireDefault(_keys);
- exports.default = upload;
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- function getError(action, option, xhr) {
- var msg = 'fail to post ' + String(action) + ' ' + String(xhr.status) + '\'';
- var err = new Error(msg);
- err.status = xhr.status;
- err.method = 'post';
- err.url = action;
- return err;
- }
- function getBody(xhr) {
- var text = xhr.responseText || xhr.response;
- if (!text) {
- return text;
- }
- try {
- return JSON.parse(text);
- } catch (e) {
- return text;
- }
- }
- function upload(option) {
- var _this = this;
- if (typeof XMLHttpRequest === 'undefined') {
- return;
- }
- var xhr = new XMLHttpRequest();
- var action = option.action;
- if (xhr.upload) {
- xhr.upload.onprogress = function progress(e) {
- if (e.total > 0) {
- e.percent = e.loaded / e.total * 100;
- }
- option.onProgress(e);
- };
- }
- var formData = new FormData();
- if (option.data) {
- (0, _keys2.default)(option.data).map(function (key) {
- (0, _newArrowCheck3.default)(this, _this);
- formData.append(key, option.data[key]);
- }.bind(this));
- }
- formData.append(option.filename, option.file);
- xhr.onerror = function error(e) {
- option.onError(e);
- };
- xhr.onload = function onload() {
- if (xhr.status < 200 || xhr.status >= 300) {
- return option.onError(getError(action, option, xhr), getBody(xhr));
- }
- option.onSuccess(getBody(xhr));
- };
- xhr.open('post', action, true);
- if (option.withCredentials && 'withCredentials' in xhr) {
- xhr.withCredentials = true;
- }
- var headers = option.headers || {};
- for (var item in headers) {
- if (headers.hasOwnProperty(item) && headers[item] !== null) {
- xhr.setRequestHeader(item, headers[item]);
- }
- }
- xhr.send(formData);
- }
- /***/ }),
- /* 621 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls] }, [_c('div', { class: _vm.classes, on: { "click": _vm.handleClick, "drop": function drop($event) {
- $event.preventDefault();return _vm.onDrop($event);
- }, "paste": _vm.handlePaste, "dragover": function dragover($event) {
- $event.preventDefault();_vm.dragOver = true;
- }, "dragleave": function dragleave($event) {
- $event.preventDefault();_vm.dragOver = false;
- } } }, [_c('input', { ref: "input", class: [_vm.prefixCls + '-input'], attrs: { "type": "file", "multiple": _vm.multiple, "webkitdirectory": _vm.webkitdirectory, "accept": _vm.accept }, on: { "change": _vm.handleChange } }), _vm._v(" "), _vm._t("default")], 2), _vm._v(" "), _vm._t("tip"), _vm._v(" "), _vm.showUploadList ? _c('upload-list', { attrs: { "files": _vm.fileList }, on: { "on-file-remove": _vm.handleRemove, "on-file-preview": _vm.handlePreview } }) : _vm._e()], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 622 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.Col = exports.Row = undefined;
- var _row = __webpack_require__(623);
- var _row2 = _interopRequireDefault(_row);
- var _col = __webpack_require__(625);
- var _col2 = _interopRequireDefault(_col);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.Row = _row2.default;
- exports.Col = _col2.default;
- /***/ }),
- /* 623 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__ = __webpack_require__(256);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__ = __webpack_require__(624);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 624 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 625 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__ = __webpack_require__(257);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__ = __webpack_require__(626);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 626 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ }),
- /* 627 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.OptionGroup = exports.Option = exports.Select = undefined;
- var _select = __webpack_require__(74);
- var _select2 = _interopRequireDefault(_select);
- var _option = __webpack_require__(81);
- var _option2 = _interopRequireDefault(_option);
- var _optionGroup = __webpack_require__(628);
- var _optionGroup2 = _interopRequireDefault(_optionGroup);
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
- exports.Select = _select2.default;
- exports.Option = _option2.default;
- exports.OptionGroup = _optionGroup2.default;
- exports.default = _select2.default;
- /***/ }),
- /* 628 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__ = __webpack_require__(258);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__);
- /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__ = __webpack_require__(629);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
- /* script */
- /* template */
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
- __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue___default.a,
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__["render"],
- __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__["staticRenderFns"],
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
- /***/ }),
- /* 629 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var render = function render() {
- var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !_vm.hidden, expression: "!hidden" }], class: [_vm.prefixCls + '-wrap'] }, [_c('div', { class: [_vm.prefixCls + '-title'] }, [_vm._v(_vm._s(_vm.label))]), _vm._v(" "), _c('ul', [_c('li', { ref: "options", class: [_vm.prefixCls] }, [_vm._t("default")], 2)])]);
- };
- var staticRenderFns = [];
- exports.render = render;
- exports.staticRenderFns = staticRenderFns;
- /***/ })
- /******/ ]);
- });
- //# sourceMappingURL=iview.js.map
- /***/ }),
- /* 194 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- var languageListenerObjects = [];
- /* harmony default export */ __webpack_exports__["a"] = ({
- install: function install(Vue) {
- Vue.mixin({
- data: function data() {
- return {
- languageInit: false,
- languageData: {},
- languageType: window.localStorage['__language:type__'] || 'zh'
- };
- },
- watch: {
- languageType: {
- handler: function handler(type) {
- if (type && typeof this.initLanguage === "function") {
- this.initLanguage();
- }
- },
- immediate: true
- }
- },
- methods: {
- /**
- * 初始化语言数据
- * @private
- */
- __initLanguageData: function __initLanguageData() {
- var _this = this;
- if (this.languageInit === false) {
- this.languageInit = true;
- //
- this.addLanguageData({
- en: __webpack_require__(195).default,
- zh: __webpack_require__(196).default
- });
- //
- languageListenerObjects.push(function (lang) {
- _this.languageType = lang;
- });
- }
- },
- /**
- * 监听语言变化
- * @param callback
- */
- setLanguageListener: function setLanguageListener(callback) {
- if (typeof callback === 'function') {
- languageListenerObjects.push(function (lang) {
- callback(lang);
- });
- }
- },
- /**
- * 语言包数据
- * @param language
- * @param data
- */
- addLanguageData: function addLanguageData(language, data) {
- var _this2 = this;
- if ((typeof language === 'undefined' ? 'undefined' : _typeof(language)) === 'object') {
- Object.keys(language).forEach(function (key) {
- _this2.addLanguageData(key, language[key]);
- });
- return;
- }
- if (!language || (typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== "object") {
- return;
- }
- this.__initLanguageData();
- if (typeof this.languageData[language] === "undefined") {
- this.languageData[language] = {};
- }
- Object.assign(this.languageData[language], data);
- //
- if (language === 'en') {
- if (typeof this.languageData['zh'] === "undefined") {
- this.languageData['zh'] = {};
- }
- var cnData = {};
- for (var key in data) {
- if (data.hasOwnProperty(key) && typeof this.languageData['zh'][data[key]] === 'undefined') {
- cnData[data[key]] = key;
- }
- }
- Object.assign(this.languageData['zh'], cnData);
- } else if (language === 'zh') {
- if (typeof this.languageData['en'] === "undefined") {
- this.languageData['en'] = {};
- }
- var enData = {};
- for (var _key in data) {
- if (data.hasOwnProperty(_key) && typeof this.languageData['en'][data[_key]] === 'undefined') {
- enData[data[_key]] = _key;
- }
- }
- Object.assign(this.languageData['en'], enData);
- }
- },
- /**
- * 变化语言
- * @param language
- */
- setLanguage: function setLanguage(language) {
- this.__initLanguageData();
- window.localStorage['__language:type__'] = language;
- languageListenerObjects.forEach(function (call) {
- if (typeof call === 'function') {
- call(language);
- }
- });
- },
- /**
- * 获取语言
- * @returns {*}
- */
- getLanguage: function getLanguage() {
- this.__initLanguageData();
- return this.languageType;
- },
- /**
- * 替换%遍历
- * @param text
- * @param objects
- */
- replaceArgumentsLanguage: function replaceArgumentsLanguage(text, objects) {
- var j = 1;
- while (text.indexOf("%") !== -1) {
- if (_typeof(objects[j]) === "object") {
- text = text.replace("%", "");
- } else {
- text = text.replace("%", objects[j]);
- }
- j++;
- }
- return text;
- },
- /**
- * 显示语言
- * @return {string}
- */
- $L: function $L(text) {
- if (text) {
- this.__initLanguageData();
- //
- if (_typeof(this.languageData[this.languageType]) === "object") {
- var temp = this.languageData[this.languageType][text];
- if (temp === null) {
- return this.replaceArgumentsLanguage(text, arguments);
- }
- if (typeof temp !== 'undefined') {
- return this.replaceArgumentsLanguage(temp, arguments);
- }
- }
- //
- try {
- var key = '__language:Undefined__';
- var tmpData = JSON.parse(window.localStorage[key] || '{}');
- if (_typeof(tmpData[this.languageType]) !== "object") {
- tmpData[this.languageType] = {};
- }
- tmpData[this.languageType][text] = "";
- window.localStorage[key] = JSON.stringify(tmpData);
- } catch (e) {
- //
- }
- }
- return this.replaceArgumentsLanguage(text, arguments);
- }
- }
- });
- }
- });
- /***/ }),
- /* 195 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony default export */ __webpack_exports__["default"] = ({
- "3天": "3 days",
- "5天": "5 days",
- "7天": "7 days",
- "Github/Gitee图标": "Github/Gitee icon",
- "MD编辑器": "Markdown Cell",
- "[任务消息]": "[Task message]",
- "[图片]": "[image]",
- "[工作报告]": "[Work report]",
- "[已超期]": "[Expired]",
- "[文件]": "[file]",
- "[未知类型]": "[Unknown type]",
- "[来自关注任务]": "[Attention from the task]",
- "[来自工作报告]": "[From work report]",
- "[管理员]": "[Administrator]",
- "[视频通话]": "[Video call]",
- "[语音通话]": "[Voice call]",
- "上传": "Upload",
- "上传/浏览 图片": "Upload / browse pictures",
- "上传图片": "Upload image",
- "上传失败": "Upload failed",
- "上传文件": "Upload files",
- "上传时间": "Upload time",
- "上传者": "Uploaded by",
- "上午": "Morning",
- "下午": "In the afternoon",
- "下载": "Download",
- "下载次数": "Download times",
- "不重要不紧急": "Unimportant and not urgent",
- "两次密码输入不一致!": "Inconsistent new passwords!",
- "个人中心": "Personal Center",
- "个人资料": "Personal information",
- "产品开发": "Product development",
- "产品规划": "Product Planning",
- "产品计划": "Product plans",
- "仅作者可以修改。": "Only the author can modify it.",
- "仅作者可以阅读分享地址。": "Only the author can read the shared link.",
- "仅作者和文档成员可以修改。": "Only authors and document members can modify it.",
- "仅作者和文档成员可以阅读分享地址。": "Only authors and document members can read the shared link.",
- "仅有修改权限的人员。": "Only personnel with modification authority.",
- "仅项目负责人、任务创建人、任务负责人或任务关注人可查看任务详情。": "Only the project leader, task creator, task Leader, or task follower can view task details.",
- "今天": "Today",
- "以“http://”或“https://”开头": "Start with \"http: //\" or \"https: //\"",
- "任务内容": "Summary",
- "任务列表": "Task list",
- "任务列表为空,请先添加任务。": "The task list is empty, please add the task first.",
- "任务名称": "Task name",
- "任务完成 % 天后自动归档。": "Tasks are automatically archived % days after completion.",
- "任务已删除,点击确定关闭窗口。": "Task has been deleted, click OK to close the window.",
- "任务权限": "Mandate",
- "任务状态:": "Task Status:",
- "任务等级": "Level",
- "任务负责人": "Task leader",
- "任务负责人已改变,点击确定关闭窗口。": "The person-in-charge has been changed, click OK to close the window.",
- "企业版": "Enterprise Edition",
- "优先级": "Priority",
- "优先级:": "Priority:",
- "会员信息": "Member information",
- "你确定你要删除这个子任务吗?": "Are you sure you want to delete this subtask?",
- "你确定修改负责人设置为“%”吗?": "Are you sure to modify the person-in-charge to \"%\"?",
- "你确定取消管理员身份的操作吗?": "Are you sure to cancel the administrator?",
- "你确定将任务计划时间取消吗?": "Are you sure to cancel the scheduled time?",
- "你确定将任务计划时间设置为“%”吗?": "Are you sure to reschedule the task to \"%\" do?",
- "你确定要删除%【%】吗?": "Are you sure you want to delete % [%]?",
- "你确定要删除此列表吗?": "Are you sure to delete this list?",
- "你确定要删除此团队成员吗?": "Are you sure you want to delete this team?",
- "你确定要删除此对话吗?": "Are you sure you want to delete this conversation?",
- "你确定要删除此文件吗?": "Are you sure to delete this file?",
- "你确定要删除此文档吗?": "Are you sure you want to delete this document?",
- "你确定要删除此知识库吗?": "Are you sure you want to delete this knowledge base it?",
- "你确定要删除此项目吗?": "Are you sure you want to delete this project?",
- "你确定要删除汇报吗?": "Are you sure to delete the report?",
- "你确定要发送汇报吗?": "Are you sure to send the report?",
- "你确定要取消归档吗?": "Are you sure you want to cancel the archive?",
- "你确定要取消收藏此项目吗?": "Are you sure you want to unsubscribe this project?",
- "你确定要将此成员移出项目吗?": "Are you sure you want to do this project out of the members?",
- "你确定要将这些团队成员%[%]吗?": "Are you sure you want to these team members% [%] do?",
- "你确定要清除聊天记录吗?": "Are you sure you want to clear the chat history?",
- "你确定要解散群聊吗?": "Are you sure you want to disband a group chat?",
- "你确定要退出此项目吗?": "Are you sure you want to quit this project?",
- "你确定设置管理员的操作吗?": "Are you sure to set him/her as administrator?",
- "使用我上次抄送的人": "Use the person I cc'd last time",
- "使用换行添加多个子任务": "Add multiple subtasks using line feeds",
- "保存": "Save",
- "保存并发送": "Save and Send",
- "保存并返回": "Save and Return",
- "修改": "Modify",
- "修改了工作报告": "Revised work report",
- "修改任务": "Modify task",
- "修改团队成员": "Modify team member",
- "修改成功": "Successfully modified",
- "修改成功,请重新登录!": "Modified successfully, please log in again!",
- "修改成员信息": "Modify",
- "修改文档标题": "Modify the document title",
- "修改权限": "Modify permissions",
- "修改标题": "Modify Title",
- "修改群资料": "Modify group information",
- "修改计划时间": "Modify the scheduled time",
- "修改负责人": "Modify the person in charge",
- "修改项目任务": "Modify the project tasks",
- "偏好设置": "Preferences",
- "允许": "Allowed",
- "允许注册": "Allowed register",
- "全局团队管理": "Global Management Team",
- "全局知识库查看和管理": "View and manage the global knowledge base",
- "全局项目查看和管理": "View and manage the overall project",
- "全屏": "Full Screen",
- "全部": "All",
- "全部任务": "All tasks",
- "关注人": "Subscribers ",
- "关注任务": "Subscribe task",
- "关注时间": "Attention time",
- "关注的任务": "Task concern",
- "关注者:": "Followers:",
- "关键词": "Keywords",
- "关闭": "Shut down",
- "其它": "Other",
- "内容加载中.....": "Content Loading .....",
- "准备发布": "Ready for release",
- "分享": "Share",
- "分享文档": "Share documents",
- "分组": "Packet",
- "分组名称": "Group Name",
- "列表": "List",
- "列表开头": "Beginning of the list",
- "列表结尾": "End of the list",
- "创建于:": "Built in:",
- "创建人": "Founder",
- "创建日期": "Created Date",
- "创建时间": "Created date",
- "创建的任务": "Tasks created",
- "删除": "Delete",
- "删除任务": "Delete task",
- "删除列表": "Delete List",
- "删除团队成员": "Remove team members",
- "删除对话": "Delete a conversation",
- "删除成员": "Remove members",
- "删除提示": "Delete Tip",
- "删除文件": "Delete Files",
- "删除文档": "Delete Document",
- "删除汇报": "Delete report",
- "删除知识库": "Delete repository",
- "删除项目": "Remove project",
- "删除项目任务": "Delete project tasks",
- "刷新": "Refresh",
- "刷新列表": "Refresh",
- "刷新成功!": "Refresh success!",
- "前一周": "Prev Week",
- "前一天": "Prev Day",
- "前端开发": "Front-end development",
- "功能开启": "Feature is turned on",
- "加入IP": "Join IP",
- "加入分组": "Join Group",
- "加入时间": "Joined date",
- "加载下一页": "Next loading",
- "加载下一页...": "Loads next ...",
- "加载中...": "Loading...",
- "加载更多": "Load more",
- "加载更多...": "Load more...",
- "加载组件中...": "Loading...",
- "动态": "History",
- "历史消息": "Message History",
- "历史版本": "Historic version",
- "原计划时间": "Original time",
- "参与的项目": "Involved Projects",
- "发布": "Release",
- "发布成功": "Successfully posted",
- "发起群聊": "Start a group chat",
- "发送": "Send",
- "发送了工作报告": "Send the work report",
- "发送人": "Sender",
- "发送汇报": "Send report",
- "取消": "Cancel",
- "取消关注": "Unsubscribe",
- "取消归档": "Unarchiving",
- "取消收藏": "Unfavorite",
- "取消筛选": "Remove Filter",
- "取消管理员": "Cancel administrator",
- "取消计划时间": "Cancel a scheduled time",
- "同修改权限": "Same as modify permissions",
- "后一周": "Next Week",
- "后一天": "Next Day",
- "后端开发": "Back-end development",
- "周报": "Weekly",
- "周报/日报": "Weekly / Daily",
- "周视图": "Week",
- "呼叫失败!": "Call failed!",
- "团队": "Team",
- "团队分组管理": "Group Management Team",
- "团队成员": "Team member",
- "团队成员(%)更新了内容,<br/>更新时间:%。<br/><br/>点击【确定】加载最新内容。": "Team members (%) updated content, <br/> update time: %. <br/><br/> click \"ok\" to load the latest content.",
- "图形": "Graph",
- "图片": "Image",
- "在线知识库": "Online Knowledge Base",
- "在线知识库:在线流程图,在线文档,以及可视化的目录编排,文档管理无忧。": "Online Knowledge Base: Online flowchart, online documentation, and visualization of the catalog layout, document management worries.",
- "在这里输入事项,回车即可保存": "Here input matters, Enter to save",
- "基本信息": "Basic Information",
- "复制失败!": "Copy failed!",
- "复制成功!": "Copy successful!",
- "复制链接": "Copy Link",
- "大小": "Size",
- "天": "Day",
- "天空蓝": "Sky blue",
- "天视图": "Day",
- "头像": "Avatar",
- "如果不指定任务负责人则项目所有成员均可领此任务。": "If you do not specify a task leader, all members of the project can take the task.",
- "子任务": "Subtasks",
- "子任务描述...": "Subtask description...",
- "存档日期": "Archived Date",
- "完全开放": "Open",
- "完成": "Complete",
- "完成并归档": "Complete and Archive",
- "完成时间": "Complete time",
- "完成自动归档": "Auto archiving",
- "密码": "Password",
- "密码错长度至少6位!": "Wrong password length of at least 6!",
- "密码长度至少6位!": " Passwords must be at least 6 characters!",
- "对方:": "Person: ",
- "对方:拒绝接听": "Person: Refuse to answer",
- "导出": "Export",
- "导出CSV": "Export to CSV",
- "导出JPG图片": "Export to JPG",
- "导出PDF文件": "Export to PDF",
- "导出PNG图片": "Export to PNG",
- "导出TXT": "Export to TXT",
- "导出XLS": "Export to XLS",
- "导出XLSX": "Export to XLSX",
- "导出任务": "Export Task",
- "导出列表": "Export List",
- "导出结果": "Export Results",
- "将项目任务标记已完成": "The project marks the task has been completed",
- "将项目任务标记归档或未归档": "The project task tag archive or archives",
- "尊敬的会员": "Dear Member",
- "小时": "Hour",
- "居中": "Center",
- "展开全部节点": "Expand all nodes",
- "展开到一级节点": "Expand to a node",
- "展开到三级节点": "Expand the node to three",
- "展开到二级节点": "Expand the node to two",
- "展开到五级节点": "Expand the node to five",
- "展开到四级节点": "Expand to four nodes",
- "已发送": "Sent",
- "已完成": "Completed",
- "已完成任务": "Completed tasks",
- "已完成数": "Completed Number",
- "已完成的任务": "Completed Tasks",
- "已归档": "Archived",
- "已归档任务": "Archived tasks",
- "已签到": "Checked in",
- "已超期": "Overdue",
- "已锁定": "Locked",
- "建议尺寸:%": "Suggested size: %",
- "开启": "Open",
- "开放任务": "Open task",
- "归档": "Archive",
- "归档任务": "Archive task",
- "归档时间": "Archive Time",
- "归档权限": "Archive Permissions",
- "当前浏览器不支持音视频通话!": "Current browser does not support audio/video calls!",
- "待办": "Pending",
- "待办四象限": "Upcoming Quadrant",
- "待办四象限:突出事情优先级,帮助员工合理安排时间,提高工作效率。": "Four quadrant to-do: highlight what priority, to help employees arrange your time, improve work efficiency.",
- "待办日程": "Upcoming Schedule",
- "必须指定负责人,负责人需确认接收任务。": "You must specify the person in charge, the responsible person to be confirmed receiving task.",
- "恭喜你!已完成了所有待办": "Congratulations! You have completed all the to-do",
- "恭喜您成为管理员。": "Congratulations on becoming an administrator.",
- "您的帐号在其他地方(%)登录,您被迫退出,如果这不是您本人的操作,请注意帐号安全!": "Your account is logged in elsewhere (%), you are forced to log out, if this is not your own operation, please pay attention to account security!",
- "您的管理员身份已被撤销。": "Your administrator status has been revoked.",
- "您确定要删除此任务吗?": "Are you sure to delete this task?",
- "您确定要退出登录吗?": "Are you sure you want to sign out?",
- "成员": "Member",
- "成员分组": "Members of the group",
- "成员开放": "Members",
- "成员管理": "Members Management",
- "成员角色": "Member role",
- "我关注的任务": "Concerned Tasks",
- "我创建的任务": "Created tasks",
- "我归档的任务": "Archived tasks",
- "我的待办": "My to-do",
- "我的汇报": "My report",
- "我的知识库": "My Knowledge",
- "我管理的项目": "Managed Projects",
- "我负责的任务": "Tasks-in-charge",
- "所属知识库": "Knowledge belongs",
- "所属项目:": "View project:",
- "所有人(含游客)都可以阅读分享地址。": "Everyone (including visitors) can read the shared link.",
- "所有会员都可以修改。": "All members can modify it.",
- "所有会员都可以阅读分享地址。": "All members can read the shared link.",
- "手动": "Manually",
- "打开": "Open",
- "批量添加子任务": "Batch add subtasks",
- "抄送人": "Cc",
- "折叠": "Fold",
- "拒绝": "Refused",
- "拖动到这里发送给 %": "Send to drag%",
- "拖动到这里添加附件至 %": "Drag here to add attachments to%",
- "指定任务": "Specify the task",
- "接受": "Accept",
- "描述": "Description",
- "提交": "Submit",
- "搜索": "Search",
- "搜索成员": "Search members",
- "搜索知识库": "Search the Knowledge Base",
- "搜索项目、任务": "Search projects, tasks",
- "操作": "Operating",
- "操作员": "Operator",
- "操作记录": "Operation Records",
- "收到的汇报": "Received reports",
- "收藏": "Collect",
- "收藏时间": "Favorite time",
- "收藏的项目": "Favorite Projects",
- "放弃保存": "Discard",
- "敬请期待!": "Stay tuned!",
- "数据加载中.....": "Loading....",
- "数据加载失败!": "Loading failed!",
- "文件": "File",
- "文件 % 上传失败 %": "File upload failed%%",
- "文件 % 上传失败,%": "File upload failed%,%",
- "文件 % 太大,不能超过%。": "File % is too large to exceed %.",
- "文件 % 格式不正确,仅支持上传:%": "% File format is not correct, only supports uploading:%",
- "文件 % 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。": "% File format is incorrect, only jpg, jpeg, gif, png formats are supported.",
- "文件/图片": "File / Picture",
- "文件列表": "Document list",
- "文件名": "File name",
- "文件格式不正确": "File format is incorrect",
- "文本": "Text",
- "文本编辑器": "Text Cell",
- "文档历史版本": "Historical versions",
- "文档成员": "Members",
- "文档标题": "Document Title",
- "文档标题长度至少2位!": "Document title length of at least two!",
- "文档类型": "Document Type",
- "文档编辑": "Document editing",
- "文档设置": "Settings",
- "文档链接": "Links",
- "新增章节": "New Chapter",
- "新密码": "New password",
- "新建文档": "New Document",
- "新建汇报": "New report",
- "新建知识库": "New Knowledge",
- "新建项目": "New Project",
- "新计划时间": "New time",
- "无标题": "Untitled",
- "日报": "Daily",
- "日期": "Date",
- "日期范围": "Date range",
- "日程管理": "Calendar",
- "日程管理:可视化日程管理,快速搞定工作计划,了解工作宏观安排。": "Calendar: visual schedule management, quick to get the work plan, understand the macro work arrangements.",
- "旧密码": "Old password",
- "明天": "Tomorrow",
- "星期一": "Monday",
- "星期三": "Wednesday",
- "星期二": "Tuesday",
- "星期五": "Friday",
- "星期六": "Saturday",
- "星期四": "Thursday",
- "星期日": "Sunday",
- "是否放弃保存修改的内容?": "Do you want to abandon the modified contents?",
- "是否放弃修改的内容并返回?": "Whether to give up the modification and return?",
- "昵称": "Nickname",
- "昵称长度至少2位!": "Nicknames must be at least 2 characters!",
- "显示": "Show",
- "显示已完成": "Display completed",
- "晚上": "At night",
- "暂无子任务": "No subtasks",
- "暂无群公告": "No group bulletin",
- "更新提示": "Update",
- "最后登录IP": "Last Login IP",
- "最后登录时间": "Last login time",
- "最多只能上传 % 张图片。": "Can only upload % pictures.",
- "最多只能选择 % 张图片。": "Select at most % pictures.",
- "最少6位数": "At least 6 digits",
- "月视图": "Month",
- "有%条新消息": "There are new messages%",
- "未保存计划时间": "Unsaved planned time",
- "未完成": "Unfinished",
- "未完成任务": "Unfinished tasks",
- "未完成数": "Uncompleted Number",
- "未归档": "Unfiled",
- "本周": "This week",
- "本月": "This month",
- "权限": "Competence",
- "权限设置": "Permission Settings",
- "来自关注任务": "Attention from the task",
- "来自工作报告": "From work report",
- "查看": "View",
- "查看任务列表": "View Task List",
- "查看及管理项目成员": "View and manage project members",
- "查看图片": "View image",
- "查看已归档任务": "View archived task",
- "查看归档任务": "View archived task",
- "查看成员统计页面": "View member statistics page",
- "查看文件列表": "View File List",
- "查看权限": "View permissions",
- "查看甘特图": "View Gantt",
- "查看项目动态": "View Project News",
- "查看项目统计": "View project statistics",
- "标记": "Mark",
- "标记完成": "Mark completed",
- "标记已完成": "Mark as completed",
- "标记未完成": "Mark as unfinished",
- "标题": "Title",
- "样式": "Style",
- "欢迎您": "Welcome",
- "正在协作会员": "Collaborating member",
- "正在研发": "Under developing",
- "正在视频通话...": "On a video call...",
- "正在设计": "Under designing",
- "正在语音通话...": "On a voice call...",
- "正在进行其他操作,请稍后重试...": "Other operations in progress, please try again later...",
- "汇报标题": "Report title",
- "没有任何修改!": "No changes!",
- "没有相关内容": "No related content",
- "没有相关的数据": "No record",
- "没有相关的文件": "No related documents",
- "注册": "Register",
- "注册会员": "Registered",
- "注册账号": "Register",
- "注明:系统管理员拥有以下所有权限": "Note: Administrators have all of the following rights",
- "注:将同时删除列表下所有任务": "Note: This will delete all tasks in the list",
- "流程图": "Flow Chart",
- "测试": "Test",
- "浏览": "Browse",
- "浏览器不支持音视频通话!": "The browser does not support audio and video calls!",
- "浏览器阻止不是https的网站访问音视频,所以请尝试安装SSL!": "Browsers prevent sites that are not HTTPS from accessing audio and video, so try installing SSL!",
- "浏览图片": "View picture",
- "浏览图片空间的图片": "Browse pictures from Image Space",
- "浏览文档": "View the document",
- "添加": "Add",
- "添加一个新列表": "Add a new list",
- "添加任务": "Add a task",
- "添加任务至": "Adding to the task",
- "添加位置": "Add location",
- "添加分组": "Adding Grouping",
- "添加列表": "Add List",
- "添加后不可修改,使用英文逗号添加多个。": "Do not modify after adding, use [,] to add multiple.",
- "添加团队成员": "Add team members",
- "添加子任务": "Add subtasks",
- "添加成员": "Add Members",
- "添加流程": "Adding Process",
- "添加至列表结尾": "Add to the end of the list",
- "添加详细描述...": "Add a detailed description ...",
- "添加附件": "Add attachments",
- "添加项目任务": "Add project tasks",
- "清除聊天记录": "Clear chat history",
- "清除记录": "Clear History",
- "温柔冷光": "Gentle cold",
- "温馨提示": "Tips",
- "点击下载 (%)": "Click to download (%)",
- "点击可快速添加需要处理的事项": "Click to quickly add items need to be addressed",
- "点击弹出": "Click the pop-up",
- "状态": "Status",
- "现在": "Now",
- "甘特图": "Gantt chart",
- "用户名": "Username",
- "用户名长度至少2位!": "Username length of at least two!",
- "用户登录": "User login",
- "留空不修改": "Does not modify the blank",
- "留空默认: 自己": "Blank default: own",
- "留空默认:WookTeam © 2018-2020": "Default:WookTeam © 2018-2020",
- "登录": "Log in",
- "登录密码": "Login password",
- "登录成功": "Login successful",
- "登录有效时间": "Log effective time",
- "登录窗口": "Login window",
- "登录身份 % 小时过期,过期后需要重新登录。": "Log on as% hours expired, you need to log in again after expired.",
- "登录验证码": "Login verification code",
- "目录": "Table of Contents",
- "直接弹出": "Direct pop",
- "相关任务": "Related Tasks",
- "相关工作报告": "Related work report",
- "相关知识库": "Related Knowledge",
- "相关项目": "Related projects",
- "知识库": "Knowledge",
- "知识库名称": "Knowledge Name",
- "知识库名称长度至少2位!": "Knowledge name must be at least 2 characters!",
- "知识库目录": "Knowledge directory",
- "确定": "Determine",
- "确定操作": "Approve the operation",
- "确定要修改任务【%】的计划时间吗?<br/>开始时间:%<br/>结束时间:%": "Are you sure you want to change the scheduled time for task [%]? <br/> start time: %<br/> end time: %",
- "确认密码": "Confirm password",
- "确认密码错长度至少6位!": "Make sure the password is at least 6 digits long!",
- "确认操作": "Confirm the operation",
- "确认新密码": "Confirm the new password",
- "禁止": "Forbid",
- "私有文库": "Private",
- "移交项目": "Transfer",
- "移出分组": "Out of the grouping",
- "移出成员": "Members removed",
- "移动": "Mobile",
- "空白模板": "Blank template",
- "立即登陆": "Sign in",
- "第一次签到": "The first sign",
- "第二次签到": "The second sign",
- "等级": "Grade",
- "筛选": "Filter",
- "签到": "Attendance",
- "签到弹窗": "Check-pop",
- "签到时间时未签到时自动弹出签到窗口": "Automatic pop-up window when not in attendance when attendance time attendance",
- "签到时间:": "Check-in time:",
- "签到记录": "Attendance record",
- "签到设置": "Set sign",
- "管理权限": "Management permissions",
- "管理的项目": "Managed Projects",
- "类型": "Type",
- "系统提示": "System prompt",
- "系统皮肤": "Skin System",
- "系统设置": "System Settings",
- "紧凑冷光": "Compact cold light",
- "紧凑天盘": "Compact disc days",
- "紧凑经典": "Compact Classic",
- "紧急不重要": "Emergency and unimportant",
- "累计登陆次数": "Cumulative number of landing",
- "级别": "Level",
- "线框": "Wireframe",
- "组员权限": "Crew permission",
- "组长": "Leader",
- "经典天盘": "Classic Tin plate",
- "编辑": "Edit",
- "缩放": "Scaling",
- "网络繁忙,保存失败!": "The Internet is busy, save failed!",
- "网络繁忙,请稍后再试!": "Internet is busy, please try again later!",
- "群公告": "Group bulletin",
- "群名": "Group name",
- "群名称": "Group name",
- "群头像": "Group picture",
- "群聊": "Group chat",
- "群聊名称": "Group chat name",
- "职位/职称": "Position / Title",
- "脑图": "Brain Mapping",
- "脑图经典": "Figure classic brain",
- "自动": "Automatic",
- "自定义图片地址": "Custom Image URL",
- "自定义地址": "Custom address",
- "自己": "Own",
- "至": "To",
- "表情": "Emoji",
- "表格": "Form",
- "视频聊天": "Video chat",
- "视频通话": "Video call",
- "解散群聊": "Disbanded group chat",
- "解锁文档": "Unlock",
- "计划时间": "Schedule",
- "计划时间:": "Planning time:",
- "设为管理员": "Set as administrator",
- "设置": "Settings",
- "评论": "Comments",
- "详细内容加载中.....": "Details Loading .....",
- "语音聊天": "Voice chat",
- "语音通话": "Voice call",
- "请填写文档标题!": "Please fill out the document title!",
- "请填写用户名!": "Please enter username!",
- "请填写登录密码!": "Please fill in the login password!",
- "请填写知识库名称!": "Please fill in the knowledge base name!",
- "请填写确认密码!": "Please fill in the confirmation password!",
- "请填写项目名称!": "Please fill in project name!",
- "请稍候...": "Please wait...",
- "请输入列表名称": "Please enter a list of names",
- "请输入新密码!": "Please enter a new password!",
- "请输入新的列表名称": "Enter a new list name",
- "请输入新的文件名称": "Please enter a new file name",
- "请输入新的项目名称": "Please enter a new project name",
- "请输入旧密码!": "Please enter your old password!",
- "请输入昵称/用户名搜索": "Search by nickname or username",
- "请输入昵称!": "Please enter a nickname!",
- "请输入流程名称,多个可用英文逗号分隔。": "Use [,] to add multiple.",
- "请输入要发送的消息": "Please enter the message to be sent",
- "请重新输入新密码!": "Please re-enter the new password!",
- "负责人": "Principal",
- "负责人:": "Principle:",
- "负责的任务": "Responsible for tasks",
- "账号": "Account",
- "账号密码": "Account password",
- "超出文件大小限制": "File size limit exceeded",
- "超期": "Extended",
- "超期任务": "Overdue tasks",
- "软件开发": "Software Development",
- "轻量级的团队在线协作": "Lightweight online teamwork ",
- "输入任务,回车即可保存": "Enter the task, press Enter to save",
- "输入关键词搜索": "Enter search keywords",
- "输入评论,Enter发表评论,Shift+Enter换行": "Enter a comment, Enter comment, Shift + Enter Wrap",
- "还原": "Restore",
- "退出": "Drop out",
- "退出全屏": "Exit Full Screen",
- "退出登录": "Sign out",
- "退出群聊": "Exit group chat",
- "退出项目": "Quit Project",
- "选中节点,按enter键添加同级节点,tab键添加子节点": "Select the node, press Enter to add siblings, and TAB to add children",
- "选择关注人": "Select subscriber",
- "选择日期范围": "Select a date range",
- "选择负责人": "Select the person in charge",
- "选择起止时间": "Select the starting and ending time",
- "通话时长:%": "Length of call: %",
- "邀请视频通话...": "Invite video calls...",
- "邀请语音通话...": "Inviting voice calls...",
- "酷团队协作工具就从这里开始": "Cool team collaboration tools from here",
- "重命名": "Rename",
- "重命名列表": "Rename list",
- "重命名文件名": "Rename the file",
- "重命名项目": "Rename the project",
- "重置": "Reset",
- "重要不紧急": "Important but not urgent",
- "重要且紧急": "Important and urgent",
- "锁定后其他会员将无法修改保存文档。": "After locking, other members will not be able to modify the saved document.",
- "锁定文档": "Lock",
- "错误详情": "Error Details",
- "阅读权限": "Read permissions",
- "阶段": "Stage",
- "附件": "Attachments",
- "隐藏": "Hidden",
- "面板显示": "Panel displays",
- "音视频通话": "Audio video call",
- "项目": "Project",
- "项目信息": "Project information",
- "项目动态": "Project News",
- "项目名称": "Project name",
- "项目名称至少2个字!": "Project Name at least two words!",
- "项目名称:": "Project name:",
- "项目成员": "Project Members",
- "项目成员均可查看任务详情。": "Project members can view task details.",
- "项目权限": "Project Permissions",
- "项目模板": "Project Templates",
- "项目流程": "Project Flow",
- "项目简介": "Project introduction",
- "项目管理": "Project management",
- "项目管理:自定义项目看板,可视化任务安排。": "Project Management: Project custom signage, visualization tasks scheduled.",
- "项目统计": "Project Statistics",
- "项目设置": "Project Settings",
- "项目负责人": "Project leader",
- "项目面板": "Project panel",
- "项目面板是否显示已完成的任务": "Project panel for completed tasks",
- "项目面板显示已完成的任务。": "The project panel displays the completed tasks.",
- "项目面板隐藏已完成的任务。": "The project panel hides completed tasks.",
- "首次登陆需修改密码": "Password must be changed for the first login",
- "首页Logo": "Logo",
- "鱼骨图": "Fishbone Diagram",
- "默认节点": "The default node",
- "个人总计": "Total personal",
- "项目总任务数": "The total number of project tasks",
- "项目已完成数": "Number of projects have been completed",
- "项目未完成数": "The number of unfinished projects",
- "发送日期": "Send date"
- });
- /***/ }),
- /* 196 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony default export */ __webpack_exports__["default"] = ({});
- /***/ }),
- /* 197 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- /* harmony default export */ __webpack_exports__["a"] = ({
- install: function install(Vue) {
- Vue.mixin({
- data: function data() {
- return {
- mixinId: 0,
- //用户信息
- usrLogin: false,
- usrInfo: {},
- usrName: '',
- //浏览器宽度≤768返回true
- windowMax768: window.innerWidth <= 768
- };
- },
- mounted: function mounted() {
- var _this = this;
- if (typeof window.__mixinId != "number") window.__mixinId = 0;
- this.mixinId = window.__mixinId++;
- //
- this.usrLogin = $A.getToken() !== false;
- this.usrInfo = $A.getUserInfo();
- this.usrName = this.usrInfo.username || '';
- $A.setOnUserInfoListener('mixins_' + this.mixinId, function (data, isLogin) {
- _this.usrLogin = isLogin;
- _this.usrInfo = data;
- _this.usrName = _this.usrInfo.username || '';
- });
- //
- window.addEventListener('resize', this.windowMax768Listener);
- },
- beforeDestroy: function beforeDestroy() {
- $A.removeUserInfoListener('mixins_' + this.mixinId);
- window.removeEventListener('resize', this.windowMax768Listener);
- },
- methods: {
- isArray: function isArray(obj) {
- return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == '[object array]' && typeof obj.length == "number";
- },
- isJson: function isJson(obj) {
- return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
- },
- windowMax768Listener: function windowMax768Listener() {
- this.windowMax768 = window.innerWidth <= 768;
- }
- }
- });
- }
- });
- /***/ }),
- /* 198 */
- /***/ (function(module, exports) {
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
- function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
- /**
- * 基础函数
- */
- (function (window, $, undefined) {
- var _serverUrl = window.location.origin + '/';
- /**
- * =============================================================================
- * ************************** 基础函数类 **************************
- * =============================================================================
- */
- $.extend({
- /**
- * 身份识别码
- * @param text
- * @returns {*|string}
- */
- token: function token(text) {
- var token = this.storage('token') || '';
- if (typeof text === 'string') {
- this.storage('token', text);
- token = text;
- }
- return token;
- },
- /**
- * 随机获取范围
- * @param Min
- * @param Max
- * @returns {*}
- */
- randNum: function randNum(Min, Max) {
- var Range = Max - Min;
- var Rand = Math.random();
- return Min + Math.round(Rand * Range); //四舍五入
- },
- /**
- * 获取数组最后一个值
- * @param array
- * @returns {boolean}
- */
- last: function last(array) {
- var str = false;
- if ((typeof array === 'undefined' ? 'undefined' : _typeof(array)) === 'object' && array.length > 0) {
- str = array[array.length - 1];
- }
- return str;
- },
- /**
- * 字符串是否包含
- * @param string
- * @param find
- * @param lower
- * @returns {boolean}
- */
- strExists: function strExists(string, find) {
- var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- string += "";
- find += "";
- if (lower !== true) {
- string = string.toLowerCase();
- find = find.toLowerCase();
- }
- return string.indexOf(find) !== -1;
- },
- /**
- * 字符串是否左边包含
- * @param string
- * @param find
- * @param lower
- * @returns {boolean}
- */
- leftExists: function leftExists(string, find) {
- var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- string += "";
- find += "";
- if (lower !== true) {
- string = string.toLowerCase();
- find = find.toLowerCase();
- }
- return string.substring(0, find.length) === find;
- },
- /**
- * 删除左边字符串
- * @param string
- * @param find
- * @param lower
- * @returns {string}
- */
- leftDelete: function leftDelete(string, find) {
- var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- string += "";
- find += "";
- if (this.leftExists(string, find, lower)) {
- string = string.substring(find.length);
- }
- return string ? string : '';
- },
- /**
- * 字符串是否右边包含
- * @param string
- * @param find
- * @param lower
- * @returns {boolean}
- */
- rightExists: function rightExists(string, find) {
- var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- string += "";
- find += "";
- if (lower !== true) {
- string = string.toLowerCase();
- find = find.toLowerCase();
- }
- return string.substring(string.length - find.length) === find;
- },
- /**
- * 取字符串中间
- * @param string
- * @param start
- * @param end
- * @returns {*}
- */
- getMiddle: function getMiddle(string, start, end) {
- string = string.toString();
- if (this.ishave(start) && this.strExists(string, start)) {
- string = string.substring(string.indexOf(start) + start.length);
- }
- if (this.ishave(end) && this.strExists(string, end)) {
- string = string.substring(0, string.indexOf(end));
- }
- return string;
- },
- /**
- * 截取字符串
- * @param string
- * @param start
- * @param end
- * @returns {string}
- */
- subString: function subString(string, start, end) {
- string += "";
- if (!this.ishave(end)) {
- end = string.length;
- }
- return string.substring(start, end);
- },
- /**
- * 随机字符
- * @param len
- * @returns {string}
- */
- randomString: function randomString(len) {
- len = len || 32;
- var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678oOLl9gqVvUuI1';
- var maxPos = $chars.length;
- var pwd = '';
- for (var i = 0; i < len; i++) {
- pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return pwd;
- },
- /**
- * 判断是否有
- * @param set
- * @returns {boolean}
- */
- ishave: function ishave(set) {
- return !!(set !== null && set !== "null" && set !== undefined && set !== "undefined" && set);
- },
- /**
- * 相当于 intval
- * @param str
- * @param fixed
- * @returns {number}
- */
- runNum: function runNum(str, fixed) {
- var _s = Number(str);
- if (_s + "" === "NaN") {
- _s = 0;
- }
- if (/^[0-9]*[1-9][0-9]*$/.test(fixed)) {
- _s = _s.toFixed(fixed);
- var rs = _s.indexOf('.');
- if (rs < 0) {
- _s += ".";
- for (var i = 0; i < fixed; i++) {
- _s += "0";
- }
- }
- }
- return _s;
- },
- /**
- * 服务器地址
- * @param str
- * @returns {string}
- */
- serverUrl: function serverUrl(str) {
- if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
- return str;
- }
- return _serverUrl + str;
- },
- /**
- * 获取IP地址详情
- * @param ip
- * @param callback
- */
- getIpInfo: function getIpInfo(ip, callback) {
- var _this = this;
- if (!this.strExists(ip, ".")) {
- return;
- }
- var keyName = '__ip' + ip.substring(0, 1) + '__';
- var key = this.getMiddle(ip, '', '.');
- var res = this.loadFromlLocal(key, ip, '', keyName);
- if ((typeof res === 'undefined' ? 'undefined' : _typeof(res)) == "object") {
- if (typeof callback == "function") {
- callback(res);
- }
- return;
- }
- $A.ajax({
- url: $A.serverUrl('api/system/get/ipinfo'),
- data: { ip: ip },
- timeout: 8000,
- success: function success(res) {
- _this.savaToLocal(key, ip, res, keyName);
- if (typeof callback == "function") {
- callback(res);
- }
- }
- });
- },
- /**
- * 新增&&获取缓存数据
- * @param key
- * @param value
- * @returns {*}
- */
- storage: function storage(key, value) {
- var keyName = 'app';
- switch (window.location.pathname) {
- case "/admin":
- keyName += ":" + window.location.pathname.substr(1);
- break;
- }
- if (typeof value === 'undefined') {
- return this.loadFromlLocal('__::', key, '', '__' + keyName + '__');
- } else {
- this.savaToLocal('__::', key, value, '__' + keyName + '__');
- }
- },
- /**
- * 新增&&修改本地缓存
- * @param {string} id 唯一id
- * @param {string} key 标示
- * @param value 新增&修改的值
- * @param keyName 主键名称
- */
- savaToLocal: function savaToLocal(id, key, value, keyName) {
- try {
- if (typeof keyName === 'undefined') keyName = '__seller__';
- var seller = window.localStorage[keyName];
- if (!seller) {
- seller = {};
- seller[id] = {};
- } else {
- seller = JSON.parse(seller);
- if (!seller[id]) {
- seller[id] = {};
- }
- }
- seller[id][key] = value;
- window.localStorage[keyName] = JSON.stringify(seller);
- } catch (e) {}
- },
- /**
- * 查询本地缓存
- * @param {string} id 唯一id
- * @param {string} key 标示
- * @param def 如果查询不到显示的值
- * @param keyName 主键名称
- */
- loadFromlLocal: function loadFromlLocal(id, key, def, keyName) {
- if (typeof keyName === 'undefined') keyName = '__seller__';
- var seller = window.localStorage[keyName];
- if (!seller) {
- return def;
- }
- seller = JSON.parse(seller)[id];
- if (!seller) {
- return def;
- }
- var ret = seller[key];
- return ret || def;
- },
- /**
- * 补零
- * @param str
- * @param length
- * @param after
- * @returns {*}
- */
- zeroFill: function zeroFill(str, length, after) {
- str += "";
- if (str.length >= length) {
- return str;
- }
- var _str = '',
- _ret = '';
- for (var i = 0; i < length; i++) {
- _str += '0';
- }
- if (after || typeof after === 'undefined') {
- _ret = (_str + "" + str).substr(length * -1);
- } else {
- _ret = (str + "" + _str).substr(0, length);
- }
- return _ret;
- },
- /**
- * 时间戳转时间格式
- * @param format
- * @param v
- * @returns {string}
- */
- formatDate: function formatDate(format, v) {
- if (format === '') {
- format = 'Y-m-d H:i:s';
- }
- var dateObj = void 0;
- if (v instanceof Date) {
- dateObj = v;
- } else {
- if (typeof v === 'undefined') {
- v = new Date().getTime();
- } else if (/^(-)?\d{1,10}$/.test(v)) {
- v = v * 1000;
- } else if (/^(-)?\d{1,13}$/.test(v)) {
- v = v * 1000;
- } else if (/^(-)?\d{1,14}$/.test(v)) {
- v = v * 100;
- } else if (/^(-)?\d{1,15}$/.test(v)) {
- v = v * 10;
- } else if (/^(-)?\d{1,16}$/.test(v)) {
- v = v * 1;
- } else {
- return v;
- }
- dateObj = new Date(v);
- }
- //
- format = format.replace(/Y/g, dateObj.getFullYear());
- format = format.replace(/m/g, this.zeroFill(dateObj.getMonth() + 1, 2));
- format = format.replace(/d/g, this.zeroFill(dateObj.getDate(), 2));
- format = format.replace(/H/g, this.zeroFill(dateObj.getHours(), 2));
- format = format.replace(/i/g, this.zeroFill(dateObj.getMinutes(), 2));
- format = format.replace(/s/g, this.zeroFill(dateObj.getSeconds(), 2));
- return format;
- },
- /**
- * 租用时间差(不够1个小时算一个小时)
- * @param s
- * @param e
- * @returns {*}
- */
- timeDiff: function timeDiff(s, e) {
- if (typeof e === 'undefined') {
- e = Math.round(new Date().getTime() / 1000);
- }
- var d = e - s;
- if (d > 86400) {
- var day = Math.floor(d / 86400);
- var hour = Math.ceil((d - day * 86400) / 3600);
- if (hour > 0) {
- return day + '天' + hour + '小时';
- } else {
- return day + '天';
- }
- } else if (d > 3600) {
- return Math.ceil(d / 3600) + '小时';
- } else if (d > 60) {
- return Math.ceil(d / 60) + '分钟';
- } else if (d > 10) {
- return d + '秒';
- } else {
- return '刚刚';
- }
- },
- /**
- * 检测手机号码格式
- * @param str
- * @returns {boolean}
- */
- isMobile: function isMobile(str) {
- return (/^1([3456789])\d{9}$/.test(str)
- );
- },
- /**
- * 是否手机号码
- * @param phone
- * @returns {boolean}
- */
- isPhone: function isPhone(phone) {
- return this.isMobile(phone);
- },
- /**
- * 根据两点间的经纬度计算距离
- * @param lng1
- * @param lat1
- * @param lng2
- * @param lat2
- * @returns {string|*}
- */
- getDistance: function getDistance(lng1, lat1, lng2, lat2) {
- var DEF_PI = 3.14159265359; // PI
- var DEF_2PI = 6.28318530712; // 2*PI
- var DEF_PI180 = 0.01745329252; // PI/180.0
- var DEF_R = 6370693.5; // radius of earth
- //
- var ew1 = void 0,
- ns1 = void 0,
- ew2 = void 0,
- ns2 = void 0;
- var dx = void 0,
- dy = void 0,
- dew = void 0;
- var distance = void 0;
- // 角度转换为弧度
- ew1 = lng1 * DEF_PI180;
- ns1 = lat1 * DEF_PI180;
- ew2 = lng2 * DEF_PI180;
- ns2 = lat2 * DEF_PI180;
- // 经度差
- dew = ew1 - ew2;
- // 若跨东经和西经180 度,进行调整
- if (dew > DEF_PI) dew = DEF_2PI - dew;else if (dew < -DEF_PI) dew = DEF_2PI + dew;
- dx = DEF_R * Math.cos(ns1) * dew; // 东西方向长度(在纬度圈上的投影长度)
- dy = DEF_R * (ns1 - ns2); // 南北方向长度(在经度圈上的投影长度)
- // 勾股定理求斜边长
- distance = Math.sqrt(dx * dx + dy * dy).toFixed(0);
- return distance;
- },
- /**
- * 设置网页标题
- * @param title
- */
- setTile: function setTile(title) {
- document.title = title;
- var mobile = navigator.userAgent.toLowerCase();
- if (/iphone|ipad|ipod/.test(mobile)) {
- var iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- iframe.setAttribute('src', '/favicon.ico');
- var iframeCallback = function iframeCallback() {
- setTimeout(function () {
- iframe.removeEventListener('load', iframeCallback);
- document.body.removeChild(iframe);
- }, 0);
- };
- iframe.addEventListener('load', iframeCallback);
- document.body.appendChild(iframe);
- }
- },
- /**
- * 克隆对象
- * @param myObj
- * @returns {*}
- */
- cloneData: function cloneData(myObj) {
- if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) !== 'object') return myObj;
- if (myObj === null) return myObj;
- //
- if (typeof myObj.length === 'number') {
- var _myObj = _toArray(myObj),
- myNewObj = _myObj.slice(0);
- return myNewObj;
- } else {
- var _myNewObj = _objectWithoutProperties(myObj, []);
- return _myNewObj;
- }
- },
- /**
- * 将一个 JSON 字符串转换为对象(已try)
- * @param str
- * @param defaultVal
- * @returns {*}
- */
- jsonParse: function jsonParse(str, defaultVal) {
- if (str === null) {
- return defaultVal ? defaultVal : {};
- }
- if ((typeof str === 'undefined' ? 'undefined' : _typeof(str)) === "object") {
- return str;
- }
- try {
- return JSON.parse(str);
- } catch (e) {
- return defaultVal ? defaultVal : {};
- }
- },
- /**
- * 将 JavaScript 值转换为 JSON 字符串(已try)
- * @param json
- * @param defaultVal
- * @returns {string}
- */
- jsonStringify: function jsonStringify(json, defaultVal) {
- if ((typeof json === 'undefined' ? 'undefined' : _typeof(json)) !== 'object') {
- return json;
- }
- try {
- return JSON.stringify(json);
- } catch (e) {
- return defaultVal ? defaultVal : "";
- }
- },
- /**
- * 监听对象尺寸发生改变
- * @param obj
- * @param callback
- */
- resize: function resize(obj, callback) {
- var myObj = $A(obj);
- if (myObj.length === 0) return;
- var height = parseInt(myObj.outerHeight()),
- width = parseInt(myObj.outerWidth());
- var inter = setInterval(function () {
- if (myObj.length === 0) clearInterval(inter);
- var tmpHeight = parseInt(myObj.outerHeight()),
- tmpWidth = parseInt(myObj.outerWidth());
- if (height !== tmpHeight || width !== tmpWidth) {
- height = tmpHeight;
- width = tmpWidth;
- console.log(width, height);
- if (typeof callback === 'function') callback();
- }
- }, 250);
- },
- /**
- * 是否IOS
- * @returns {boolean|string}
- */
- isIos: function isIos() {
- var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
- return ua && /iphone|ipad|ipod|ios/.test(ua);
- },
- /**
- * 是否安卓
- * @returns {boolean|string}
- */
- isAndroid: function isAndroid() {
- var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
- return ua && ua.indexOf('android') > 0;
- },
- /**
- * 是否微信
- * @returns {boolean}
- */
- isWeixin: function isWeixin() {
- var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
- return ua.match(/MicroMessenger/i) + '' === 'micromessenger';
- },
- /**
- * 获取对象
- * @param obj
- * @param keys
- * @returns {string|*}
- */
- getObject: function getObject(obj, keys) {
- var object = obj;
- if (this.count(obj) === 0 || this.count(keys) === 0) {
- return "";
- }
- var arr = keys.replace(/,/g, "|").replace(/\./g, "|").split("|");
- $A.each(arr, function (index, key) {
- object = typeof object[key] === "undefined" ? "" : object[key];
- });
- return object;
- },
- /**
- * 统计数组或对象长度
- * @param obj
- * @returns {number}
- */
- count: function count(obj) {
- try {
- if (typeof obj === "undefined") {
- return 0;
- }
- if (typeof obj === "number") {
- obj += "";
- }
- if (typeof obj.length === 'number') {
- return obj.length;
- } else {
- var i = 0,
- key = void 0;
- for (key in obj) {
- i++;
- }
- return i;
- }
- } catch (e) {
- return 0;
- }
- },
- /**
- * 将数组或对象内容部分拼成字符串
- * @param obj
- * @returns {string}
- */
- objImplode: function objImplode(obj) {
- var _this2 = this;
- if (obj === null) {
- return "";
- }
- var str = "";
- $A.each(obj, function (key, val) {
- if (val !== null) {
- if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === "object" && _this2.count(val) > 0) {
- str += _this2.objImplode(val);
- } else {
- str += String(val);
- }
- }
- });
- return str.replace(/\s/g, "").replace(/undefined/g, "");
- },
- /**
- * 指定键获取url参数
- * @param key
- * @returns {*}
- */
- urlParameter: function urlParameter(key) {
- var params = this.urlParameterAll();
- return typeof key === "undefined" ? params : params[key];
- },
- urlParameterAll: function urlParameterAll() {
- var search = window.location.search || "";
- var arr = [];
- if (this.strExists(search, "?")) {
- arr = this.getMiddle(search, "?").split("&");
- }
- var params = {};
- for (var i = 0; i < arr.length; i++) {
- var data = arr[i].split("=");
- if (data.length === 2) {
- params[data[0]] = data[1];
- }
- }
- return params;
- },
- /**
- * 删除地址中的参数
- * @param url
- * @param parameter
- * @returns {string|*}
- */
- removeURLParameter: function removeURLParameter(url, parameter) {
- if (parameter instanceof Array) {
- parameter.forEach(function (key) {
- url = $A.removeURLParameter(url, key);
- });
- return url;
- }
- var urlparts = url.split('?');
- if (urlparts.length >= 2) {
- //参数名前缀
- var prefix = encodeURIComponent(parameter) + '=';
- var pars = urlparts[1].split(/[&;]/g);
- //循环查找匹配参数
- for (var i = pars.length; i-- > 0;) {
- if (pars[i].lastIndexOf(prefix, 0) !== -1) {
- //存在则删除
- pars.splice(i, 1);
- }
- }
- return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
- }
- return url;
- },
- /**
- * 连接加上参数
- * @param url
- * @param params
- * @returns {*}
- */
- urlAddParams: function urlAddParams(url, params) {
- if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === "object" && params !== null) {
- url += "";
- url += url.indexOf("?") === -1 ? '?' : '';
- for (var key in params) {
- if (!params.hasOwnProperty(key)) {
- continue;
- }
- url += '&' + key + '=' + params[key];
- }
- }
- return url.replace("?&", "?");
- },
- /**
- * 链接字符串
- * @param value 第一个参数为连接符
- * @returns {string}
- */
- stringConnect: function stringConnect() {
- var s = null;
- var text = "";
- for (var _len = arguments.length, value = Array(_len), _key = 0; _key < _len; _key++) {
- value[_key] = arguments[_key];
- }
- value.forEach(function (val) {
- if (s === null) {
- s = val;
- } else if (val) {
- if (val && text) text += s;
- text += val;
- }
- });
- return text;
- },
- /**
- * 判断两个对象是否相等
- * @param x
- * @param y
- * @returns {boolean}
- */
- objEquals: function objEquals(x, y) {
- var f1 = x instanceof Object;
- var f2 = y instanceof Object;
- if (!f1 || !f2) {
- return x === y;
- }
- if (Object.keys(x).length !== Object.keys(y).length) {
- return false;
- }
- for (var p in x) {
- if (x.hasOwnProperty(p)) {
- var a = x[p] instanceof Object;
- var b = y[p] instanceof Object;
- if (a && b) {
- if (!this.objEquals(x[p], y[p])) {
- return false;
- }
- } else if (x[p] != y[p]) {
- return false;
- }
- }
- }
- return true;
- },
- /**
- * 输入框内插入文本
- * @param object
- * @param content
- */
- insert2Input: function insert2Input(object, content) {
- if (object === null || (typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== "object") return;
- if (typeof object.length === 'number' && object.length > 0) object = object[0];
- var ele = _typeof(object.$el) === "object" ? $A(object.$el) : $A(object);
- if (ele.length === 0) return;
- var eleDom = ele[0];
- if (eleDom.tagName != "INPUT" && eleDom.tagName != "TEXTAREA") {
- if (ele.find("input").length === 0) {
- ele = ele.find("textarea");
- } else {
- ele = ele.find("input");
- }
- }
- if (ele.length === 0) return;
- eleDom = ele[0];
- if (eleDom.tagName != "INPUT" && eleDom.tagName != "TEXTAREA") return;
- var text = ele.val();
- var _eleDom = eleDom,
- selectionStart = _eleDom.selectionStart,
- selectionEnd = _eleDom.selectionEnd;
- ele.val('' + text.substring(0, selectionStart) + content + text.substring(selectionEnd, text.length));
- eleDom.dispatchEvent(new Event('input'));
- setTimeout(function () {
- if (eleDom.setSelectionRange) {
- var pos = text.substring(0, selectionStart).length + content.length;
- eleDom.focus();
- eleDom.setSelectionRange(pos, pos);
- }
- }, 10);
- },
- /**
- * iOS上虚拟键盘引起的触控错位
- */
- iOSKeyboardFixer: function iOSKeyboardFixer() {
- if (!this.isIos()) {
- return;
- }
- document.body.scrollTop = document.body.scrollTop + 1;
- document.body.scrollTop = document.body.scrollTop - 1;
- },
- autoDevwid: function autoDevwid(width) {
- var _width = width || 640;
- new function () {
- var _self = this;
- _self.width = _width; //设置默认最大宽度
- _self.fontSize = 30; //默认字体大小
- _self.widthProportion = function () {
- var p = (document.body && document.body.clientWidth || document.getElementsByTagName("html")[0].offsetWidth) / _self.width;
- return p > 1 ? 1 : p < 0.38 ? 0.38 : p;
- };
- _self.changePage = function () {
- document.getElementsByTagName("html")[0].setAttribute("style", "font-size:" + _self.widthProportion() * _self.fontSize + "px !important");
- };
- _self.changePage();
- window.addEventListener('resize', function () {
- _self.changePage();
- }, false);
- }();
- //
- var scale = $A(window).width() / _width;
- $A(".__auto").each(function () {
- if ($A(this).attr("data-original") !== "1") {
- $A(this).attr("data-original-top", parseInt($A(this).css("top")));
- $A(this).attr("data-original-right", parseInt($A(this).css("right")));
- $A(this).attr("data-original-bottom", parseInt($A(this).css("bottom")));
- $A(this).attr("data-original-left", parseInt($A(this).css("left")));
- $A(this).attr("data-original-width", parseInt($A(this).css("width")));
- $A(this).attr("data-original-height", parseInt($A(this).css("height")));
- $A(this).attr("data-original-line-height", parseInt($A(this).css("line-height")));
- $A(this).attr("data-original", "1");
- }
- var _t = parseInt($A(this).attr("data-original-top"));
- var _r = parseInt($A(this).attr("data-original-right"));
- var _b = parseInt($A(this).attr("data-original-bottom"));
- var _l = parseInt($A(this).attr("data-original-left"));
- var _w = parseInt($A(this).attr("data-original-width"));
- var _h = parseInt($A(this).attr("data-original-height"));
- var _lh = parseInt($A(this).attr("data-original-line-height"));
- //
- var _css = {};
- if (_t > 0) _css['top'] = _t * scale;
- if (_r > 0) _css['right'] = _r * scale;
- if (_b > 0) _css['bottom'] = _b * scale;
- if (_l > 0) _css['left'] = _l * scale;
- if (_w > 0) _css['width'] = _w * scale;
- if (_h > 0) _css['height'] = _h * scale;
- if (_lh > 0) _css['line-height'] = _lh * scale + 'px';
- $A(this).css(_css);
- });
- return scale;
- }
- });
- /**
- * =============================================================================
- * **************************** ihttp ****************************
- * =============================================================================
- */
- $.extend({
- serializeObject: function serializeObject(obj, parents) {
- if (typeof obj === 'string') return obj;
- var resultArray = [];
- var separator = '&';
- parents = parents || [];
- var newParents = void 0;
- function var_name(name) {
- if (parents.length > 0) {
- var _parents = '';
- for (var j = 0; j < parents.length; j++) {
- if (j === 0) _parents += parents[j];else _parents += '[' + encodeURIComponent(parents[j]) + ']';
- }
- return _parents + '[' + encodeURIComponent(name) + ']';
- } else {
- return encodeURIComponent(name);
- }
- }
- function var_value(value) {
- return encodeURIComponent(value);
- }
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) {
- var toPush = void 0;
- if (Array.isArray(obj[prop])) {
- toPush = [];
- for (var i = 0; i < obj[prop].length; i++) {
- if (!Array.isArray(obj[prop][i]) && _typeof(obj[prop][i]) === 'object') {
- newParents = parents.slice();
- newParents.push(prop);
- newParents.push(i + '');
- toPush.push($.serializeObject(obj[prop][i], newParents));
- } else {
- toPush.push(var_name(prop) + '[]=' + var_value(obj[prop][i]));
- }
- }
- if (toPush.length > 0) resultArray.push(toPush.join(separator));
- } else if (obj[prop] === null) {
- resultArray.push(var_name(prop) + '=');
- } else if (_typeof(obj[prop]) === 'object') {
- // Object, convert to named array
- newParents = parents.slice();
- newParents.push(prop);
- toPush = $.serializeObject(obj[prop], newParents);
- if (toPush !== '') resultArray.push(toPush);
- } else if (typeof obj[prop] !== 'undefined' && obj[prop] !== '') {
- // Should be string or plain value
- resultArray.push(var_name(prop) + '=' + var_value(obj[prop]));
- } else if (obj[prop] === '') resultArray.push(var_name(prop));
- }
- }
- return resultArray.join(separator);
- },
- // Global Ajax Setup
- globalAjaxOptions: {},
- ajaxSetup: function ajaxSetup(options) {
- if (options.type) options.method = options.type;
- $.each(options, function (optionName, optionValue) {
- $.globalAjaxOptions[optionName] = optionValue;
- });
- },
- // Ajax
- _jsonpRequests: 0,
- ihttp: function ihttp(options) {
- var defaults = {
- method: 'GET',
- data: false,
- async: true,
- cache: true,
- user: '',
- password: '',
- headers: {},
- xhrFields: {},
- statusCode: {},
- processData: true,
- dataType: 'text',
- contentType: 'application/x-www-form-urlencoded',
- timeout: 0
- };
- var callbacks = ['beforeSend', 'error', 'complete', 'success', 'statusCode'];
- //For jQuery guys
- if (options.type) options.method = options.type;
- // Merge global and defaults
- $.each($.globalAjaxOptions, function (globalOptionName, globalOptionValue) {
- if (callbacks.indexOf(globalOptionName) < 0) defaults[globalOptionName] = globalOptionValue;
- });
- // Function to run XHR callbacks and events
- function fireAjaxCallback(eventName, eventData, callbackName) {
- var a = arguments;
- if (eventName) $(document).trigger(eventName, eventData);
- if (callbackName) {
- // Global callback
- if (callbackName in $.globalAjaxOptions) $.globalAjaxOptions[callbackName](a[3], a[4], a[5], a[6]);
- // Options callback
- if (options[callbackName]) options[callbackName](a[3], a[4], a[5], a[6]);
- }
- }
- // Merge options and defaults
- $.each(defaults, function (prop, defaultValue) {
- if (!(prop in options)) options[prop] = defaultValue;
- });
- // Default URL
- if (!options.url) {
- options.url = window.location.toString();
- }
- // Parameters Prefix
- var paramsPrefix = options.url.indexOf('?') >= 0 ? '&' : '?';
- // UC method
- var _method = options.method.toUpperCase();
- // Data to modify GET URL
- if ((_method === 'GET' || _method === 'HEAD' || _method === 'OPTIONS' || _method === 'DELETE') && options.data) {
- var stringData = void 0;
- if (typeof options.data === 'string') {
- // Should be key=value string
- if (options.data.indexOf('?') >= 0) stringData = options.data.split('?')[1];else stringData = options.data;
- } else {
- // Should be key=value object
- stringData = $.serializeObject(options.data);
- }
- if (stringData.length) {
- options.url += paramsPrefix + stringData;
- if (paramsPrefix === '?') paramsPrefix = '&';
- }
- }
- // JSONP
- if (options.dataType === 'json' && options.url.indexOf('callback=') >= 0) {
- var callbackName = 'f7jsonp_' + Date.now() + $._jsonpRequests++;
- var abortTimeout = void 0;
- var callbackSplit = options.url.split('callback=');
- var requestUrl = callbackSplit[0] + 'callback=' + callbackName;
- if (callbackSplit[1].indexOf('&') >= 0) {
- var addVars = callbackSplit[1].split('&').filter(function (el) {
- return el.indexOf('=') > 0;
- }).join('&');
- if (addVars.length > 0) requestUrl += '&' + addVars;
- }
- // Create script
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.onerror = function () {
- clearTimeout(abortTimeout);
- fireAjaxCallback(undefined, undefined, 'error', null, 'scripterror');
- fireAjaxCallback('ajaxComplete ajax:complete', { scripterror: true }, 'complete', null, 'scripterror');
- };
- script.src = requestUrl;
- // Handler
- window[callbackName] = function (data) {
- clearTimeout(abortTimeout);
- fireAjaxCallback(undefined, undefined, 'success', data);
- script.parentNode.removeChild(script);
- script = null;
- delete window[callbackName];
- };
- document.querySelector('head').appendChild(script);
- if (options.timeout > 0) {
- abortTimeout = setTimeout(function () {
- script.parentNode.removeChild(script);
- script = null;
- fireAjaxCallback(undefined, undefined, 'error', null, 'timeout');
- }, options.timeout);
- }
- return;
- }
- // Cache for GET/HEAD requests
- if (_method === 'GET' || _method === 'HEAD' || _method === 'OPTIONS' || _method === 'DELETE') {
- if (options.cache === false) {
- options.url += paramsPrefix + '_nocache=' + Date.now();
- }
- }
- // Create XHR
- var xhr = new XMLHttpRequest();
- // Save Request URL
- xhr.requestUrl = options.url;
- xhr.requestParameters = options;
- // Open XHR
- xhr.open(_method, options.url, options.async, options.user, options.password);
- // Create POST Data
- var postData = null;
- if ((_method === 'POST' || _method === 'PUT' || _method === 'PATCH') && options.data) {
- if (options.processData) {
- var postDataInstances = [ArrayBuffer, Blob, Document, FormData];
- // Post Data
- if (postDataInstances.indexOf(options.data.constructor) >= 0) {
- postData = options.data;
- } else {
- // POST Headers
- var boundary = '---------------------------' + Date.now().toString(16);
- if (options.contentType === 'multipart\/form-data') {
- xhr.setRequestHeader('Content-Type', 'multipart\/form-data; boundary=' + boundary);
- } else {
- xhr.setRequestHeader('Content-Type', options.contentType);
- }
- postData = '';
- var _data = $.serializeObject(options.data);
- if (options.contentType === 'multipart\/form-data') {
- boundary = '---------------------------' + Date.now().toString(16);
- _data = _data.split('&');
- var _newData = [];
- for (var i = 0; i < _data.length; i++) {
- _newData.push('Content-Disposition: form-data; name="' + _data[i].split('=')[0] + '"\r\n\r\n' + _data[i].split('=')[1] + '\r\n');
- }
- postData = '--' + boundary + '\r\n' + _newData.join('--' + boundary + '\r\n') + '--' + boundary + '--\r\n';
- } else {
- postData = _data;
- }
- }
- } else {
- postData = options.data;
- }
- }
- // Additional headers
- if (options.headers) {
- $.each(options.headers, function (headerName, headerCallback) {
- xhr.setRequestHeader(headerName, headerCallback);
- });
- }
- // Check for crossDomain
- if (typeof options.crossDomain === 'undefined') {
- options.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(options.url) && RegExp.$2 !== window.location.host;
- }
- if (!options.crossDomain) {
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- }
- if (options.xhrFields) {
- $.each(options.xhrFields, function (fieldName, fieldValue) {
- xhr[fieldName] = fieldValue;
- });
- }
- var xhrTimeout = void 0;
- // Handle XHR
- xhr.onload = function (e) {
- if (xhrTimeout) clearTimeout(xhrTimeout);
- if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 0) {
- var responseData = void 0;
- if (options.dataType === 'json') {
- try {
- responseData = JSON.parse(xhr.responseText);
- fireAjaxCallback('ajaxSuccess ajax:success', { xhr: xhr }, 'success', responseData, xhr.status, xhr);
- } catch (err) {
- fireAjaxCallback('ajaxError ajax:error', {
- xhr: xhr,
- parseerror: true
- }, 'error', xhr, 'parseerror');
- }
- } else {
- responseData = xhr.responseType === 'text' || xhr.responseType === '' ? xhr.responseText : xhr.response;
- fireAjaxCallback('ajaxSuccess ajax:success', { xhr: xhr }, 'success', responseData, xhr.status, xhr);
- }
- } else {
- fireAjaxCallback('ajaxError ajax:error', { xhr: xhr }, 'error', xhr, xhr.status);
- }
- if (options.statusCode) {
- if ($.globalAjaxOptions.statusCode && $.globalAjaxOptions.statusCode[xhr.status]) $.globalAjaxOptions.statusCode[xhr.status](xhr);
- if (options.statusCode[xhr.status]) options.statusCode[xhr.status](xhr);
- }
- fireAjaxCallback('ajaxComplete ajax:complete', { xhr: xhr }, 'complete', xhr, xhr.status);
- };
- xhr.onerror = function (e) {
- if (xhrTimeout) clearTimeout(xhrTimeout);
- fireAjaxCallback('ajaxError ajax:error', { xhr: xhr }, 'error', xhr, xhr.status);
- fireAjaxCallback('ajaxComplete ajax:complete', { xhr: xhr, error: true }, 'complete', xhr, 'error');
- };
- // Ajax start callback
- fireAjaxCallback('ajaxStart ajax:start', { xhr: xhr }, 'start', xhr);
- fireAjaxCallback(undefined, undefined, 'beforeSend', xhr);
- // Timeout
- if (options.timeout > 0) {
- xhr.onabort = function () {
- if (xhrTimeout) clearTimeout(xhrTimeout);
- };
- xhrTimeout = setTimeout(function () {
- xhr.abort();
- fireAjaxCallback('ajaxError ajax:error', { xhr: xhr, timeout: true }, 'error', xhr, 'timeout');
- fireAjaxCallback('ajaxComplete ajax:complete', {
- xhr: xhr,
- timeout: true
- }, 'complete', xhr, 'timeout');
- }, options.timeout);
- }
- // Send XHR
- xhr.send(postData);
- // Return XHR object
- return xhr;
- }
- });
- /**
- * =============================================================================
- * ************************* Bootstrap extend ************************
- * =============================================================================
- */
- $.extend({
- toast: function toast(params, timeout, template) {
- var _bg = function _bg(num) {
- var container = $A(".__bootstrap_toast_container");
- if (container.length > 0) {
- var bgobj = container.find(".alert-bg");
- var bgnum = parseInt(bgobj.attr("data-num"));
- bgnum += num;
- bgobj.attr("data-num", bgnum);
- if (bgnum > 0) {
- bgobj.show();
- } else {
- bgobj.hide();
- }
- }
- };
- if (!params) return false;
- if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === 'object' && params.length > 0) {
- if (params.attr("data-show-bg") === "true") _bg(-1);
- params.css({ width: Math.ceil(params.outerWidth()) });
- params.addClass("leave");
- setTimeout(function () {
- params.remove();
- }, 300);
- return;
- }
- if (typeof timeout === 'string') {
- template = timeout;
- timeout = 2500;
- }
- if (typeof params === 'string') params = { title: params };
- if (typeof params.timeout === 'undefined') params.timeout = 2500;
- if (typeof params.template === 'undefined') params.template = 'success';
- if (typeof params.fixed === 'undefined') params.fixed = false;
- if (typeof params.close === 'undefined') params.close = true;
- if (typeof timeout !== 'undefined') params.timeout = timeout;
- if (typeof template !== 'undefined') params.template = template;
- //
- var container = $A(".__bootstrap_toast_container");
- if (container.length === 0) {
- $A("<style>").attr({ type: "text/css" }).html(".__bootstrap_toast_container{position:fixed;z-index:99999;top:5%;right:5%;padding:0;text-align:right;}" + ".__bootstrap_toast_container .alert-bg{position:fixed;display:none;z-index:1;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.6);}" + ".__bootstrap_toast_container .alert-body{position:relative;z-index:2;display:block;min-width:180px;text-align:left;opacity:0;transform:translate3d(0,100px,0);-webkit-transform:translate3d(0,100px,0);transition-duration:300ms;-webkit-transition-duration:300ms;}" + ".__bootstrap_toast_container .alert-body.enter{opacity:1;transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);}" + ".__bootstrap_toast_container .alert-body.leave{position:absolute;top:0;right:0;z-index:3;opacity:0;transform:translate3d(100%,0,0);-webkit-transform:translate3d(100%,0,0);transition-duration:200ms;-webkit-transition-duration:300ms;}" + "").appendTo("head");
- $A("body").append("<div class='__bootstrap_toast_container'><div class='alert-bg' data-num='0'></div></div>");
- container = $A(".__bootstrap_toast_container");
- }
- //
- var $intemp = $A('<div class="alert-body alert alert-' + params.template + ' alert-dismissible" role="alert"><button type="button" class="close"><span aria-hidden="true">×</span></button>' + params.title + '</div>');
- if (params.close === false) {
- $intemp.removeClass("alert-dismissible");
- $intemp.find(".close").remove();
- } else {
- $intemp.find(".close").click(function () {
- $A.toast($intemp);
- });
- }
- if (params.fixed === true) {
- _bg(1);
- $intemp.attr("data-show-bg", "true");
- }
- container.append($intemp);
- //
- if (typeof params.timeout === 'number') {
- setTimeout(function () {
- $A.toast($intemp);
- }, params.timeout);
- }
- setTimeout(function () {
- $intemp.addClass("enter");
- }, 10);
- //
- return $intemp;
- }
- });
- /**
- * =============================================================================
- * ***************************** ajax ****************************
- * =============================================================================
- */
- $.extend({
- ajax: function ajax(params) {
- if (!params) return false;
- if (typeof params.url === 'undefined') return false;
- if (typeof params.data === 'undefined') params.data = {};
- if (typeof params.cache === 'undefined') params.cache = false;
- if (typeof params.method === 'undefined') params.method = 'GET';
- if (typeof params.timeout === 'undefined') params.timeout = 30000;
- if (typeof params.dataType === 'undefined') params.dataType = 'json';
- if (typeof params.beforeSend === 'undefined') params.beforeSend = function () {};
- if (typeof params.complete === 'undefined') params.complete = function () {};
- if (typeof params.afterComplete === 'undefined') params.afterComplete = function () {};
- if (typeof params.success === 'undefined') params.success = function () {};
- if (typeof params.error === 'undefined') params.error = function () {};
- //
- var loadText = "数据加载中.....";
- var busyNetwork = "网络繁忙,请稍后再试!";
- if (_typeof($A.app) === 'object' && typeof $A.app.$L === 'function') {
- loadText = $A.app.$L(loadText);
- busyNetwork = $A.app.$L(busyNetwork);
- }
- //
- var toastID = null,
- beforeTitle = '',
- errorTitle = '';
- if (_typeof($A.app) === 'object' && _typeof($A.app.$Message) === 'object') {
- if (typeof params.beforeSend === 'string') {
- beforeTitle = params.beforeSend;
- params.beforeSend = function () {
- toastID = $A.app.$Message.loading({ content: beforeTitle, duration: 0 });
- };
- } else if (params.beforeSend === true) {
- params.beforeSend = function () {
- toastID = $A.app.$Message.loading({ content: loadText, duration: 0 });
- };
- }
- if (typeof params.error === 'string') {
- errorTitle = params.error;
- params.error = function () {
- $A.app.$Message.error({ content: errorTitle, duration: 5 });
- };
- } else if (params.error === true) {
- params.error = function () {
- $A.app.$Message.error({ content: busyNetwork, duration: 5 });
- };
- }
- if (params.complete === true) {
- params.complete = function () {
- toastID ? toastID() : '';
- };
- }
- } else {
- if (typeof params.beforeSend === 'string') {
- beforeTitle = params.beforeSend;
- params.beforeSend = function () {
- toastID = $A.toast({ title: beforeTitle, fixed: true, timeout: false });
- };
- } else if (params.beforeSend === true) {
- params.beforeSend = function () {
- toastID = $A.toast({ title: loadText, fixed: true, timeout: false });
- };
- }
- if (typeof params.error === 'string') {
- errorTitle = params.error;
- params.error = function () {
- $A.toast(errorTitle, "danger");
- };
- } else if (params.error === true) {
- params.error = function () {
- $A.toast(busyNetwork, "danger");
- };
- }
- if (params.complete === true) {
- params.complete = function () {
- toastID ? $A.toast(toastID) : '';
- };
- }
- }
- //
- if (_typeof(params.header) !== 'object') params.header = {};
- params.header['Content-Type'] = 'application/json';
- params.header['language'] = window.localStorage['__language:type__'] || 'zh';
- params.header['token'] = $A.token();
- //
- params.data['__Access-Control-Allow-Origin'] = true;
- params.beforeSend();
- $A.ihttp({
- url: params.url,
- data: params.data,
- cache: params.cache,
- headers: params.header,
- method: params.method.toUpperCase(),
- contentType: "OPTIONS",
- crossDomain: true,
- dataType: params.dataType,
- timeout: params.timeout,
- success: function success(data, status, xhr) {
- params.complete();
- params.success(data, status, xhr);
- params.afterComplete(true);
- },
- error: function error(xhr, status) {
- params.complete();
- params.error(xhr, status);
- params.afterComplete(false);
- }
- });
- }
- });
- /**
- * =============================================================================
- * ***************************** manage assist ****************************
- * =============================================================================
- */
- $.extend({
- /**
- * 对象中有Date格式的转成指定格式
- * @param myObj
- * @param format 默认格式:Y-m-d
- * @returns {*}
- */
- date2string: function date2string(myObj, format) {
- if (myObj === null) {
- return myObj;
- }
- if (typeof format === "undefined") {
- format = "Y-m-d";
- }
- if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) === "object") {
- if (myObj instanceof Date) {
- return $A.formatDate(format, myObj);
- }
- $A.each(myObj, function (key, val) {
- myObj[key] = $A.date2string(val, format);
- });
- return myObj;
- }
- return myObj;
- },
- /**
- * 获取一些指定时间
- * @param str
- * @param retInt
- * @returns {*|string}
- */
- getData: function getData(str) {
- var retInt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var now = new Date(); //当前日期
- var nowDayOfWeek = now.getDay(); //今天本周的第几天
- var nowDay = now.getDate(); //当前日
- var nowMonth = now.getMonth(); //当前月
- var nowYear = now.getYear(); //当前年
- nowYear += nowYear < 2000 ? 1900 : 0;
- var lastMonthDate = new Date(); //上月日期
- lastMonthDate.setDate(1);
- lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
- var lastMonth = lastMonthDate.getMonth();
- var getQuarterStartMonth = function getQuarterStartMonth() {
- var quarterStartMonth = 0;
- if (nowMonth < 3) {
- quarterStartMonth = 0;
- }
- if (2 < nowMonth && nowMonth < 6) {
- quarterStartMonth = 3;
- }
- if (5 < nowMonth && nowMonth < 9) {
- quarterStartMonth = 6;
- }
- if (nowMonth > 8) {
- quarterStartMonth = 9;
- }
- return quarterStartMonth;
- };
- var getMonthDays = function getMonthDays(myMonth) {
- var monthStartDate = new Date(nowYear, myMonth, 1);
- var monthEndDate = new Date(nowYear, myMonth + 1, 1);
- return (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
- };
- //
- var time = now.getTime();
- switch (str) {
- case '今天':
- time = now;
- break;
- case '昨天':
- time = now - 86400000;
- break;
- case '前天':
- time = now - 86400000 * 2;
- break;
- case '本周':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
- break;
- case '本周结束':
- time = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
- break;
- case '上周':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7);
- break;
- case '上周结束':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1);
- break;
- case '本周2':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
- break;
- case '本周结束2':
- time = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek) + 1);
- break;
- case '上周2':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7 + 1);
- break;
- case '上周结束2':
- time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1 + 1);
- break;
- case '本月':
- time = new Date(nowYear, nowMonth, 1);
- break;
- case '本月结束':
- time = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
- break;
- case '上个月':
- time = new Date(nowYear, lastMonth, 1);
- break;
- case '上个月结束':
- time = new Date(nowYear, lastMonth, getMonthDays(lastMonth));
- break;
- case '本季度':
- time = new Date(nowYear, getQuarterStartMonth(), 1);
- break;
- case '本季度结束':
- var quarterEndMonth = getQuarterStartMonth() + 2;
- time = new Date(nowYear, quarterEndMonth, getMonthDays(quarterEndMonth));
- break;
- }
- if (retInt === true) {
- return time;
- }
- return $A.formatDate("Y-m-d", parseInt(time / 1000));
- },
- /**
- * 字节转换
- * @param bytes
- * @returns {string}
- */
- bytesToSize: function bytesToSize(bytes) {
- if (bytes === 0) return '0 B';
- var k = 1024;
- var sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
- var i = Math.floor(Math.log(bytes) / Math.log(k));
- if (typeof sizes[i] === "undefined") {
- return '0 B';
- }
- return $A.runNum(bytes / Math.pow(k, i), 2) + ' ' + sizes[i];
- }
- });
- window.$A = $;
- })(window, window.jQuery);
- /***/ }),
- /* 199 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sass_main_scss__ = __webpack_require__(200);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sass_main_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__sass_main_scss__);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- /**
- * 页面专用
- */
- (function (window) {
- var _apiUrl = window.location.origin + '/api/';
- var $ = window.$A;
- $.extend({
- fillUrl: function fillUrl(str) {
- if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
- return str;
- }
- return window.location.origin + '/' + str;
- },
- webUrl: function webUrl(str) {
- return $A.fillUrl(str || '');
- },
- apiUrl: function apiUrl(str) {
- if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
- return str;
- }
- return _apiUrl + str;
- },
- apiAjax: function apiAjax(params) {
- if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') return false;
- if (typeof params.success === 'undefined') params.success = function () {};
- params.url = this.apiUrl(params.url);
- //
- var beforeCall = params.beforeSend;
- params.beforeSend = function () {
- $A.aAjaxLoad++;
- $A(".w-spinner").show();
- //
- if (typeof beforeCall == "function") {
- beforeCall();
- }
- };
- //
- var completeCall = params.complete;
- params.complete = function () {
- $A.aAjaxLoad--;
- if ($A.aAjaxLoad <= 0) {
- $A(".w-spinner").hide();
- }
- //
- if (typeof completeCall == "function") {
- completeCall();
- }
- };
- //
- var callback = params.success;
- params.success = function (data, status, xhr) {
- if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
- if (data.ret === -1 && params.checkRole !== false) {
- //身份丢失
- $A.app.$Modal.error({
- title: '温馨提示',
- content: data.msg,
- onOk: function onOk() {
- $A.userLogout();
- }
- });
- return;
- }
- if (data.ret === -2 && params.role !== false) {
- //没有权限
- $A.app.$Modal.error({
- title: '权限不足',
- content: data.msg ? data.msg : "你没有相关的权限查看或编辑!"
- });
- }
- }
- if (typeof callback === "function") {
- callback(data, status, xhr);
- }
- };
- //
- $A.ajax(params);
- },
- aAjaxLoad: 0,
- /**
- * 编辑器参数配置
- * @returns {{modules: {toolbar: *[]}}}
- */
- editorOption: function editorOption() {
- return {
- modules: {
- toolbar: [['bold', 'italic'], [{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'size': ['small', false, 'large', 'huge'] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'color': [] }, { 'background': [] }], [{ 'align': [] }]]
- }
- };
- },
- /**
- * 获取token
- * @returns {boolean}
- */
- getToken: function getToken() {
- var token = $A.token();
- return $A.count(token) < 10 ? false : token;
- },
- /**
- * 设置token
- * @param token
- */
- setToken: function setToken(token) {
- $A.token(token);
- },
- /**
- * 获取会员账号
- * @returns string
- */
- getUserName: function getUserName() {
- if ($A.getToken() === false) {
- return "";
- }
- var userInfo = $A.getUserInfo();
- return $A.ishave(userInfo.username) ? userInfo.username : '';
- },
- /**
- * 获取会员昵称
- * @param nullName
- * @returns {string|*}
- */
- getNickName: function getNickName() {
- var nullName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- if ($A.getToken() === false) {
- return "";
- }
- var userInfo = $A.getUserInfo();
- return $A.ishave(userInfo.nickname) ? userInfo.nickname : nullName ? $A.getUserName() : '';
- },
- /**
- * 获取用户信息(并保存)
- * @param callback 网络请求获取到用户信息回调(监听用户信息发生变化)
- * @returns Object
- */
- getUserInfo: function getUserInfo(callback) {
- if (typeof callback === 'function' || callback === true) {
- $A.apiAjax({
- url: 'users/info',
- error: function error() {
- $A.userLogout();
- },
- success: function success(res) {
- if (res.ret === 1) {
- $A.storage("userInfo", res.data);
- $A.setToken(res.data.token);
- $A.triggerUserInfoListener(res.data);
- typeof callback === "function" && callback(res.data, $A.getToken() !== false);
- }
- }
- });
- }
- return $A.jsonParse($A.storage("userInfo"));
- },
- /**
- * 根据用户名获取用户基本信息
- * @param username
- * @param callback
- * @param cacheTime
- */
- getUserBasic: function getUserBasic(username, callback) {
- var cacheTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
- if (typeof callback !== "function") {
- return;
- }
- if (!username) {
- callback({}, false);
- return;
- }
- //
- var keyName = '__userBasic:' + username.substring(0, 1) + '__';
- var localData = $A.jsonParse(window.localStorage[keyName]);
- if ($A.getObject(localData, username + '.success') === true) {
- callback(localData[username].data, true);
- if (localData[username].update + cacheTime > Math.round(new Date().getTime() / 1000)) {
- return;
- }
- }
- //
- $A.__userBasicObject.push({
- username: username,
- callback: callback
- });
- //
- $A.__userBasicTimeout++;
- var timeout = $A.__userBasicTimeout;
- setTimeout(function () {
- timeout === $A.__userBasicTimeout && $A.__userBasicEvent();
- }, 100);
- },
- __userBasicEvent: function __userBasicEvent() {
- if ($A.__userBasicLoading === true) {
- return;
- }
- $A.__userBasicLoading = true;
- //
- var userArray = [];
- $A.__userBasicObject.some(function (item) {
- userArray.push(item.username);
- if (userArray.length >= 30) {
- return true;
- }
- });
- //
- $A.apiAjax({
- url: 'users/basic',
- data: {
- username: $A.jsonStringify(userArray)
- },
- error: function error() {
- userArray.forEach(function (username) {
- var tmpLists = $A.__userBasicObject.filter(function (item) {
- return item.username == username;
- });
- tmpLists.forEach(function (item) {
- if (typeof item.callback === "function") {
- item.callback({}, false);
- item.callback = null;
- }
- });
- });
- //
- $A.__userBasicLoading = false;
- $A.__userBasicObject = $A.__userBasicObject.filter(function (item) {
- return typeof item.callback === "function";
- });
- if ($A.__userBasicObject.length > 0) {
- $A.__userBasicEvent();
- }
- },
- success: function success(res) {
- if (res.ret === 1) {
- res.data.forEach(function (data) {
- var keyName = '__userBasic:' + data.username.substring(0, 1) + '__';
- var localData = $A.jsonParse(window.localStorage[keyName]);
- localData[data.username] = {
- success: true,
- update: Math.round(new Date().getTime() / 1000),
- data: data
- };
- window.localStorage[keyName] = $A.jsonStringify(localData);
- });
- }
- userArray.forEach(function (username) {
- var tmpLists = $A.__userBasicObject.filter(function (item) {
- return item.username == username;
- });
- tmpLists.forEach(function (item) {
- if (typeof item.callback === "function") {
- var info = res.data.filter(function (data) {
- return data.username == username;
- });
- if (info.length === 0) {
- item.callback({}, false);
- } else {
- item.callback(info[0], true);
- }
- item.callback = null;
- }
- });
- });
- //
- $A.__userBasicLoading = false;
- $A.__userBasicObject = $A.__userBasicObject.filter(function (item) {
- return typeof item.callback === "function";
- });
- if ($A.__userBasicObject.length > 0) {
- $A.__userBasicEvent();
- }
- }
- });
- },
- __userBasicTimeout: 0,
- __userBasicLoading: false,
- __userBasicObject: [],
- /**
- * 打开登录页面
- */
- userLogout: function userLogout() {
- $A.token("");
- $A.storage("userInfo", {});
- $A.triggerUserInfoListener({});
- var from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
- if (_typeof($A.app) === "object") {
- $A.app.goForward({ path: '/', query: from ? { from: from } : {} }, true);
- } else {
- window.location.replace($A.webUrl() + (from ? '?from=' + from : ''));
- }
- },
- /**
- * 权限是否通过
- * @param role
- * @returns {boolean}
- */
- identity: function identity(role) {
- var userInfo = $A.getUserInfo();
- return $A.identityRaw(role, userInfo.identity);
- },
- /**
- * 权限是否通过
- * @param role
- * @returns {boolean}
- */
- identityRaw: function identityRaw(role, identity) {
- var isRole = false;
- $A.each(identity, function (index, res) {
- if (res === role) {
- isRole = true;
- }
- });
- return isRole;
- },
- /**
- * 监听用户信息发生变化
- * @param listenerName 监听标识
- * @param callback 监听回调
- */
- setOnUserInfoListener: function setOnUserInfoListener(listenerName, callback) {
- if (typeof listenerName != "string") {
- return;
- }
- if (typeof callback === "function") {
- $A.__userInfoListenerObject[listenerName] = {
- callback: callback
- };
- }
- },
- removeUserInfoListener: function removeUserInfoListener(listenerName) {
- if (typeof listenerName != "string") {
- return;
- }
- if (typeof $A.__userInfoListenerObject[listenerName] != "undefined") {
- delete $A.__userInfoListenerObject[listenerName];
- }
- },
- triggerUserInfoListener: function triggerUserInfoListener(userInfo) {
- var key = void 0,
- item = void 0;
- for (key in $A.__userInfoListenerObject) {
- if (!$A.__userInfoListenerObject.hasOwnProperty(key)) continue;
- item = $A.__userInfoListenerObject[key];
- if (typeof item.callback === "function") {
- item.callback(userInfo, $A.getToken() !== false);
- }
- }
- },
- __userInfoListenerObject: {},
- /**
- * 监听任务发生变化
- * @param listenerName 监听标识
- * @param callback 监听回调
- * @param callSpecial 是否监听几种特殊事件(非操作任务的)
- */
- setOnTaskInfoListener: function setOnTaskInfoListener(listenerName, callback, callSpecial) {
- if (typeof listenerName != "string") {
- return;
- }
- if (typeof callback === "function") {
- $A.__taskInfoListenerObject[listenerName] = {
- special: callSpecial === true,
- callback: callback
- };
- }
- },
- triggerTaskInfoListener: function triggerTaskInfoListener(act, taskDetail) {
- var sendToWS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
- var key = void 0,
- item = void 0;
- for (key in $A.__taskInfoListenerObject) {
- if (!$A.__taskInfoListenerObject.hasOwnProperty(key)) continue;
- item = $A.__taskInfoListenerObject[key];
- if (typeof item.callback === "function") {
- if (['addlabel', 'deleteproject', 'deletelabel', 'labelsort', 'tasksort'].indexOf(act) === -1 || item.special === true) {
- if (typeof taskDetail.__modifyUsername === "undefined") {
- taskDetail.__modifyUsername = $A.getUserName();
- }
- item.callback(act, taskDetail);
- }
- }
- }
- if (sendToWS === true) {
- $A.WSOB.sendTo('team', {
- type: "taskA",
- act: act,
- taskDetail: taskDetail
- });
- }
- },
- __taskInfoListenerObject: {},
- /**
- * 获取待推送的日志并推送
- * @param taskid
- */
- triggerTaskInfoChange: function triggerTaskInfoChange(taskid) {
- $A.apiAjax({
- url: 'project/task/pushlog',
- data: {
- taskid: taskid,
- pagesize: 20
- },
- success: function success(res) {
- if (res.ret === 1) {
- res.data.lists.forEach(function (item) {
- var msgData = {
- type: 'taskB',
- username: item.username,
- userimg: item.userimg,
- indate: item.indate,
- text: item.detail,
- other: item.other
- };
- res.data.follower.forEach(function (username) {
- if (username != msgData.username && username != $A.getUserName()) {
- $A.WSOB.sendTo('user', username, msgData, 'special');
- }
- });
- });
- }
- }
- });
- },
- /**
- * 推送任务至钉钉
- * @param taskid
- */
- triggerTaskDing: function triggerTaskDing(ajaxData) {
- $A.apiAjax({
- url: 'ding/notice/push',
- method: 'post',
- data: ajaxData,
- success: function success(res) {}
- });
- }
- });
- /**
- * =============================================================================
- * ***************************** websocket assist ****************************
- * =============================================================================
- */
- $.extend({
- /**
- * @param config {username, url, token, channel, logCallback}
- */
- WTWS: function WTWS(config) {
- this.__instance = null;
- this.__connected = false;
- this.__callbackid = {};
- this.__openNum = 0;
- this.__autoNum = 0;
- this.__autoLine = function (timeout) {
- var tempNum = this.__autoNum;
- var thas = this;
- setTimeout(function () {
- if (tempNum === thas.__autoNum) {
- thas.__autoNum++;
- if (!thas.__config.token) {
- thas.__log("[WS] No token");
- thas.__autoLine(timeout + 5);
- } else {
- thas.sendTo('refresh', function (res) {
- thas.__log("[WS] Connection " + (res.status ? 'success' : 'error'));
- thas.__autoLine(timeout + 5);
- });
- }
- }
- }, Math.min(timeout, 30) * 1000);
- };
- this.__log = function (text, event) {
- typeof this.__config.logCallback === "function" && this.__config.logCallback(text, event);
- };
- this.__lExists = function (string, find, lower) {
- string += "";
- find += "";
- if (lower !== true) {
- string = string.toLowerCase();
- find = find.toLowerCase();
- }
- return string.substring(0, find.length) === find;
- };
- this.__rNum = function (str, fixed) {
- var _s = Number(str);
- if (_s + "" === "NaN") {
- _s = 0;
- }
- if (/^[0-9]*[1-9][0-9]*$/.test(fixed)) {
- _s = _s.toFixed(fixed);
- var rs = _s.indexOf('.');
- if (rs < 0) {
- _s += ".";
- for (var i = 0; i < fixed; i++) {
- _s += "0";
- }
- }
- }
- return _s;
- };
- this.__jParse = function (str, defaultVal) {
- if (str === null) {
- return defaultVal ? defaultVal : {};
- }
- if ((typeof str === 'undefined' ? 'undefined' : _typeof(str)) === "object") {
- return str;
- }
- try {
- return JSON.parse(str);
- } catch (e) {
- return defaultVal ? defaultVal : {};
- }
- };
- this.__randString = function (len) {
- len = len || 32;
- var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678oOLl9gqVvUuI1';
- var maxPos = $chars.length;
- var pwd = '';
- for (var i = 0; i < len; i++) {
- pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
- }
- return pwd;
- };
- this.__urlParams = function (url, params) {
- if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === "object" && params !== null) {
- url += "";
- url += url.indexOf("?") === -1 ? '?' : '';
- for (var key in params) {
- if (!params.hasOwnProperty(key)) {
- continue;
- }
- url += '&' + key + '=' + params[key];
- }
- }
- return url.replace("?&", "?");
- };
- this.__isArr = function (obj) {
- return Object.prototype.toString.call(obj) == '[object Array]';
- };
- /**
- * 设置参数
- * @param config
- */
- this.config = function (config) {
- if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) !== "object" || config === null) {
- config = {};
- }
- config.username = config.username || '';
- config.url = config.url || '';
- config.token = config.token || '';
- config.channel = config.channel || '';
- config.logCallback = config.logCallback || null;
- this.__config = config;
- return this;
- };
- /**
- * 连接
- * @param force
- */
- this.connection = function (force) {
- if (!this.__lExists(this.__config.url, "ws://") && !this.__lExists(this.__config.url, "wss://")) {
- this.__log("[WS] No connection address");
- return this;
- }
- if (!this.__config.token) {
- this.__log("[WS] No connected token");
- return this;
- }
- if (this.__instance !== null && force !== true) {
- this.__log("[WS] Connection exists");
- return this;
- }
- var thas = this;
- // 初始化客户端套接字并建立连接
- this.__instance = new WebSocket(this.__urlParams(this.__config.url, {
- token: this.__config.token,
- channel: this.__config.channel
- }));
- // 连接建立时触发
- this.__instance.onopen = function (event) {
- thas.__log("[WS] Connection opened", event);
- };
- // 接收到服务端推送时执行
- this.__instance.onmessage = function (event) {
- var msgDetail = thas.__jParse(event.data);
- if (msgDetail.messageType === 'open') {
- thas.__log("[WS] Connection connected");
- msgDetail.openNum = thas.__openNum;
- msgDetail.config = thas.__config;
- thas.__openNum++;
- thas.__connected = true;
- thas.__autoLine(30);
- } else if (msgDetail.messageType === 'back') {
- typeof thas.__callbackid[msgDetail.messageId] === "function" && thas.__callbackid[msgDetail.messageId](msgDetail.body);
- delete thas.__callbackid[msgDetail.messageId];
- return;
- }
- if (thas.__rNum(msgDetail.contentId) > 0) {
- thas.sendTo('roger', msgDetail.contentId);
- }
- thas.triggerMsgListener(msgDetail);
- };
- // 连接关闭时触发
- this.__instance.onclose = function (event) {
- thas.__log("[WS] Connection closed", event);
- thas.__connected = false;
- thas.__instance = null;
- thas.__autoLine(5);
- };
- // 连接出错
- this.__instance.onerror = function (event) {
- thas.__log("[WS] Connection error", event);
- thas.__connected = false;
- thas.__instance = null;
- thas.__autoLine(5);
- };
- return this;
- };
- /**
- * 添加消息监听
- * @param listenerName
- * @param listenerType
- * @param callback
- */
- this.setOnMsgListener = function (listenerName, listenerType, callback) {
- if (typeof listenerName != "string") {
- return this;
- }
- if (typeof listenerType === "function") {
- callback = listenerType;
- listenerType = [];
- }
- if (!this.__isArr(listenerType)) {
- listenerType = [listenerType];
- }
- if (typeof callback === "function") {
- this.__msgListenerObject[listenerName] = {
- callback: callback,
- listenerType: listenerType
- };
- }
- return this;
- };
- this.triggerMsgListener = function (msgDetail) {
- var key, item;
- for (key in this.__msgListenerObject) {
- if (!this.__msgListenerObject.hasOwnProperty(key)) {
- continue;
- }
- item = this.__msgListenerObject[key];
- if (item.listenerType.length > 0 && item.listenerType.indexOf(msgDetail.messageType) === -1) {
- continue;
- }
- if (typeof item.callback === "function") {
- item.callback(msgDetail);
- }
- }
- };
- this.__msgListenerObject = {};
- /**
- * 添加特殊监听
- * @param listenerName
- * @param callback
- */
- this.setOnSpecialListener = function (listenerName, callback) {
- if (typeof listenerName != "string") {
- return this;
- }
- if (typeof callback === "function") {
- this.__specialListenerObject[listenerName] = {
- callback: callback
- };
- }
- return this;
- };
- this.triggerSpecialListener = function (simpleMsg) {
- var key, item;
- for (key in this.__specialListenerObject) {
- if (!this.__specialListenerObject.hasOwnProperty(key)) {
- continue;
- }
- item = this.__specialListenerObject[key];
- if (typeof item.callback === "function") {
- item.callback(simpleMsg);
- }
- }
- };
- this.__specialListenerObject = {};
- /**
- * 发送消息
- * @param messageType 会话类型
- * - refresh: 刷新
- * - unread: 未读信息总数量
- * - read: 已读会员信息
- * - roger: 收到信息回执
- * - user: 发送消息,指定target
- * - info: 发送消息(不保存),指定target
- * - team: 团队会员
- * - docs: 知识库
- * @param target 发送目标
- * @param body 发送内容(对象或数组)
- * @param callback 发送回调
- * @param againNum
- */
- this.sendTo = function (messageType, target, body, callback) {
- var againNum = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
- if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === "object" && typeof body === "undefined") {
- body = target;
- target = null;
- }
- if (typeof target === "function") {
- body = target;
- target = null;
- }
- if (typeof body === "function") {
- callback = body;
- body = null;
- }
- if (body === null || (typeof body === 'undefined' ? 'undefined' : _typeof(body)) !== "object") {
- body = {};
- }
- //
- var thas = this;
- if (this.__instance === null || this.__connected === false) {
- if (againNum < 10 && messageType != 'team') {
- setTimeout(function () {
- thas.sendTo(messageType, target, body, callback, thas.__rNum(againNum) + 1);
- }, 600);
- if (againNum === 0) {
- this.connection();
- }
- } else {
- if (this.__instance === null) {
- this.__log("[WS] Service not connected");
- typeof callback === "function" && callback({ status: 0, message: '服务未连接' });
- } else {
- this.__log("[WS] Failed connection");
- typeof callback === "function" && callback({ status: 0, message: '未连接成功' });
- }
- }
- return this;
- }
- if (['refresh', 'unread', 'read', 'roger', 'user', 'info', 'team', 'docs'].indexOf(messageType) === -1) {
- this.__log("[WS] Wrong message messageType: " + messageType);
- typeof callback === "function" && callback({ status: 0, message: '错误的消息类型: ' + messageType });
- return this;
- }
- //
- var contentId = 0;
- if (messageType === 'roger') {
- contentId = target;
- target = null;
- }
- var messageId = '';
- if (typeof callback === "string" && callback === 'special') {
- callback = function callback(res) {
- res.status === 1 && thas.triggerSpecialListener({
- target: target,
- body: body
- });
- };
- }
- if (typeof callback === "function") {
- messageId = this.__randString(16);
- this.__callbackid[messageId] = callback;
- }
- this.__instance.send(JSON.stringify({
- messageType: messageType,
- messageId: messageId,
- contentId: contentId,
- channel: this.__config.channel,
- username: this.__config.username,
- target: target,
- body: body,
- time: Math.round(new Date().getTime() / 1000)
- }));
- return this;
- };
- /**
- * 关闭连接
- */
- this.close = function () {
- if (this.__instance === null) {
- this.__log("[WS] Service not connected");
- return this;
- }
- if (this.__connected === false) {
- this.__log("[WS] Failed connection");
- return this;
- }
- this.__instance.close();
- return this;
- };
- return this.config(config);
- },
- WSOB: {
- instance: null,
- isClose: false,
- /**
- * 初始化
- */
- initialize: function initialize() {
- var url = $A.getObject(window.webSocketConfig, 'URL');
- if (!url) {
- url = window.location.origin;
- url = url.replace("https://", "wss://");
- url = url.replace("http://", "ws://");
- url += "/ws";
- }
- var config = {
- username: $A.getUserName(),
- url: url,
- token: $A.getToken(),
- channel: 'web'
- };
- if (this.instance === null) {
- this.instance = new $A.WTWS(config);
- this.instance.connection();
- } else if (this.isClose) {
- this.isClose = false;
- this.instance.config(config);
- this.instance.connection();
- }
- },
- /**
- * 主动连接
- */
- connection: function connection() {
- this.initialize();
- this.instance.connection();
- },
- /**
- * 监听消息
- * @param listenerName
- * @param listenerType
- * @param callback
- */
- setOnMsgListener: function setOnMsgListener(listenerName, listenerType, callback) {
- this.initialize();
- this.instance.setOnMsgListener(listenerName, listenerType, callback);
- },
- /**
- * 添加特殊监听
- * @param listenerName
- * @param callback
- */
- setOnSpecialListener: function setOnSpecialListener(listenerName, callback) {
- this.initialize();
- this.instance.setOnSpecialListener(listenerName, callback);
- },
- /**
- * 发送消息
- * @param messageType
- * @param target
- * @param body
- * @param callback
- */
- sendTo: function sendTo(messageType, target, body, callback) {
- this.initialize();
- this.instance.sendTo(messageType, target, body, callback);
- },
- /**
- * 关闭连接
- */
- close: function close() {
- if (this.instance === null) {
- return;
- }
- this.isClose = true;
- this.instance.config(null).close();
- },
- /**
- * 获取消息描述
- * @param content
- * @returns {string}
- */
- getMsgDesc: function getMsgDesc(content) {
- var desc = void 0;
- switch (content.type) {
- case 'text':
- desc = content.text;
- break;
- case 'image':
- desc = $A.app.$L('[图片]');
- break;
- case 'file':
- desc = $A.app.$L('[文件]');
- break;
- case 'taskB':
- desc = content.text + " " + $A.app.$L("[来自关注任务]");
- break;
- case 'report':
- desc = content.text + " " + $A.app.$L("[来自工作报告]");
- break;
- case 'video':
- desc = $A.app.$L('[视频通话]');
- break;
- case 'voice':
- desc = $A.app.$L('[语音通话]');
- break;
- default:
- desc = $A.app.$L('[未知类型]');
- break;
- }
- return desc;
- }
- }
- });
- window.$A = $;
- })(window);
- /***/ }),
- /* 200 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(201);
- if(typeof content === 'string') content = [[module.i, content, '']];
- // Prepare cssTransformation
- var transform;
- var options = {}
- options.transform = transform
- // add the styles to the DOM
- var update = __webpack_require__(50)(content, options);
- if(content.locals) module.exports = content.locals;
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../node_modules/css-loader/index.js!../../../node_modules/sass-loader/lib/loader.js!./main.scss", function() {
- var newContent = require("!!../../../node_modules/css-loader/index.js!../../../node_modules/sass-loader/lib/loader.js!./main.scss");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 201 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "*[hidden=\"hidden\"] {\n display: none !important; }\n\n.z-row {\n text-rendering: optimizespeed;\n display: flex;\n align-items: stretch;\n flex-flow: row wrap; }\n\n.z-row.gap .z-1, .z-row.gap .z-3, .z-row.gap .z-4, .z-row.gap .z-6, .z-row.gap .z-8, .z-row.gap .z-12, .z-row.gap .z-16, .z-row.gap .z-18, .z-row.gap .z-20, .z-row.gap .z-21, .z-row.gap .z-col {\n padding: .35rem .5rem; }\n\n.z-row > .z-row {\n width: 100%; }\n\n.z-1, .z-3, .z-4, .z-6, .z-8, .z-12, .z-16, .z-18, .z-20, .z-21, .z-col {\n display: inline-block;\n zoom: 1;\n box-sizing: border-box;\n vertical-align: top;\n text-rendering: auto; }\n\n.z-1 {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n max-width: 100%; }\n\n.z-3 {\n width: 12.5%;\n max-width: 12.5%; }\n\n.z-4 {\n width: 16.6667%;\n max-width: 16.6667%; }\n\n.z-6 {\n width: 25%; }\n\n.z-8 {\n width: 33.3333%; }\n\n.z-12 {\n width: 50%; }\n\n.z-16 {\n width: 66.6667%; }\n\n.z-18 {\n width: 75%; }\n\n.z-20 {\n width: 83.3333%; }\n\n.z-21 {\n width: 87.5%; }\n\n.f-12 {\n font-size: 12px !important; }\n\n.f-14 {\n font-size: 14px !important; }\n\n.f-16 {\n font-size: 16px !important; }\n\n.w-box {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n .w-box * {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n\n.w-main {\n position: absolute;\n color: #000000;\n top: 0;\n left: 0;\n min-width: 100%;\n min-height: 100%;\n padding: 0;\n margin: 0; }\n .w-main .w-nav {\n position: fixed;\n left: 0;\n right: 0;\n top: 40px;\n font-size: 14px;\n z-index: 12;\n color: #606266;\n height: 32px;\n line-height: 34px;\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.1); }\n .w-main .w-nav .nav-row {\n margin: 0 32px;\n display: flex;\n flex-direction: row;\n align-items: center; }\n .w-main .w-nav .nav-row:before, .w-main .w-nav .nav-row:after {\n display: table;\n content: \"\"; }\n .w-main .w-nav .nav-row:after {\n clear: both; }\n .w-main .w-nav .nav-row span {\n margin: 0 12px 0 0;\n cursor: pointer; }\n .w-main .w-nav .nav-row span.active {\n color: #0285d7;\n font-weight: 500; }\n .w-main .w-nav .nav-row span + span {\n padding-left: 12px;\n border-left: 1px solid #ccc; }\n .w-main .w-nav .nav-row .icon {\n font-size: 16px;\n margin-right: 2px; }\n .w-main .w-nav .nav-row .w-nav-left {\n white-space: nowrap;\n padding-right: 24px; }\n .w-main .w-nav .nav-row .w-nav-flex {\n flex: 1; }\n .w-main .w-nav .nav-row .w-nav-right {\n margin-top: -2px;\n white-space: nowrap;\n overflow: hidden;\n overflow-x: auto;\n -webkit-backface-visibility: hidden;\n -webkit-overflow-scrolling: touch; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper {\n margin-top: -2px;\n width: auto; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input {\n padding: 0 26px 0 6px;\n font-size: 14px;\n width: 140px;\n height: 24px;\n line-height: 24px;\n border: none;\n box-shadow: none;\n transition: all 0.2s;\n transform: translateZ(0); }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input:focus {\n width: 180px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.substantial input {\n width: 180px;\n background-color: #eeeeee; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.showclose input {\n padding-right: 48px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix {\n display: flex;\n align-items: center;\n margin: 0 6px 0 0;\n width: auto; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix .nav-sreach-loading {\n display: flex;\n align-items: center;\n margin-right: 6px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix .nav-sreach-loading .w-loading {\n width: 12px;\n height: 12px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix i {\n font-size: 16px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix i.suffix-close {\n font-size: 22px; }\n .w-main .w-nav .nav-row .page-nav-left {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-width: 138px; }\n .w-main .w-nav .nav-row .page-nav-left:hover .page-nav-refresh em {\n display: block; }\n .w-main .w-nav .nav-row .page-nav-left > span {\n margin-right: 8px; }\n .w-main .w-nav .nav-row .page-nav-left > span.bold {\n font-weight: bold; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-loading {\n width: 18px;\n height: 18px;\n display: flex; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh {\n min-width: 36px;\n height: 100%;\n display: flex;\n flex-direction: row;\n align-items: center; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh em {\n display: none;\n padding-left: 4px;\n padding-right: 4px;\n color: #048be0;\n cursor: pointer; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh em:hover {\n text-decoration: underline; }\n @media (max-width: 768px) {\n .w-main .w-nav .nav-row {\n margin: 0 16px; }\n .w-main .w-nav .nav-row span {\n margin: 0 8px 0 0; }\n .w-main .w-nav .nav-row span + span {\n margin: 0;\n padding-left: 8px; }\n .w-main .w-nav .nav-row .w-nav-left {\n padding-right: 12px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input {\n width: 140px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input:focus {\n width: 140px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.substantial input {\n width: 140px; } }\n\n.w-sreach-main {\n position: fixed;\n top: 76px;\n right: 6px;\n left: 0;\n bottom: 0;\n z-index: 20; }\n .w-sreach-main .w-sreach-box {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-end; }\n .w-sreach-main .sreach-none,\n .w-sreach-main .sreach-ul {\n background: #ffffff;\n border-radius: 4px;\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2); }\n .w-sreach-main .sreach-none {\n text-align: center;\n color: #666;\n padding: 16px 32px; }\n .w-sreach-main .sreach-ul {\n width: 480px;\n max-width: 96%;\n max-height: 100%;\n padding: 16px 12px;\n margin: 0 0 6px 0;\n overflow: auto;\n opacity: 0;\n transform: translate(50%, 0);\n transition: all 0.2s; }\n .w-sreach-main .sreach-ul.sreach-enter {\n opacity: 1;\n transform: translate(0, 0); }\n .w-sreach-main .sreach-ul > li {\n list-style-type: none;\n padding: 6px 12px;\n margin: 0; }\n .w-sreach-main .sreach-ul > li.sreach-result {\n font-size: 12px;\n color: #999; }\n .w-sreach-main .sreach-ul > li:last-child {\n border-bottom: 0; }\n .w-sreach-main .sreach-ul > li .sreach-title {\n font-size: 14px;\n color: #555555;\n font-weight: 400;\n cursor: pointer;\n border-bottom: 1px solid #eeeeee;\n padding-bottom: 6px; }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag {\n background-color: #cccccc;\n display: inline-block;\n padding: 0 3px;\n color: #ffffff;\n border-radius: 2px;\n transform: scale(0.96);\n font-size: 12px; }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p1 {\n background: rgba(248, 14, 21, 0.6); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p2 {\n background: rgba(236, 196, 2, 0.5); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p3 {\n background: rgba(0, 159, 227, 0.7); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p4 {\n background: rgba(121, 170, 28, 0.7); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.overdue {\n background: #ff0000; }\n .w-sreach-main .sreach-ul > li .sreach-title:hover {\n color: #333333; }\n .w-sreach-main .sreach-ul > li .sreach-text {\n font-size: 13px;\n color: #888888;\n font-weight: 400;\n cursor: pointer;\n padding-top: 4px; }\n .w-sreach-main .sreach-ul > li .sreach-text:hover {\n color: #333333; }\n .w-sreach-main .sreach-ul > li > ul {\n padding-top: 3px;\n padding-left: 24px; }\n .w-sreach-main .sreach-ul > li > ul > li {\n padding: 6px 0;\n border-bottom: 1px dotted #eeeeee; }\n .w-sreach-main .sreach-ul > li > ul > li .sreach-title {\n font-size: 13px;\n border-bottom: 0;\n padding-bottom: 0; }\n\n.tableFill .ivu-table table {\n width: 100% !important; }\n .tableFill .ivu-table table .ivu-table-cell {\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-left: 12px;\n padding-right: 12px; }\n .tableFill .ivu-table table .ivu-table-cell > div {\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n vertical-align: middle; }\n .tableFill .ivu-table table .ivu-table-cell > div .ivu-tooltip-rel {\n vertical-align: middle; }\n\n.tableFill .ivu-table:before {\n background-color: #efefef; }\n\n.tableFlex .ivu-table {\n display: flex;\n flex-direction: column; }\n .tableFlex .ivu-table .ivu-table-header {\n flex-grow: 0;\n flex-shrink: 0; }\n .tableFlex .ivu-table .ivu-table-body {\n overflow-y: auto; }\n\n.tableSelection .ivu-table .ivu-table-cell {\n padding-left: 12px;\n padding-right: 12px; }\n .tableSelection .ivu-table .ivu-table-cell.ivu-table-cell-with-selection {\n padding-right: 2px; }\n\n.pageBox {\n text-align: center;\n margin-bottom: 12px; }\n\n.sreachBox > .item {\n margin-bottom: 8px; }\n\n.sreachBox .item > div {\n display: block;\n float: left;\n padding-right: 10px; }\n .sreachBox .item > div:last-child {\n padding-right: 0; }\n .sreachBox .item > div .ivu-input-wrapper, .sreachBox .item > div .ivu-select {\n margin-top: 2px; }\n .sreachBox .item > div input, .sreachBox .item > div .ivu-select-placeholder {\n font-weight: normal; }\n\n.sreachBox .item .item-1 {\n width: 100%; }\n\n.sreachBox .item .item-2 {\n width: 50%; }\n\n.sreachBox .item .item-3 {\n width: 33.33%; }\n\n.sreachBox .item .item-4 {\n width: 25%; }\n\n.sreachBox .item .item-5 {\n width: 20%; }\n\n.sreachBox .item:after {\n content: '';\n display: block;\n height: 0;\n clear: both;\n visibility: hidden; }\n\n.sreachBox .item-title,\n.sreachBox .item-title-active {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 600; }\n\n.sreachBox .item-title-active {\n color: #ff0000; }\n\n.sreachBox .item-button {\n text-align: right;\n margin-top: 10px;\n margin-bottom: 0; }\n .sreachBox .item-button .ivu-input-wrapper {\n float: none;\n width: 150px;\n display: inline-block; }\n\n.sreachBox .ivu-date-picker {\n width: 100%;\n position: relative;\n vertical-align: middle; }\n\n.sreachBox .item-button .ivu-btn {\n margin-left: 8px; }\n\n.sreachBox .item-button .left-btn {\n float: left;\n margin-right: 8px;\n margin-left: 0; }\n\n.sreach-highlight {\n color: #c00; }\n\n.drawer-tabs .ivu-tabs-tabpane {\n position: relative; }\n\n.drawer-box {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column; }\n .drawer-box .drawer-content {\n flex: 1;\n width: 100%;\n overflow: auto;\n padding: 16px;\n position: relative;\n transform: translateZ(0); }\n .drawer-box .drawer-footer {\n width: 100%;\n border-top: 1px solid #e8e8e8;\n padding: 10px 16px;\n text-align: right;\n background: #fff; }\n\n.ivu-drawer-body .ivu-tabs-bar {\n padding-right: 32px; }\n\n.ivu-select-dropdown-max {\n max-height: 300px; }\n\n.ivu-modal-wrap.simple-modal .ivu-modal-header,\n.ivu-modal-wrap.simple-modal .ivu-modal-footer {\n border-color: transparent; }\n\n.ivu-dropdown-item.dropdown-active {\n color: #058ce4; }\n\n.upload-control-spin-icon-load {\n font-size: 18px;\n animation: upload-control-spin-icon-animation 1s linear infinite; }\n\n@keyframes upload-control-spin-icon-animation {\n from {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(180deg); }\n to {\n transform: rotate(360deg); } }\n\n.m768-show,\n.m768-show-i,\n.m768-show-ib {\n display: none; }\n\n.m768-hide {\n display: block; }\n\n.m768-hide-i {\n display: inline; }\n\n.m768-hide-ib {\n display: inline-block; }\n\n@media (max-width: 768px) {\n .m768-show {\n display: block; }\n .m768-show-i {\n display: inline; }\n .m768-show-ib {\n display: inline-block; }\n .m768-hide,\n .m768-hide-i,\n .m768-hide-ib {\n display: none; } }\n", ""]);
- // exports
- /***/ }),
- /* 202 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(203)
- /* template */
- var __vue_template__ = __webpack_require__(204)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/_components/Title.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-ada52cc8", Component.options)
- } else {
- hotAPI.reload("data-v-ada52cc8", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 203 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'v-title',
- data: function data() {
- return {};
- },
- mounted: function mounted() {
- this.updateTitle();
- },
- beforeUpdate: function beforeUpdate() {
- this.updateTitle();
- },
- activated: function activated() {
- this.updateTitle();
- },
- methods: {
- updateTitle: function updateTitle() {
- var slots = this.$slots.default;
- if (typeof slots === 'undefined' || slots.length < 1 || typeof slots[0].text !== 'string') {
- return;
- }
- var text = slots[0].text;
- var _document = document,
- title = _document.title;
- if (text !== title) this.setTile(text);
- },
- setTile: function setTile(title) {
- document.title = title;
- var mobile = navigator.userAgent.toLowerCase();
- if (/iphone|ipad|ipod/.test(mobile)) {
- var iframe = document.createElement('iframe');
- iframe.style.display = 'none';
- var iframeCallback = function iframeCallback() {
- setTimeout(function () {
- iframe.removeEventListener('load', iframeCallback);
- document.body.removeChild(iframe);
- }, 0);
- };
- iframe.addEventListener('load', iframeCallback);
- document.body.appendChild(iframe);
- }
- }
- }
- });
- /***/ }),
- /* 204 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return false ? _c("h1", [_vm._t("default")], 2) : _vm._e()
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-ada52cc8", module.exports)
- }
- }
- /***/ }),
- /* 205 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(206)
- /* template */
- var __vue_template__ = __webpack_require__(207)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/_components/sreachTitle.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-0e8d1888", Component.options)
- } else {
- hotAPI.reload("data-v-0e8d1888", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 206 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'sreach-title',
- props: {
- val: {}
- },
- methods: {
- count: function count(obj) {
- var _this = this;
- try {
- if (typeof obj === "undefined") {
- return 0;
- }
- if (typeof obj === "number" || obj instanceof Date) {
- obj += "";
- }
- if (typeof obj.length === 'number') {
- if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === 'object') {
- var i = 0;
- $A.each(obj, function (key, val) {
- if (_this.count(val) > 0) i++;
- });
- return i;
- }
- return obj.length;
- } else {
- var _i = 0,
- key = void 0;
- for (key in obj) {
- if (this.count(obj) > 0) _i++;
- }
- return _i;
- }
- } catch (e) {
- return 0;
- }
- }
- }
- });
- /***/ }),
- /* 207 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { class: [_vm.count(_vm.val) > 0 ? "item-title-active" : "item-title"] },
- [_vm._t("default")],
- 2
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-0e8d1888", module.exports)
- }
- }
- /***/ }),
- /* 208 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(209)
- __webpack_require__(211)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(213)
- /* template */
- var __vue_template__ = __webpack_require__(218)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-453021ba"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/UserInput.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-453021ba", Component.options)
- } else {
- hotAPI.reload("data-v-453021ba", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 209 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(210);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("6a134112", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserInput.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserInput.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 210 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.user-id-multiple[data-v-453021ba] {\n margin-bottom: 6px;\n overflow: auto;\n white-space: normal;\n}\n.user-id-multiple .ivu-tag[data-v-453021ba] {\n padding-left: 7px;\n}\n.user-id-multiple .user-id-multiple-item[data-v-453021ba] {\n display: inline-block;\n}\n.user-id-multiple .user-view-inline[data-v-453021ba] {\n height: 20px;\n line-height: 20px;\n vertical-align: top;\n}\n.user-id-input[data-v-453021ba] {\n display: inline-block;\n width: 100%;\n position: relative;\n vertical-align: middle;\n z-index: 5;\n}\n.user-id-input .user-id-subtitle[data-v-453021ba] {\n position: absolute;\n top: 2px;\n right: 32px;\n height: 30px;\n line-height: 30px;\n color: #cccccc;\n z-index: 2;\n}\n.user-id-input .user-id-spin[data-v-453021ba] {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 50%;\n right: 34px;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.user-id-input .user-id-spin > div[data-v-453021ba] {\n width: 100%;\n height: 100%;\n}\n", ""]);
- // exports
- /***/ }),
- /* 211 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(212);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("6fd99c4c", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserInput.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserInput.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 212 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.user-id-input-body {\n z-index: 99999;\n}\n.user-id-input-table {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n border-radius: 4px;\n overflow: hidden;\n -webkit-box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1);\n background-color: #ffffff;\n}\n.user-id-input-table .ivu-table table {\n width: 100% !important;\n}\n.user-id-input-table .ivu-table:before, .user-id-input-table .ivu-table:after {\n display: none !important;\n}\n.user-id-input-table .ivu-table-body {\n max-height: 180px;\n overflow: auto;\n}\n.user-id-input-table .ivu-table-small td {\n cursor: pointer;\n}\n.user-id-input-table .user-id-input-bottom {\n padding: 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.user-id-input-table .user-id-input-bottom > button {\n font-size: 13px;\n margin-left: 10px;\n}\n", ""]);
- // exports
- /***/ }),
- /* 213 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__modules_directives_clickoutside__ = __webpack_require__(214);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__modules_directives_transfer_dom__ = __webpack_require__(215);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modules_directives_popper_novalue__ = __webpack_require__(216);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'UserInput',
- directives: { clickoutside: __WEBPACK_IMPORTED_MODULE_0__modules_directives_clickoutside__["a" /* default */], TransferDom: __WEBPACK_IMPORTED_MODULE_1__modules_directives_transfer_dom__["a" /* default */] },
- mixins: [__WEBPACK_IMPORTED_MODULE_2__modules_directives_popper_novalue__["a" /* default */]],
- props: {
- placement: {
- default: 'bottom'
- },
- value: {
- default: ''
- },
- identity: {
- default: ''
- },
- noidentity: {
- default: ''
- },
- nousername: {
- default: ''
- },
- noprojectid: {
- default: ''
- },
- projectid: {
- default: ''
- },
- nobookid: {
- default: ''
- },
- nogroupid: {
- default: ''
- },
- placeholder: {
- default: ''
- },
- disabled: {
- type: Boolean,
- default: false
- },
- transfer: {
- type: Boolean,
- default: function _default() {
- return true;
- }
- },
- loadstatus: {
- default: false
- },
- multiple: {
- type: Boolean,
- default: false
- },
- multipleDisabled: {
- default: ''
- }
- },
- data: function data() {
- return {
- multipleLists: [],
- userName: '',
- nickName: '',
- nickName__: '',
- seleName: '',
- searchShow: false,
- spinShow: false,
- skipSearch: false,
- isConfirm: false,
- tempName: '',
- winStyle: {},
- columns: [],
- userLists: [],
- noDataText: ''
- };
- },
- watch: {
- value: function value(val) {
- if (this.multiple) {
- this.multipleLists = this.formatMultipleLists(val);
- return;
- }
- this.userName = $A.cloneData(val);
- },
- userName: function userName(val) {
- var _this = this;
- if (this.skipSearch === true) {
- this.skipSearch = false;
- } else {
- this.nickName = '';
- if (val) {
- var where = { usernameequal: val };
- if (typeof this.identity === "string") {
- where['identity'] = this.identity;
- }
- if (typeof this.noidentity === "string") {
- where['noidentity'] = this.noidentity;
- }
- if (typeof this.nousername === "string") {
- where['nousername'] = this.nousername;
- }
- if (this.noprojectid) {
- where['noprojectid'] = this.noprojectid;
- }
- if (this.projectid) {
- where['projectid'] = this.projectid;
- }
- if (this.nobookid) {
- where['nobookid'] = this.nobookid;
- }
- if (this.nogroupid) {
- where['nogroupid'] = this.nogroupid;
- }
- this.noDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'users/searchinfo',
- data: {
- where: where,
- take: 1
- },
- beforeSend: function beforeSend() {
- _this.spinShow = true;
- },
- complete: function complete() {
- _this.spinShow = false;
- _this.noDataText = _this.$L("没有相关的数据");
- },
- error: function error() {
- _this.noDataText = _this.$L("数据加载失败!");
- },
- success: function success(res) {
- if (res.ret === 1 && $A.count(res.data) > 0) {
- var tmpData = res.data[0];
- if (_this.multiple) {
- _this.addMultipleLists(tmpData);
- } else {
- _this.userName = tmpData.username;
- _this.seleName = tmpData.nickname || tmpData.username;
- _this.nickName = tmpData.nickname || tmpData.username;
- _this.nickName__ = tmpData.nickname || tmpData.username;
- _this.$emit('input', _this.userName);
- _this.$emit('change', tmpData);
- }
- }
- }
- });
- }
- }
- },
- nickName: function nickName(val) {
- if (val != this.seleName || val == '') {
- this.userName = '';
- if (!this.multiple) {
- this.$emit('input', this.userName);
- this.$emit('change', {});
- }
- }
- },
- spinShow: function spinShow(val) {
- if (typeof this.loadstatus === 'number') {
- this.$emit('update:loadstatus', val ? this.loadstatus + 1 : this.loadstatus - 1);
- } else if (typeof this.loadstatus === 'boolean') {
- this.$emit('update:loadstatus', val);
- }
- },
- searchShow: function searchShow(val) {
- if (val) {
- this.handleShowPopper();
- this.updateMultipleLists();
- } else {
- this.handleClosePopper();
- }
- },
- multipleLists: {
- handler: function handler() {
- if (this.searchShow) {
- this.updateMultipleLists();
- }
- this.emitMultipleLists();
- },
- deep: true
- }
- },
- computed: {
- tableStyle: function tableStyle() {
- return this.winStyle;
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- this.columns = [{
- "title": this.$L("头像"),
- "width": 60,
- "align": 'center',
- render: function render(h, params) {
- return h('UserImg', {
- props: {
- info: params.row
- },
- style: {
- width: "26px",
- height: "26px",
- fontSize: "13px",
- lineHeight: "26px",
- borderRadius: "50%",
- verticalAlign: "middle"
- }
- });
- }
- }, {
- "title": this.$L("用户名"),
- "key": "username",
- "minWidth": 80,
- "ellipsis": true
- }, {
- "title": this.$L("昵称"),
- "key": "nickname",
- "minWidth": 80,
- "ellipsis": true,
- render: function render(h, params) {
- return h('span', params.row.nickname || '-');
- }
- }];
- if (this.multiple) {
- this.columns.unshift({
- type: 'selection',
- width: 30,
- align: 'center'
- });
- }
- this.noDataText = this.$L("数据加载中.....");
- this.isConfirm = this.$listeners['on-confirm'];
- },
- inputChange: function inputChange() {
- var _this2 = this;
- var val = this.nickName;
- this.spinShow = false;
- this.tempName = '';
- if (val != '') {
- setTimeout(function () {
- if (val == _this2.nickName && val != _this2.tempName) {
- _this2.searchEnter(false, function (res) {
- return val == _this2.nickName;
- });
- }
- }, 500);
- } else {
- this.searchShow = false;
- }
- },
- handleShowPopper: function handleShowPopper() {
- var _this3 = this;
- if (this.timeout) clearTimeout(this.timeout);
- this.timeout = setTimeout(function () {
- _this3.visible = true;
- }, this.delay);
- },
- handleClosePopper: function handleClosePopper() {
- var _this4 = this;
- if (this.timeout) {
- clearTimeout(this.timeout);
- if (!this.controlled) {
- this.timeout = setTimeout(function () {
- _this4.visible = false;
- }, 100);
- }
- }
- },
- updateStyle: function updateStyle() {
- this.winStyle = {
- width: Math.max(this.$el.offsetWidth, 230) + 'px'
- };
- },
- emptyAll: function emptyAll() {
- this.userName = '';
- this.nickName = '';
- this.nickName__ = '';
- this.seleName = '';
- this.searchShow = false;
- this.spinShow = false;
- },
- searchEnter: function searchEnter(verify, callback) {
- var _this5 = this;
- if (this.disabled === true) {
- return;
- }
- if (this.spinShow === true) {
- return;
- }
- if (verify === true) {
- if (this.nickName === '') {
- this.nickName__ = this.nickName;
- }
- if (this.nickName__ === this.nickName) {
- return;
- }
- }
- this.updateStyle();
- this.nickName__ = this.nickName;
- //
- var where = { username: this.nickName };
- if (typeof this.identity === "string") {
- where['identity'] = this.identity;
- }
- if (typeof this.noidentity === "string") {
- where['noidentity'] = this.noidentity;
- }
- if (typeof this.nousername === "string") {
- where['nousername'] = this.nousername;
- }
- if (this.noprojectid) {
- where['noprojectid'] = this.noprojectid;
- }
- if (this.projectid) {
- where['projectid'] = this.projectid;
- }
- if (this.nobookid) {
- where['nobookid'] = this.nobookid;
- }
- if (this.nogroupid) {
- where['nogroupid'] = this.nogroupid;
- }
- this.tempName = where.username;
- this.noDataText = this.$L("数据加载中.....");
- $A.apiAjax({
- url: 'users/searchinfo',
- data: {
- where: where,
- take: 30
- },
- beforeSend: function beforeSend() {
- _this5.spinShow = true;
- },
- complete: function complete() {
- _this5.spinShow = false;
- _this5.noDataText = _this5.$L("没有相关的数据");
- },
- error: function error() {
- _this5.noDataText = _this5.$L("数据加载失败!");
- },
- success: function success(res) {
- if (typeof callback === "function" && callback(res) === false) {
- return;
- }
- if (res.ret === 1) {
- _this5.userLists = res.data;
- _this5.userLists.forEach(function (item) {
- if (_this5.multiple) {
- if (_this5.existMultipleDisabled(item.username)) {
- item._disabled = true;
- }
- } else {
- if (item.username == _this5.userName) {
- item._highlight = true;
- }
- }
- });
- _this5.searchShow = true;
- } else {
- _this5.$Message.warning(res.msg);
- _this5.emptyAll();
- }
- }
- });
- },
- userChange: function userChange(item) {
- if (this.multiple) {
- if (this.existMultipleDisabled(item.username)) {
- return;
- }
- var tempLists = this.multipleLists.filter(function (_ref) {
- var username = _ref.username;
- return username == item.username;
- });
- if (tempLists.length > 0) {
- this.multipleLists = this.multipleLists.filter(function (_ref2) {
- var username = _ref2.username;
- return username != item.username;
- });
- } else {
- this.addMultipleLists(item);
- }
- } else {
- this.userName = item.username;
- this.seleName = item.nickname || item.username;
- this.nickName = item.nickname || item.username;
- this.nickName__ = item.nickname || item.username;
- this.skipSearch = true;
- this.searchShow = false;
- this.$emit('input', this.userName);
- this.$emit('change', item);
- }
- },
- userSelect: function userSelect() {
- var _this6 = this;
- if (this.multiple) {
- (function () {
- var lists = _this6.$refs.myTable.objData,
- item = void 0,
- inThe = void 0;
- for (var index in lists) {
- if (lists.hasOwnProperty(index)) {
- item = lists[index];
- inThe = _this6.multipleLists.find(function (_ref3) {
- var username = _ref3.username;
- return username == item.username;
- });
- if (item._isChecked) {
- !inThe && _this6.multipleLists.push(item);
- } else {
- inThe && (_this6.multipleLists = _this6.multipleLists.filter(function (_ref4) {
- var username = _ref4.username;
- return username != item.username;
- }));
- }
- }
- }
- })();
- }
- },
- handleClose: function handleClose(e) {
- if (this.multiple && $A(e.target).parents('.user-id-input-table').length > 0) {
- return;
- }
- if (this.searchShow === true) {
- this.searchShow = false;
- }
- },
- existMultipleDisabled: function existMultipleDisabled(username) {
- return this.multipleDisabled && $A.strExists(',' + this.multipleDisabled + ',', ',' + username + ',');
- },
- addMultipleLists: function addMultipleLists(item) {
- var inThe = this.multipleLists.find(function (_ref5) {
- var username = _ref5.username;
- return username == item.username;
- });
- if (!inThe) {
- this.multipleLists.push(item);
- }
- },
- updateMultipleLists: function updateMultipleLists() {
- var _this7 = this;
- this.$nextTick(function () {
- var lists = _this7.$refs.myTable.objData,
- item = void 0,
- inThe = void 0;
- for (var index in lists) {
- if (lists.hasOwnProperty(index)) {
- item = lists[index];
- inThe = _this7.multipleLists.find(function (_ref6) {
- var username = _ref6.username;
- return username == item.username;
- });
- _this7.$set(item, "_isChecked", !!inThe);
- }
- }
- });
- },
- emitMultipleLists: function emitMultipleLists() {
- var val = '';
- this.multipleLists.forEach(function (tmp) {
- if (val) {
- val += ",";
- }
- val += tmp.username;
- });
- this.$emit('input', val);
- },
- formatMultipleLists: function formatMultipleLists(val) {
- var arr = (val + ",").split(",");
- var narr = [];
- arr.forEach(function (uname) {
- if (uname) {
- var inn = false;
- narr.some(function (tmp) {
- if (tmp.username == uname) {
- return inn = true;
- }
- });
- if (!inn) {
- narr.push({
- username: uname
- });
- }
- }
- });
- return narr;
- },
- onConfirm: function onConfirm(e) {
- this.searchShow = false;
- this.$emit('on-confirm', e);
- }
- },
- mounted: function mounted() {
- this.updatePopper();
- //
- if (this.multiple) {
- this.multipleLists = this.formatMultipleLists(this.value);
- } else if ($A.count(this.value) > 0) {
- this.userName = this.value;
- }
- }
- });
- /***/ }),
- /* 214 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony default export */ __webpack_exports__["a"] = ({
- bind: function bind(el, binding, vnode) {
- function documentHandler(e) {
- if (el.contains(e.target)) {
- return false;
- }
- if (binding.expression) {
- binding.value(e);
- }
- }
- el.__vueClickOutside__ = documentHandler;
- document.addEventListener('click', documentHandler);
- },
- update: function update() {},
- unbind: function unbind(el, binding) {
- document.removeEventListener('click', el.__vueClickOutside__);
- delete el.__vueClickOutside__;
- }
- });
- /***/ }),
- /* 215 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // Thanks to: https://github.com/airyland/vux/blob/v2/src/directives/transfer-dom/index.js
- // Thanks to: https://github.com/calebroseland/vue-dom-portal
- /**
- * Get target DOM Node
- * @param {(Node|string|Boolean)} [node=document.body] DOM Node, CSS selector, or Boolean
- * @return {Node} The target that the el will be appended to
- */
- function getTarget(node) {
- if (node === void 0) {
- node = document.body;
- }
- if (node === true) {
- return document.body;
- }
- return node instanceof window.Node ? node : document.querySelector(node);
- }
- var directive = {
- inserted: function inserted(el, _ref, vnode) {
- var value = _ref.value;
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
- var parentNode = el.parentNode;
- if (!parentNode) return;
- var home = document.createComment('');
- var hasMovedOut = false;
- if (value !== false) {
- parentNode.replaceChild(home, el); // moving out, el is no longer in the document
- getTarget(value).appendChild(el); // moving into new place
- hasMovedOut = true;
- }
- if (!el.__transferDomData) {
- el.__transferDomData = {
- parentNode: parentNode,
- home: home,
- target: getTarget(value),
- hasMovedOut: hasMovedOut
- };
- }
- },
- componentUpdated: function componentUpdated(el, _ref2) {
- var value = _ref2.value;
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- // need to make sure children are done updating (vs. `update`)
- var ref$1 = el.__transferDomData;
- if (!ref$1) return;
- // homes.get(el)
- var parentNode = ref$1.parentNode;
- var home = ref$1.home;
- var hasMovedOut = ref$1.hasMovedOut; // recall where home is
- if (!hasMovedOut && value) {
- // remove from document and leave placeholder
- parentNode.replaceChild(home, el);
- // append to target
- getTarget(value).appendChild(el);
- el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
- } else if (hasMovedOut && value === false) {
- // previously moved, coming back home
- parentNode.replaceChild(el, home);
- el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
- } else if (value) {
- // already moved, going somewhere else
- getTarget(value).appendChild(el);
- }
- },
- unbind: function unbind(el) {
- if (el.dataset && el.dataset.transfer !== 'true') return false;
- el.className = el.className.replace('v-transfer-dom', '');
- var ref$1 = el.__transferDomData;
- if (!ref$1) return;
- if (el.__transferDomData.hasMovedOut === true) {
- el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el);
- }
- el.__transferDomData = null;
- }
- };
- /* harmony default export */ __webpack_exports__["a"] = (directive);
- /***/ }),
- /* 216 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- /**
- * https://github.com/freeze-component/vue-popper
- * */
- var isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
- var Popper = isServer ? function () {} : __webpack_require__(217); // eslint-disable-line
- /* harmony default export */ __webpack_exports__["a"] = ({
- props: {
- placement: {
- type: String,
- default: 'bottom'
- },
- boundariesPadding: {
- type: Number,
- default: 5
- },
- reference: Object,
- popper: Object,
- offset: {
- default: 0
- },
- transition: String,
- options: {
- type: Object,
- default: function _default() {
- return {
- modifiers: {
- computeStyle: {
- gpuAcceleration: false
- },
- preventOverflow: {
- boundariesElement: 'window'
- }
- }
- };
- }
- }
- },
- data: function data() {
- return {
- visible: false
- };
- },
- watch: {
- visible: function visible(val) {
- if (val) {
- if (this.handleIndexIncrease) this.handleIndexIncrease(); // just use for Poptip
- this.updatePopper();
- this.$emit('on-popper-show');
- } else {
- this.$emit('on-popper-hide');
- }
- }
- },
- methods: {
- createPopper: function createPopper() {
- var _this = this;
- if (isServer) return;
- if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) {
- return;
- }
- var options = this.options;
- var popper = this.popper || this.$refs.popper;
- var reference = this.reference || this.$refs.reference;
- if (!popper || !reference) return;
- if (this.popperJS && this.popperJS.hasOwnProperty('destroy')) {
- this.popperJS.destroy();
- }
- options.placement = this.placement;
- if (!options.modifiers.offset) {
- options.modifiers.offset = {};
- }
- options.modifiers.offset.offset = this.offset;
- options.onCreate = function () {
- _this.$nextTick(_this.updatePopper);
- _this.$emit('created', _this);
- };
- this.popperJS = new Popper(reference, popper, options);
- },
- updatePopper: function updatePopper() {
- if (isServer) return;
- this.popperJS ? this.popperJS.update() : this.createPopper();
- },
- doDestroy: function doDestroy() {
- if (isServer) return;
- if (this.visible) return;
- this.popperJS.destroy();
- this.popperJS = null;
- }
- },
- updated: function updated() {
- var _this2 = this;
- this.$nextTick(function () {
- return _this2.updatePopper();
- });
- },
- beforeDestroy: function beforeDestroy() {
- if (isServer) return;
- if (this.popperJS) {
- this.popperJS.destroy();
- }
- }
- });
- /***/ }),
- /* 217 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {/**!
- * @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.16.1
- * @license
- * Copyright (c) 2016 Federico Zivolo and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- (function (global, factory) {
- true ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Popper = factory());
- }(this, (function () { 'use strict';
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
- var timeoutDuration = function () {
- var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
- for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
- if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
- return 1;
- }
- }
- return 0;
- }();
- function microtaskDebounce(fn) {
- var called = false;
- return function () {
- if (called) {
- return;
- }
- called = true;
- window.Promise.resolve().then(function () {
- called = false;
- fn();
- });
- };
- }
- function taskDebounce(fn) {
- var scheduled = false;
- return function () {
- if (!scheduled) {
- scheduled = true;
- setTimeout(function () {
- scheduled = false;
- fn();
- }, timeoutDuration);
- }
- };
- }
- var supportsMicroTasks = isBrowser && window.Promise;
- /**
- * Create a debounced version of a method, that's asynchronously deferred
- * but called in the minimum time possible.
- *
- * @method
- * @memberof Popper.Utils
- * @argument {Function} fn
- * @returns {Function}
- */
- var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
- /**
- * Check if the given variable is a function
- * @method
- * @memberof Popper.Utils
- * @argument {Any} functionToCheck - variable to check
- * @returns {Boolean} answer to: is a function?
- */
- function isFunction(functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- }
- /**
- * Get CSS computed property of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Eement} element
- * @argument {String} property
- */
- function getStyleComputedProperty(element, property) {
- if (element.nodeType !== 1) {
- return [];
- }
- // NOTE: 1 DOM access here
- var window = element.ownerDocument.defaultView;
- var css = window.getComputedStyle(element, null);
- return property ? css[property] : css;
- }
- /**
- * Returns the parentNode or the host of the element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} parent
- */
- function getParentNode(element) {
- if (element.nodeName === 'HTML') {
- return element;
- }
- return element.parentNode || element.host;
- }
- /**
- * Returns the scrolling parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} scroll parent
- */
- function getScrollParent(element) {
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
- if (!element) {
- return document.body;
- }
- switch (element.nodeName) {
- case 'HTML':
- case 'BODY':
- return element.ownerDocument.body;
- case '#document':
- return element.body;
- }
- // Firefox want us to check `-x` and `-y` variations as well
- var _getStyleComputedProp = getStyleComputedProperty(element),
- overflow = _getStyleComputedProp.overflow,
- overflowX = _getStyleComputedProp.overflowX,
- overflowY = _getStyleComputedProp.overflowY;
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
- return element;
- }
- return getScrollParent(getParentNode(element));
- }
- /**
- * Returns the reference node of the reference object, or the reference object itself.
- * @method
- * @memberof Popper.Utils
- * @param {Element|Object} reference - the reference element (the popper will be relative to this)
- * @returns {Element} parent
- */
- function getReferenceNode(reference) {
- return reference && reference.referenceNode ? reference.referenceNode : reference;
- }
- var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
- var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
- /**
- * Determines if the browser is Internet Explorer
- * @method
- * @memberof Popper.Utils
- * @param {Number} version to check
- * @returns {Boolean} isIE
- */
- function isIE(version) {
- if (version === 11) {
- return isIE11;
- }
- if (version === 10) {
- return isIE10;
- }
- return isIE11 || isIE10;
- }
- /**
- * Returns the offset parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} offset parent
- */
- function getOffsetParent(element) {
- if (!element) {
- return document.documentElement;
- }
- var noOffsetParent = isIE(10) ? document.body : null;
- // NOTE: 1 DOM access here
- var offsetParent = element.offsetParent || null;
- // Skip hidden elements which don't have an offsetParent
- while (offsetParent === noOffsetParent && element.nextElementSibling) {
- offsetParent = (element = element.nextElementSibling).offsetParent;
- }
- var nodeName = offsetParent && offsetParent.nodeName;
- if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- return element ? element.ownerDocument.documentElement : document.documentElement;
- }
- // .offsetParent will return the closest TH, TD or TABLE in case
- // no offsetParent is present, I hate this job...
- if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
- return getOffsetParent(offsetParent);
- }
- return offsetParent;
- }
- function isOffsetContainer(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY') {
- return false;
- }
- return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
- }
- /**
- * Finds the root node (document, shadowDOM root) of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} node
- * @returns {Element} root node
- */
- function getRoot(node) {
- if (node.parentNode !== null) {
- return getRoot(node.parentNode);
- }
- return node;
- }
- /**
- * Finds the offset parent common to the two provided nodes
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element1
- * @argument {Element} element2
- * @returns {Element} common offset parent
- */
- function findCommonOffsetParent(element1, element2) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
- return document.documentElement;
- }
- // Here we make sure to give as "start" the element that comes first in the DOM
- var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
- var start = order ? element1 : element2;
- var end = order ? element2 : element1;
- // Get common ancestor container
- var range = document.createRange();
- range.setStart(start, 0);
- range.setEnd(end, 0);
- var commonAncestorContainer = range.commonAncestorContainer;
- // Both nodes are inside #document
- if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
- if (isOffsetContainer(commonAncestorContainer)) {
- return commonAncestorContainer;
- }
- return getOffsetParent(commonAncestorContainer);
- }
- // one of the nodes is inside shadowDOM, find which one
- var element1root = getRoot(element1);
- if (element1root.host) {
- return findCommonOffsetParent(element1root.host, element2);
- } else {
- return findCommonOffsetParent(element1, getRoot(element2).host);
- }
- }
- /**
- * Gets the scroll value of the given element in the given side (top and left)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {String} side `top` or `left`
- * @returns {number} amount of scrolled pixels
- */
- function getScroll(element) {
- var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
- var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- var html = element.ownerDocument.documentElement;
- var scrollingElement = element.ownerDocument.scrollingElement || html;
- return scrollingElement[upperSide];
- }
- return element[upperSide];
- }
- /*
- * Sum or subtract the element scroll values (left and top) from a given rect object
- * @method
- * @memberof Popper.Utils
- * @param {Object} rect - Rect object you want to change
- * @param {HTMLElement} element - The element from the function reads the scroll values
- * @param {Boolean} subtract - set to true if you want to subtract the scroll values
- * @return {Object} rect - The modifier rect object
- */
- function includeScroll(rect, element) {
- var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- var modifier = subtract ? -1 : 1;
- rect.top += scrollTop * modifier;
- rect.bottom += scrollTop * modifier;
- rect.left += scrollLeft * modifier;
- rect.right += scrollLeft * modifier;
- return rect;
- }
- /*
- * Helper to detect borders of a given element
- * @method
- * @memberof Popper.Utils
- * @param {CSSStyleDeclaration} styles
- * Result of `getStyleComputedProperty` on the given element
- * @param {String} axis - `x` or `y`
- * @return {number} borders - The borders size of the given axis
- */
- function getBordersSize(styles, axis) {
- var sideA = axis === 'x' ? 'Left' : 'Top';
- var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
- return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
- }
- function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
- }
- function getWindowSizes(document) {
- var body = document.body;
- var html = document.documentElement;
- var computedStyle = isIE(10) && getComputedStyle(html);
- return {
- height: getSize('Height', body, html, computedStyle),
- width: getSize('Width', body, html, computedStyle)
- };
- }
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
- var createClass = function () {
- 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);
- }
- }
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- var defineProperty = function (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;
- };
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
- /**
- * Given element offsets, generate an output similar to getBoundingClientRect
- * @method
- * @memberof Popper.Utils
- * @argument {Object} offsets
- * @returns {Object} ClientRect like output
- */
- function getClientRect(offsets) {
- return _extends({}, offsets, {
- right: offsets.left + offsets.width,
- bottom: offsets.top + offsets.height
- });
- }
- /**
- * Get bounding client rect of given element
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} element
- * @return {Object} client rect
- */
- function getBoundingClientRect(element) {
- var rect = {};
- // IE10 10 FIX: Please, don't ask, the element isn't
- // considered in DOM in some circumstances...
- // This isn't reproducible in IE10 compatibility mode of IE11
- try {
- if (isIE(10)) {
- rect = element.getBoundingClientRect();
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- rect.top += scrollTop;
- rect.left += scrollLeft;
- rect.bottom += scrollTop;
- rect.right += scrollLeft;
- } else {
- rect = element.getBoundingClientRect();
- }
- } catch (e) {}
- var result = {
- left: rect.left,
- top: rect.top,
- width: rect.right - rect.left,
- height: rect.bottom - rect.top
- };
- // subtract scrollbar size from sizes
- var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
- var width = sizes.width || element.clientWidth || result.width;
- var height = sizes.height || element.clientHeight || result.height;
- var horizScrollbar = element.offsetWidth - width;
- var vertScrollbar = element.offsetHeight - height;
- // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
- // we make this check conditional for performance reasons
- if (horizScrollbar || vertScrollbar) {
- var styles = getStyleComputedProperty(element);
- horizScrollbar -= getBordersSize(styles, 'x');
- vertScrollbar -= getBordersSize(styles, 'y');
- result.width -= horizScrollbar;
- result.height -= vertScrollbar;
- }
- return getClientRect(result);
- }
- function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var isIE10 = isIE(10);
- var isHTML = parent.nodeName === 'HTML';
- var childrenRect = getBoundingClientRect(children);
- var parentRect = getBoundingClientRect(parent);
- var scrollParent = getScrollParent(children);
- var styles = getStyleComputedProperty(parent);
- var borderTopWidth = parseFloat(styles.borderTopWidth);
- var borderLeftWidth = parseFloat(styles.borderLeftWidth);
- // In cases where the parent is fixed, we must ignore negative scroll in offset calc
- if (fixedPosition && isHTML) {
- parentRect.top = Math.max(parentRect.top, 0);
- parentRect.left = Math.max(parentRect.left, 0);
- }
- var offsets = getClientRect({
- top: childrenRect.top - parentRect.top - borderTopWidth,
- left: childrenRect.left - parentRect.left - borderLeftWidth,
- width: childrenRect.width,
- height: childrenRect.height
- });
- offsets.marginTop = 0;
- offsets.marginLeft = 0;
- // Subtract margins of documentElement in case it's being used as parent
- // we do this only on HTML because it's the only element that behaves
- // differently when margins are applied to it. The margins are included in
- // the box of the documentElement, in the other cases not.
- if (!isIE10 && isHTML) {
- var marginTop = parseFloat(styles.marginTop);
- var marginLeft = parseFloat(styles.marginLeft);
- offsets.top -= borderTopWidth - marginTop;
- offsets.bottom -= borderTopWidth - marginTop;
- offsets.left -= borderLeftWidth - marginLeft;
- offsets.right -= borderLeftWidth - marginLeft;
- // Attach marginTop and marginLeft because in some circumstances we may need them
- offsets.marginTop = marginTop;
- offsets.marginLeft = marginLeft;
- }
- if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
- offsets = includeScroll(offsets, parent);
- }
- return offsets;
- }
- function getViewportOffsetRectRelativeToArtbitraryNode(element) {
- var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var html = element.ownerDocument.documentElement;
- var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
- var width = Math.max(html.clientWidth, window.innerWidth || 0);
- var height = Math.max(html.clientHeight, window.innerHeight || 0);
- var scrollTop = !excludeScroll ? getScroll(html) : 0;
- var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
- var offset = {
- top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
- left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
- width: width,
- height: height
- };
- return getClientRect(offset);
- }
- /**
- * Check if the given element is fixed or is inside a fixed parent
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {Element} customContainer
- * @returns {Boolean} answer to "isFixed?"
- */
- function isFixed(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- return false;
- }
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
- return true;
- }
- var parentNode = getParentNode(element);
- if (!parentNode) {
- return false;
- }
- return isFixed(parentNode);
- }
- /**
- * Finds the first parent of an element that has a transformed property defined
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} first transformed parent or documentElement
- */
- function getFixedPositionOffsetParent(element) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element || !element.parentElement || isIE()) {
- return document.documentElement;
- }
- var el = element.parentElement;
- while (el && getStyleComputedProperty(el, 'transform') === 'none') {
- el = el.parentElement;
- }
- return el || document.documentElement;
- }
- /**
- * Computed the boundaries limits and return them
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} popper
- * @param {HTMLElement} reference
- * @param {number} padding
- * @param {HTMLElement} boundariesElement - Element used to define the boundaries
- * @param {Boolean} fixedPosition - Is in fixed position mode
- * @returns {Object} Coordinates of the boundaries
- */
- function getBoundaries(popper, reference, padding, boundariesElement) {
- var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
- // NOTE: 1 DOM access here
- var boundaries = { top: 0, left: 0 };
- var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
- // Handle viewport case
- if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
- } else {
- // Handle other cases based on DOM element used as boundaries
- var boundariesNode = void 0;
- if (boundariesElement === 'scrollParent') {
- boundariesNode = getScrollParent(getParentNode(reference));
- if (boundariesNode.nodeName === 'BODY') {
- boundariesNode = popper.ownerDocument.documentElement;
- }
- } else if (boundariesElement === 'window') {
- boundariesNode = popper.ownerDocument.documentElement;
- } else {
- boundariesNode = boundariesElement;
- }
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
- // In case of HTML, we need a different computation
- if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
- var _getWindowSizes = getWindowSizes(popper.ownerDocument),
- height = _getWindowSizes.height,
- width = _getWindowSizes.width;
- boundaries.top += offsets.top - offsets.marginTop;
- boundaries.bottom = height + offsets.top;
- boundaries.left += offsets.left - offsets.marginLeft;
- boundaries.right = width + offsets.left;
- } else {
- // for all the other DOM elements, this one is good
- boundaries = offsets;
- }
- }
- // Add paddings
- padding = padding || 0;
- var isPaddingNumber = typeof padding === 'number';
- boundaries.left += isPaddingNumber ? padding : padding.left || 0;
- boundaries.top += isPaddingNumber ? padding : padding.top || 0;
- boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
- boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
- return boundaries;
- }
- function getArea(_ref) {
- var width = _ref.width,
- height = _ref.height;
- return width * height;
- }
- /**
- * Utility used to transform the `auto` placement to the placement with more
- * available space.
- * @method
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
- var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
- if (placement.indexOf('auto') === -1) {
- return placement;
- }
- var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
- var rects = {
- top: {
- width: boundaries.width,
- height: refRect.top - boundaries.top
- },
- right: {
- width: boundaries.right - refRect.right,
- height: boundaries.height
- },
- bottom: {
- width: boundaries.width,
- height: boundaries.bottom - refRect.bottom
- },
- left: {
- width: refRect.left - boundaries.left,
- height: boundaries.height
- }
- };
- var sortedAreas = Object.keys(rects).map(function (key) {
- return _extends({
- key: key
- }, rects[key], {
- area: getArea(rects[key])
- });
- }).sort(function (a, b) {
- return b.area - a.area;
- });
- var filteredAreas = sortedAreas.filter(function (_ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- return width >= popper.clientWidth && height >= popper.clientHeight;
- });
- var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
- var variation = placement.split('-')[1];
- return computedPlacement + (variation ? '-' + variation : '');
- }
- /**
- * Get offsets to the reference element
- * @method
- * @memberof Popper.Utils
- * @param {Object} state
- * @param {Element} popper - the popper element
- * @param {Element} reference - the reference element (the popper will be relative to this)
- * @param {Element} fixedPosition - is in fixed position mode
- * @returns {Object} An object containing the offsets which will be applied to the popper
- */
- function getReferenceOffsets(state, popper, reference) {
- var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
- }
- /**
- * Get the outer sizes of the given element (offset size + margins)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Object} object containing width and height properties
- */
- function getOuterSizes(element) {
- var window = element.ownerDocument.defaultView;
- var styles = window.getComputedStyle(element);
- var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
- var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
- var result = {
- width: element.offsetWidth + y,
- height: element.offsetHeight + x
- };
- return result;
- }
- /**
- * Get the opposite placement of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement
- * @returns {String} flipped placement
- */
- function getOppositePlacement(placement) {
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
- return placement.replace(/left|right|bottom|top/g, function (matched) {
- return hash[matched];
- });
- }
- /**
- * Get offsets to the popper
- * @method
- * @memberof Popper.Utils
- * @param {Object} position - CSS position the Popper will get applied
- * @param {HTMLElement} popper - the popper element
- * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
- * @param {String} placement - one of the valid placement options
- * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
- */
- function getPopperOffsets(popper, referenceOffsets, placement) {
- placement = placement.split('-')[0];
- // Get popper node sizes
- var popperRect = getOuterSizes(popper);
- // Add position, width and height to our offsets object
- var popperOffsets = {
- width: popperRect.width,
- height: popperRect.height
- };
- // depending by the popper placement we have to compute its offsets slightly differently
- var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
- var mainSide = isHoriz ? 'top' : 'left';
- var secondarySide = isHoriz ? 'left' : 'top';
- var measurement = isHoriz ? 'height' : 'width';
- var secondaryMeasurement = !isHoriz ? 'height' : 'width';
- popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
- if (placement === secondarySide) {
- popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
- } else {
- popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
- }
- return popperOffsets;
- }
- /**
- * Mimics the `find` method of Array
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function find(arr, check) {
- // use native find if supported
- if (Array.prototype.find) {
- return arr.find(check);
- }
- // use `filter` to obtain the same behavior of `find`
- return arr.filter(check)[0];
- }
- /**
- * Return the index of the matching object
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function findIndex(arr, prop, value) {
- // use native findIndex if supported
- if (Array.prototype.findIndex) {
- return arr.findIndex(function (cur) {
- return cur[prop] === value;
- });
- }
- // use `find` + `indexOf` if `findIndex` isn't supported
- var match = find(arr, function (obj) {
- return obj[prop] === value;
- });
- return arr.indexOf(match);
- }
- /**
- * Loop trough the list of modifiers and run them in order,
- * each of them will then edit the data object.
- * @method
- * @memberof Popper.Utils
- * @param {dataObject} data
- * @param {Array} modifiers
- * @param {String} ends - Optional modifier name used as stopper
- * @returns {dataObject}
- */
- function runModifiers(modifiers, data, ends) {
- var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
- modifiersToRun.forEach(function (modifier) {
- if (modifier['function']) {
- // eslint-disable-line dot-notation
- console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
- }
- var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
- if (modifier.enabled && isFunction(fn)) {
- // Add properties to offsets to make them a complete clientRect object
- // we do this before each modifier to make sure the previous one doesn't
- // mess with these values
- data.offsets.popper = getClientRect(data.offsets.popper);
- data.offsets.reference = getClientRect(data.offsets.reference);
- data = fn(data, modifier);
- }
- });
- return data;
- }
- /**
- * Updates the position of the popper, computing the new offsets and applying
- * the new style.<br />
- * Prefer `scheduleUpdate` over `update` because of performance reasons.
- * @method
- * @memberof Popper
- */
- function update() {
- // if popper is destroyed, don't perform any further update
- if (this.state.isDestroyed) {
- return;
- }
- var data = {
- instance: this,
- styles: {},
- arrowStyles: {},
- attributes: {},
- flipped: false,
- offsets: {}
- };
- // compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
- // store the computed placement inside `originalPlacement`
- data.originalPlacement = data.placement;
- data.positionFixed = this.options.positionFixed;
- // compute the popper offsets
- data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
- data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
- // run the modifiers
- data = runModifiers(this.modifiers, data);
- // the first `update` will call `onCreate` callback
- // the other ones will call `onUpdate` callback
- if (!this.state.isCreated) {
- this.state.isCreated = true;
- this.options.onCreate(data);
- } else {
- this.options.onUpdate(data);
- }
- }
- /**
- * Helper used to know if the given modifier is enabled.
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean}
- */
- function isModifierEnabled(modifiers, modifierName) {
- return modifiers.some(function (_ref) {
- var name = _ref.name,
- enabled = _ref.enabled;
- return enabled && name === modifierName;
- });
- }
- /**
- * Get the prefixed supported property name
- * @method
- * @memberof Popper.Utils
- * @argument {String} property (camelCase)
- * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
- */
- function getSupportedPropertyName(property) {
- var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
- var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
- for (var i = 0; i < prefixes.length; i++) {
- var prefix = prefixes[i];
- var toCheck = prefix ? '' + prefix + upperProp : property;
- if (typeof document.body.style[toCheck] !== 'undefined') {
- return toCheck;
- }
- }
- return null;
- }
- /**
- * Destroys the popper.
- * @method
- * @memberof Popper
- */
- function destroy() {
- this.state.isDestroyed = true;
- // touch DOM only if `applyStyle` modifier is enabled
- if (isModifierEnabled(this.modifiers, 'applyStyle')) {
- this.popper.removeAttribute('x-placement');
- this.popper.style.position = '';
- this.popper.style.top = '';
- this.popper.style.left = '';
- this.popper.style.right = '';
- this.popper.style.bottom = '';
- this.popper.style.willChange = '';
- this.popper.style[getSupportedPropertyName('transform')] = '';
- }
- this.disableEventListeners();
- // remove the popper if user explicitly asked for the deletion on destroy
- // do not use `remove` because IE11 doesn't support it
- if (this.options.removeOnDestroy) {
- this.popper.parentNode.removeChild(this.popper);
- }
- return this;
- }
- /**
- * Get the window associated with the element
- * @argument {Element} element
- * @returns {Window}
- */
- function getWindow(element) {
- var ownerDocument = element.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView : window;
- }
- function attachToScrollParents(scrollParent, event, callback, scrollParents) {
- var isBody = scrollParent.nodeName === 'BODY';
- var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
- target.addEventListener(event, callback, { passive: true });
- if (!isBody) {
- attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
- }
- scrollParents.push(target);
- }
- /**
- * Setup needed event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function setupEventListeners(reference, options, state, updateBound) {
- // Resize event listener on window
- state.updateBound = updateBound;
- getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
- // Scroll event listener on scroll parents
- var scrollElement = getScrollParent(reference);
- attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
- state.scrollElement = scrollElement;
- state.eventsEnabled = true;
- return state;
- }
- /**
- * It will add resize/scroll events and start recalculating
- * position of the popper element when they are triggered.
- * @method
- * @memberof Popper
- */
- function enableEventListeners() {
- if (!this.state.eventsEnabled) {
- this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
- }
- }
- /**
- * Remove event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function removeEventListeners(reference, state) {
- // Remove resize event listener on window
- getWindow(reference).removeEventListener('resize', state.updateBound);
- // Remove scroll event listener on scroll parents
- state.scrollParents.forEach(function (target) {
- target.removeEventListener('scroll', state.updateBound);
- });
- // Reset state
- state.updateBound = null;
- state.scrollParents = [];
- state.scrollElement = null;
- state.eventsEnabled = false;
- return state;
- }
- /**
- * It will remove resize/scroll events and won't recalculate popper position
- * when they are triggered. It also won't trigger `onUpdate` callback anymore,
- * unless you call `update` method manually.
- * @method
- * @memberof Popper
- */
- function disableEventListeners() {
- if (this.state.eventsEnabled) {
- cancelAnimationFrame(this.scheduleUpdate);
- this.state = removeEventListeners(this.reference, this.state);
- }
- }
- /**
- * Tells if a given input is a number
- * @method
- * @memberof Popper.Utils
- * @param {*} input to check
- * @return {Boolean}
- */
- function isNumeric(n) {
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
- }
- /**
- * Set the style to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the style to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setStyles(element, styles) {
- Object.keys(styles).forEach(function (prop) {
- var unit = '';
- // add unit if the value is numeric and is one of the following
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
- unit = 'px';
- }
- element.style[prop] = styles[prop] + unit;
- });
- }
- /**
- * Set the attributes to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the attributes to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setAttributes(element, attributes) {
- Object.keys(attributes).forEach(function (prop) {
- var value = attributes[prop];
- if (value !== false) {
- element.setAttribute(prop, attributes[prop]);
- } else {
- element.removeAttribute(prop);
- }
- });
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} data.styles - List of style properties - values to apply to popper element
- * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The same data object
- */
- function applyStyle(data) {
- // any property present in `data.styles` will be applied to the popper,
- // in this way we can make the 3rd party modifiers add custom styles to it
- // Be aware, modifiers could override the properties defined in the previous
- // lines of this modifier!
- setStyles(data.instance.popper, data.styles);
- // any property present in `data.attributes` will be applied to the popper,
- // they will be set as HTML attributes of the element
- setAttributes(data.instance.popper, data.attributes);
- // if arrowElement is defined and arrowStyles has some properties
- if (data.arrowElement && Object.keys(data.arrowStyles).length) {
- setStyles(data.arrowElement, data.arrowStyles);
- }
- return data;
- }
- /**
- * Set the x-placement attribute before everything else because it could be used
- * to add margins to the popper margins needs to be calculated to get the
- * correct popper offsets.
- * @method
- * @memberof Popper.modifiers
- * @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper
- * @param {Object} options - Popper.js options
- */
- function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
- // compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
- popper.setAttribute('x-placement', placement);
- // Apply `position` to popper before anything else because
- // without the position applied we can't guarantee correct computations
- setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
- return options;
- }
- /**
- * @function
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Boolean} shouldRound - If the offsets should be rounded at all
- * @returns {Object} The popper's position offsets rounded
- *
- * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
- * good as it can be within reason.
- * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
- *
- * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
- * as well on High DPI screens).
- *
- * Firefox prefers no rounding for positioning and does not have blurriness on
- * high DPI screens.
- *
- * Only horizontal placement and left/right values need to be considered.
- */
- function getRoundedOffsets(data, shouldRound) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var round = Math.round,
- floor = Math.floor;
- var noRound = function noRound(v) {
- return v;
- };
- var referenceWidth = round(reference.width);
- var popperWidth = round(popper.width);
- var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
- var isVariation = data.placement.indexOf('-') !== -1;
- var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
- var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
- var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
- var verticalToInteger = !shouldRound ? noRound : round;
- return {
- left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
- top: verticalToInteger(popper.top),
- bottom: verticalToInteger(popper.bottom),
- right: horizontalToInteger(popper.right)
- };
- }
- var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeStyle(data, options) {
- var x = options.x,
- y = options.y;
- var popper = data.offsets.popper;
- // Remove this legacy support in Popper.js v2
- var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'applyStyle';
- }).gpuAcceleration;
- if (legacyGpuAccelerationOption !== undefined) {
- console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
- }
- var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
- var offsetParent = getOffsetParent(data.instance.popper);
- var offsetParentRect = getBoundingClientRect(offsetParent);
- // Styles
- var styles = {
- position: popper.position
- };
- var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
- var sideA = x === 'bottom' ? 'top' : 'bottom';
- var sideB = y === 'right' ? 'left' : 'right';
- // if gpuAcceleration is set to `true` and transform is supported,
- // we use `translate3d` to apply the position to the popper we
- // automatically use the supported prefixed version if needed
- var prefixedProperty = getSupportedPropertyName('transform');
- // now, let's make a step back and look at this code closely (wtf?)
- // If the content of the popper grows once it's been positioned, it
- // may happen that the popper gets misplaced because of the new content
- // overflowing its reference element
- // To avoid this problem, we provide two options (x and y), which allow
- // the consumer to define the offset origin.
- // If we position a popper on top of a reference element, we can set
- // `x` to `top` to make the popper grow towards its top instead of
- // its bottom.
- var left = void 0,
- top = void 0;
- if (sideA === 'bottom') {
- // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
- // and not the bottom of the html element
- if (offsetParent.nodeName === 'HTML') {
- top = -offsetParent.clientHeight + offsets.bottom;
- } else {
- top = -offsetParentRect.height + offsets.bottom;
- }
- } else {
- top = offsets.top;
- }
- if (sideB === 'right') {
- if (offsetParent.nodeName === 'HTML') {
- left = -offsetParent.clientWidth + offsets.right;
- } else {
- left = -offsetParentRect.width + offsets.right;
- }
- } else {
- left = offsets.left;
- }
- if (gpuAcceleration && prefixedProperty) {
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
- styles[sideA] = 0;
- styles[sideB] = 0;
- styles.willChange = 'transform';
- } else {
- // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
- var invertTop = sideA === 'bottom' ? -1 : 1;
- var invertLeft = sideB === 'right' ? -1 : 1;
- styles[sideA] = top * invertTop;
- styles[sideB] = left * invertLeft;
- styles.willChange = sideA + ', ' + sideB;
- }
- // Attributes
- var attributes = {
- 'x-placement': data.placement
- };
- // Update `data` attributes, styles and arrowStyles
- data.attributes = _extends({}, attributes, data.attributes);
- data.styles = _extends({}, styles, data.styles);
- data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
- return data;
- }
- /**
- * Helper used to know if the given modifier depends from another one.<br />
- * It checks if the needed modifier is listed and enabled.
- * @method
- * @memberof Popper.Utils
- * @param {Array} modifiers - list of modifiers
- * @param {String} requestingName - name of requesting modifier
- * @param {String} requestedName - name of requested modifier
- * @returns {Boolean}
- */
- function isModifierRequired(modifiers, requestingName, requestedName) {
- var requesting = find(modifiers, function (_ref) {
- var name = _ref.name;
- return name === requestingName;
- });
- var isRequired = !!requesting && modifiers.some(function (modifier) {
- return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
- });
- if (!isRequired) {
- var _requesting = '`' + requestingName + '`';
- var requested = '`' + requestedName + '`';
- console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
- }
- return isRequired;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function arrow(data, options) {
- var _data$offsets$arrow;
- // arrow depends on keepTogether in order to work
- if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
- return data;
- }
- var arrowElement = options.element;
- // if arrowElement is a string, suppose it's a CSS selector
- if (typeof arrowElement === 'string') {
- arrowElement = data.instance.popper.querySelector(arrowElement);
- // if arrowElement is not found, don't run the modifier
- if (!arrowElement) {
- return data;
- }
- } else {
- // if the arrowElement isn't a query selector we must check that the
- // provided DOM node is child of its popper node
- if (!data.instance.popper.contains(arrowElement)) {
- console.warn('WARNING: `arrow.element` must be child of its popper element!');
- return data;
- }
- }
- var placement = data.placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
- var len = isVertical ? 'height' : 'width';
- var sideCapitalized = isVertical ? 'Top' : 'Left';
- var side = sideCapitalized.toLowerCase();
- var altSide = isVertical ? 'left' : 'top';
- var opSide = isVertical ? 'bottom' : 'right';
- var arrowElementSize = getOuterSizes(arrowElement)[len];
- //
- // extends keepTogether behavior making sure the popper and its
- // reference have enough pixels in conjunction
- //
- // top/left side
- if (reference[opSide] - arrowElementSize < popper[side]) {
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
- }
- // bottom/right side
- if (reference[side] + arrowElementSize > popper[opSide]) {
- data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
- }
- data.offsets.popper = getClientRect(data.offsets.popper);
- // compute center of the popper
- var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
- // Compute the sideValue using the updated popper offsets
- // take popper margin in account because we don't have this info available
- var css = getStyleComputedProperty(data.instance.popper);
- var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
- var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
- var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
- // prevent arrowElement from being placed not contiguously to its popper
- sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
- data.arrowElement = arrowElement;
- data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
- return data;
- }
- /**
- * Get the opposite placement variation of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement variation
- * @returns {String} flipped placement variation
- */
- function getOppositeVariation(variation) {
- if (variation === 'end') {
- return 'start';
- } else if (variation === 'start') {
- return 'end';
- }
- return variation;
- }
- /**
- * List of accepted placements to use as values of the `placement` option.<br />
- * Valid placements are:
- * - `auto`
- * - `top`
- * - `right`
- * - `bottom`
- * - `left`
- *
- * Each placement can have a variation from this list:
- * - `-start`
- * - `-end`
- *
- * Variations are interpreted easily if you think of them as the left to right
- * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
- * is right.<br />
- * Vertically (`left` and `right`), `start` is top and `end` is bottom.
- *
- * Some valid examples are:
- * - `top-end` (on top of reference, right aligned)
- * - `right-start` (on right of reference, top aligned)
- * - `bottom` (on bottom, centered)
- * - `auto-end` (on the side with more space available, alignment depends by placement)
- *
- * @static
- * @type {Array}
- * @enum {String}
- * @readonly
- * @method placements
- * @memberof Popper
- */
- var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
- // Get rid of `auto` `auto-start` and `auto-end`
- var validPlacements = placements.slice(3);
- /**
- * Given an initial placement, returns all the subsequent placements
- * clockwise (or counter-clockwise).
- *
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement - A valid placement (it accepts variations)
- * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
- * @returns {Array} placements including their variations
- */
- function clockwise(placement) {
- var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var index = validPlacements.indexOf(placement);
- var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
- return counter ? arr.reverse() : arr;
- }
- var BEHAVIORS = {
- FLIP: 'flip',
- CLOCKWISE: 'clockwise',
- COUNTERCLOCKWISE: 'counterclockwise'
- };
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function flip(data, options) {
- // if `inner` modifier is enabled, we can't use the `flip` modifier
- if (isModifierEnabled(data.instance.modifiers, 'inner')) {
- return data;
- }
- if (data.flipped && data.placement === data.originalPlacement) {
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
- return data;
- }
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
- var placement = data.placement.split('-')[0];
- var placementOpposite = getOppositePlacement(placement);
- var variation = data.placement.split('-')[1] || '';
- var flipOrder = [];
- switch (options.behavior) {
- case BEHAVIORS.FLIP:
- flipOrder = [placement, placementOpposite];
- break;
- case BEHAVIORS.CLOCKWISE:
- flipOrder = clockwise(placement);
- break;
- case BEHAVIORS.COUNTERCLOCKWISE:
- flipOrder = clockwise(placement, true);
- break;
- default:
- flipOrder = options.behavior;
- }
- flipOrder.forEach(function (step, index) {
- if (placement !== step || flipOrder.length === index + 1) {
- return data;
- }
- placement = data.placement.split('-')[0];
- placementOpposite = getOppositePlacement(placement);
- var popperOffsets = data.offsets.popper;
- var refOffsets = data.offsets.reference;
- // using floor because the reference offsets may contain decimals we are not going to consider here
- var floor = Math.floor;
- var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
- var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
- var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
- var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
- var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
- var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
- // flip the variation if required
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- // flips variation if reference element overflows boundaries
- var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
- // flips variation if popper content overflows boundaries
- var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
- var flippedVariation = flippedVariationByRef || flippedVariationByContent;
- if (overlapsRef || overflowsBoundaries || flippedVariation) {
- // this boolean to detect any flip loop
- data.flipped = true;
- if (overlapsRef || overflowsBoundaries) {
- placement = flipOrder[index + 1];
- }
- if (flippedVariation) {
- variation = getOppositeVariation(variation);
- }
- data.placement = placement + (variation ? '-' + variation : '');
- // this object contains `position`, we want to preserve it along with
- // any additional property we may add in the future
- data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
- data = runModifiers(data.instance.modifiers, data, 'flip');
- }
- });
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function keepTogether(data) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var placement = data.placement.split('-')[0];
- var floor = Math.floor;
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- var side = isVertical ? 'right' : 'bottom';
- var opSide = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
- if (popper[side] < floor(reference[opSide])) {
- data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
- }
- if (popper[opSide] > floor(reference[side])) {
- data.offsets.popper[opSide] = floor(reference[side]);
- }
- return data;
- }
- /**
- * Converts a string containing value + unit into a px value number
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} str - Value + unit string
- * @argument {String} measurement - `height` or `width`
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @returns {Number|String}
- * Value in pixels, or original string if no values were extracted
- */
- function toValue(str, measurement, popperOffsets, referenceOffsets) {
- // separate value from unit
- var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
- var value = +split[1];
- var unit = split[2];
- // If it's not a number it's an operator, I guess
- if (!value) {
- return str;
- }
- if (unit.indexOf('%') === 0) {
- var element = void 0;
- switch (unit) {
- case '%p':
- element = popperOffsets;
- break;
- case '%':
- case '%r':
- default:
- element = referenceOffsets;
- }
- var rect = getClientRect(element);
- return rect[measurement] / 100 * value;
- } else if (unit === 'vh' || unit === 'vw') {
- // if is a vh or vw, we calculate the size based on the viewport
- var size = void 0;
- if (unit === 'vh') {
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
- } else {
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
- return size / 100 * value;
- } else {
- // if is an explicit pixel unit, we get rid of the unit and keep the value
- // if is an implicit unit, it's px, and we return just the value
- return value;
- }
- }
- /**
- * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} offset
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @argument {String} basePlacement
- * @returns {Array} a two cells array with x and y offsets in numbers
- */
- function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
- var offsets = [0, 0];
- // Use height if placement is left or right and index is 0 otherwise use width
- // in this way the first offset will use an axis and the second one
- // will use the other one
- var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
- // Split the offset string to obtain a list of values and operands
- // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
- var fragments = offset.split(/(\+|\-)/).map(function (frag) {
- return frag.trim();
- });
- // Detect if the offset string contains a pair of values or a single one
- // they could be separated by comma or space
- var divider = fragments.indexOf(find(fragments, function (frag) {
- return frag.search(/,|\s/) !== -1;
- }));
- if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
- console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
- }
- // If divider is found, we divide the list of values and operands to divide
- // them by ofset X and Y.
- var splitRegex = /\s*,\s*|\s+/;
- var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
- // Convert the values with units to absolute pixels to allow our computations
- ops = ops.map(function (op, index) {
- // Most of the units rely on the orientation of the popper
- var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
- var mergeWithPrevious = false;
- return op
- // This aggregates any `+` or `-` sign that aren't considered operators
- // e.g.: 10 + +5 => [10, +, +5]
- .reduce(function (a, b) {
- if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
- a[a.length - 1] = b;
- mergeWithPrevious = true;
- return a;
- } else if (mergeWithPrevious) {
- a[a.length - 1] += b;
- mergeWithPrevious = false;
- return a;
- } else {
- return a.concat(b);
- }
- }, [])
- // Here we convert the string values into number values (in px)
- .map(function (str) {
- return toValue(str, measurement, popperOffsets, referenceOffsets);
- });
- });
- // Loop trough the offsets arrays and execute the operations
- ops.forEach(function (op, index) {
- op.forEach(function (frag, index2) {
- if (isNumeric(frag)) {
- offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
- }
- });
- });
- return offsets;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @argument {Number|String} options.offset=0
- * The offset value as described in the modifier description
- * @returns {Object} The data object, properly modified
- */
- function offset(data, _ref) {
- var offset = _ref.offset;
- var placement = data.placement,
- _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var basePlacement = placement.split('-')[0];
- var offsets = void 0;
- if (isNumeric(+offset)) {
- offsets = [+offset, 0];
- } else {
- offsets = parseOffset(offset, popper, reference, basePlacement);
- }
- if (basePlacement === 'left') {
- popper.top += offsets[0];
- popper.left -= offsets[1];
- } else if (basePlacement === 'right') {
- popper.top += offsets[0];
- popper.left += offsets[1];
- } else if (basePlacement === 'top') {
- popper.left += offsets[0];
- popper.top -= offsets[1];
- } else if (basePlacement === 'bottom') {
- popper.left += offsets[0];
- popper.top += offsets[1];
- }
- data.popper = popper;
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function preventOverflow(data, options) {
- var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
- // If offsetParent is the reference element, we really want to
- // go one step up and use the next offsetParent as reference to
- // avoid to make this modifier completely useless and look like broken
- if (data.instance.reference === boundariesElement) {
- boundariesElement = getOffsetParent(boundariesElement);
- }
- // NOTE: DOM access here
- // resets the popper's position so that the document size can be calculated excluding
- // the size of the popper element itself
- var transformProp = getSupportedPropertyName('transform');
- var popperStyles = data.instance.popper.style; // assignment to help minification
- var top = popperStyles.top,
- left = popperStyles.left,
- transform = popperStyles[transformProp];
- popperStyles.top = '';
- popperStyles.left = '';
- popperStyles[transformProp] = '';
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
- // NOTE: DOM access here
- // restores the original style properties after the offsets have been computed
- popperStyles.top = top;
- popperStyles.left = left;
- popperStyles[transformProp] = transform;
- options.boundaries = boundaries;
- var order = options.priority;
- var popper = data.offsets.popper;
- var check = {
- primary: function primary(placement) {
- var value = popper[placement];
- if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
- value = Math.max(popper[placement], boundaries[placement]);
- }
- return defineProperty({}, placement, value);
- },
- secondary: function secondary(placement) {
- var mainSide = placement === 'right' ? 'left' : 'top';
- var value = popper[mainSide];
- if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
- value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
- }
- return defineProperty({}, mainSide, value);
- }
- };
- order.forEach(function (placement) {
- var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
- popper = _extends({}, popper, check[side](placement));
- });
- data.offsets.popper = popper;
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function shift(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var shiftvariation = placement.split('-')[1];
- // if shift shiftvariation is specified, run the modifier
- if (shiftvariation) {
- var _data$offsets = data.offsets,
- reference = _data$offsets.reference,
- popper = _data$offsets.popper;
- var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
- var side = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
- var shiftOffsets = {
- start: defineProperty({}, side, reference[side]),
- end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
- };
- data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
- }
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function hide(data) {
- if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
- return data;
- }
- var refRect = data.offsets.reference;
- var bound = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'preventOverflow';
- }).boundaries;
- if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === true) {
- return data;
- }
- data.hide = true;
- data.attributes['x-out-of-boundaries'] = '';
- } else {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === false) {
- return data;
- }
- data.hide = false;
- data.attributes['x-out-of-boundaries'] = false;
- }
- return data;
- }
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function inner(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
- var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
- popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
- data.placement = getOppositePlacement(placement);
- data.offsets.popper = getClientRect(popper);
- return data;
- }
- /**
- * Modifier function, each modifier can have a function of this type assigned
- * to its `fn` property.<br />
- * These functions will be called on each update, this means that you must
- * make sure they are performant enough to avoid performance bottlenecks.
- *
- * @function ModifierFn
- * @argument {dataObject} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {dataObject} The data object, properly modified
- */
- /**
- * Modifiers are plugins used to alter the behavior of your poppers.<br />
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
- * needed by the library.
- *
- * Usually you don't want to override the `order`, `fn` and `onLoad` props.
- * All the other properties are configurations that could be tweaked.
- * @namespace modifiers
- */
- var modifiers = {
- /**
- * Modifier used to shift the popper on the start or end of its reference
- * element.<br />
- * It will read the variation of the `placement` property.<br />
- * It can be one either `-end` or `-start`.
- * @memberof modifiers
- * @inner
- */
- shift: {
- /** @prop {number} order=100 - Index used to define the order of execution */
- order: 100,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: shift
- },
- /**
- * The `offset` modifier can shift your popper on both its axis.
- *
- * It accepts the following units:
- * - `px` or unit-less, interpreted as pixels
- * - `%` or `%r`, percentage relative to the length of the reference element
- * - `%p`, percentage relative to the length of the popper element
- * - `vw`, CSS viewport width unit
- * - `vh`, CSS viewport height unit
- *
- * For length is intended the main axis relative to the placement of the popper.<br />
- * This means that if the placement is `top` or `bottom`, the length will be the
- * `width`. In case of `left` or `right`, it will be the `height`.
- *
- * You can provide a single value (as `Number` or `String`), or a pair of values
- * as `String` divided by a comma or one (or more) white spaces.<br />
- * The latter is a deprecated method because it leads to confusion and will be
- * removed in v2.<br />
- * Additionally, it accepts additions and subtractions between different units.
- * Note that multiplications and divisions aren't supported.
- *
- * Valid examples are:
- * ```
- * 10
- * '10%'
- * '10, 10'
- * '10%, 10'
- * '10 + 10%'
- * '10 - 5vh + 3%'
- * '-10px + 5vh, 5px - 6%'
- * ```
- * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
- * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
- * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
- *
- * @memberof modifiers
- * @inner
- */
- offset: {
- /** @prop {number} order=200 - Index used to define the order of execution */
- order: 200,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: offset,
- /** @prop {Number|String} offset=0
- * The offset value as described in the modifier description
- */
- offset: 0
- },
- /**
- * Modifier used to prevent the popper from being positioned outside the boundary.
- *
- * A scenario exists where the reference itself is not within the boundaries.<br />
- * We can say it has "escaped the boundaries" — or just "escaped".<br />
- * In this case we need to decide whether the popper should either:
- *
- * - detach from the reference and remain "trapped" in the boundaries, or
- * - if it should ignore the boundary and "escape with its reference"
- *
- * When `escapeWithReference` is set to`true` and reference is completely
- * outside its boundaries, the popper will overflow (or completely leave)
- * the boundaries in order to remain attached to the edge of the reference.
- *
- * @memberof modifiers
- * @inner
- */
- preventOverflow: {
- /** @prop {number} order=300 - Index used to define the order of execution */
- order: 300,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: preventOverflow,
- /**
- * @prop {Array} [priority=['left','right','top','bottom']]
- * Popper will try to prevent overflow following these priorities by default,
- * then, it could overflow on the left and on top of the `boundariesElement`
- */
- priority: ['left', 'right', 'top', 'bottom'],
- /**
- * @prop {number} padding=5
- * Amount of pixel used to define a minimum distance between the boundaries
- * and the popper. This makes sure the popper always has a little padding
- * between the edges of its container
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='scrollParent'
- * Boundaries used by the modifier. Can be `scrollParent`, `window`,
- * `viewport` or any DOM element.
- */
- boundariesElement: 'scrollParent'
- },
- /**
- * Modifier used to make sure the reference and its popper stay near each other
- * without leaving any gap between the two. Especially useful when the arrow is
- * enabled and you want to ensure that it points to its reference element.
- * It cares only about the first axis. You can still have poppers with margin
- * between the popper and its reference element.
- * @memberof modifiers
- * @inner
- */
- keepTogether: {
- /** @prop {number} order=400 - Index used to define the order of execution */
- order: 400,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: keepTogether
- },
- /**
- * This modifier is used to move the `arrowElement` of the popper to make
- * sure it is positioned between the reference element and its popper element.
- * It will read the outer size of the `arrowElement` node to detect how many
- * pixels of conjunction are needed.
- *
- * It has no effect if no `arrowElement` is provided.
- * @memberof modifiers
- * @inner
- */
- arrow: {
- /** @prop {number} order=500 - Index used to define the order of execution */
- order: 500,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: arrow,
- /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
- element: '[x-arrow]'
- },
- /**
- * Modifier used to flip the popper's placement when it starts to overlap its
- * reference element.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- *
- * **NOTE:** this modifier will interrupt the current update cycle and will
- * restart it if it detects the need to flip the placement.
- * @memberof modifiers
- * @inner
- */
- flip: {
- /** @prop {number} order=600 - Index used to define the order of execution */
- order: 600,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: flip,
- /**
- * @prop {String|Array} behavior='flip'
- * The behavior used to change the popper's placement. It can be one of
- * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
- * placements (with optional variations)
- */
- behavior: 'flip',
- /**
- * @prop {number} padding=5
- * The popper will flip if it hits the edges of the `boundariesElement`
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='viewport'
- * The element which will define the boundaries of the popper position.
- * The popper will never be placed outside of the defined boundaries
- * (except if `keepTogether` is enabled)
- */
- boundariesElement: 'viewport',
- /**
- * @prop {Boolean} flipVariations=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the reference element overlaps its boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariations: false,
- /**
- * @prop {Boolean} flipVariationsByContent=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the popper element overlaps its reference boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariationsByContent: false
- },
- /**
- * Modifier used to make the popper flow toward the inner of the reference element.
- * By default, when this modifier is disabled, the popper will be placed outside
- * the reference element.
- * @memberof modifiers
- * @inner
- */
- inner: {
- /** @prop {number} order=700 - Index used to define the order of execution */
- order: 700,
- /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
- enabled: false,
- /** @prop {ModifierFn} */
- fn: inner
- },
- /**
- * Modifier used to hide the popper when its reference element is outside of the
- * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
- * be used to hide with a CSS selector the popper when its reference is
- * out of boundaries.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- * @memberof modifiers
- * @inner
- */
- hide: {
- /** @prop {number} order=800 - Index used to define the order of execution */
- order: 800,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: hide
- },
- /**
- * Computes the style that will be applied to the popper element to gets
- * properly positioned.
- *
- * Note that this modifier will not touch the DOM, it just prepares the styles
- * so that `applyStyle` modifier can apply it. This separation is useful
- * in case you need to replace `applyStyle` with a custom implementation.
- *
- * This modifier has `850` as `order` value to maintain backward compatibility
- * with previous versions of Popper.js. Expect the modifiers ordering method
- * to change in future major versions of the library.
- *
- * @memberof modifiers
- * @inner
- */
- computeStyle: {
- /** @prop {number} order=850 - Index used to define the order of execution */
- order: 850,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: computeStyle,
- /**
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: true,
- /**
- * @prop {string} [x='bottom']
- * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
- * Change this if your popper should grow in a direction different from `bottom`
- */
- x: 'bottom',
- /**
- * @prop {string} [x='left']
- * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
- * Change this if your popper should grow in a direction different from `right`
- */
- y: 'right'
- },
- /**
- * Applies the computed styles to the popper element.
- *
- * All the DOM manipulations are limited to this modifier. This is useful in case
- * you want to integrate Popper.js inside a framework or view library and you
- * want to delegate all the DOM manipulations to it.
- *
- * Note that if you disable this modifier, you must make sure the popper element
- * has its position set to `absolute` before Popper.js can do its work!
- *
- * Just disable this modifier and define your own to achieve the desired effect.
- *
- * @memberof modifiers
- * @inner
- */
- applyStyle: {
- /** @prop {number} order=900 - Index used to define the order of execution */
- order: 900,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: applyStyle,
- /** @prop {Function} */
- onLoad: applyStyleOnLoad,
- /**
- * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: undefined
- }
- };
- /**
- * The `dataObject` is an object containing all the information used by Popper.js.
- * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
- * @name dataObject
- * @property {Object} data.instance The Popper.js instance
- * @property {String} data.placement Placement applied to popper
- * @property {String} data.originalPlacement Placement originally defined on init
- * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
- * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
- * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
- * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.boundaries Offsets of the popper boundaries
- * @property {Object} data.offsets The measurements of popper, reference and arrow elements
- * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
- */
- /**
- * Default options provided to Popper.js constructor.<br />
- * These can be overridden using the `options` argument of Popper.js.<br />
- * To override an option, simply pass an object with the same
- * structure of the `options` object, as the 3rd argument. For example:
- * ```
- * new Popper(ref, pop, {
- * modifiers: {
- * preventOverflow: { enabled: false }
- * }
- * })
- * ```
- * @type {Object}
- * @static
- * @memberof Popper
- */
- var Defaults = {
- /**
- * Popper's placement.
- * @prop {Popper.placements} placement='bottom'
- */
- placement: 'bottom',
- /**
- * Set this to true if you want popper to position it self in 'fixed' mode
- * @prop {Boolean} positionFixed=false
- */
- positionFixed: false,
- /**
- * Whether events (resize, scroll) are initially enabled.
- * @prop {Boolean} eventsEnabled=true
- */
- eventsEnabled: true,
- /**
- * Set to true if you want to automatically remove the popper when
- * you call the `destroy` method.
- * @prop {Boolean} removeOnDestroy=false
- */
- removeOnDestroy: false,
- /**
- * Callback called when the popper is created.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onCreate}
- */
- onCreate: function onCreate() {},
- /**
- * Callback called when the popper is updated. This callback is not called
- * on the initialization/creation of the popper, but only on subsequent
- * updates.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onUpdate}
- */
- onUpdate: function onUpdate() {},
- /**
- * List of modifiers used to modify the offsets before they are applied to the popper.
- * They provide most of the functionalities of Popper.js.
- * @prop {modifiers}
- */
- modifiers: modifiers
- };
- /**
- * @callback onCreate
- * @param {dataObject} data
- */
- /**
- * @callback onUpdate
- * @param {dataObject} data
- */
- // Utils
- // Methods
- var Popper = function () {
- /**
- * Creates a new Popper.js instance.
- * @class Popper
- * @param {Element|referenceObject} reference - The reference element used to position the popper
- * @param {Element} popper - The HTML / XML element used as the popper
- * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
- * @return {Object} instance - The generated Popper.js instance
- */
- function Popper(reference, popper) {
- var _this = this;
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- classCallCheck(this, Popper);
- this.scheduleUpdate = function () {
- return requestAnimationFrame(_this.update);
- };
- // make update() debounced, so that it only runs at most once-per-tick
- this.update = debounce(this.update.bind(this));
- // with {} we create a new object with the options inside it
- this.options = _extends({}, Popper.Defaults, options);
- // init state
- this.state = {
- isDestroyed: false,
- isCreated: false,
- scrollParents: []
- };
- // get reference and popper elements (allow jQuery wrappers)
- this.reference = reference && reference.jquery ? reference[0] : reference;
- this.popper = popper && popper.jquery ? popper[0] : popper;
- // Deep merge modifiers options
- this.options.modifiers = {};
- Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
- _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
- });
- // Refactoring modifiers' list (Object => Array)
- this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
- return _extends({
- name: name
- }, _this.options.modifiers[name]);
- })
- // sort the modifiers by order
- .sort(function (a, b) {
- return a.order - b.order;
- });
- // modifiers have the ability to execute arbitrary code when Popper.js get inited
- // such code is executed in the same order of its modifier
- // they could add new properties to their options configuration
- // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
- this.modifiers.forEach(function (modifierOptions) {
- if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
- modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
- }
- });
- // fire the first update to position the popper in the right place
- this.update();
- var eventsEnabled = this.options.eventsEnabled;
- if (eventsEnabled) {
- // setup event listeners, they will take care of update the position in specific situations
- this.enableEventListeners();
- }
- this.state.eventsEnabled = eventsEnabled;
- }
- // We can't use class properties because they don't get listed in the
- // class prototype and break stuff like Sinon stubs
- createClass(Popper, [{
- key: 'update',
- value: function update$$1() {
- return update.call(this);
- }
- }, {
- key: 'destroy',
- value: function destroy$$1() {
- return destroy.call(this);
- }
- }, {
- key: 'enableEventListeners',
- value: function enableEventListeners$$1() {
- return enableEventListeners.call(this);
- }
- }, {
- key: 'disableEventListeners',
- value: function disableEventListeners$$1() {
- return disableEventListeners.call(this);
- }
- /**
- * Schedules an update. It will run on the next UI update available.
- * @method scheduleUpdate
- * @memberof Popper
- */
- /**
- * Collection of utilities useful when writing custom modifiers.
- * Starting from version 1.7, this method is available only if you
- * include `popper-utils.js` before `popper.js`.
- *
- * **DEPRECATION**: This way to access PopperUtils is deprecated
- * and will be removed in v2! Use the PopperUtils module directly instead.
- * Due to the high instability of the methods contained in Utils, we can't
- * guarantee them to follow semver. Use them at your own risk!
- * @static
- * @private
- * @type {Object}
- * @deprecated since version 1.8
- * @member Utils
- * @memberof Popper
- */
- }]);
- return Popper;
- }();
- /**
- * The `referenceObject` is an object that provides an interface compatible with Popper.js
- * and lets you use it as replacement of a real DOM node.<br />
- * You can use this method to position a popper relatively to a set of coordinates
- * in case you don't have a DOM node to use as reference.
- *
- * ```
- * new Popper(referenceObject, popperNode);
- * ```
- *
- * NB: This feature isn't supported in Internet Explorer 10.
- * @name referenceObject
- * @property {Function} data.getBoundingClientRect
- * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
- * @property {number} data.clientWidth
- * An ES6 getter that will return the width of the virtual reference element.
- * @property {number} data.clientHeight
- * An ES6 getter that will return the height of the virtual reference element.
- */
- Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
- Popper.placements = placements;
- Popper.Defaults = Defaults;
- return Popper;
- })));
- //# sourceMappingURL=popper.js.map
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
- /***/ }),
- /* 218 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- {
- directives: [
- {
- name: "clickoutside",
- rawName: "v-clickoutside",
- value: _vm.handleClose,
- expression: "handleClose"
- }
- ],
- on: { click: _vm.handleClose }
- },
- [
- _vm.multipleLists.length > 0
- ? _c(
- "div",
- { staticClass: "user-id-multiple" },
- _vm._l(_vm.multipleLists, function(item, index) {
- return _c(
- "div",
- { key: index, staticClass: "user-id-multiple-item" },
- [
- _c(
- "Tag",
- {
- attrs: {
- closable: !_vm.existMultipleDisabled(item.username)
- },
- on: {
- "on-close": function($event) {
- return _vm.multipleLists.splice(index, 1)
- }
- }
- },
- [
- _c("UserView", {
- attrs: { username: item.username, showimg: "" }
- })
- ],
- 1
- )
- ],
- 1
- )
- }),
- 0
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "div",
- { ref: "reference", staticClass: "user-id-input" },
- [
- _c(
- "Input",
- {
- attrs: {
- placeholder: _vm.placeholder,
- disabled: _vm.disabled,
- icon: "md-search"
- },
- on: {
- "on-click": _vm.searchEnter,
- "on-enter": _vm.searchEnter,
- "on-blur": function($event) {
- return _vm.searchEnter(true)
- },
- "on-change": _vm.inputChange
- },
- model: {
- value: _vm.nickName,
- callback: function($$v) {
- _vm.nickName = $$v
- },
- expression: "nickName"
- }
- },
- [
- _vm.$slots.prepend !== undefined
- ? _c(
- "div",
- { attrs: { slot: "prepend" }, slot: "prepend" },
- [_vm._t("prepend")],
- 2
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.$slots.append !== undefined
- ? _c(
- "div",
- { attrs: { slot: "append" }, slot: "append" },
- [_vm._t("append")],
- 2
- )
- : _vm._e()
- ]
- ),
- _vm._v(" "),
- _vm.userName
- ? _c("div", { staticClass: "user-id-subtitle" }, [
- _vm._v(_vm._s(_vm.$L("用户名")) + ": " + _vm._s(_vm.userName))
- ])
- : _vm._e(),
- _vm._v(" "),
- _vm.spinShow
- ? _c("div", { staticClass: "user-id-spin" }, [
- _c("div", [_c("w-loading")], 1)
- ])
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c("transition", { attrs: { name: "fade" } }, [
- _c(
- "div",
- {
- directives: [
- {
- name: "show",
- rawName: "v-show",
- value: !_vm.disabled && _vm.visible,
- expression: "!disabled && visible"
- },
- { name: "transfer-dom", rawName: "v-transfer-dom" }
- ],
- ref: "popper",
- staticClass: "user-id-input-body",
- attrs: { "data-transfer": _vm.transfer }
- },
- [
- _c(
- "div",
- { staticClass: "user-id-input-table" },
- [
- _vm.searchShow
- ? _c("Table", {
- ref: "myTable",
- staticClass: "tableSelection",
- style: _vm.tableStyle,
- attrs: {
- "highlight-row": "",
- size: "small",
- columns: _vm.columns,
- data: _vm.userLists,
- "no-data-text": _vm.noDataText
- },
- on: {
- "on-row-click": _vm.userChange,
- "on-selection-change": _vm.userSelect
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _vm.isConfirm && _vm.searchShow
- ? _c(
- "div",
- { staticClass: "user-id-input-bottom" },
- [
- _c(
- "Button",
- {
- attrs: { type: "default", size: "small" },
- on: {
- click: function($event) {
- _vm.visible = false
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("取消")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- attrs: { type: "primary", size: "small" },
- on: { click: _vm.onConfirm }
- },
- [_vm._v(_vm._s(_vm.$L("确定")))]
- )
- ],
- 1
- )
- : _vm._e()
- ],
- 1
- )
- ]
- )
- ])
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-453021ba", module.exports)
- }
- }
- /***/ }),
- /* 219 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(220)
- __webpack_require__(222)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(224)
- /* template */
- var __vue_template__ = __webpack_require__(225)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-6f741b65"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/UserView.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-6f741b65", Component.options)
- } else {
- hotAPI.reload("data-v-6f741b65", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 220 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(221);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("1b76010a", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserView.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserView.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 221 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.user-view-inline .ivu-tooltip {\n max-width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.user-view-inline .ivu-tooltip .ivu-tooltip-rel {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.user-view-inline .ivu-tooltip .ivu-tooltip-rel .user-view-info .user-view-img .usertext-container-text {\n -webkit-transform: scale(0.86);\n transform: scale(0.86);\n}\n", ""]);
- // exports
- /***/ }),
- /* 222 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(223);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("62f3f1a0", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserView.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserView.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 223 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.user-view-inline[data-v-6f741b65] {\n display: inline-block;\n max-width: 100%;\n}\n.user-view-inline .user-view-info[data-v-6f741b65] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.user-view-inline .user-view-info .user-view-img[data-v-6f741b65] {\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 16px;\n border-radius: 50%;\n margin-right: 3px;\n}\n.user-view-inline .user-view-info .user-view-title[data-v-6f741b65] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n line-height: 1.2;\n}\n", ""]);
- // exports
- /***/ }),
- /* 224 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'UserView',
- props: {
- username: {
- default: ''
- },
- delay: {
- type: Number,
- default: 600
- },
- transfer: {
- type: Boolean,
- default: true
- },
- placement: {
- default: 'bottom'
- },
- showimg: {
- type: Boolean,
- default: false
- },
- imgsize: {},
- imgfontsize: {},
- showname: {
- type: Boolean,
- default: true
- },
- info: {
- default: null
- }
- },
- data: function data() {
- return {
- loadIng: true,
- nickname: null,
- userimg: '',
- profession: ''
- };
- },
- mounted: function mounted() {
- this.getUserData(300);
- },
- watch: {
- username: function username() {
- this.getUserData(300);
- },
- info: {
- handler: function handler() {
- this.upInfo();
- },
- deep: true
- }
- },
- computed: {
- userInfo: function userInfo() {
- var username = this.username,
- nickname = this.nickname,
- userimg = this.userimg;
- return { username: username, nickname: nickname, userimg: userimg };
- },
- imgStyle: function imgStyle() {
- var imgsize = this.imgsize,
- imgfontsize = this.imgfontsize;
- var myStyle = {};
- if (imgsize) {
- var size = /^\d+$/.test(imgsize) ? imgsize + 'px' : imgsize;
- myStyle.width = size;
- myStyle.height = size;
- myStyle.lineHeight = size;
- }
- if (imgfontsize) {
- myStyle.fontSize = /^\d+$/.test(imgfontsize) ? imgfontsize + 'px' : imgfontsize;
- }
- return myStyle;
- }
- },
- methods: {
- isJson: function isJson(obj) {
- return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
- },
- upInfo: function upInfo() {
- if (this.isJson(this.info)) {
- this.$set(this.info, 'nickname', this.nickname);
- this.$set(this.info, 'userimg', this.userimg);
- }
- },
- getUserData: function getUserData(cacheTime) {
- var _this = this;
- $A.getUserBasic(this.username, function (data, success) {
- if (success) {
- _this.nickname = data.nickname;
- _this.userimg = data.userimg;
- _this.profession = data.profession;
- } else {
- _this.nickname = '';
- _this.userimg = '';
- _this.profession = '';
- }
- _this.loadIng = false;
- _this.$emit("on-result", data);
- _this.upInfo();
- }, cacheTime);
- }
- }
- });
- /***/ }),
- /* 225 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { staticClass: "user-view-inline" },
- [
- _c(
- "Tooltip",
- {
- attrs: {
- disabled: _vm.loadIng,
- delay: _vm.delay,
- transfer: _vm.transfer,
- placement: _vm.placement,
- maxWidth: "auto"
- },
- on: {
- "on-popper-show": function($event) {
- return _vm.getUserData(30)
- }
- }
- },
- [
- _c(
- "div",
- { staticClass: "user-view-info" },
- [
- _vm.showimg
- ? _c("UserImg", {
- staticClass: "user-view-img",
- style: _vm.imgStyle,
- attrs: { info: _vm.userInfo }
- })
- : _vm._e(),
- _vm._v(" "),
- _vm.showname
- ? _c("div", { staticClass: "user-view-name" }, [
- _vm._v(_vm._s(_vm.nickname || _vm.username))
- ])
- : _vm._e()
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- {
- staticStyle: { "white-space": "normal" },
- attrs: { slot: "content" },
- slot: "content"
- },
- [
- !_vm.showname
- ? _c("div", [
- _vm._v(
- _vm._s(_vm.$L("昵称")) +
- ": " +
- _vm._s(_vm.nickname || "-")
- )
- ])
- : _vm._e(),
- _vm._v(" "),
- _c("div", [
- _vm._v(_vm._s(_vm.$L("用户名")) + ": " + _vm._s(_vm.username))
- ]),
- _vm._v(" "),
- _c("div", [
- _vm._v(
- _vm._s(_vm.$L("职位/职称")) +
- ": " +
- _vm._s(_vm.profession || "-")
- )
- ])
- ]
- )
- ]
- )
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-6f741b65", module.exports)
- }
- }
- /***/ }),
- /* 226 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(227)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(229)
- /* template */
- var __vue_template__ = __webpack_require__(230)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-6b3af333"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/UserImg.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-6b3af333", Component.options)
- } else {
- hotAPI.reload("data-v-6b3af333", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 227 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(228);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("33f5f999", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6b3af333\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserImg.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6b3af333\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserImg.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 228 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.userimg-container[data-v-6b3af333] {\n display: inline-block;\n max-width: 100%;\n max-height: 100%;\n position: relative;\n overflow: hidden;\n}\n.userimg-container.usering-scale[data-v-6b3af333] {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n.userimg-container.usering-scale[data-v-6b3af333]:hover {\n z-index: 1;\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n}\n.userimg-container .userimg-container-img[data-v-6b3af333] {\n width: 100%;\n height: 100%;\n display: table;\n}\n.userimg-container .userimg-container-box[data-v-6b3af333] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n font-weight: 400;\n color: #ffffff;\n}\n.userimg-container .userimg-container-box .usertext-container-text[data-v-6b3af333] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n white-space: nowrap;\n}\n", ""]);
- // exports
- /***/ }),
- /* 229 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'UserImg',
- props: {
- info: {
- default: {} //{username, nickname, userimg}
- },
- size: {},
- scale: {
- type: Boolean,
- default: false
- },
- twoWords: {
- type: Boolean,
- default: false
- },
- showTitle: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- imgError: false,
- againUrl: ''
- };
- },
- computed: {
- textStyle: function textStyle() {
- var style = {
- backgroundColor: '#A0D7F1'
- };
- var size = this.size;
- if (size) {
- style.fontSize = /^\d+$/.test(size) ? size + 'px' : size;
- }
- var username = this.info.username;
- if (username) {
- var bgColor = '';
- for (var i = 0; i < username.length; i++) {
- bgColor += parseInt(username[i].charCodeAt(0), 10).toString(16);
- }
- style.backgroundColor = '#' + bgColor.slice(1, 4);
- }
- return style;
- },
- nameStyle: function nameStyle() {
- var style = {};
- if (this.twoWords) {
- if ((this.userName + "").length >= 2) {
- style.transform = 'scale(0.68)';
- }
- }
- return style;
- },
- userName: function userName() {
- if (!this.isJson(this.info)) {
- return '';
- }
- var name = this.info.send_username || this.info.username;
- if (this.info.nickname && !this.isEmojiPrefix(this.info.nickname)) {
- name = this.info.nickname;
- }
- if (this.twoWords) {
- if (this.allChina(name) && $A.count(name) == 3) {
- return name.substring(1, 3).toLocaleUpperCase();
- } else {
- return (name + " ").substring(0, 2).toLocaleUpperCase();
- }
- } else {
- return (name + " ").substring(0, 1).toLocaleUpperCase();
- }
- },
- fullName: function fullName() {
- if (!this.isJson(this.info)) {
- return '';
- }
- var name = this.info.send_username || this.info.username;
- if (this.info.nickname && !this.isEmojiPrefix(this.info.nickname)) {
- name = this.info.nickname;
- }
- return name;
- },
- userImg: function userImg() {
- if (!this.isJson(this.info)) {
- return '';
- }
- if (this.againUrl) {
- return this.againUrl;
- }
- return this.info.send_userimg || this.info.userimg;
- }
- },
- methods: {
- isJson: function isJson(obj) {
- return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
- },
- isShowImg: function isShowImg(url) {
- return !!(url && !$A.rightExists(url, 'images/other/avatar.png'));
- },
- isEmojiPrefix: function isEmojiPrefix(text) {
- return (/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(text)
- );
- },
- allChina: function allChina(str) {
- if (/^[\u4e00-\u9fa5]+$/.test(str)) {
- return true; //全是中文
- } else {
- return false;
- }
- },
- loadError: function loadError() {
- if (!this.againUrl) {
- if ($A.rightExists(this.userImg, 'images/other/system-message.png')) {
- this.againUrl = $A.fillUrl('images/other/system-message.png');
- return;
- } else if ($A.rightExists(this.userImg, 'images/other/group.png')) {
- this.againUrl = $A.fillUrl('images/other/group.png');
- return;
- }
- }
- this.imgError = true;
- },
- onClick: function onClick(e) {
- this.$emit('click', e);
- }
- }
- });
- /***/ }),
- /* 230 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- {
- staticClass: "userimg-container",
- class: { "usering-scale": _vm.scale },
- attrs: { title: _vm.showTitle ? _vm.fullName : "" },
- on: { click: _vm.onClick }
- },
- [
- this.isJson(_vm.info)
- ? [
- _vm.isShowImg(_vm.userImg) && !_vm.imgError
- ? _c("img", {
- staticClass: "userimg-container-img",
- attrs: { src: _vm.userImg },
- on: { error: _vm.loadError }
- })
- : _c(
- "div",
- {
- staticClass: "userimg-container-box",
- style: _vm.textStyle
- },
- [
- _c(
- "div",
- {
- staticClass: "usertext-container-text",
- style: _vm.nameStyle
- },
- [_vm._v(_vm._s(_vm.userName))]
- )
- ]
- )
- ]
- : _vm._e()
- ],
- 2
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-6b3af333", module.exports)
- }
- }
- /***/ }),
- /* 231 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(232)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(234)
- /* template */
- var __vue_template__ = __webpack_require__(235)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-3f1dd09a"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/WLoading.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-3f1dd09a", Component.options)
- } else {
- hotAPI.reload("data-v-3f1dd09a", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 232 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(233);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("6e0ddf92", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f1dd09a\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WLoading.vue", function() {
- var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f1dd09a\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WLoading.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 233 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.w-loading[data-v-3f1dd09a] {\n -webkit-animation: rotate-data-v-3f1dd09a 2s linear infinite;\n animation: rotate-data-v-3f1dd09a 2s linear infinite;\n -webkit-transform-origin: center center;\n transform-origin: center center;\n width: 30px;\n height: 30px;\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n overflow: hidden;\n}\n.w-loading .w-path[data-v-3f1dd09a] {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n -webkit-animation: dash-data-v-3f1dd09a 1.5s ease-in-out infinite,color-data-v-3f1dd09a 6s ease-in-out infinite;\n animation: dash-data-v-3f1dd09a 1.5s ease-in-out infinite,color-data-v-3f1dd09a 6s ease-in-out infinite;\n stroke-linecap: round;\n}\n@-webkit-keyframes rotate-data-v-3f1dd09a {\nto {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n}\n}\n@keyframes rotate-data-v-3f1dd09a {\nto {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n}\n}\n@-webkit-keyframes dash-data-v-3f1dd09a {\n0% {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -35;\n}\nto {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -124;\n}\n}\n@keyframes dash-data-v-3f1dd09a {\n0% {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -35;\n}\nto {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -124;\n}\n}\n@-webkit-keyframes color-data-v-3f1dd09a {\n0%, to {\n stroke: #d62d20;\n}\n40% {\n stroke: #0057e7;\n}\n66% {\n stroke: #008744;\n}\n80%, 90% {\n stroke: #ffa700;\n}\n}\n@keyframes color-data-v-3f1dd09a {\n0%, to {\n stroke: #d62d20;\n}\n40% {\n stroke: #0057e7;\n}\n66% {\n stroke: #008744;\n}\n80%, 90% {\n stroke: #ffa700;\n}\n}\n", ""]);
- // exports
- /***/ }),
- /* 234 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'WLoading'
- });
- /***/ }),
- /* 235 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "svg",
- { staticClass: "w-loading", attrs: { viewBox: "25 25 50 50" } },
- [
- _c("circle", {
- staticClass: "w-path",
- attrs: {
- cx: "50",
- cy: "50",
- r: "20",
- fill: "none",
- "stroke-width": "5",
- "stroke-miterlimit": "10"
- }
- })
- ]
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-3f1dd09a", module.exports)
- }
- }
- /***/ }),
- /* 236 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue__ = __webpack_require__(237);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__detail_vue__);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
- function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
- var detailElement = function detailElement(taskid) {
- var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var cloneData = function cloneData(myObj) {
- if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) !== 'object') return myObj;
- if (myObj === null) return myObj;
- //
- if (typeof myObj.length === 'number') {
- var _myObj = _toArray(myObj),
- myNewObj = _myObj.slice(0);
- return myNewObj;
- } else {
- var _myNewObj = _objectWithoutProperties(myObj, []);
- return _myNewObj;
- }
- };
- var isArray = function isArray(myObj) {
- return Object.prototype.toString.call(myObj) == '[object Array]';
- };
- return new Promise(function () {
- var custom = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.extend(__WEBPACK_IMPORTED_MODULE_1__detail_vue___default.a);
- if ((typeof taskid === 'undefined' ? 'undefined' : _typeof(taskid)) === 'object' && taskid !== null) {
- detail = cloneData(taskid);
- taskid = parseInt(taskid.id);
- if (isNaN(taskid)) {
- taskid = 0;
- }
- }
- if ((typeof detail === 'undefined' ? 'undefined' : _typeof(detail)) !== 'object' || detail === null) {
- detail = {};
- }
- if (typeof taskid === "number") {
- detail.taskid = taskid;
- }
- if (!isArray(detail.subtask)) {
- detail.subtask = [];
- }
- var data = {
- taskid: taskid,
- detail: detail
- };
- var instance = new custom({
- data: data
- });
- instance.$mount();
- document.body.appendChild(instance.$el);
- });
- };
- /* harmony default export */ __webpack_exports__["a"] = (detailElement);
- /***/ }),
- /* 237 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(238)
- __webpack_require__(240)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(242)
- /* template */
- var __vue_template__ = __webpack_require__(280)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-57fd86f0"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/task/detail/detail.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-57fd86f0", Component.options)
- } else {
- hotAPI.reload("data-v-57fd86f0", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 238 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(239);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("4d2f9578", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./detail.vue", function() {
- var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./detail.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 239 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-task-detail-window .detail-title-box .detail-title-input textarea {\n margin: -7px 0 3px -2px;\n font-size: 20px;\n font-weight: 600;\n border: 2px solid #ffffff;\n padding: 2px;\n cursor: pointer;\n color: #172b4d;\n background: #ffffff;\n width: 100%;\n border-radius: 3px;\n resize: none;\n}\n.project-task-detail-window .detail-subtask-input {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n border: 0;\n background: #ffffff;\n margin-left: 2px;\n border-bottom: 1px solid #f6f6f6;\n}\n.project-task-detail-window .detail-subtask-input textarea {\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n outline: none;\n resize: none;\n min-height: auto;\n padding-left: 0;\n padding-right: 0;\n}\n.project-task-detail-window .detail-subtask-input textarea:focus {\n color: #333333;\n}\n.project-task-detail-window .detail-subtask-input.subtask-complete textarea {\n text-decoration: line-through;\n color: #999;\n}\n", ""]);
- // exports
- /***/ }),
- /* 240 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(241);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("4f5f86a8", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./detail.vue", function() {
- var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./detail.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 241 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.project-task-detail-window[data-v-57fd86f0] {\n position: fixed;\n z-index: 1001;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n -webkit-transition: all .3s;\n transition: all .3s;\n opacity: 0;\n pointer-events: unset;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.project-task-detail-window.task-detail-show[data-v-57fd86f0] {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-bg[data-v-57fd86f0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: -1;\n}\n.project-task-detail-window .task-detail-main[data-v-57fd86f0] {\n position: relative;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n width: 92%;\n max-width: 800px;\n max-height: 92%;\n background: #ffffff;\n overflow: visible;\n border-radius: 4px;\n padding: 10px 20px 2px;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.project-task-detail-window .task-detail-main .detail-left[data-v-57fd86f0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n padding: 0 8px;\n overflow: auto;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2[data-v-57fd86f0] {\n color: #172b4d;\n font-size: 16px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n line-height: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong[data-v-57fd86f0] {\n font-size: 14px;\n font-weight: normal;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong.link[data-v-57fd86f0] {\n cursor: pointer;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong.active[data-v-57fd86f0] {\n font-size: 16px;\n font-weight: bold;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 em[data-v-57fd86f0] {\n margin: 0 9px;\n width: 1px;\n height: 10px;\n background: #cccccc;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n right: 12px;\n top: 50%;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button:hover .detail-button-batch[data-v-57fd86f0] {\n display: inline-block;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-btn[data-v-57fd86f0],\n .project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0] {\n font-size: 12px;\n opacity: 0.9;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n margin-left: 5px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-btn[data-v-57fd86f0]:hover,\n .project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0]:hover {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0] {\n display: none;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0] {\n position: relative;\n padding-left: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0]:before {\n font-family: zenicon;\n font-size: 20px;\n color: #42526e;\n font-weight: 600;\n position: absolute;\n top: 0;\n left: 0;\n width: 26px;\n height: 26px;\n line-height: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box[data-v-57fd86f0] {\n margin-top: 12px;\n margin-bottom: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box[data-v-57fd86f0]:before {\n content: \"\\E740\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle[data-v-57fd86f0] {\n padding-top: 3px;\n font-size: 12px;\n color: #606266;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle .project-title[data-v-57fd86f0] {\n cursor: pointer;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle .project-title[data-v-57fd86f0]:hover {\n color: #57a3f3;\n text-decoration: underline;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-desc-box[data-v-57fd86f0]:before {\n content: \"\\E75E\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box[data-v-57fd86f0] {\n margin-bottom: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li[data-v-57fd86f0] {\n color: #606266;\n font-size: 14px;\n line-height: 32px;\n word-break: break-all;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li[data-v-57fd86f0]:before {\n font-weight: normal;\n color: #606266;\n font-size: 14px;\n padding-left: 4px;\n line-height: 32px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-time[data-v-57fd86f0]:before {\n content: \"\\E706\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username[data-v-57fd86f0]:before {\n content: \"\\E903\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-no[data-v-57fd86f0] {\n display: inline-block;\n color: #888888;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-button[data-v-57fd86f0] {\n font-size: 12px;\n margin-left: 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-text[data-v-57fd86f0] {\n line-height: 24px;\n color: #666666;\n font-size: 12px;\n margin-left: 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower[data-v-57fd86f0]:before {\n content: \"\\E90D\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower .ivu-tag[data-v-57fd86f0] {\n padding: 0 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower .user-view-inline[data-v-57fd86f0] {\n height: 20px;\n line-height: 20px;\n vertical-align: top;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-level[data-v-57fd86f0]:before {\n content: \"\\E725\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-status[data-v-57fd86f0]:before {\n content: \"\\E6AF\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > span[data-v-57fd86f0] {\n white-space: nowrap;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em[data-v-57fd86f0] {\n margin-left: 4px;\n padding-top: 5px;\n line-height: 22px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p1[data-v-57fd86f0] {\n color: #ed3f14;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p2[data-v-57fd86f0] {\n color: #ff9900;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p3[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p4[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.complete[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.complete .completedate[data-v-57fd86f0] {\n font-size: 12px;\n padding-left: 4px;\n opacity: 0.6;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.overdue[data-v-57fd86f0],\n .project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em > em.overdue[data-v-57fd86f0] {\n color: #ff0000;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.unfinished[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-file-box[data-v-57fd86f0]:before {\n content: \"\\E8B9\";\n font-size: 16px;\n padding-left: 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-icon[data-v-57fd86f0]:before {\n content: \"\\E819\";\n font-size: 16px;\n padding-left: 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box[data-v-57fd86f0] {\n padding: 12px;\n margin-bottom: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-progress[data-v-57fd86f0] {\n margin: 2px 0 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin: 0 2px 0 -6px;\n padding-top: 4px;\n padding-left: 8px;\n position: relative;\n background-color: #ffffff;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item:hover .detail-subtask-right[data-v-57fd86f0] {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right[data-v-57fd86f0] {\n opacity: 0;\n position: absolute;\n top: 50%;\n right: 0;\n padding: 0 6px;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n background: #ffffff;\n border-radius: 3px 0 0 3px;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n cursor: pointer;\n -webkit-box-shadow: -3px 0px 3px 0px rgba(45, 45, 45, 0.1);\n box-shadow: -3px 0px 3px 0px rgba(45, 45, 45, 0.1);\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right .detail-subtask-ricon[data-v-57fd86f0] {\n display: inline-block;\n opacity: 0.9;\n width: 18px;\n height: 26px;\n line-height: 26px;\n font-size: 16px;\n text-align: center;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right .detail-subtask-ricon[data-v-57fd86f0]:hover {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-none[data-v-57fd86f0] {\n color: #666666;\n padding: 0 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-comment-box[data-v-57fd86f0]:before {\n content: \"\\E753\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-footer-box[data-v-57fd86f0] {\n border-top: 1px solid #e5e5e5;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding-top: 20px;\n padding-bottom: 16px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-footer-box .comment-input[data-v-57fd86f0] {\n margin-right: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-right[data-v-57fd86f0] {\n margin: 38px 0 6px;\n padding-left: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.project-task-detail-window .task-detail-main .detail-right .block[data-v-57fd86f0] {\n display: block;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p1[data-v-57fd86f0] {\n color: #ed3f14;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p2[data-v-57fd86f0] {\n color: #ff9900;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p3[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p4[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .checkmark[data-v-57fd86f0] {\n margin-left: 8px;\n margin-right: -8px;\n}\n.project-task-detail-window .task-detail-main .detail-right .btn[data-v-57fd86f0] {\n display: block;\n width: 118px;\n text-align: left;\n margin-top: 8px;\n padding-left: 10px;\n padding-right: 10px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.project-task-detail-window .task-detail-main .detail-complete[data-v-57fd86f0] {\n display: inline-block;\n pointer-events: none;\n position: absolute;\n top: 6px;\n right: 23%;\n font-size: 72px;\n color: #19be6b;\n opacity: 0.2;\n z-index: 1;\n}\n.project-task-detail-window .task-detail-main .detail-menu[data-v-57fd86f0] {\n display: none;\n position: absolute;\n top: 10px;\n right: 64px;\n text-align: right;\n width: auto;\n height: 38px;\n z-index: 5;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.project-task-detail-window .task-detail-main .detail-cancel[data-v-57fd86f0] {\n position: absolute;\n top: 10px;\n right: 20px;\n text-align: right;\n width: auto;\n height: 38px;\n z-index: 5;\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0] {\n display: inline-block;\n width: 38px;\n height: 38px;\n cursor: pointer;\n border-radius: 50%;\n -webkit-transform: scale(0.92);\n transform: scale(0.92);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:after, .project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:before {\n position: absolute;\n content: \"\";\n top: 50%;\n left: 50%;\n width: 2px;\n height: 20px;\n background-color: #EE2321;\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n -webkit-transition: all .2s;\n transition: all .2s;\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:before {\n position: absolute;\n -webkit-transform: translate(-50%, -50%) rotate(-45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(-45deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:after, .project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:before {\n background-color: #ff0000;\n -webkit-transform: translate(-50%, -50%) rotate(135deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(135deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:before {\n background-color: #ff0000;\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-drag-over[data-v-57fd86f0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 6;\n background-color: rgba(255, 255, 255, 0.78);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n border-radius: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-drag-over[data-v-57fd86f0]:before {\n content: \"\";\n position: absolute;\n top: 16px;\n left: 16px;\n right: 16px;\n bottom: 16px;\n border: 2px dashed #7b7b7b;\n border-radius: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-drag-over .detail-drag-text[data-v-57fd86f0] {\n padding: 12px;\n font-size: 18px;\n color: #666666;\n}\n@media (max-width: 768px) {\n.project-task-detail-window .task-detail-main[data-v-57fd86f0] {\n padding: 10px 12px 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left[data-v-57fd86f0] {\n margin-top: 32px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0] {\n padding-left: 22px;\n}\n.project-task-detail-window .task-detail-main .detail-right[data-v-57fd86f0] {\n -webkit-transform: translate(200%, 0);\n transform: translate(200%, 0);\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n padding: 48px 18px;\n background: #ffffff;\n -webkit-box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);\n box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);\n z-index: 4;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-right.open-menu[data-v-57fd86f0] {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.project-task-detail-window .task-detail-main .detail-menu[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n}\n", ""]);
- // exports
- /***/ }),
- /* 242 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logs__ = __webpack_require__(58);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__logs__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__files__ = __webpack_require__(57);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__files___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__files__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuedraggable__ = __webpack_require__(51);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuedraggable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vuedraggable__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep__ = __webpack_require__(243);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WInput__ = __webpack_require__(268);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WInput___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__iview_WInput__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DescEditor__ = __webpack_require__(273);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DescEditor___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__DescEditor__);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- components: { DescEditor: __WEBPACK_IMPORTED_MODULE_5__DescEditor___default.a, WInput: __WEBPACK_IMPORTED_MODULE_4__iview_WInput___default.a, ProjectTaskFiles: __WEBPACK_IMPORTED_MODULE_1__files___default.a, ProjectTaskLogs: __WEBPACK_IMPORTED_MODULE_0__logs___default.a, draggable: __WEBPACK_IMPORTED_MODULE_2_vuedraggable___default.a },
- data: function data() {
- return {
- taskid: 0,
- detail: {},
- detailDragOver: false,
- visible: false,
- subwinVisible: 0,
- urlProjectid: 0,
- bakData: {},
- loadData: {},
- loadRand: {},
- commentText: '',
- logType: '评论',
- timeValue: [],
- timeOptions: {},
- openMenu: false
- };
- },
- beforeCreate: function beforeCreate() {
- var doms = document.querySelectorAll('.project-task-detail-window');
- for (var i = 0; i < doms.length; ++i) {
- if (doms[i].parentNode != null) doms[i].parentNode.removeChild(doms[i]);
- }
- },
- mounted: function mounted() {
- var _this = this;
- var match = (window.location.pathname + "").match(/\/project\/panel\/(\d+)$/i);
- this.urlProjectid = match ? match[1] : 0;
- //
- this.$nextTick(function () {
- var dom = _this.$el;
- if (parseInt(_this.taskid) === 0) {
- if (dom.parentNode != null) dom.parentNode.removeChild(dom);
- return;
- }
- //
- dom.addEventListener('transitionend', function () {
- if (dom !== null && dom.parentNode !== null && !_this.visible) {
- dom.parentNode.removeChild(dom);
- }
- }, false);
- //
- setTimeout(function () {
- _this.visible = true;
- }, 0);
- });
- this.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail);
- this.getTaskDetail("mounted");
- //
- $A.setOnTaskInfoListener('components/project/task/detail', function (act, detail) {
- if (detail.id != _this.taskid) {
- return;
- }
- if (detail.__modifyUsername == _this.usrName) {
- return;
- }
- _this.getTaskDetail("setOnTaskInfoListener");
- }, true);
- },
- watch: {
- taskid: function taskid() {
- this.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail);
- this.getTaskDetail("watch");
- }
- },
- computed: {
- subtaskProgress: function subtaskProgress() {
- var countLists = this.detail.subtask;
- if (countLists.length === 0) {
- return 0;
- }
- var completeLists = countLists.filter(function (item) {
- return item.status == 'complete';
- });
- return parseFloat((completeLists.length / countLists.length * 100).toFixed(2));
- }
- },
- methods: {
- initLanguage: function initLanguage() {
- var lastSecond = function lastSecond(e) {
- return new Date($A.formatDate("Y-m-d 23:59:29", Math.round(e / 1000)));
- };
- this.timeOptions = {
- shortcuts: [{
- text: this.$L('今天'),
- value: function value() {
- return [new Date(), lastSecond(new Date().getTime())];
- }
- }, {
- text: this.$L('明天'),
- value: function value() {
- var e = new Date();
- e.setDate(e.getDate() + 1);
- return [new Date(), lastSecond(e.getTime())];
- }
- }, {
- text: this.$L('本周'),
- value: function value() {
- return [$A.getData('今天', true), lastSecond($A.getData('本周结束2', true))];
- }
- }, {
- text: this.$L('本月'),
- value: function value() {
- return [$A.getData('今天', true), lastSecond($A.getData('本月结束', true))];
- }
- }, {
- text: this.$L('3天'),
- value: function value() {
- var e = new Date();
- e.setDate(e.getDate() + 3);
- return [new Date(), lastSecond(e.getTime())];
- }
- }, {
- text: this.$L('5天'),
- value: function value() {
- var e = new Date();
- e.setDate(e.getDate() + 5);
- return [new Date(), lastSecond(e.getTime())];
- }
- }, {
- text: this.$L('7天'),
- value: function value() {
- var e = new Date();
- e.setDate(e.getDate() + 7);
- return [new Date(), lastSecond(e.getTime())];
- }
- }]
- };
- },
- levelFormt: function levelFormt(p) {
- switch (parseInt(p)) {
- case 1:
- return this.$L("重要且紧急") + " (P1)";
- case 2:
- return this.$L("重要不紧急") + " (P2)";
- case 3:
- return this.$L("紧急不重要") + " (P3)";
- case 4:
- return this.$L("不重要不紧急") + " (P4)";
- }
- },
- titleKeydown: function titleKeydown(e) {
- if (e.keyCode == 13) {
- e.preventDefault();
- e.target.blur();
- }
- },
- descKeydown: function descKeydown(e) {
- if (e.keyCode == 13) {
- if (e.shiftKey) {
- return;
- }
- e.preventDefault();
- e.target.blur();
- }
- },
- commentKeydown: function commentKeydown(e) {
- if (e.keyCode == 13) {
- if (e.shiftKey) {
- return;
- }
- e.preventDefault();
- this.handleTask('comment');
- }
- },
- commentDragOver: function commentDragOver(show) {
- var _this2 = this;
- var random = this.__detailDragOver = $A.randomString(8);
- if (!show) {
- setTimeout(function () {
- if (random === _this2.__detailDragOver) {
- _this2.detailDragOver = show;
- }
- }, 150);
- } else {
- this.detailDragOver = show;
- }
- },
- commentPasteDrag: function commentPasteDrag(e, type) {
- var _this3 = this;
- this.detailDragOver = false;
- var files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
- var postFiles = Array.prototype.slice.call(files);
- if (postFiles.length > 0) {
- e.preventDefault();
- postFiles.forEach(function (file) {
- _this3.$refs.projectUpload.upload(file);
- });
- }
- },
- subtaskKeydown: function subtaskKeydown(subindex, e) {
- if (e.keyCode == 13) {
- if (e.shiftKey) {
- return;
- }
- e.preventDefault();
- this.handleTask('subtaskEnter', subindex);
- }
- },
- followerLength: function followerLength(follower) {
- if (follower instanceof Array) {
- return follower.length;
- } else {
- return 0;
- }
- },
- followerToStr: function followerToStr(follower) {
- if (follower instanceof Array) {
- return follower.join(",");
- } else {
- return '';
- }
- },
- haveAttention: function haveAttention(follower) {
- var _this4 = this;
- if (follower instanceof Array) {
- return follower.filter(function (uname) {
- return uname == _this4.usrName;
- }).length > 0;
- } else {
- return 0;
- }
- },
- getTaskDetail: function getTaskDetail() {
- var _this5 = this;
- var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- $A.apiAjax({
- url: 'project/task/detail',
- data: {
- taskid: this.taskid
- },
- error: function error() {
- alert(_this5.$L('网络繁忙,请稍后再试!'));
- _this5.visible = false;
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this5.detail = Object.assign(_this5.detail, res.data);
- _this5.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this5.detail);
- _this5.$nextTick(function () {
- _this5.$refs.titleInput.resizeTextarea();
- _this5.detail.subtask.forEach(function (temp, index) {
- _this5.$refs['subtaskInput_' + index][0].resizeTextarea();
- });
- });
- } else {
- _this5.$Modal.error({
- title: _this5.$L('温馨提示'),
- content: res.msg,
- onOk: function onOk() {
- _this5.visible = false;
- }
- });
- }
- }
- });
- },
- subtaskBatchAdd: function subtaskBatchAdd() {
- var _this6 = this;
- this.inputValue = "";
- this.$Modal.confirm({
- width: 560,
- render: function render(h) {
- return h('div', [h('div', {
- style: {
- fontSize: '16px',
- fontWeight: '500',
- marginBottom: '20px'
- }
- }, _this6.$L('批量添加子任务')), h('Input', {
- props: {
- type: 'textarea',
- rows: 4,
- autosize: { minRows: 4, maxRows: 30 },
- value: _this6.inputValue,
- placeholder: _this6.$L('使用换行添加多个子任务')
- },
- on: {
- input: function input(val) {
- _this6.inputValue = val;
- }
- }
- })]);
- },
- loading: true,
- onOk: function onOk() {
- if (_this6.inputValue) {
- var tempArray = _this6.inputValue.split(/\n/);
- tempArray.forEach(function (detail) {
- detail = detail.trim();
- detail && _this6.detail.subtask.push({
- time: Math.round(new Date().getTime() / 1000),
- status: 'unfinished',
- detail: detail,
- stip: ''
- });
- });
- _this6.handleTask('subtask', function () {
- _this6.$Modal.remove();
- }, 'all');
- } else {
- _this6.$Modal.remove();
- }
- }
- });
- },
- getTaskSort: function getTaskSort() {
- var sortData = "",
- taskData = "";
- this.projectLabel.forEach(function (label) {
- taskData = "";
- label.taskLists.forEach(function (task) {
- if (taskData) taskData += "-";
- taskData += task.id;
- });
- if (sortData) sortData += ";";
- sortData += label.id + ":" + taskData;
- });
- return sortData;
- },
- taskSortUpdate: function taskSortUpdate(isLabel) {
- var oldSort = this.projectSortData;
- var newSort = this.getTaskSort();
- if (oldSort == newSort) {
- return;
- }
- this.projectSortData = newSort;
- this.projectSortDisabled = true;
- this.loadIng++;
- console.log(oldSort, newSort);
- // $A.apiAjax({
- // url: 'project/sort',
- // data: {
- // projectid: this.projectid,
- // oldsort: oldSort,
- // newsort: newSort,
- // label: isLabel === true ? 1 : 0
- // },
- // complete: () => {
- // this.projectSortDisabled = false;
- // this.loadIng--;
- // },
- // error: () => {
- // this.getDetail();
- // alert(this.$L('网络繁忙,请稍后再试!'));
- // },
- // success: (res) => {
- // if (res.ret === 1) {
- // this.projectLabel.forEach((label) => {
- // let length = label.taskLists.length;
- // label.taskLists.forEach((task, index) => {
- // task.inorder = length - index;
- // });
- // });
- // this.taskNewSort();
- // //
- // this.$Message.success(res.msg);
- // $A.triggerTaskInfoListener(isLabel ? 'labelsort' : 'tasksort', { projectid: this.projectid, nickname: $A.getNickName(), time: Math.round(new Date().getTime()/1000) });
- // } else {
- // this.getDetail();
- // this.$Modal.error({title: this.$L('温馨提示'), content: res.msg});
- // }
- // }
- // });
- },
- handleUsernameShow: function handleUsernameShow() {
- this.$set(this.detail, 'newusername', '');
- },
- handleAttentionShow: function handleAttentionShow() {
- this.$set(this.detail, 'attentionLists', this.followerToStr(this.detail.follower));
- },
- handleBgClose: function handleBgClose() {
- if (this.subwinVisible > 0) {
- return;
- }
- this.visible = false;
- },
- handleSubwinToggle: function handleSubwinToggle(visible) {
- if (visible) {
- this.subwinVisible++;
- } else {
- this.subwinVisible--;
- }
- },
- handleTask: function handleTask(act, eve, type) {
- var _this7 = this;
- var ajaxData = {
- act: act,
- taskid: this.taskid,
- type: typeof type === 'undefined' ? '' : type
- };
- var ajaxCallback = function ajaxCallback() {};
- //
- switch (act) {
- case 'title':
- if (this.detail[act] == this.bakData[act]) {
- return;
- }
- if (act == 'title' && !this.detail[act]) {
- this.$set(this.detail, act, this.bakData[act]);
- return;
- }
- ajaxData.content = this.detail[act];
- ajaxCallback = function ajaxCallback(res) {
- if (res !== 1) {
- _this7.$set(_this7.detail, act, _this7.bakData[act]);
- }
- };
- break;
- case 'desc':
- this.logType == '日志' && this.$refs.log.getLists(true, true);
- return;
- case 'subtaskAdd':
- if (!$A.isArray(this.detail.subtask)) {
- this.detail.subtask = [];
- }
- this.detail.subtask.push({
- time: Math.round(new Date().getTime() / 1000),
- status: 'unfinished',
- detail: '',
- stip: ''
- });
- this.$nextTick(function () {
- _this7.$refs['subtaskInput_' + (_this7.detail.subtask.length - 1)][0].focus();
- });
- return;
- case 'subtaskDelete':
- //this.detail.subtask.splice(eve, 1);
- //console.log(type)
- this.handleTask('subtaskBlur', eve, type);
- return;
- case 'subtaskEnter':
- if (!$A.isArray(this.detail.subtask)) {
- this.detail.subtask = [];
- }
- if (eve + 1 >= this.detail.subtask.length) {
- this.handleTask('subtaskAdd');
- return;
- }
- this.$refs['subtaskInput_' + (eve + 1)][0].focus();
- return;
- case 'subtaskBlur':
- this.handleTask('subtask', eve, type);
- return;
- case 'subtask':
- if (type === 'all') {
- //批量
- var tempArray = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail[act]);
- while (tempArray.length > 0 && tempArray[tempArray.length - 1].detail == '') {
- tempArray.splice(tempArray.length - 1, 1);
- }
- if ($A.jsonStringify(tempArray) === $A.jsonStringify(this.bakData[act])) {
- return;
- }
- ajaxData.content = tempArray;
- } else {
- //单个任务
- if (this.detail.subtask[eve].detail == "" && type == 'detail') {
- return;
- }
- if (this.detail.subtask[eve].uname == "" && type == 'uname') {
- return;
- }
- ajaxData.content = [this.detail.subtask[eve]];
- }
- ajaxCallback = function ajaxCallback(res) {
- if (res !== 1) {
- _this7.$set(_this7.detail, act, __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.bakData[act]));
- }
- typeof eve === "function" && eve(res);
- };
- break;
- case 'fileupload':
- this.$refs.projectUpload.uploadHandleClick();
- return;
- case 'filechange':
- var filenum = $A.runNum(this.detail.filenum);
- switch (eve) {
- case 'up':
- this.$set(this.detail, 'filenum', filenum + 1);
- break;
- case 'error':
- case 'delete':
- this.$set(this.detail, 'filenum', filenum - 1);
- break;
- }
- if (eve == 'add' || eve == 'delete') {
- this.logType == '日志' && this.$refs.log.getLists(true, true);
- $A.triggerTaskInfoChange(ajaxData.taskid);
- }
- return;
- case 'claimb':
- this.$Modal.confirm({
- title: this.$L('认领任务'),
- content: this.$L('你确定认领任务“%”吗?', this.detail.title),
- onOk: function onOk() {
- _this7.handleTask('claim', eve);
- }
- });
- return;
- case 'claim':
- case 'reassign':
- case 'complete':
- case 'unfinished':
- case 'archived':
- case 'unarchived':
- break;
- case 'archived2':
- ajaxData.act = 'complete';
- ajaxCallback = function ajaxCallback(res) {
- if (res === 1 && !_this7.detail.archived) {
- _this7.handleTask('archived');
- return false;
- }
- };
- break;
- case 'level-1':
- case 'level-2':
- case 'level-3':
- case 'level-4':
- ajaxData.act = 'level';
- ajaxData.content = act.substring(6);
- break;
- case 'usernameb':
- if (!eve.username) {
- return;
- }
- this.$Modal.confirm({
- title: this.$L('修改负责人'),
- content: this.$L('你确定修改负责人设置为“%”吗?', eve.nickname || eve.username),
- onOk: function onOk() {
- _this7.handleTask('username', eve);
- }
- });
- return;
- case 'username':
- if (!eve.username) {
- return;
- }
- ajaxData.content = eve.username;
- break;
- case 'inittime':
- if (this.detail.startdate > 0 && this.detail.enddate > 0) {
- this.timeValue = [$A.formatDate("Y-m-d H:i", this.detail.startdate), $A.formatDate("Y-m-d H:i", this.detail.enddate)];
- } else {
- this.timeValue = [];
- }
- return;
- case 'plannedtimeb':
- var temp = $A.date2string(this.timeValue, "Y-m-d H:i");
- if (!temp[0] || !temp[1]) {
- this.$Modal.error({ title: this.$L('温馨提示'), content: this.$L('请选择一个有效时间!') });
- return;
- }
- this.$Modal.confirm({
- title: this.$L('修改计划时间'),
- content: this.$L('你确定将任务计划时间设置为“%”吗?', temp[0] + "~" + temp[1]),
- onOk: function onOk() {
- _this7.handleTask('plannedtime');
- }
- });
- return;
- case 'plannedtime':
- this.timeValue = $A.date2string(this.timeValue, "Y-m-d H:i");
- ajaxData.content = this.timeValue[0] + "," + this.timeValue[1];
- this.$refs.timeRef.handleClose();
- break;
- case 'unplannedtimeb':
- this.$Modal.confirm({
- title: this.$L('取消计划时间'),
- content: this.$L('你确定将任务计划时间取消吗?'),
- onOk: function onOk() {
- _this7.handleTask('unplannedtime');
- }
- });
- return;
- case 'unplannedtime':
- this.$refs.timeRef.handleClose();
- break;
- case 'attentiona':
- ajaxData.act = "attention";
- ajaxData.content = this.usrName;
- break;
- case 'attention':
- if (!this.detail.attentionLists) {
- return;
- }
- ajaxData.mode = eve ? 'clean' : '';
- ajaxData.content = this.detail.attentionLists;
- this.$refs.attentionRef.handleClose();
- break;
- case 'unattention':
- ajaxData.content = eve.username;
- if (eve.uisynch === true) {
- var bakFollower = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail.follower);
- this.$set(this.detail, 'follower', this.detail.follower.filter(function (uname) {
- return uname != eve;
- }));
- ajaxCallback = function ajaxCallback(res) {
- if (res !== 1) {
- _this7.$set(_this7.detail, 'follower', bakFollower);
- }
- };
- }
- break;
- case 'deleteb':
- this.$Modal.confirm({
- title: this.$L('删除提示'),
- content: this.$L('您确定要删除此任务吗?'),
- onOk: function onOk() {
- _this7.handleTask('delete');
- }
- });
- return;
- case 'delete':
- ajaxCallback = function ajaxCallback(res) {
- if (res === 1) {
- _this7.$Modal.info({
- title: _this7.$L('温馨提示'),
- content: _this7.$L('任务已删除,点击确定关闭窗口。'),
- onOk: function onOk() {
- _this7.visible = false;
- }
- });
- return false;
- }
- };
- break;
- case 'comment':
- if (!this.commentText) {
- return;
- }
- ajaxData.content = this.commentText;
- ajaxCallback = function ajaxCallback(res) {
- if (res === 1) {
- _this7.commentText = "";
- _this7.logType == '评论' && _this7.$refs.log.getLists(true, true);
- }
- };
- break;
- default:
- {
- return;
- }
- }
- //
- var loadRand = $A.randomString(6);
- this.$set(this.loadRand, ajaxData.act, loadRand);
- this.$set(this.loadData, ajaxData.act, true);
- var runTime = Math.round(new Date().getTime());
- $A.apiAjax({
- url: 'project/task/edit',
- method: 'post',
- data: ajaxData,
- complete: function complete() {
- if (_this7.loadRand[ajaxData.act] !== loadRand) {
- return;
- }
- _this7.$set(_this7.loadData, ajaxData.act, false);
- },
- error: function error() {
- if (_this7.loadRand[ajaxData.act] !== loadRand) {
- return;
- }
- ajaxCallback(-1);
- alert(_this7.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- if (_this7.loadRand[ajaxData.act] !== loadRand) {
- return;
- }
- runTime = Math.round(new Date().getTime()) - runTime;
- if (res.ret === 1) {
- var _tempArray = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.detail.subtask);
- _this7.detail = res.data;
- _this7.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.detail);
- while (_tempArray.length > 0 && _tempArray[_tempArray.length - 1].detail == '') {
- _tempArray.splice(_tempArray.length - 1, 1);
- _this7.detail.subtask.push({
- uname: '',
- time: Math.round(new Date().getTime() / 1000),
- status: 'unfinished',
- detail: '',
- stip: ''
- });
- }
- $A.triggerTaskInfoListener(ajaxData.act, res.data);
- $A.triggerTaskInfoChange(ajaxData.taskid);
- setTimeout(function () {
- if (ajaxCallback(1) !== false) {
- _this7.logType == '日志' && _this7.$refs.log.getLists(true, true);
- _this7.$Message.success(res.msg);
- }
- }, Math.max(0, 350 - runTime));
- //$A.triggerTaskDing(ajaxData);
- } else {
- setTimeout(function () {
- ajaxCallback(0);
- _this7.$Modal.error({ title: _this7.$L('温馨提示'), content: res.msg });
- }, Math.max(0, 350 - runTime));
- }
- }
- });
- },
- openProject: function openProject(projectid) {
- try {
- this.visible = false;
- $A.app.$router.push({
- name: 'project-panel',
- params: { projectid: projectid, statistics: '', other: {} }
- });
- } catch (e) {
- this.visible = true;
- }
- }
- }
- });
- /***/ }),
- /* 243 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseClone = __webpack_require__(244);
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_SYMBOLS_FLAG = 4;
- /**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- module.exports = cloneDeep;
- /***/ }),
- /* 244 */
- /***/ (function(module, exports, __webpack_require__) {
- var Stack = __webpack_require__(55),
- arrayEach = __webpack_require__(245),
- assignValue = __webpack_require__(45),
- baseAssign = __webpack_require__(247),
- baseAssignIn = __webpack_require__(248),
- cloneBuffer = __webpack_require__(251),
- copyArray = __webpack_require__(252),
- copySymbols = __webpack_require__(253),
- copySymbolsIn = __webpack_require__(254),
- getAllKeys = __webpack_require__(60),
- getAllKeysIn = __webpack_require__(255),
- getTag = __webpack_require__(21),
- initCloneArray = __webpack_require__(256),
- initCloneByTag = __webpack_require__(257),
- initCloneObject = __webpack_require__(262),
- isArray = __webpack_require__(16),
- isBuffer = __webpack_require__(34),
- isMap = __webpack_require__(264),
- isObject = __webpack_require__(9),
- isSet = __webpack_require__(266),
- keys = __webpack_require__(19),
- keysIn = __webpack_require__(28);
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- weakMapTag = '[object WeakMap]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
- cloneableTags[boolTag] = cloneableTags[dateTag] =
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[setTag] =
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[weakMapTag] = false;
- /**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Deep clone
- * 2 - Flatten inherited properties
- * 4 - Clone symbols
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value),
- isFunc = tag == funcTag || tag == genTag;
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat
- ? copySymbolsIn(value, baseAssignIn(result, value))
- : copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new Stack);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
- if (isSet(value)) {
- value.forEach(function(subValue) {
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap(value)) {
- value.forEach(function(subValue, key) {
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- }
- var keysFunc = isFull
- ? (isFlat ? getAllKeysIn : getAllKeys)
- : (isFlat ? keysIn : keys);
- var props = isArr ? undefined : keysFunc(value);
- arrayEach(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
- module.exports = baseClone;
- /***/ }),
- /* 245 */
- /***/ (function(module, exports) {
- /**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- module.exports = arrayEach;
- /***/ }),
- /* 246 */
- /***/ (function(module, exports, __webpack_require__) {
- var getNative = __webpack_require__(5);
- var defineProperty = (function() {
- try {
- var func = getNative(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }());
- module.exports = defineProperty;
- /***/ }),
- /* 247 */
- /***/ (function(module, exports, __webpack_require__) {
- var copyObject = __webpack_require__(15),
- keys = __webpack_require__(19);
- /**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
- module.exports = baseAssign;
- /***/ }),
- /* 248 */
- /***/ (function(module, exports, __webpack_require__) {
- var copyObject = __webpack_require__(15),
- keysIn = __webpack_require__(28);
- /**
- * The base implementation of `_.assignIn` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
- module.exports = baseAssignIn;
- /***/ }),
- /* 249 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(9),
- isPrototype = __webpack_require__(27),
- nativeKeysIn = __webpack_require__(250);
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object),
- result = [];
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
- module.exports = baseKeysIn;
- /***/ }),
- /* 250 */
- /***/ (function(module, exports) {
- /**
- * This function is like
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * except that it includes inherited enumerable properties.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
- module.exports = nativeKeysIn;
- /***/ }),
- /* 251 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3);
- /** Detect free variable `exports`. */
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
- /** Built-in value references. */
- var Buffer = moduleExports ? root.Buffer : undefined,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
- /**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result);
- return result;
- }
- module.exports = cloneBuffer;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
- /***/ }),
- /* 252 */
- /***/ (function(module, exports) {
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- module.exports = copyArray;
- /***/ }),
- /* 253 */
- /***/ (function(module, exports, __webpack_require__) {
- var copyObject = __webpack_require__(15),
- getSymbols = __webpack_require__(24);
- /**
- * Copies own symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
- module.exports = copySymbols;
- /***/ }),
- /* 254 */
- /***/ (function(module, exports, __webpack_require__) {
- var copyObject = __webpack_require__(15),
- getSymbolsIn = __webpack_require__(47);
- /**
- * Copies own and inherited symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
- module.exports = copySymbolsIn;
- /***/ }),
- /* 255 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseGetAllKeys = __webpack_require__(40),
- getSymbolsIn = __webpack_require__(47),
- keysIn = __webpack_require__(28);
- /**
- * Creates an array of own and inherited enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
- module.exports = getAllKeysIn;
- /***/ }),
- /* 256 */
- /***/ (function(module, exports) {
- /** Used for built-in method references. */
- var objectProto = Object.prototype;
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
- module.exports = initCloneArray;
- /***/ }),
- /* 257 */
- /***/ (function(module, exports, __webpack_require__) {
- var cloneArrayBuffer = __webpack_require__(29),
- cloneDataView = __webpack_require__(258),
- cloneRegExp = __webpack_require__(259),
- cloneSymbol = __webpack_require__(260),
- cloneTypedArray = __webpack_require__(261);
- /** `Object#toString` result references. */
- var boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return cloneDataView(object, isDeep);
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return cloneTypedArray(object, isDeep);
- case mapTag:
- return new Ctor;
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return cloneRegExp(object);
- case setTag:
- return new Ctor;
- case symbolTag:
- return cloneSymbol(object);
- }
- }
- module.exports = initCloneByTag;
- /***/ }),
- /* 258 */
- /***/ (function(module, exports, __webpack_require__) {
- var cloneArrayBuffer = __webpack_require__(29);
- /**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- module.exports = cloneDataView;
- /***/ }),
- /* 259 */
- /***/ (function(module, exports) {
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
- /**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
- module.exports = cloneRegExp;
- /***/ }),
- /* 260 */
- /***/ (function(module, exports, __webpack_require__) {
- var Symbol = __webpack_require__(18);
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
- /**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
- module.exports = cloneSymbol;
- /***/ }),
- /* 261 */
- /***/ (function(module, exports, __webpack_require__) {
- var cloneArrayBuffer = __webpack_require__(29);
- /**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- module.exports = cloneTypedArray;
- /***/ }),
- /* 262 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseCreate = __webpack_require__(263),
- getPrototype = __webpack_require__(48),
- isPrototype = __webpack_require__(27);
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !isPrototype(object))
- ? baseCreate(getPrototype(object))
- : {};
- }
- module.exports = initCloneObject;
- /***/ }),
- /* 263 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(9);
- /** Built-in value references. */
- var objectCreate = Object.create;
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} proto The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object;
- object.prototype = undefined;
- return result;
- };
- }());
- module.exports = baseCreate;
- /***/ }),
- /* 264 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseIsMap = __webpack_require__(265),
- baseUnary = __webpack_require__(20),
- nodeUtil = __webpack_require__(26);
- /* Node.js helper references. */
- var nodeIsMap = nodeUtil && nodeUtil.isMap;
- /**
- * Checks if `value` is classified as a `Map` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- * @example
- *
- * _.isMap(new Map);
- * // => true
- *
- * _.isMap(new WeakMap);
- * // => false
- */
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
- module.exports = isMap;
- /***/ }),
- /* 265 */
- /***/ (function(module, exports, __webpack_require__) {
- var getTag = __webpack_require__(21),
- isObjectLike = __webpack_require__(8);
- /** `Object#toString` result references. */
- var mapTag = '[object Map]';
- /**
- * The base implementation of `_.isMap` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- */
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
- module.exports = baseIsMap;
- /***/ }),
- /* 266 */
- /***/ (function(module, exports, __webpack_require__) {
- var baseIsSet = __webpack_require__(267),
- baseUnary = __webpack_require__(20),
- nodeUtil = __webpack_require__(26);
- /* Node.js helper references. */
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
- /**
- * Checks if `value` is classified as a `Set` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- * @example
- *
- * _.isSet(new Set);
- * // => true
- *
- * _.isSet(new WeakSet);
- * // => false
- */
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
- module.exports = isSet;
- /***/ }),
- /* 267 */
- /***/ (function(module, exports, __webpack_require__) {
- var getTag = __webpack_require__(21),
- isObjectLike = __webpack_require__(8);
- /** `Object#toString` result references. */
- var setTag = '[object Set]';
- /**
- * The base implementation of `_.isSet` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- */
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
- module.exports = baseIsSet;
- /***/ }),
- /* 268 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(269)
- /* template */
- var __vue_template__ = __webpack_require__(272)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/iview/WInput.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-2cdade09", Component.options)
- } else {
- hotAPI.reload("data-v-2cdade09", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 269 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__ = __webpack_require__(22);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_calcTextareaHeight__ = __webpack_require__(270);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_view_design_src_mixins_emitter__ = __webpack_require__(36);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_form__ = __webpack_require__(271);
- 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; }
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- var prefixCls = 'ivu-input';
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'WInput',
- mixins: [__WEBPACK_IMPORTED_MODULE_2_view_design_src_mixins_emitter__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_form__["a" /* default */]],
- props: {
- type: {
- validator: function validator(value) {
- return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number', 'tel']);
- },
- default: 'text'
- },
- value: {
- type: [String, Number],
- default: ''
- },
- size: {
- validator: function validator(value) {
- return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['small', 'large', 'default']);
- },
- default: function _default() {
- return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
- }
- },
- placeholder: {
- type: String,
- default: ''
- },
- maxlength: {
- type: [String, Number]
- },
- disabled: {
- type: Boolean,
- default: false
- },
- icon: String,
- autosize: {
- type: [Boolean, Object],
- default: false
- },
- rows: {
- type: Number,
- default: 2
- },
- readonly: {
- type: Boolean,
- default: false
- },
- name: {
- type: String
- },
- number: {
- type: Boolean,
- default: false
- },
- autofocus: {
- type: Boolean,
- default: false
- },
- spellcheck: {
- type: Boolean,
- default: false
- },
- autocomplete: {
- type: String,
- default: 'off'
- },
- clearable: {
- type: Boolean,
- default: false
- },
- elementId: {
- type: String
- },
- wrap: {
- validator: function validator(value) {
- return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['hard', 'soft']);
- },
- default: 'soft'
- },
- prefix: {
- type: String,
- default: ''
- },
- suffix: {
- type: String,
- default: ''
- },
- search: {
- type: Boolean,
- default: false
- },
- enterButton: {
- type: [Boolean, String],
- default: false
- },
- // 4.0.0
- showWordLimit: {
- type: Boolean,
- default: false
- },
- // 4.0.0
- password: {
- type: Boolean,
- default: false
- }
- },
- data: function data() {
- return {
- currentValue: this.value,
- prefixCls: prefixCls,
- slotReady: false,
- textareaStyles: {},
- isOnComposition: false,
- showPassword: false
- };
- },
- computed: {
- currentType: function currentType() {
- var type = this.type;
- if (type === 'password' && this.password && this.showPassword) type = 'text';
- return type;
- },
- prepend: function prepend() {
- var state = false;
- if (this.type !== 'textarea') state = this.$slots.prepend !== undefined;
- return state;
- },
- append: function append() {
- var state = false;
- if (this.type !== 'textarea') state = this.$slots.append !== undefined;
- return state;
- },
- showPrefix: function showPrefix() {
- var state = false;
- if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined;
- return state;
- },
- showSuffix: function showSuffix() {
- var state = false;
- if (this.type !== 'textarea') state = this.suffix !== '' || this.$slots.suffix !== undefined;
- return state;
- },
- wrapClasses: function wrapClasses() {
- var _ref;
- return [prefixCls + '-wrapper', (_ref = {}, _defineProperty(_ref, prefixCls + '-wrapper-' + this.size, !!this.size), _defineProperty(_ref, prefixCls + '-type-' + this.type, this.type), _defineProperty(_ref, prefixCls + '-group', this.prepend || this.append || this.search && this.enterButton), _defineProperty(_ref, prefixCls + '-group-' + this.size, (this.prepend || this.append || this.search && this.enterButton) && !!this.size), _defineProperty(_ref, prefixCls + '-group-with-prepend', this.prepend), _defineProperty(_ref, prefixCls + '-group-with-append', this.append || this.search && this.enterButton), _defineProperty(_ref, prefixCls + '-hide-icon', this.append), _defineProperty(_ref, prefixCls + '-with-search', this.search && this.enterButton), _ref)];
- },
- inputClasses: function inputClasses() {
- var _ref2;
- return ['' + prefixCls, (_ref2 = {}, _defineProperty(_ref2, prefixCls + '-' + this.size, !!this.size), _defineProperty(_ref2, prefixCls + '-disabled', this.itemDisabled), _defineProperty(_ref2, prefixCls + '-with-prefix', this.showPrefix), _defineProperty(_ref2, prefixCls + '-with-suffix', this.showSuffix || this.search && this.enterButton === false), _ref2)];
- },
- textareaClasses: function textareaClasses() {
- return ['' + prefixCls, _defineProperty({}, prefixCls + '-disabled', this.itemDisabled)];
- },
- upperLimit: function upperLimit() {
- return this.maxlength;
- },
- textLength: function textLength() {
- if (typeof this.value === 'number') {
- return String(this.value).length;
- }
- return (this.value || '').length;
- }
- },
- methods: {
- handleEnter: function handleEnter(event) {
- this.$emit('on-enter', event);
- if (this.search) this.$emit('on-search', this.currentValue);
- },
- handleKeydown: function handleKeydown(event) {
- this.$emit('on-keydown', event);
- },
- handleKeypress: function handleKeypress(event) {
- this.$emit('on-keypress', event);
- },
- handleKeyup: function handleKeyup(event) {
- this.$emit('on-keyup', event);
- },
- handleIconClick: function handleIconClick(event) {
- this.$emit('on-click', event);
- },
- handleFocus: function handleFocus(event) {
- this.$emit('on-focus', event);
- },
- handleBlur: function handleBlur(event) {
- this.$emit('on-blur', event);
- if (!Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["b" /* findComponentUpward */])(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
- this.dispatch('FormItem', 'on-form-blur', this.currentValue);
- }
- },
- handleComposition: function handleComposition(event) {
- if (event.type === 'compositionstart') {
- this.isOnComposition = true;
- }
- if (event.type === 'compositionend') {
- this.isOnComposition = false;
- this.handleInput(event);
- }
- },
- handleInput: function handleInput(event) {
- if (this.isOnComposition) return;
- var value = event.target.value;
- if (this.number && value !== '') value = Number.isNaN(Number(value)) ? value : Number(value);
- this.$emit('input', value);
- this.setCurrentValue(value);
- this.$emit('on-change', event);
- },
- handleChange: function handleChange(event) {
- this.$emit('on-input-change', event);
- },
- handlePaste: function handlePaste(event) {
- this.$emit('on-input-paste', event);
- },
- setCurrentValue: function setCurrentValue(value) {
- var _this = this;
- if (value === this.currentValue) return;
- this.$nextTick(function () {
- _this.resizeTextarea();
- });
- this.currentValue = value;
- if (!Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["b" /* findComponentUpward */])(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
- this.dispatch('FormItem', 'on-form-change', value);
- }
- },
- resizeTextarea: function resizeTextarea() {
- var autosize = this.autosize;
- if (!autosize || this.type !== 'textarea') {
- return false;
- }
- var minRows = autosize.minRows;
- var maxRows = autosize.maxRows;
- this.textareaStyles = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_calcTextareaHeight__["a" /* default */])(this.$refs.textarea, minRows, maxRows);
- },
- focus: function focus() {
- if (this.type === 'textarea') {
- this.$refs.textarea.focus();
- } else {
- this.$refs.input.focus();
- }
- },
- blur: function blur() {
- if (this.type === 'textarea') {
- this.$refs.textarea.blur();
- } else {
- this.$refs.input.blur();
- }
- },
- handleClear: function handleClear() {
- var e = { target: { value: '' } };
- this.$emit('input', '');
- this.setCurrentValue('');
- this.$emit('on-change', e);
- this.$emit('on-clear');
- },
- handleSearch: function handleSearch() {
- if (this.itemDisabled) return false;
- this.$refs.input.focus();
- this.$emit('on-search', this.currentValue);
- },
- handleToggleShowPassword: function handleToggleShowPassword() {
- var _this2 = this;
- if (this.itemDisabled) return false;
- this.showPassword = !this.showPassword;
- this.focus();
- var len = this.currentValue.length;
- setTimeout(function () {
- _this2.$refs.input.setSelectionRange(len, len);
- }, 0);
- }
- },
- watch: {
- value: function value(val) {
- this.setCurrentValue(val);
- }
- },
- mounted: function mounted() {
- this.slotReady = true;
- this.resizeTextarea();
- }
- });
- /***/ }),
- /* 270 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = calcTextareaHeight;
- // Thanks to
- // https://github.com/andreypopp/react-textarea-autosize/
- // let hiddenTextarea;
- //
- // const HIDDEN_STYLE = `
- // height:0 !important;
- // min-height:0 !important;
- // max-height:none !important;
- // visibility:hidden !important;
- // overflow:hidden !important;
- // position:absolute !important;
- // z-index:-1000 !important;
- // top:0 !important;
- // right:0 !important
- // `;
- //
- // const CONTEXT_STYLE = [
- // 'letter-spacing',
- // 'line-height',
- // 'padding-top',
- // 'padding-bottom',
- // 'font-family',
- // 'font-weight',
- // 'font-size',
- // 'text-rendering',
- // 'text-transform',
- // 'width',
- // 'text-indent',
- // 'padding-left',
- // 'padding-right',
- // 'border-width',
- // 'box-sizing'
- // ];
- //
- // function calculateNodeStyling(node) {
- // const style = window.getComputedStyle(node);
- //
- // const boxSizing = style.getPropertyValue('box-sizing');
- //
- // const paddingSize = (
- // parseFloat(style.getPropertyValue('padding-bottom')) +
- // parseFloat(style.getPropertyValue('padding-top'))
- // );
- //
- // const borderSize = (
- // parseFloat(style.getPropertyValue('border-bottom-width')) +
- // parseFloat(style.getPropertyValue('border-top-width'))
- // );
- //
- // const contextStyle = CONTEXT_STYLE
- // .map(name => `${name}:${style.getPropertyValue(name)}`)
- // .join(';');
- //
- // return {contextStyle, paddingSize, borderSize, boxSizing};
- // }
- //
- // export default function calcTextareaHeight(targetNode, minRows = null, maxRows = null) {
- // if (!hiddenTextarea) {
- // hiddenTextarea = document.createElement('textarea');
- // document.body.appendChild(hiddenTextarea);
- // }
- //
- // let {
- // paddingSize,
- // borderSize,
- // boxSizing,
- // contextStyle
- // } = calculateNodeStyling(targetNode);
- //
- // hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
- // hiddenTextarea.value = targetNode.value || targetNode.placeholder || '';
- //
- // let height = hiddenTextarea.scrollHeight;
- // let minHeight = -Infinity;
- // let maxHeight = Infinity;
- // let overflowY;
- //
- // if (boxSizing === 'border-box') {
- // height = height + borderSize;
- // } else if (boxSizing === 'content-box') {
- // height = height - paddingSize;
- // }
- //
- // hiddenTextarea.value = '';
- // let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
- //
- // if (minRows !== null) {
- // minHeight = singleRowHeight * minRows;
- // if (boxSizing === 'border-box') {
- // minHeight = minHeight + paddingSize + borderSize;
- // }
- // height = Math.max(minHeight, height);
- // }
- // if (maxRows !== null) {
- // maxHeight = singleRowHeight * maxRows;
- // if (boxSizing === 'border-box') {
- // maxHeight = maxHeight + paddingSize + borderSize;
- // }
- // overflowY = height > maxHeight ? '' : 'hidden';
- // height = Math.min(maxHeight, height);
- // }
- //
- // if (!maxRows) {
- // overflowY = 'hidden';
- // }
- //
- // return {
- // height: `${height}px`,
- // minHeight: `${minHeight}px`,
- // maxHeight: `${maxHeight}px`,
- // overflowY
- // };
- // }
- const HIDDEN_TEXTAREA_STYLE = `
- min-height:0 !important;
- max-height:none !important;
- height:0 !important;
- visibility:hidden !important;
- overflow:hidden !important;
- position:absolute !important;
- z-index:-1000 !important;
- top:0 !important;
- right:0 !important
- `;
- const SIZING_STYLE = [
- 'letter-spacing',
- 'line-height',
- 'padding-top',
- 'padding-bottom',
- 'font-family',
- 'font-weight',
- 'font-size',
- 'text-rendering',
- 'text-transform',
- 'width',
- 'text-indent',
- 'padding-left',
- 'padding-right',
- 'border-width',
- 'box-sizing',
- ];
- let computedStyleCache = {};
- let hiddenTextarea;
- function calculateNodeStyling(node, useCache = false) {
- const nodeRef = (
- node.getAttribute('id') ||
- node.getAttribute('data-reactid') ||
- node.getAttribute('name'));
- if (useCache && computedStyleCache[nodeRef]) {
- return computedStyleCache[nodeRef];
- }
- const style = window.getComputedStyle(node);
- const boxSizing = (
- style.getPropertyValue('box-sizing') ||
- style.getPropertyValue('-moz-box-sizing') ||
- style.getPropertyValue('-webkit-box-sizing')
- );
- const paddingSize = (
- parseFloat(style.getPropertyValue('padding-bottom')) +
- parseFloat(style.getPropertyValue('padding-top'))
- );
- const borderSize = (
- parseFloat(style.getPropertyValue('border-bottom-width')) +
- parseFloat(style.getPropertyValue('border-top-width'))
- );
- const sizingStyle = SIZING_STYLE
- .map(name => `${name}:${style.getPropertyValue(name)}`)
- .join(';');
- const nodeInfo = {
- sizingStyle,
- paddingSize,
- borderSize,
- boxSizing,
- };
- if (useCache && nodeRef) {
- computedStyleCache[nodeRef] = nodeInfo;
- }
- return nodeInfo;
- }
- function calcTextareaHeight(uiTextNode, minRows = null, maxRows = null, useCache = false) {
- if (!hiddenTextarea) {
- hiddenTextarea = document.createElement('textarea');
- document.body.appendChild(hiddenTextarea);
- }
- // Fix wrap="off" issue
- // https://github.com/ant-design/ant-design/issues/6577
- if (uiTextNode.getAttribute('wrap')) {
- hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
- } else {
- hiddenTextarea.removeAttribute('wrap');
- }
- // Copy all CSS properties that have an impact on the height of the content in
- // the textbox
- let {
- paddingSize, borderSize,
- boxSizing, sizingStyle,
- } = calculateNodeStyling(uiTextNode, useCache);
- // Need to have the overflow attribute to hide the scrollbar otherwise
- // text-lines will not calculated properly as the shadow will technically be
- // narrower for content
- hiddenTextarea.setAttribute('style', `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`);
- hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
- let minHeight = Number.MIN_SAFE_INTEGER;
- let maxHeight = Number.MAX_SAFE_INTEGER;
- let height = hiddenTextarea.scrollHeight;
- let overflowY;
- if (boxSizing === 'border-box') {
- // border-box: add border, since height = content + padding + border
- height = height + borderSize;
- } else if (boxSizing === 'content-box') {
- // remove padding, since height = content
- height = height - paddingSize;
- }
- if (minRows !== null || maxRows !== null) {
- // measure height of a textarea with a single row
- hiddenTextarea.value = ' ';
- let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
- if (minRows !== null) {
- minHeight = singleRowHeight * minRows;
- if (boxSizing === 'border-box') {
- minHeight = minHeight + paddingSize + borderSize;
- }
- height = Math.max(minHeight, height);
- }
- if (maxRows !== null) {
- maxHeight = singleRowHeight * maxRows;
- if (boxSizing === 'border-box') {
- maxHeight = maxHeight + paddingSize + borderSize;
- }
- overflowY = height > maxHeight ? '' : 'hidden';
- height = Math.min(maxHeight, height);
- }
- }
- // Remove scroll bar flash when autosize without maxRows
- if (!maxRows) {
- overflowY = 'hidden';
- }
- return {
- height: `${height}px`,
- minHeight: `${minHeight}px`,
- maxHeight: `${maxHeight}px`,
- overflowY
- };
- }
- /***/ }),
- /* 271 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony default export */ __webpack_exports__["a"] = ({
- inject: {
- FormInstance: {
- default: ''
- }
- },
- computed: {
- itemDisabled () {
- let state = this.disabled;
- if (!state && this.FormInstance) state = this.FormInstance.disabled;
- return state;
- }
- }
- });
- /***/ }),
- /* 272 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- { class: _vm.wrapClasses },
- [
- _vm.type !== "textarea"
- ? [
- _vm.prepend
- ? _c(
- "div",
- {
- directives: [
- {
- name: "show",
- rawName: "v-show",
- value: _vm.slotReady,
- expression: "slotReady"
- }
- ],
- class: [_vm.prefixCls + "-group-prepend"]
- },
- [_vm._t("prepend")],
- 2
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.clearable && _vm.currentValue && !_vm.itemDisabled
- ? _c("i", {
- staticClass: "ivu-icon",
- class: [
- "ivu-icon-ios-close-circle",
- _vm.prefixCls + "-icon",
- _vm.prefixCls + "-icon-clear",
- _vm.prefixCls + "-icon-normal"
- ],
- on: { click: _vm.handleClear }
- })
- : _vm.icon
- ? _c("i", {
- staticClass: "ivu-icon",
- class: [
- "ivu-icon-" + _vm.icon,
- _vm.prefixCls + "-icon",
- _vm.prefixCls + "-icon-normal"
- ],
- on: { click: _vm.handleIconClick }
- })
- : _vm.search && _vm.enterButton === false
- ? _c("i", {
- staticClass: "ivu-icon ivu-icon-ios-search",
- class: [
- _vm.prefixCls + "-icon",
- _vm.prefixCls + "-icon-normal",
- _vm.prefixCls + "-search-icon"
- ],
- on: { click: _vm.handleSearch }
- })
- : _vm.showSuffix
- ? _c(
- "span",
- { staticClass: "ivu-input-suffix" },
- [
- _vm._t("suffix", function() {
- return [
- _vm.suffix
- ? _c("i", {
- staticClass: "ivu-icon",
- class: ["ivu-icon-" + _vm.suffix]
- })
- : _vm._e()
- ]
- })
- ],
- 2
- )
- : _vm.showWordLimit
- ? _c("span", { staticClass: "ivu-input-word-count" }, [
- _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
- ])
- : _vm.password
- ? _c(
- "span",
- {
- staticClass: "ivu-input-suffix",
- on: { click: _vm.handleToggleShowPassword }
- },
- [
- _vm.showPassword
- ? _c("i", {
- staticClass: "ivu-icon ivu-icon-ios-eye-off-outline"
- })
- : _c("i", {
- staticClass: "ivu-icon ivu-icon-ios-eye-outline"
- })
- ]
- )
- : _vm._e(),
- _vm._v(" "),
- _c("transition", { attrs: { name: "fade" } }, [
- !_vm.icon
- ? _c("i", {
- staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop",
- class: [
- _vm.prefixCls + "-icon",
- _vm.prefixCls + "-icon-validate"
- ]
- })
- : _vm._e()
- ]),
- _vm._v(" "),
- _c("input", {
- ref: "input",
- class: _vm.inputClasses,
- attrs: {
- id: _vm.elementId,
- autocomplete: _vm.autocomplete,
- spellcheck: _vm.spellcheck,
- type: _vm.currentType,
- placeholder: _vm.placeholder,
- disabled: _vm.itemDisabled,
- maxlength: _vm.maxlength,
- readonly: _vm.readonly,
- name: _vm.name,
- number: _vm.number,
- autofocus: _vm.autofocus
- },
- domProps: { value: _vm.currentValue },
- on: {
- keyup: [
- function($event) {
- if (
- !$event.type.indexOf("key") &&
- _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
- ) {
- return null
- }
- return _vm.handleEnter.apply(null, arguments)
- },
- _vm.handleKeyup
- ],
- keypress: _vm.handleKeypress,
- keydown: _vm.handleKeydown,
- focus: _vm.handleFocus,
- blur: _vm.handleBlur,
- compositionstart: _vm.handleComposition,
- compositionupdate: _vm.handleComposition,
- compositionend: _vm.handleComposition,
- input: _vm.handleInput,
- change: _vm.handleChange,
- paste: _vm.handlePaste
- }
- }),
- _vm._v(" "),
- _vm.append
- ? _c(
- "div",
- {
- directives: [
- {
- name: "show",
- rawName: "v-show",
- value: _vm.slotReady,
- expression: "slotReady"
- }
- ],
- class: [_vm.prefixCls + "-group-append"]
- },
- [_vm._t("append")],
- 2
- )
- : _vm.search && _vm.enterButton
- ? _c(
- "div",
- {
- class: [
- _vm.prefixCls + "-group-append",
- _vm.prefixCls + "-search"
- ],
- on: { click: _vm.handleSearch }
- },
- [
- _vm.enterButton === true
- ? _c("i", { staticClass: "ivu-icon ivu-icon-ios-search" })
- : [_vm._v(_vm._s(_vm.enterButton))]
- ],
- 2
- )
- : _vm.showPrefix
- ? _c(
- "span",
- { staticClass: "ivu-input-prefix" },
- [
- _vm._t("prefix", function() {
- return [
- _vm.prefix
- ? _c("i", {
- staticClass: "ivu-icon",
- class: ["ivu-icon-" + _vm.prefix]
- })
- : _vm._e()
- ]
- })
- ],
- 2
- )
- : _vm._e()
- ]
- : [
- _c("textarea", {
- ref: "textarea",
- class: _vm.textareaClasses,
- style: _vm.textareaStyles,
- attrs: {
- id: _vm.elementId,
- wrap: _vm.wrap,
- autocomplete: _vm.autocomplete,
- spellcheck: _vm.spellcheck,
- placeholder: _vm.placeholder,
- disabled: _vm.itemDisabled,
- rows: _vm.rows,
- maxlength: _vm.maxlength,
- readonly: _vm.readonly,
- name: _vm.name,
- autofocus: _vm.autofocus
- },
- domProps: { value: _vm.currentValue },
- on: {
- keyup: [
- function($event) {
- if (
- !$event.type.indexOf("key") &&
- _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
- ) {
- return null
- }
- return _vm.handleEnter.apply(null, arguments)
- },
- _vm.handleKeyup
- ],
- keypress: _vm.handleKeypress,
- keydown: _vm.handleKeydown,
- focus: _vm.handleFocus,
- blur: _vm.handleBlur,
- compositionstart: _vm.handleComposition,
- compositionupdate: _vm.handleComposition,
- compositionend: _vm.handleComposition,
- input: _vm.handleInput,
- paste: _vm.handlePaste
- }
- }),
- _vm._v(" "),
- _vm.showWordLimit
- ? _c("span", { staticClass: "ivu-input-word-count" }, [
- _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
- ])
- : _vm._e()
- ]
- ],
- 2
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-2cdade09", module.exports)
- }
- }
- /***/ }),
- /* 273 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- function injectStyle (ssrContext) {
- if (disposed) return
- __webpack_require__(274)
- __webpack_require__(276)
- }
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(278)
- /* template */
- var __vue_template__ = __webpack_require__(279)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = injectStyle
- /* scopeId */
- var __vue_scopeId__ = "data-v-32dd27c6"
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/project/task/detail/DescEditor.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-32dd27c6", Component.options)
- } else {
- hotAPI.reload("data-v-32dd27c6", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 274 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(275);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("250b4972", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DescEditor.vue", function() {
- var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DescEditor.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 275 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.desc-editor-box .desc-editor-content img {\n max-width: 100%;\n max-height: 100%;\n}\n.desc-editor-box .desc-editor-content:before {\n left: 8px !important;\n color: #cccccc !important;\n}\n.desc-editor-transfer {\n background-color: #ffffff;\n}\n.desc-editor-transfer .tox-toolbar > div:last-child > button:last-child {\n margin-right: 64px;\n}\n.desc-editor-transfer .ivu-modal-header {\n display: none;\n}\n.desc-editor-transfer .ivu-modal-close {\n top: 7px;\n z-index: 2;\n}\n.desc-editor-transfer .desc-editor-transfer-body {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body textarea {\n opacity: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body .tox-tinymce {\n border: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body .tox-tinymce .tox-statusbar span.tox-statusbar__branding a {\n display: none;\n}\n", ""]);
- // exports
- /***/ }),
- /* 276 */
- /***/ (function(module, exports, __webpack_require__) {
- // style-loader: Adds some css to the DOM by adding a <style> tag
- // load the styles
- var content = __webpack_require__(277);
- if(typeof content === 'string') content = [[module.i, content, '']];
- if(content.locals) module.exports = content.locals;
- // add the styles to the DOM
- var update = __webpack_require__(1)("7fc5d739", content, false, {});
- // Hot Module Replacement
- if(false) {
- // When the styles change, update the <style> tags
- if(!content.locals) {
- module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./DescEditor.vue", function() {
- var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./DescEditor.vue");
- if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
- update(newContent);
- });
- }
- // When the module is disposed, remove the <style> tags
- module.hot.dispose(function() { update(); });
- }
- /***/ }),
- /* 277 */
- /***/ (function(module, exports, __webpack_require__) {
- exports = module.exports = __webpack_require__(0)(false);
- // imports
- // module
- exports.push([module.i, "\n.desc-editor-box[data-v-32dd27c6] {\n position: relative;\n}\n.desc-editor-box:hover .desc-editor-tool .tool-button[data-v-32dd27c6] {\n opacity: 0.9;\n}\n.desc-editor-box:hover .desc-editor-tool .tool-button[data-v-32dd27c6]:hover {\n opacity: 1;\n}\n.desc-editor-box .desc-editor-tool[data-v-32dd27c6] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n top: 5px;\n right: 5px;\n z-index: 2;\n}\n.desc-editor-box .desc-editor-tool .tool-button[data-v-32dd27c6] {\n font-size: 12px;\n opacity: 0;\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n margin-left: 5px;\n background-color: #ffffff;\n}\n.desc-editor-box .desc-editor-load[data-v-32dd27c6] {\n position: absolute;\n right: 5px;\n bottom: 5px;\n z-index: 2;\n width: 16px;\n height: 16px;\n}\n.desc-editor-content[data-v-32dd27c6] {\n position: relative;\n margin: 10px 0 6px;\n border: 2px solid transparent;\n padding: 5px 8px;\n color: #172b4d;\n line-height: 1.5;\n border-radius: 4px;\n min-height: 56px;\n max-height: 182px;\n background: rgba(9, 30, 66, 0.04);\n overflow: auto;\n}\n.desc-editor-content[data-v-32dd27c6]:focus {\n -webkit-box-shadow: 0 0 0 2px rgba(45, 140, 240, 0.2);\n box-shadow: 0 0 0 2px rgba(45, 140, 240, 0.2);\n}\n.desc-editor-upload[data-v-32dd27c6] {\n display: none;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n", ""]);
- // exports
- /***/ }),
- /* 278 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__ImgUpload__);
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- name: 'DescEditor',
- components: { ImgUpload: __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default.a },
- props: {
- taskid: {
- default: ''
- },
- desc: {
- default: ''
- },
- placeholder: {
- type: String,
- default: ''
- }
- },
- data: function data() {
- return {
- loadIng: 0,
- uploadIng: 0,
- id: "tinymce_" + Math.round(Math.random() * 10000),
- content: '',
- submitContent: '',
- editor: null,
- editorT: null,
- cTinyMce: null,
- checkerTimeout: null,
- isTyping: false,
- transfer: false
- };
- },
- mounted: function mounted() {
- var _this = this;
- this.loadData(function (val) {
- _this.submitContent = val;
- _this.content = val;
- _this.init();
- });
- },
- beforeDestroy: function beforeDestroy() {
- if (this.editor !== null) {
- this.editor.destroy();
- }
- if (this.editorT !== null) {
- this.editorT.destroy();
- }
- },
- watch: {
- desc: function desc() {
- var _this2 = this;
- this.loadData(function (val) {
- _this2.submitContent = val;
- _this2.content = val;
- _this2.getEditor().setContent(val);
- });
- }
- },
- methods: {
- loadData: function loadData(callback) {
- var _this3 = this;
- this.loadIng++;
- $A.apiAjax({
- url: 'project/task/desc',
- data: {
- taskid: this.taskid
- },
- complete: function complete() {
- _this3.loadIng--;
- },
- success: function success(res) {
- if (res.ret === 1) {
- callback(res.data.desc);
- } else {
- callback('');
- }
- }
- });
- },
- init: function init() {
- var _this4 = this;
- this.$nextTick(function () {
- __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this4.options(false));
- });
- },
- initTransfer: function initTransfer() {
- var _this5 = this;
- this.$nextTick(function () {
- __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this5.options(true));
- });
- },
- options: function options(isFull) {
- var _this6 = this;
- var toolbar = void 0;
- if (isFull) {
- toolbar = 'undo redo | styleselect | uploadImages | bold italic underline forecolor backcolor | alignleft aligncenter alignright | outdent indent | link image emoticons media codesample | preview screenload';
- } else {
- toolbar = false;
- }
- return {
- selector: (isFull ? '#T_' : '#') + this.id,
- base_url: $A.serverUrl('js/build'),
- auto_focus: false,
- language: "zh_CN",
- toolbar: toolbar,
- plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak imagetools', 'searchreplace visualblocks code', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons paste textcolor colorpicker imagetools codesample'],
- save_onsavecallback: function save_onsavecallback(e) {
- _this6.handleBlur(e);
- },
- menubar: isFull,
- inline: !isFull,
- inline_boundaries: false,
- paste_data_images: true,
- menu: {
- view: {
- title: 'View',
- items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen screenload | showcomments'
- },
- insert: {
- title: "Insert",
- items: "image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime | uploadImages browseImages"
- }
- },
- codesample_languages: [{ text: "HTML/VUE/XML", value: "markup" }, { text: "JavaScript", value: "javascript" }, { text: "CSS", value: "css" }, { text: "PHP", value: "php" }, { text: "Ruby", value: "ruby" }, { text: "Python", value: "python" }, { text: "Java", value: "java" }, { text: "C", value: "c" }, { text: "C#", value: "csharp" }, { text: "C++", value: "cpp" }],
- height: isFull ? '100%' : $A.rightExists(this.height, '%') ? this.height : $A.runNum(this.height) || 360,
- resize: !isFull,
- convert_urls: false,
- toolbar_mode: 'sliding',
- toolbar_drawer: 'floating',
- setup: function setup(editor) {
- editor.ui.registry.addMenuButton('uploadImages', {
- text: _this6.$L('图片'),
- tooltip: _this6.$L('上传/浏览 图片'),
- fetch: function fetch(callback) {
- var items = [{
- type: 'menuitem',
- text: _this6.$L('上传图片'),
- onAction: function onAction() {
- _this6.$refs.myUpload.handleClick();
- }
- }, {
- type: 'menuitem',
- text: _this6.$L('浏览图片'),
- onAction: function onAction() {
- _this6.$refs.myUpload.browsePicture();
- }
- }];
- callback(items);
- }
- });
- editor.ui.registry.addMenuItem('uploadImages', {
- text: _this6.$L('上传图片'),
- onAction: function onAction() {
- _this6.$refs.myUpload.handleClick();
- }
- });
- editor.ui.registry.addMenuItem('browseImages', {
- text: _this6.$L('浏览图片'),
- onAction: function onAction() {
- _this6.$refs.myUpload.browsePicture();
- }
- });
- if (isFull) {
- editor.ui.registry.addButton('screenload', {
- icon: 'fullscreen',
- tooltip: _this6.$L('退出全屏'),
- onAction: function onAction() {
- _this6.closeFull();
- }
- });
- editor.ui.registry.addMenuItem('screenload', {
- text: _this6.$L('退出全屏'),
- onAction: function onAction() {
- _this6.closeFull();
- }
- });
- editor.on('Init', function (e) {
- _this6.editorT = editor;
- _this6.editorT.setContent(_this6.content);
- });
- } else {
- editor.ui.registry.addButton('screenload', {
- icon: 'fullscreen',
- tooltip: _this6.$L('全屏'),
- onAction: function onAction() {
- _this6.openFull();
- }
- });
- editor.ui.registry.addMenuItem('screenload', {
- text: _this6.$L('全屏'),
- onAction: function onAction() {
- _this6.openFull();
- }
- });
- editor.on('Init', function (e) {
- _this6.editor = editor;
- _this6.editor.setContent(_this6.content);
- _this6.$emit('editorInit', _this6.editor);
- });
- editor.on('KeyUp', function (e) {
- if (_this6.editor !== null) {
- _this6.submitNewContent();
- }
- });
- editor.on('Change', function (e) {
- if (_this6.editor !== null) {
- if (_this6.getContent() !== _this6.value) {
- _this6.submitNewContent();
- }
- _this6.$emit('editorChange', e);
- }
- });
- }
- }
- };
- },
- openFull: function openFull() {
- this.content = this.getContent();
- this.transfer = true;
- this.initTransfer();
- },
- closeFull: function closeFull() {
- this.content = this.getContent();
- this.editor.setContent(this.content);
- this.transfer = false;
- if (this.editorT != null) {
- this.editorT.destroy();
- this.editorT = null;
- }
- },
- transferChange: function transferChange(visible) {
- if (!visible) {
- this.$refs.myTextarea.focus();
- if (this.editorT != null) {
- this.content = this.editorT.getContent();
- this.editor.setContent(this.content);
- this.editorT.destroy();
- this.editorT = null;
- }
- }
- },
- getEditor: function getEditor() {
- return this.transfer ? this.editorT : this.editor;
- },
- getContent: function getContent() {
- if (this.getEditor() === null) {
- return "";
- }
- return this.getEditor().getContent();
- },
- submitNewContent: function submitNewContent() {
- var _this7 = this;
- this.isTyping = true;
- if (this.checkerTimeout !== null) {
- clearTimeout(this.checkerTimeout);
- }
- this.checkerTimeout = setTimeout(function () {
- _this7.isTyping = false;
- }, 300);
- },
- insertContent: function insertContent(content) {
- if (this.getEditor() !== null) {
- this.getEditor().insertContent(content);
- } else {
- this.content += content;
- }
- },
- insertImage: function insertImage(src) {
- this.insertContent('<img src="' + src + '">');
- },
- editorImage: function editorImage(lists) {
- for (var i = 0; i < lists.length; i++) {
- var item = lists[i];
- if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' && typeof item.url === "string") {
- this.insertImage(item.url);
- }
- }
- },
- handleBlur: function handleBlur() {
- var _this8 = this;
- this.loadIng++;
- setTimeout(function () {
- _this8.handleSave();
- _this8.loadIng--;
- }, 300);
- },
- handleSave: function handleSave() {
- var _this9 = this;
- if (this.transfer) {
- return;
- }
- if (this.submitContent != this.getContent()) {
- var bakContent = this.submitContent;
- this.submitContent = this.getContent();
- //
- this.loadIng++;
- $A.apiAjax({
- url: 'project/task/edit',
- method: 'post',
- data: {
- act: 'desc',
- taskid: this.taskid,
- content: this.submitContent
- },
- complete: function complete() {
- _this9.loadIng--;
- },
- error: function error() {
- _this9.getEditor().setContent(bakContent);
- alert(_this9.$L('网络繁忙,请稍后再试!'));
- },
- success: function success(res) {
- if (res.ret === 1) {
- $A.triggerTaskInfoListener('desc', res.data);
- $A.triggerTaskInfoChange(_this9.taskid);
- _this9.$Message.success(res.msg);
- _this9.$emit('save-success');
- } else {
- _this9.$Modal.error({ title: _this9.$L('温馨提示'), content: res.msg });
- _this9.getEditor().setContent(bakContent);
- }
- }
- });
- }
- }
- }
- });
- /***/ }),
- /* 279 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "div",
- [
- _c(
- "div",
- { staticClass: "desc-editor-box" },
- [
- _c(
- "div",
- { staticClass: "desc-editor-tool" },
- [
- _c(
- "Button",
- {
- staticClass: "tool-button",
- attrs: { size: "small" },
- on: { click: _vm.openFull }
- },
- [_vm._v(_vm._s(_vm.$L("全屏")))]
- )
- ],
- 1
- ),
- _vm._v(" "),
- _vm.loadIng > 0
- ? _c(
- "div",
- { staticClass: "desc-editor-load" },
- [_c("WLoading")],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _c("div", {
- ref: "myTextarea",
- staticClass: "desc-editor-content",
- attrs: { id: _vm.id, placeholder: _vm.placeholder },
- domProps: { innerHTML: _vm._s(_vm.content) },
- on: { blur: _vm.handleBlur }
- }),
- _vm._v(" "),
- _c("ImgUpload", {
- ref: "myUpload",
- staticClass: "desc-editor-upload",
- attrs: { type: "callback", uploadIng: _vm.uploadIng, num: "50" },
- on: {
- "update:uploadIng": function($event) {
- _vm.uploadIng = $event
- },
- "update:upload-ing": function($event) {
- _vm.uploadIng = $event
- },
- "on-callback": _vm.editorImage
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _vm.uploadIng > 0
- ? _c(
- "Spin",
- { attrs: { fix: "" } },
- [
- _c("Icon", {
- staticClass: "upload-control-spin-icon-load",
- attrs: { type: "ios-loading" }
- }),
- _vm._v(" "),
- _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "Modal",
- {
- staticClass: "desc-editor-transfer",
- attrs: { "footer-hide": "", fullscreen: "", transfer: "" },
- on: { "on-visible-change": _vm.transferChange },
- model: {
- value: _vm.transfer,
- callback: function($$v) {
- _vm.transfer = $$v
- },
- expression: "transfer"
- }
- },
- [
- _c(
- "div",
- { attrs: { slot: "close" }, slot: "close" },
- [
- _c("Button", { attrs: { type: "primary", size: "small" } }, [
- _vm._v(_vm._s(_vm.$L("完成")))
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c("div", { staticClass: "desc-editor-transfer-body" }, [
- _c(
- "textarea",
- { attrs: { id: "T_" + _vm.id, placeholder: _vm.placeholder } },
- [_vm._v(_vm._s(_vm.content))]
- )
- ]),
- _vm._v(" "),
- _vm.uploadIng > 0
- ? _c(
- "Spin",
- { attrs: { fix: "" } },
- [
- _c("Icon", {
- staticClass: "upload-control-spin-icon-load",
- attrs: { type: "ios-loading" }
- }),
- _vm._v(" "),
- _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
- ],
- 1
- )
- : _vm._e()
- ],
- 1
- )
- ],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-32dd27c6", module.exports)
- }
- }
- /***/ }),
- /* 280 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _vm.detail.isassign !== true
- ? _c(
- "div",
- {
- staticClass: "project-task-detail-window",
- class: { "task-detail-show": _vm.visible }
- },
- [
- _c("div", {
- staticClass: "task-detail-bg",
- on: { click: _vm.handleBgClose }
- }),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "task-detail-main",
- on: {
- drop: function($event) {
- $event.preventDefault()
- return _vm.commentPasteDrag($event, "drag")
- },
- dragover: function($event) {
- $event.preventDefault()
- return _vm.commentDragOver(true)
- },
- dragleave: function($event) {
- $event.preventDefault()
- return _vm.commentDragOver(false)
- }
- }
- },
- [
- _c("div", { staticClass: "detail-left" }, [
- _c(
- "div",
- { staticClass: "detail-title-box detail-icon" },
- [
- _c("Input", {
- ref: "titleInput",
- staticClass: "detail-title-input",
- attrs: {
- disabled: !!_vm.loadData.title,
- type: "textarea",
- rows: 1,
- autosize: { minRows: 1, maxRows: 5 },
- maxlength: "60"
- },
- on: {
- "on-keydown": _vm.titleKeydown,
- "on-blur": function($event) {
- return _vm.handleTask("title")
- }
- },
- model: {
- value: _vm.detail.title,
- callback: function($$v) {
- _vm.$set(_vm.detail, "title", $$v)
- },
- expression: "detail.title"
- }
- }),
- _vm._v(" "),
- _vm.detail.projectTitle &&
- _vm.urlProjectid != _vm.detail.projectid
- ? _c("div", { staticClass: "subtitle" }, [
- _vm._v(
- "\n " +
- _vm._s(_vm.$L("所属项目:")) +
- "\n "
- ),
- _c(
- "span",
- {
- staticClass: "project-title",
- on: {
- click: function($event) {
- return _vm.openProject(_vm.detail.projectid)
- }
- }
- },
- [_vm._v(_vm._s(_vm.detail.projectTitle))]
- )
- ])
- : _vm._e(),
- _vm._v(" "),
- _c("div", { staticClass: "subtitle" }, [
- _c(
- "span",
- { staticClass: "z-nick" },
- [
- _c("UserView", {
- attrs: { username: _vm.detail.createuser }
- })
- ],
- 1
- ),
- _vm._v(
- "\n " +
- _vm._s(_vm.$L("创建于:")) +
- "\n "
- ),
- _c("span", [
- _vm._v(
- _vm._s(
- _vm.$A.formatDate("Y-m-d H:i:s", _vm.detail.indate)
- )
- )
- ])
- ])
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-desc-box detail-icon" },
- [
- _c("div", { staticClass: "detail-h2" }, [
- _c("strong", { staticClass: "active" }, [
- _vm._v(_vm._s(_vm.$L("描述")))
- ])
- ]),
- _vm._v(" "),
- _c("DescEditor", {
- attrs: {
- taskid: _vm.detail.id,
- desc: _vm.detail.desc,
- placeholder: _vm.$L("添加详细描述...")
- },
- on: {
- "save-success": function($event) {
- return _vm.handleTask("desc")
- }
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c("ul", { staticClass: "detail-text-box" }, [
- _vm.detail.startdate > 0 && _vm.detail.enddate > 0
- ? _c("li", { staticClass: "text-time detail-icon" }, [
- _c("span", [_vm._v(_vm._s(_vm.$L("计划时间:")))]),
- _vm._v(" "),
- _c("em", [
- _vm._v(
- "\n " +
- _vm._s(
- _vm.$A.formatDate(
- "Y-m-d H:i",
- _vm.detail.startdate
- )
- ) +
- " " +
- _vm._s(_vm.$L("至")) +
- " " +
- _vm._s(
- _vm.$A.formatDate(
- "Y-m-d H:i",
- _vm.detail.enddate
- )
- ) +
- "\n "
- ),
- _vm.detail.overdue
- ? _c("em", { staticClass: "overdue" }, [
- _vm._v("[" + _vm._s(_vm.$L("已超期")) + "]")
- ])
- : _vm._e()
- ])
- ])
- : _vm._e(),
- _vm._v(" "),
- _c(
- "li",
- { staticClass: "text-username detail-icon" },
- [
- _c("span", [_vm._v(_vm._s(_vm.$L("负责人:")))]),
- _vm._v(" "),
- typeof _vm.detail.username !== "undefined"
- ? [
- _vm.detail.username
- ? _c(
- "em",
- [
- _c("UserView", {
- attrs: {
- username: _vm.detail.username,
- showimg: ""
- }
- })
- ],
- 1
- )
- : _c(
- "em",
- [
- _c("div", { staticClass: "uname-no" }, [
- _vm._v(_vm._s(_vm.$L("暂无负责人")))
- ]),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticClass: "uname-button",
- attrs: {
- loading: !!_vm.loadData.claim,
- type: "primary",
- size: "small"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("claimb")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("认领任务")))]
- )
- ],
- 1
- ),
- _vm._v(" "),
- _vm.detail.type == "assign" && !_vm.detail.reassign
- ? _c(
- "em",
- [
- _vm.detail.username == _vm.usrName
- ? _c(
- "Button",
- {
- staticClass: "uname-button",
- attrs: {
- type: "success",
- size: "small"
- },
- on: {
- click: function($event) {
- return _vm.handleTask(
- "reassign"
- )
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("确认接收")))]
- )
- : _c(
- "div",
- { staticClass: "uname-text" },
- [
- _vm._v(
- "[" +
- _vm._s(_vm.$L("等待确认")) +
- "]"
- )
- ]
- )
- ],
- 1
- )
- : _vm._e()
- ]
- : _vm._e()
- ],
- 2
- ),
- _vm._v(" "),
- _vm.followerLength(_vm.detail.follower) > 0
- ? _c("li", { staticClass: "text-follower detail-icon" }, [
- _c("span", [_vm._v(_vm._s(_vm.$L("关注者:")))]),
- _vm._v(" "),
- _c(
- "em",
- _vm._l(_vm.detail.follower, function(fname, findex) {
- return _c(
- "Tag",
- {
- key: findex,
- attrs: { closable: "" },
- on: {
- "on-close": function($event) {
- return _vm.handleTask("unattention", {
- username: fname,
- uisynch: true
- })
- }
- }
- },
- [
- _c("UserView", {
- attrs: { username: fname, showimg: "" }
- })
- ],
- 1
- )
- }),
- 1
- )
- ])
- : _vm._e(),
- _vm._v(" "),
- _c("li", { staticClass: "text-level detail-icon" }, [
- _c("span", [_vm._v(_vm._s(_vm.$L("优先级:")))]),
- _vm._v(" "),
- _c("em", { class: "p" + _vm.detail.level }, [
- _vm._v(_vm._s(_vm.levelFormt(_vm.detail.level)))
- ])
- ]),
- _vm._v(" "),
- _c("li", { staticClass: "text-status detail-icon" }, [
- _c("span", [_vm._v(_vm._s(_vm.$L("任务状态:")))]),
- _vm._v(" "),
- _vm.detail.complete
- ? _c("em", { staticClass: "complete" }, [
- _vm._v(_vm._s(_vm.$L("已完成"))),
- _c("span", { staticClass: "completedate" }, [
- _vm._v(
- "(" +
- _vm._s(
- _vm.$A.formatDate(
- "Y-m-d H:i",
- _vm.detail.completedate
- )
- ) +
- ")"
- )
- ])
- ])
- : _c("em", { staticClass: "unfinished" }, [
- _vm._v(_vm._s(_vm.$L("未完成")))
- ])
- ])
- ]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-h2 detail-subtask-icon detail-icon" },
- [
- _c("strong", { staticClass: "active" }, [
- _vm._v(_vm._s(_vm.$L("子任务")))
- ]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-button" },
- [
- _c(
- "Button",
- {
- staticClass: "detail-button-batch",
- attrs: { size: "small" },
- on: { click: _vm.subtaskBatchAdd }
- },
- [_vm._v(_vm._s(_vm.$L("批量添加子任务")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticClass: "detail-button-btn",
- attrs: { size: "small" },
- on: {
- click: function($event) {
- return _vm.handleTask("subtaskAdd")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("添加子任务")))]
- )
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _c("div", { staticClass: "detail-subtask-box" }, [
- _vm.detail.subtask.length == 0
- ? _c("div", { staticClass: "detail-subtask-none" }, [
- _vm._v(_vm._s(_vm.$L("暂无子任务")))
- ])
- : _c(
- "div",
- [
- _c("Progress", {
- staticClass: "detail-subtask-progress",
- attrs: {
- percent: _vm.subtaskProgress,
- "stroke-width": 5,
- status: "active"
- }
- }),
- _vm._v(" "),
- _c(
- "draggable",
- {
- attrs: {
- draggable: ".detail-subtask-item",
- animation: 150
- },
- on: {
- sort: function($event) {
- return _vm.taskSortUpdate(false)
- }
- },
- model: {
- value: _vm.detail.subtask,
- callback: function($$v) {
- _vm.$set(_vm.detail, "subtask", $$v)
- },
- expression: "detail.subtask"
- }
- },
- _vm._l(_vm.detail.subtask, function(
- subitem,
- subindex
- ) {
- return _c(
- "div",
- {
- key: subindex,
- staticClass: "detail-subtask-item"
- },
- [
- _c("Checkbox", {
- attrs: {
- "true-value": "complete",
- "false-value": "unfinished"
- },
- on: {
- "on-change": function($event) {
- return _vm.handleTask(
- "subtaskBlur",
- subindex,
- "status"
- )
- }
- },
- model: {
- value: subitem.status,
- callback: function($$v) {
- _vm.$set(subitem, "status", $$v)
- },
- expression: "subitem.status"
- }
- }),
- _vm._v(" "),
- subitem.uname
- ? _c("UserView", {
- attrs: {
- username: subitem.uname,
- imgsize: "20",
- imgfontsize: "14",
- showname: false,
- showimg: ""
- }
- })
- : _vm._e(),
- _vm._v(" "),
- _c("Input", {
- ref: "subtaskInput_" + subindex,
- refInFor: true,
- staticClass: "detail-subtask-input",
- class: {
- "subtask-complete":
- subitem.status == "complete"
- },
- attrs: {
- type: "textarea",
- readonly: subitem.status == "complete",
- rows: 1,
- autosize: { minRows: 1, maxRows: 5 },
- maxlength: "255",
- placeholder: _vm.$L("子任务描述...")
- },
- on: {
- "on-keydown": function($event) {
- return _vm.subtaskKeydown(
- subindex,
- $event
- )
- },
- "on-blur": function($event) {
- return _vm.handleTask(
- "subtaskBlur",
- subindex,
- "detail"
- )
- }
- },
- model: {
- value: subitem.detail,
- callback: function($$v) {
- _vm.$set(subitem, "detail", $$v)
- },
- expression: "subitem.detail"
- }
- }),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "detail-subtask-right",
- style:
- subitem.stip === "show"
- ? { opacity: 1 }
- : {}
- },
- [
- _c(
- "Poptip",
- {
- staticClass: "detail-subtask-ricon",
- attrs: { transfer: "" },
- on: {
- "on-popper-show": function($event) {
- return _vm.$set(
- subitem,
- "stip",
- "show"
- )
- },
- "on-popper-hide": function($event) {
- ;[
- _vm.$set(subitem, "stip", ""),
- _vm.handleTask(
- "subtaskBlur",
- subindex,
- "uname"
- )
- ]
- }
- }
- },
- [
- _c("Icon", {
- attrs: { type: "md-person" }
- }),
- _vm._v(" "),
- _c(
- "div",
- {
- attrs: { slot: "content" },
- slot: "content"
- },
- [
- _c(
- "div",
- {
- staticStyle: {
- width: "280px"
- }
- },
- [
- _vm._v(
- "\n " +
- _vm._s(
- _vm.$L("子任务负责人")
- ) +
- "\n "
- ),
- _c("UserInput", {
- staticStyle: {
- margin: "5px 0 3px"
- },
- attrs: {
- projectid:
- _vm.detail.projectid,
- transfer: false,
- placeholder: _vm.$L(
- "输入关键词搜索"
- )
- },
- model: {
- value: subitem.uname,
- callback: function($$v) {
- _vm.$set(
- subitem,
- "uname",
- $$v
- )
- },
- expression:
- "subitem.uname"
- }
- })
- ],
- 1
- )
- ]
- )
- ],
- 1
- ),
- _vm._v(" "),
- subitem.detail == ""
- ? _c(
- "div",
- {
- staticClass:
- "detail-subtask-ricon"
- },
- [
- _c("Icon", {
- attrs: { type: "md-trash" },
- on: {
- click: function($event) {
- return _vm.handleTask(
- "subtaskDelete",
- subindex,
- "delete"
- )
- }
- }
- })
- ],
- 1
- )
- : _c(
- "Poptip",
- {
- staticClass:
- "detail-subtask-ricon",
- attrs: {
- transfer: "",
- confirm: "",
- title: _vm.$L(
- "你确定你要删除这个子任务吗?"
- )
- },
- on: {
- "on-ok": function($event) {
- return _vm.handleTask(
- "subtaskDelete",
- subindex,
- "delete"
- )
- },
- "on-popper-show": function(
- $event
- ) {
- return _vm.$set(
- subitem,
- "stip",
- "show"
- )
- },
- "on-popper-hide": function(
- $event
- ) {
- return _vm.$set(
- subitem,
- "stip",
- ""
- )
- }
- }
- },
- [
- _c("Icon", {
- attrs: { type: "md-trash" }
- })
- ],
- 1
- )
- ],
- 1
- )
- ],
- 1
- )
- }),
- 0
- )
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _c(
- "div",
- {
- style: "" + (_vm.detail.filenum > 0 ? "" : "display:none")
- },
- [
- _c(
- "div",
- { staticClass: "detail-h2 detail-file-box detail-icon" },
- [
- _c("strong", { staticClass: "active" }, [
- _vm._v(_vm._s(_vm.$L("附件")))
- ]),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-button" },
- [
- _c(
- "Button",
- {
- staticClass: "detail-button-btn",
- attrs: { size: "small" },
- on: {
- click: function($event) {
- return _vm.handleTask("fileupload")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("添加附件")))]
- )
- ],
- 1
- )
- ]
- ),
- _vm._v(" "),
- _c("project-task-files", {
- ref: "projectUpload",
- attrs: {
- taskid: _vm.taskid,
- projectid: _vm.detail.projectid,
- simple: true
- },
- on: {
- change: function($event) {
- return _vm.handleTask("filechange", $event)
- }
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-h2 detail-comment-box detail-icon" },
- [
- _c(
- "strong",
- {
- staticClass: "link",
- class: { active: _vm.logType == "评论" },
- on: {
- click: function($event) {
- _vm.logType = "评论"
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("评论")))]
- ),
- _c("em"),
- _c(
- "strong",
- {
- staticClass: "link",
- class: { active: _vm.logType == "日志" },
- on: {
- click: function($event) {
- _vm.logType = "日志"
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("操作记录")))]
- )
- ]
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-log-box" },
- [
- _c("project-task-logs", {
- ref: "log",
- attrs: {
- logtype: _vm.logType,
- projectid: _vm.detail.projectid,
- taskid: _vm.taskid,
- pagesize: 5
- }
- })
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "div",
- { staticClass: "detail-footer-box" },
- [
- _c("WInput", {
- staticClass: "comment-input",
- attrs: {
- type: "textarea",
- rows: 1,
- autosize: { minRows: 1, maxRows: 3 },
- maxlength: 255,
- placeholder: _vm.$L(
- "输入评论,Enter发表评论,Shift+Enter换行"
- )
- },
- on: {
- "on-keydown": _vm.commentKeydown,
- "on-input-paste": _vm.commentPasteDrag
- },
- model: {
- value: _vm.commentText,
- callback: function($$v) {
- _vm.commentText = $$v
- },
- expression: "commentText"
- }
- }),
- _vm._v(" "),
- _c(
- "Button",
- {
- attrs: {
- loading: !!_vm.loadData.comment,
- disabled: !_vm.commentText,
- type: "primary"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("comment")
- }
- }
- },
- [_vm._v("评 论")]
- )
- ],
- 1
- )
- ]),
- _vm._v(" "),
- _vm.detail.username
- ? _c(
- "div",
- {
- staticClass: "detail-right",
- class: { "open-menu": _vm.openMenu }
- },
- [
- _vm.detail.complete
- ? _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.unfinished,
- icon: "md-checkmark-circle-outline"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("unfinished")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("标记未完成")))]
- )
- : _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.complete,
- icon: "md-radio-button-off"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("complete")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("标记已完成")))]
- ),
- _vm._v(" "),
- _c(
- "Dropdown",
- {
- staticClass: "block",
- attrs: { trigger: "click" },
- on: {
- "on-click": _vm.handleTask,
- "on-visible-change": _vm.handleSubwinToggle
- }
- },
- [
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.level,
- icon: "md-funnel"
- }
- },
- [_vm._v(_vm._s(_vm.$L("优先级")))]
- ),
- _vm._v(" "),
- _c(
- "DropdownMenu",
- { attrs: { slot: "list" }, slot: "list" },
- _vm._l([1, 2, 3, 4], function(level) {
- return _c(
- "DropdownItem",
- {
- key: level,
- class: "p" + level,
- attrs: { name: "level-" + level }
- },
- [
- _vm._v(_vm._s(_vm.levelFormt(level))),
- _vm.detail.level == level
- ? _c("Icon", {
- staticClass: "checkmark",
- attrs: { type: "md-checkmark" }
- })
- : _vm._e()
- ],
- 1
- )
- }),
- 1
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Poptip",
- {
- staticClass: "block",
- attrs: { placement: "bottom", transfer: "" },
- on: {
- "on-popper-show": function($event) {
- ;[
- _vm.handleUsernameShow(),
- _vm.handleSubwinToggle(true)
- ]
- },
- "on-popper-hide": function($event) {
- return _vm.handleSubwinToggle(false)
- }
- }
- },
- [
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.username,
- icon: "md-person"
- }
- },
- [_vm._v(_vm._s(_vm.$L("负责人")))]
- ),
- _vm._v(" "),
- _c(
- "div",
- { attrs: { slot: "content" }, slot: "content" },
- [
- _c(
- "div",
- { staticStyle: { width: "280px" } },
- [
- _vm._v(
- "\n " +
- _vm._s(_vm.$L("选择负责人")) +
- "\n "
- ),
- _c("UserInput", {
- staticStyle: { margin: "5px 0 3px" },
- attrs: {
- projectid: _vm.detail.projectid,
- nousername: _vm.detail.username,
- transfer: false,
- placeholder: _vm.$L("输入关键词搜索")
- },
- on: {
- change: function($event) {
- return _vm.handleTask(
- "usernameb",
- $event
- )
- }
- },
- model: {
- value: _vm.detail.newusername,
- callback: function($$v) {
- _vm.$set(_vm.detail, "newusername", $$v)
- },
- expression: "detail.newusername"
- }
- })
- ],
- 1
- )
- ]
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Poptip",
- {
- ref: "timeRef",
- staticClass: "block",
- attrs: { placement: "bottom", transfer: "" },
- on: {
- "on-popper-show": function($event) {
- ;[
- _vm.handleTask("inittime"),
- _vm.handleSubwinToggle(true)
- ]
- },
- "on-popper-hide": function($event) {
- return _vm.handleSubwinToggle(false)
- }
- }
- },
- [
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading:
- !!_vm.loadData.plannedtime ||
- !!_vm.loadData.unplannedtime,
- icon: "md-calendar"
- }
- },
- [_vm._v(_vm._s(_vm.$L("计划时间")))]
- ),
- _vm._v(" "),
- _c(
- "div",
- { attrs: { slot: "content" }, slot: "content" },
- [
- _c(
- "div",
- { staticStyle: { width: "280px" } },
- [
- _vm._v(
- "\n " +
- _vm._s(_vm.$L("选择日期范围")) +
- "\n "
- ),
- _c("Date-picker", {
- staticStyle: {
- display: "block",
- margin: "5px 0 3px"
- },
- attrs: {
- options: _vm.timeOptions,
- placeholder: _vm.$L("日期范围"),
- format: "yyyy-MM-dd HH:mm",
- type: "datetimerange",
- placement: "bottom"
- },
- on: {
- "on-ok": function($event) {
- return _vm.handleTask("plannedtimeb")
- },
- "on-clear": function($event) {
- return _vm.handleTask("unplannedtimeb")
- }
- },
- model: {
- value: _vm.timeValue,
- callback: function($$v) {
- _vm.timeValue = $$v
- },
- expression: "timeValue"
- }
- })
- ],
- 1
- )
- ]
- )
- ],
- 1
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: { icon: "md-attach" },
- on: {
- click: function($event) {
- return _vm.handleTask("fileupload")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("添加附件")))]
- ),
- _vm._v(" "),
- _vm.detail.username == _vm.usrName
- ? _c(
- "Poptip",
- {
- ref: "attentionRef",
- staticClass: "block",
- attrs: { placement: "bottom", transfer: "" },
- on: {
- "on-popper-show": function($event) {
- ;[
- _vm.handleAttentionShow(),
- _vm.handleSubwinToggle(true)
- ]
- },
- "on-popper-hide": function($event) {
- return _vm.handleSubwinToggle(false)
- }
- }
- },
- [
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.attention,
- icon: "md-at"
- }
- },
- [_vm._v(_vm._s(_vm.$L("关注人")))]
- ),
- _vm._v(" "),
- _c(
- "div",
- { attrs: { slot: "content" }, slot: "content" },
- [
- _c(
- "div",
- { staticStyle: { width: "280px" } },
- [
- _vm._v(
- "\n " +
- _vm._s(_vm.$L("选择关注人")) +
- "\n "
- ),
- _c("UserInput", {
- staticStyle: { margin: "5px 0 3px" },
- attrs: {
- projectid: _vm.detail.projectid,
- multiple: true,
- transfer: false,
- placeholder: _vm.$L("输入关键词搜索")
- },
- on: {
- "on-confirm": function($event) {
- return _vm.handleTask(
- "attention",
- true
- )
- }
- },
- model: {
- value: _vm.detail.attentionLists,
- callback: function($$v) {
- _vm.$set(
- _vm.detail,
- "attentionLists",
- $$v
- )
- },
- expression: "detail.attentionLists"
- }
- })
- ],
- 1
- )
- ]
- )
- ],
- 1
- )
- : _vm.haveAttention(_vm.detail.follower)
- ? _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.unattention,
- icon: "md-at"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("unattention", {
- username: _vm.usrName
- })
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("取消关注")))]
- )
- : _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.attention,
- icon: "md-at"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("attentiona")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("关注任务")))]
- ),
- _vm._v(" "),
- !_vm.detail.archived
- ? _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.archived,
- icon: "md-filing"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("archived")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("归档")))]
- )
- : _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.unarchived,
- icon: "md-filing"
- },
- on: {
- click: function($event) {
- return _vm.handleTask("unarchived")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("取消归档")))]
- ),
- _vm._v(" "),
- _c(
- "Button",
- {
- staticClass: "btn",
- attrs: {
- loading: !!_vm.loadData.delete,
- icon: "md-trash",
- type: "error",
- ghost: ""
- },
- on: {
- click: function($event) {
- return _vm.handleTask("deleteb")
- }
- }
- },
- [_vm._v(_vm._s(_vm.$L("删除")))]
- )
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _vm.detail.complete
- ? _c(
- "div",
- { staticClass: "detail-complete" },
- [
- _c("Icon", {
- attrs: { type: "md-checkmark-circle-outline" }
- })
- ],
- 1
- )
- : _vm._e(),
- _vm._v(" "),
- _c(
- "div",
- {
- staticClass: "detail-menu",
- on: {
- click: function($event) {
- _vm.openMenu = !_vm.openMenu
- }
- }
- },
- [_c("Icon", { attrs: { type: "md-menu", size: "24" } })],
- 1
- ),
- _vm._v(" "),
- _c("div", { staticClass: "detail-cancel" }, [
- _c("em", {
- on: {
- click: function($event) {
- _vm.visible = false
- }
- }
- })
- ]),
- _vm._v(" "),
- _vm.detailDragOver
- ? _c("div", { staticClass: "detail-drag-over" }, [
- _c("div", { staticClass: "detail-drag-text" }, [
- _vm._v(
- _vm._s(
- _vm.$L("拖动到这里添加附件至 %", _vm.detail.title)
- )
- )
- ])
- ])
- : _vm._e()
- ]
- )
- ]
- )
- : _vm._e()
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-57fd86f0", module.exports)
- }
- }
- /***/ }),
- /* 281 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue__ = __webpack_require__(282);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__detail_vue__);
- var detailElement = function detailElement(reportid, reporttitle) {
- return new Promise(function () {
- var custom = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.extend(__WEBPACK_IMPORTED_MODULE_1__detail_vue___default.a);
- var instance = new custom({
- data: {
- reportid: reportid,
- reporttitle: reporttitle
- }
- });
- instance.$mount();
- document.body.appendChild(instance.$el);
- });
- };
- /* harmony default export */ __webpack_exports__["a"] = (detailElement);
- /***/ }),
- /* 282 */
- /***/ (function(module, exports, __webpack_require__) {
- var disposed = false
- var normalizeComponent = __webpack_require__(2)
- /* script */
- var __vue_script__ = __webpack_require__(283)
- /* template */
- var __vue_template__ = __webpack_require__(284)
- /* template functional */
- var __vue_template_functional__ = false
- /* styles */
- var __vue_styles__ = null
- /* scopeId */
- var __vue_scopeId__ = null
- /* moduleIdentifier (server only) */
- var __vue_module_identifier__ = null
- var Component = normalizeComponent(
- __vue_script__,
- __vue_template__,
- __vue_template_functional__,
- __vue_styles__,
- __vue_scopeId__,
- __vue_module_identifier__
- )
- Component.options.__file = "resources/assets/js/main/components/report/detail/detail.vue"
- /* hot reload */
- if (false) {(function () {
- var hotAPI = require("vue-hot-reload-api")
- hotAPI.install(require("vue"), false)
- if (!hotAPI.compatible) return
- module.hot.accept()
- if (!module.hot.data) {
- hotAPI.createRecord("data-v-5954d22e", Component.options)
- } else {
- hotAPI.reload("data-v-5954d22e", Component.options)
- }
- module.hot.dispose(function (data) {
- disposed = true
- })
- })()}
- module.exports = Component.exports
- /***/ }),
- /* 283 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__content__ = __webpack_require__(64);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__content___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__content__);
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- //
- /* harmony default export */ __webpack_exports__["default"] = ({
- components: { ReportContent: __WEBPACK_IMPORTED_MODULE_0__content___default.a },
- data: function data() {
- return {
- reportid: 0,
- reporttitle: '',
- contentShow: false,
- contentTitle: '',
- contentText: ''
- };
- },
- beforeCreate: function beforeCreate() {
- var doms = document.querySelectorAll('.report-detail-window');
- for (var i = 0; i < doms.length; ++i) {
- if (doms[i].parentNode != null) doms[i].parentNode.removeChild(doms[i]);
- }
- },
- mounted: function mounted() {
- this.getDetail();
- },
- watch: {
- reportid: function reportid() {
- this.getDetail();
- }
- },
- methods: {
- getDetail: function getDetail() {
- var _this = this;
- this.contentShow = true;
- this.contentTitle = this.reporttitle;
- this.contentText = this.$L('详细内容加载中.....');
- $A.apiAjax({
- url: 'report/content?id=' + this.reportid,
- error: function error() {
- alert(_this.$L('网络繁忙,请稍后再试!'));
- _this.contentShow = false;
- },
- success: function success(res) {
- if (res.ret === 1) {
- _this.contentText = res.data.content;
- } else {
- _this.contentShow = false;
- _this.$Modal.error({ title: _this.$L('温馨提示'), content: res.msg });
- }
- }
- });
- }
- }
- });
- /***/ }),
- /* 284 */
- /***/ (function(module, exports, __webpack_require__) {
- var render = function() {
- var _vm = this
- var _h = _vm.$createElement
- var _c = _vm._self._c || _h
- return _c(
- "Modal",
- {
- staticClass: "report-detail-window",
- attrs: {
- title: _vm.contentTitle,
- width: "80%",
- styles: { top: "35px", paddingBottom: "35px" },
- footerHide: ""
- },
- model: {
- value: _vm.contentShow,
- callback: function($$v) {
- _vm.contentShow = $$v
- },
- expression: "contentShow"
- }
- },
- [_c("report-content", { attrs: { content: _vm.contentText } })],
- 1
- )
- }
- var staticRenderFns = []
- render._withStripped = true
- module.exports = { render: render, staticRenderFns: staticRenderFns }
- if (false) {
- module.hot.accept()
- if (module.hot.data) {
- require("vue-hot-reload-api") .rerender("data-v-5954d22e", module.exports)
- }
- }
- /***/ }),
- /* 285 */
- /***/ (function(module, exports) {
- // removed by extract-text-webpack-plugin
- /***/ })
- /******/ ]);
|