123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452 |
- /*!
- * TOAST UI Calendar
- * @version 1.14.1 | Wed Sep 01 2021
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- * @license MIT
- */
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("tui-code-snippet"), require("tui-date-picker"));
- else if(typeof define === 'function' && define.amd)
- define(["tui-code-snippet", "tui-date-picker"], factory);
- else if(typeof exports === 'object')
- exports["Calendar"] = factory(require("tui-code-snippet"), require("tui-date-picker"));
- else
- root["tui"] = root["tui"] || {}, root["tui"]["Calendar"] = factory((root["tui"] && root["tui"]["util"]), (root["tui"] && root["tui"]["DatePicker"]));
- })(window, function(__WEBPACK_EXTERNAL_MODULE_tui_code_snippet__, __WEBPACK_EXTERNAL_MODULE_tui_date_picker__) {
- 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 = "/dist";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ "./node_modules/dompurify/dist/purify.js":
- /*!***********************************************!*\
- !*** ./node_modules/dompurify/dist/purify.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- /*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */
- (function (global, factory) {
- true ? module.exports = factory() :
- undefined;
- }(this, function () { 'use strict';
- function _toConsumableArray(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 Array.from(arr); } }
- var hasOwnProperty = Object.hasOwnProperty,
- setPrototypeOf = Object.setPrototypeOf,
- isFrozen = Object.isFrozen,
- getPrototypeOf = Object.getPrototypeOf,
- getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var freeze = Object.freeze,
- seal = Object.seal,
- create = Object.create; // eslint-disable-line import/no-mutable-exports
- var _ref = typeof Reflect !== 'undefined' && Reflect,
- apply = _ref.apply,
- construct = _ref.construct;
- if (!apply) {
- apply = function apply(fun, thisValue, args) {
- return fun.apply(thisValue, args);
- };
- }
- if (!freeze) {
- freeze = function freeze(x) {
- return x;
- };
- }
- if (!seal) {
- seal = function seal(x) {
- return x;
- };
- }
- if (!construct) {
- construct = function construct(Func, args) {
- return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
- };
- }
- var arrayForEach = unapply(Array.prototype.forEach);
- var arrayPop = unapply(Array.prototype.pop);
- var arrayPush = unapply(Array.prototype.push);
- var stringToLowerCase = unapply(String.prototype.toLowerCase);
- var stringMatch = unapply(String.prototype.match);
- var stringReplace = unapply(String.prototype.replace);
- var stringIndexOf = unapply(String.prototype.indexOf);
- var stringTrim = unapply(String.prototype.trim);
- var regExpTest = unapply(RegExp.prototype.test);
- var typeErrorCreate = unconstruct(TypeError);
- function unapply(func) {
- return function (thisArg) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- return apply(func, thisArg, args);
- };
- }
- function unconstruct(func) {
- return function () {
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return construct(func, args);
- };
- }
- /* Add properties to a lookup table */
- function addToSet(set, array) {
- if (setPrototypeOf) {
- // Make 'in' and truthy checks like Boolean(set.constructor)
- // independent of any properties defined on Object.prototype.
- // Prevent prototype setters from intercepting set as a this value.
- setPrototypeOf(set, null);
- }
- var l = array.length;
- while (l--) {
- var element = array[l];
- if (typeof element === 'string') {
- var lcElement = stringToLowerCase(element);
- if (lcElement !== element) {
- // Config presets (e.g. tags.js, attrs.js) are immutable.
- if (!isFrozen(array)) {
- array[l] = lcElement;
- }
- element = lcElement;
- }
- }
- set[element] = true;
- }
- return set;
- }
- /* Shallow clone an object */
- function clone(object) {
- var newObject = create(null);
- var property = void 0;
- for (property in object) {
- if (apply(hasOwnProperty, object, [property])) {
- newObject[property] = object[property];
- }
- }
- return newObject;
- }
- /* IE10 doesn't support __lookupGetter__ so lets'
- * simulate it. It also automatically checks
- * if the prop is function or getter and behaves
- * accordingly. */
- function lookupGetter(object, prop) {
- while (object !== null) {
- var desc = getOwnPropertyDescriptor(object, prop);
- if (desc) {
- if (desc.get) {
- return unapply(desc.get);
- }
- if (typeof desc.value === 'function') {
- return unapply(desc.value);
- }
- }
- object = getPrototypeOf(object);
- }
- function fallbackValue(element) {
- console.warn('fallback value for', element);
- return null;
- }
- return fallbackValue;
- }
- var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
- // SVG
- var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
- var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
- // List of SVG elements that are disallowed by default.
- // We still need to know them so that we can do namespace
- // checks properly in case one wants to add them to
- // allow-list.
- var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
- var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
- // Similarly to SVG, we want to know all MathML elements,
- // even those that we disallow by default.
- var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
- var text = freeze(['#text']);
- var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
- var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
- var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
- var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
- // eslint-disable-next-line unicorn/better-regex
- var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
- var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
- var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
- var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
- var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
- );
- var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
- var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
- );
- 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 _toConsumableArray$1(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 Array.from(arr); } }
- var getGlobal = function getGlobal() {
- return typeof window === 'undefined' ? null : window;
- };
- /**
- * Creates a no-op policy for internal use only.
- * Don't export this function outside this module!
- * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
- * @param {Document} document The document object (to determine policy name suffix)
- * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
- * are not supported).
- */
- var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
- if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
- return null;
- }
- // Allow the callers to control the unique policy name
- // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
- // Policy creation with duplicate names throws in Trusted Types.
- var suffix = null;
- var ATTR_NAME = 'data-tt-policy-suffix';
- if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
- suffix = document.currentScript.getAttribute(ATTR_NAME);
- }
- var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
- try {
- return trustedTypes.createPolicy(policyName, {
- createHTML: function createHTML(html$$1) {
- return html$$1;
- }
- });
- } catch (_) {
- // Policy creation failed (most likely another DOMPurify script has
- // already run). Skip creating the policy, as this will only cause errors
- // if TT are enforced.
- console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
- return null;
- }
- };
- function createDOMPurify() {
- var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
- var DOMPurify = function DOMPurify(root) {
- return createDOMPurify(root);
- };
- /**
- * Version label, exposed for easier checks
- * if DOMPurify is up to date or not
- */
- DOMPurify.version = '2.3.1';
- /**
- * Array of elements that DOMPurify removed during sanitation.
- * Empty if nothing was removed.
- */
- DOMPurify.removed = [];
- if (!window || !window.document || window.document.nodeType !== 9) {
- // Not running in a browser, provide a factory function
- // so that you can pass your own Window
- DOMPurify.isSupported = false;
- return DOMPurify;
- }
- var originalDocument = window.document;
- var document = window.document;
- var DocumentFragment = window.DocumentFragment,
- HTMLTemplateElement = window.HTMLTemplateElement,
- Node = window.Node,
- Element = window.Element,
- NodeFilter = window.NodeFilter,
- _window$NamedNodeMap = window.NamedNodeMap,
- NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
- Text = window.Text,
- Comment = window.Comment,
- DOMParser = window.DOMParser,
- trustedTypes = window.trustedTypes;
- var ElementPrototype = Element.prototype;
- var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
- var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
- var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
- var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
- // As per issue #47, the web-components registry is inherited by a
- // new document created via createHTMLDocument. As per the spec
- // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
- // a new empty registry is used when creating a template contents owner
- // document, so we use that as our parent document to ensure nothing
- // is inherited.
- if (typeof HTMLTemplateElement === 'function') {
- var template = document.createElement('template');
- if (template.content && template.content.ownerDocument) {
- document = template.content.ownerDocument;
- }
- }
- var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
- var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
- var _document = document,
- implementation = _document.implementation,
- createNodeIterator = _document.createNodeIterator,
- createDocumentFragment = _document.createDocumentFragment,
- getElementsByTagName = _document.getElementsByTagName;
- var importNode = originalDocument.importNode;
- var documentMode = {};
- try {
- documentMode = clone(document).documentMode ? document.documentMode : {};
- } catch (_) {}
- var hooks = {};
- /**
- * Expose whether this browser supports running the full DOMPurify.
- */
- DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
- var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
- ERB_EXPR$$1 = ERB_EXPR,
- DATA_ATTR$$1 = DATA_ATTR,
- ARIA_ATTR$$1 = ARIA_ATTR,
- IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
- ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
- var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
- /**
- * We consider the elements and attributes below to be safe. Ideally
- * don't add any new ones but feel free to remove unwanted ones.
- */
- /* allowed element names */
- var ALLOWED_TAGS = null;
- var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
- /* Allowed attribute names */
- var ALLOWED_ATTR = null;
- var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
- /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
- var FORBID_TAGS = null;
- /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
- var FORBID_ATTR = null;
- /* Decide if ARIA attributes are okay */
- var ALLOW_ARIA_ATTR = true;
- /* Decide if custom data attributes are okay */
- var ALLOW_DATA_ATTR = true;
- /* Decide if unknown protocols are okay */
- var ALLOW_UNKNOWN_PROTOCOLS = false;
- /* Output should be safe for common template engines.
- * This means, DOMPurify removes data attributes, mustaches and ERB
- */
- var SAFE_FOR_TEMPLATES = false;
- /* Decide if document with <html>... should be returned */
- var WHOLE_DOCUMENT = false;
- /* Track whether config is already set on this instance of DOMPurify. */
- var SET_CONFIG = false;
- /* Decide if all elements (e.g. style, script) must be children of
- * document.body. By default, browsers might move them to document.head */
- var FORCE_BODY = false;
- /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
- * string (or a TrustedHTML object if Trusted Types are supported).
- * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
- */
- var RETURN_DOM = false;
- /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
- * string (or a TrustedHTML object if Trusted Types are supported) */
- var RETURN_DOM_FRAGMENT = false;
- /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
- * `Node` is imported into the current `Document`. If this flag is not enabled the
- * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
- * DOMPurify.
- *
- * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`
- * might cause XSS from attacks hidden in closed shadowroots in case the browser
- * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/
- */
- var RETURN_DOM_IMPORT = true;
- /* Try to return a Trusted Type object instead of a string, return a string in
- * case Trusted Types are not supported */
- var RETURN_TRUSTED_TYPE = false;
- /* Output should be free from DOM clobbering attacks? */
- var SANITIZE_DOM = true;
- /* Keep element content when removing element? */
- var KEEP_CONTENT = true;
- /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
- * of importing it into a new Document and returning a sanitized copy */
- var IN_PLACE = false;
- /* Allow usage of profiles like html, svg and mathMl */
- var USE_PROFILES = {};
- /* Tags to ignore content of when KEEP_CONTENT is true */
- var FORBID_CONTENTS = null;
- var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
- /* Tags that are safe for data: URIs */
- var DATA_URI_TAGS = null;
- var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
- /* Attributes safe for values like "javascript:" */
- var URI_SAFE_ATTRIBUTES = null;
- var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
- var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
- var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
- var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
- /* Document namespace */
- var NAMESPACE = HTML_NAMESPACE;
- var IS_EMPTY_INPUT = false;
- /* Keep a reference to config to pass to hooks */
- var CONFIG = null;
- /* Ideally, do not touch anything below this line */
- /* ______________________________________________ */
- var formElement = document.createElement('form');
- /**
- * _parseConfig
- *
- * @param {Object} cfg optional config literal
- */
- // eslint-disable-next-line complexity
- var _parseConfig = function _parseConfig(cfg) {
- if (CONFIG && CONFIG === cfg) {
- return;
- }
- /* Shield configuration object from tampering */
- if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
- cfg = {};
- }
- /* Shield configuration object from prototype pollution */
- cfg = clone(cfg);
- /* Set configuration parameters */
- ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
- ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
- URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
- DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
- FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS;
- FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
- FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
- USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
- ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
- ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
- ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
- SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
- WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
- RETURN_DOM = cfg.RETURN_DOM || false; // Default false
- RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
- RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true
- RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
- FORCE_BODY = cfg.FORCE_BODY || false; // Default false
- SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
- KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
- IN_PLACE = cfg.IN_PLACE || false; // Default false
- IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
- NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
- if (SAFE_FOR_TEMPLATES) {
- ALLOW_DATA_ATTR = false;
- }
- if (RETURN_DOM_FRAGMENT) {
- RETURN_DOM = true;
- }
- /* Parse profile info */
- if (USE_PROFILES) {
- ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
- ALLOWED_ATTR = [];
- if (USE_PROFILES.html === true) {
- addToSet(ALLOWED_TAGS, html);
- addToSet(ALLOWED_ATTR, html$1);
- }
- if (USE_PROFILES.svg === true) {
- addToSet(ALLOWED_TAGS, svg);
- addToSet(ALLOWED_ATTR, svg$1);
- addToSet(ALLOWED_ATTR, xml);
- }
- if (USE_PROFILES.svgFilters === true) {
- addToSet(ALLOWED_TAGS, svgFilters);
- addToSet(ALLOWED_ATTR, svg$1);
- addToSet(ALLOWED_ATTR, xml);
- }
- if (USE_PROFILES.mathMl === true) {
- addToSet(ALLOWED_TAGS, mathMl);
- addToSet(ALLOWED_ATTR, mathMl$1);
- addToSet(ALLOWED_ATTR, xml);
- }
- }
- /* Merge configuration parameters */
- if (cfg.ADD_TAGS) {
- if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
- ALLOWED_TAGS = clone(ALLOWED_TAGS);
- }
- addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
- }
- if (cfg.ADD_ATTR) {
- if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
- ALLOWED_ATTR = clone(ALLOWED_ATTR);
- }
- addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
- }
- if (cfg.ADD_URI_SAFE_ATTR) {
- addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
- }
- if (cfg.FORBID_CONTENTS) {
- if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
- FORBID_CONTENTS = clone(FORBID_CONTENTS);
- }
- addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS);
- }
- /* Add #text in case KEEP_CONTENT is set to true */
- if (KEEP_CONTENT) {
- ALLOWED_TAGS['#text'] = true;
- }
- /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
- if (WHOLE_DOCUMENT) {
- addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
- }
- /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
- if (ALLOWED_TAGS.table) {
- addToSet(ALLOWED_TAGS, ['tbody']);
- delete FORBID_TAGS.tbody;
- }
- // Prevent further manipulation of configuration.
- // Not available in IE8, Safari 5, etc.
- if (freeze) {
- freeze(cfg);
- }
- CONFIG = cfg;
- };
- var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
- var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
- /* Keep track of all possible SVG and MathML tags
- * so that we can perform the namespace checks
- * correctly. */
- var ALL_SVG_TAGS = addToSet({}, svg);
- addToSet(ALL_SVG_TAGS, svgFilters);
- addToSet(ALL_SVG_TAGS, svgDisallowed);
- var ALL_MATHML_TAGS = addToSet({}, mathMl);
- addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
- /**
- *
- *
- * @param {Element} element a DOM element whose namespace is being checked
- * @returns {boolean} Return false if the element has a
- * namespace that a spec-compliant parser would never
- * return. Return true otherwise.
- */
- var _checkValidNamespace = function _checkValidNamespace(element) {
- var parent = getParentNode(element);
- // In JSDOM, if we're inside shadow DOM, then parentNode
- // can be null. We just simulate parent in this case.
- if (!parent || !parent.tagName) {
- parent = {
- namespaceURI: HTML_NAMESPACE,
- tagName: 'template'
- };
- }
- var tagName = stringToLowerCase(element.tagName);
- var parentTagName = stringToLowerCase(parent.tagName);
- if (element.namespaceURI === SVG_NAMESPACE) {
- // The only way to switch from HTML namespace to SVG
- // is via <svg>. If it happens via any other tag, then
- // it should be killed.
- if (parent.namespaceURI === HTML_NAMESPACE) {
- return tagName === 'svg';
- }
- // The only way to switch from MathML to SVG is via
- // svg if parent is either <annotation-xml> or MathML
- // text integration points.
- if (parent.namespaceURI === MATHML_NAMESPACE) {
- return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
- }
- // We only allow elements that are defined in SVG
- // spec. All others are disallowed in SVG namespace.
- return Boolean(ALL_SVG_TAGS[tagName]);
- }
- if (element.namespaceURI === MATHML_NAMESPACE) {
- // The only way to switch from HTML namespace to MathML
- // is via <math>. If it happens via any other tag, then
- // it should be killed.
- if (parent.namespaceURI === HTML_NAMESPACE) {
- return tagName === 'math';
- }
- // The only way to switch from SVG to MathML is via
- // <math> and HTML integration points
- if (parent.namespaceURI === SVG_NAMESPACE) {
- return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
- }
- // We only allow elements that are defined in MathML
- // spec. All others are disallowed in MathML namespace.
- return Boolean(ALL_MATHML_TAGS[tagName]);
- }
- if (element.namespaceURI === HTML_NAMESPACE) {
- // The only way to switch from SVG to HTML is via
- // HTML integration points, and from MathML to HTML
- // is via MathML text integration points
- if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
- return false;
- }
- if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
- return false;
- }
- // Certain elements are allowed in both SVG and HTML
- // namespace. We need to specify them explicitly
- // so that they don't get erronously deleted from
- // HTML namespace.
- var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
- // We disallow tags that are specific for MathML
- // or SVG and should never appear in HTML namespace
- return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);
- }
- // The code should never reach this place (this means
- // that the element somehow got namespace that is not
- // HTML, SVG or MathML). Return false just in case.
- return false;
- };
- /**
- * _forceRemove
- *
- * @param {Node} node a DOM node
- */
- var _forceRemove = function _forceRemove(node) {
- arrayPush(DOMPurify.removed, { element: node });
- try {
- // eslint-disable-next-line unicorn/prefer-dom-node-remove
- node.parentNode.removeChild(node);
- } catch (_) {
- try {
- node.outerHTML = emptyHTML;
- } catch (_) {
- node.remove();
- }
- }
- };
- /**
- * _removeAttribute
- *
- * @param {String} name an Attribute name
- * @param {Node} node a DOM node
- */
- var _removeAttribute = function _removeAttribute(name, node) {
- try {
- arrayPush(DOMPurify.removed, {
- attribute: node.getAttributeNode(name),
- from: node
- });
- } catch (_) {
- arrayPush(DOMPurify.removed, {
- attribute: null,
- from: node
- });
- }
- node.removeAttribute(name);
- // We void attribute values for unremovable "is"" attributes
- if (name === 'is' && !ALLOWED_ATTR[name]) {
- if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
- try {
- _forceRemove(node);
- } catch (_) {}
- } else {
- try {
- node.setAttribute(name, '');
- } catch (_) {}
- }
- }
- };
- /**
- * _initDocument
- *
- * @param {String} dirty a string of dirty markup
- * @return {Document} a DOM, filled with the dirty markup
- */
- var _initDocument = function _initDocument(dirty) {
- /* Create a HTML document */
- var doc = void 0;
- var leadingWhitespace = void 0;
- if (FORCE_BODY) {
- dirty = '<remove></remove>' + dirty;
- } else {
- /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
- var matches = stringMatch(dirty, /^[\r\n\t ]+/);
- leadingWhitespace = matches && matches[0];
- }
- var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
- /*
- * Use the DOMParser API by default, fallback later if needs be
- * DOMParser not work for svg when has multiple root element.
- */
- if (NAMESPACE === HTML_NAMESPACE) {
- try {
- doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
- } catch (_) {}
- }
- /* Use createHTMLDocument in case DOMParser is not available */
- if (!doc || !doc.documentElement) {
- doc = implementation.createDocument(NAMESPACE, 'template', null);
- try {
- doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
- } catch (_) {
- // Syntax error if dirtyPayload is invalid xml
- }
- }
- var body = doc.body || doc.documentElement;
- if (dirty && leadingWhitespace) {
- body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
- }
- /* Work on whole document or just its body */
- if (NAMESPACE === HTML_NAMESPACE) {
- return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
- }
- return WHOLE_DOCUMENT ? doc.documentElement : body;
- };
- /**
- * _createIterator
- *
- * @param {Document} root document/fragment to create iterator for
- * @return {Iterator} iterator instance
- */
- var _createIterator = function _createIterator(root) {
- return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
- };
- /**
- * _isClobbered
- *
- * @param {Node} elm element to check for clobbering attacks
- * @return {Boolean} true if clobbered, false if safe
- */
- var _isClobbered = function _isClobbered(elm) {
- if (elm instanceof Text || elm instanceof Comment) {
- return false;
- }
- if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {
- return true;
- }
- return false;
- };
- /**
- * _isNode
- *
- * @param {Node} obj object to check whether it's a DOM node
- * @return {Boolean} true is object is a DOM node
- */
- var _isNode = function _isNode(object) {
- return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
- };
- /**
- * _executeHook
- * Execute user configurable hooks
- *
- * @param {String} entryPoint Name of the hook's entry point
- * @param {Node} currentNode node to work on with the hook
- * @param {Object} data additional hook parameters
- */
- var _executeHook = function _executeHook(entryPoint, currentNode, data) {
- if (!hooks[entryPoint]) {
- return;
- }
- arrayForEach(hooks[entryPoint], function (hook) {
- hook.call(DOMPurify, currentNode, data, CONFIG);
- });
- };
- /**
- * _sanitizeElements
- *
- * @protect nodeName
- * @protect textContent
- * @protect removeChild
- *
- * @param {Node} currentNode to check for permission to exist
- * @return {Boolean} true if node was killed, false if left alive
- */
- var _sanitizeElements = function _sanitizeElements(currentNode) {
- var content = void 0;
- /* Execute a hook if present */
- _executeHook('beforeSanitizeElements', currentNode, null);
- /* Check if element is clobbered or can clobber */
- if (_isClobbered(currentNode)) {
- _forceRemove(currentNode);
- return true;
- }
- /* Check if tagname contains Unicode */
- if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
- _forceRemove(currentNode);
- return true;
- }
- /* Now let's check the element's type and name */
- var tagName = stringToLowerCase(currentNode.nodeName);
- /* Execute a hook if present */
- _executeHook('uponSanitizeElement', currentNode, {
- tagName: tagName,
- allowedTags: ALLOWED_TAGS
- });
- /* Detect mXSS attempts abusing namespace confusion */
- if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
- _forceRemove(currentNode);
- return true;
- }
- /* Mitigate a problem with templates inside select */
- if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {
- _forceRemove(currentNode);
- return true;
- }
- /* Remove element if anything forbids its presence */
- if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
- /* Keep content except for bad-listed elements */
- if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
- var parentNode = getParentNode(currentNode) || currentNode.parentNode;
- var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
- if (childNodes && parentNode) {
- var childCount = childNodes.length;
- for (var i = childCount - 1; i >= 0; --i) {
- parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
- }
- }
- }
- _forceRemove(currentNode);
- return true;
- }
- /* Check whether element has a valid namespace */
- if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
- _forceRemove(currentNode);
- return true;
- }
- if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
- _forceRemove(currentNode);
- return true;
- }
- /* Sanitize element content to be template-safe */
- if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
- /* Get the element's text content */
- content = currentNode.textContent;
- content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
- content = stringReplace(content, ERB_EXPR$$1, ' ');
- if (currentNode.textContent !== content) {
- arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
- currentNode.textContent = content;
- }
- }
- /* Execute a hook if present */
- _executeHook('afterSanitizeElements', currentNode, null);
- return false;
- };
- /**
- * _isValidAttribute
- *
- * @param {string} lcTag Lowercase tag name of containing element.
- * @param {string} lcName Lowercase attribute name.
- * @param {string} value Attribute value.
- * @return {Boolean} Returns true if `value` is valid, otherwise false.
- */
- // eslint-disable-next-line complexity
- var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
- /* Make sure attribute cannot clobber */
- if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
- return false;
- }
- /* Allow valid data-* attributes: At least one character after "-"
- (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
- XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
- We don't need to check the value; it's always URI safe. */
- if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
- return false;
- /* Check value is safe. First, is attr inert? If so, is safe */
- } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
- return false;
- }
- return true;
- };
- /**
- * _sanitizeAttributes
- *
- * @protect attributes
- * @protect nodeName
- * @protect removeAttribute
- * @protect setAttribute
- *
- * @param {Node} currentNode to sanitize
- */
- var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
- var attr = void 0;
- var value = void 0;
- var lcName = void 0;
- var l = void 0;
- /* Execute a hook if present */
- _executeHook('beforeSanitizeAttributes', currentNode, null);
- var attributes = currentNode.attributes;
- /* Check if we have attributes; if not we might have a text node */
- if (!attributes) {
- return;
- }
- var hookEvent = {
- attrName: '',
- attrValue: '',
- keepAttr: true,
- allowedAttributes: ALLOWED_ATTR
- };
- l = attributes.length;
- /* Go backwards over all attributes; safely remove bad ones */
- while (l--) {
- attr = attributes[l];
- var _attr = attr,
- name = _attr.name,
- namespaceURI = _attr.namespaceURI;
- value = stringTrim(attr.value);
- lcName = stringToLowerCase(name);
- /* Execute a hook if present */
- hookEvent.attrName = lcName;
- hookEvent.attrValue = value;
- hookEvent.keepAttr = true;
- hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
- _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
- value = hookEvent.attrValue;
- /* Did the hooks approve of the attribute? */
- if (hookEvent.forceKeepAttr) {
- continue;
- }
- /* Remove attribute */
- _removeAttribute(name, currentNode);
- /* Did the hooks approve of the attribute? */
- if (!hookEvent.keepAttr) {
- continue;
- }
- /* Work around a security issue in jQuery 3.0 */
- if (regExpTest(/\/>/i, value)) {
- _removeAttribute(name, currentNode);
- continue;
- }
- /* Sanitize attribute content to be template-safe */
- if (SAFE_FOR_TEMPLATES) {
- value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
- value = stringReplace(value, ERB_EXPR$$1, ' ');
- }
- /* Is `value` valid for this attribute? */
- var lcTag = currentNode.nodeName.toLowerCase();
- if (!_isValidAttribute(lcTag, lcName, value)) {
- continue;
- }
- /* Handle invalid data-* attribute set by try-catching it */
- try {
- if (namespaceURI) {
- currentNode.setAttributeNS(namespaceURI, name, value);
- } else {
- /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
- currentNode.setAttribute(name, value);
- }
- arrayPop(DOMPurify.removed);
- } catch (_) {}
- }
- /* Execute a hook if present */
- _executeHook('afterSanitizeAttributes', currentNode, null);
- };
- /**
- * _sanitizeShadowDOM
- *
- * @param {DocumentFragment} fragment to iterate over recursively
- */
- var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
- var shadowNode = void 0;
- var shadowIterator = _createIterator(fragment);
- /* Execute a hook if present */
- _executeHook('beforeSanitizeShadowDOM', fragment, null);
- while (shadowNode = shadowIterator.nextNode()) {
- /* Execute a hook if present */
- _executeHook('uponSanitizeShadowNode', shadowNode, null);
- /* Sanitize tags and elements */
- if (_sanitizeElements(shadowNode)) {
- continue;
- }
- /* Deep shadow DOM detected */
- if (shadowNode.content instanceof DocumentFragment) {
- _sanitizeShadowDOM(shadowNode.content);
- }
- /* Check attributes, sanitize if necessary */
- _sanitizeAttributes(shadowNode);
- }
- /* Execute a hook if present */
- _executeHook('afterSanitizeShadowDOM', fragment, null);
- };
- /**
- * Sanitize
- * Public method providing core sanitation functionality
- *
- * @param {String|Node} dirty string or DOM node
- * @param {Object} configuration object
- */
- // eslint-disable-next-line complexity
- DOMPurify.sanitize = function (dirty, cfg) {
- var body = void 0;
- var importedNode = void 0;
- var currentNode = void 0;
- var oldNode = void 0;
- var returnNode = void 0;
- /* Make sure we have a string to sanitize.
- DO NOT return early, as this will return the wrong type if
- the user has requested a DOM object rather than a string */
- IS_EMPTY_INPUT = !dirty;
- if (IS_EMPTY_INPUT) {
- dirty = '<!-->';
- }
- /* Stringify, in case dirty is an object */
- if (typeof dirty !== 'string' && !_isNode(dirty)) {
- // eslint-disable-next-line no-negated-condition
- if (typeof dirty.toString !== 'function') {
- throw typeErrorCreate('toString is not a function');
- } else {
- dirty = dirty.toString();
- if (typeof dirty !== 'string') {
- throw typeErrorCreate('dirty is not a string, aborting');
- }
- }
- }
- /* Check we can run. Otherwise fall back or ignore */
- if (!DOMPurify.isSupported) {
- if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
- if (typeof dirty === 'string') {
- return window.toStaticHTML(dirty);
- }
- if (_isNode(dirty)) {
- return window.toStaticHTML(dirty.outerHTML);
- }
- }
- return dirty;
- }
- /* Assign config vars */
- if (!SET_CONFIG) {
- _parseConfig(cfg);
- }
- /* Clean up removed elements */
- DOMPurify.removed = [];
- /* Check if dirty is correctly typed for IN_PLACE */
- if (typeof dirty === 'string') {
- IN_PLACE = false;
- }
- if (IN_PLACE) ; else if (dirty instanceof Node) {
- /* If dirty is a DOM element, append to an empty document to avoid
- elements being stripped by the parser */
- body = _initDocument('<!---->');
- importedNode = body.ownerDocument.importNode(dirty, true);
- if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
- /* Node is already a body, use as is */
- body = importedNode;
- } else if (importedNode.nodeName === 'HTML') {
- body = importedNode;
- } else {
- // eslint-disable-next-line unicorn/prefer-dom-node-append
- body.appendChild(importedNode);
- }
- } else {
- /* Exit directly if we have nothing to do */
- if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
- // eslint-disable-next-line unicorn/prefer-includes
- dirty.indexOf('<') === -1) {
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
- }
- /* Initialize the document to work on */
- body = _initDocument(dirty);
- /* Check we have a DOM node from the data */
- if (!body) {
- return RETURN_DOM ? null : emptyHTML;
- }
- }
- /* Remove first element node (ours) if FORCE_BODY is set */
- if (body && FORCE_BODY) {
- _forceRemove(body.firstChild);
- }
- /* Get node iterator */
- var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
- /* Now start iterating over the created document */
- while (currentNode = nodeIterator.nextNode()) {
- /* Fix IE's strange behavior with manipulated textNodes #89 */
- if (currentNode.nodeType === 3 && currentNode === oldNode) {
- continue;
- }
- /* Sanitize tags and elements */
- if (_sanitizeElements(currentNode)) {
- continue;
- }
- /* Shadow DOM detected, sanitize it */
- if (currentNode.content instanceof DocumentFragment) {
- _sanitizeShadowDOM(currentNode.content);
- }
- /* Check attributes, sanitize if necessary */
- _sanitizeAttributes(currentNode);
- oldNode = currentNode;
- }
- oldNode = null;
- /* If we sanitized `dirty` in-place, return it. */
- if (IN_PLACE) {
- return dirty;
- }
- /* Return sanitized string or DOM */
- if (RETURN_DOM) {
- if (RETURN_DOM_FRAGMENT) {
- returnNode = createDocumentFragment.call(body.ownerDocument);
- while (body.firstChild) {
- // eslint-disable-next-line unicorn/prefer-dom-node-append
- returnNode.appendChild(body.firstChild);
- }
- } else {
- returnNode = body;
- }
- if (RETURN_DOM_IMPORT) {
- /*
- AdoptNode() is not used because internal state is not reset
- (e.g. the past names map of a HTMLFormElement), this is safe
- in theory but we would rather not risk another attack vector.
- The state that is cloned by importNode() is explicitly defined
- by the specs.
- */
- returnNode = importNode.call(originalDocument, returnNode, true);
- }
- return returnNode;
- }
- var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
- /* Sanitize final string template-safe */
- if (SAFE_FOR_TEMPLATES) {
- serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
- serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
- }
- return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
- };
- /**
- * Public method to set the configuration once
- * setConfig
- *
- * @param {Object} cfg configuration object
- */
- DOMPurify.setConfig = function (cfg) {
- _parseConfig(cfg);
- SET_CONFIG = true;
- };
- /**
- * Public method to remove the configuration
- * clearConfig
- *
- */
- DOMPurify.clearConfig = function () {
- CONFIG = null;
- SET_CONFIG = false;
- };
- /**
- * Public method to check if an attribute value is valid.
- * Uses last set config, if any. Otherwise, uses config defaults.
- * isValidAttribute
- *
- * @param {string} tag Tag name of containing element.
- * @param {string} attr Attribute name.
- * @param {string} value Attribute value.
- * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
- */
- DOMPurify.isValidAttribute = function (tag, attr, value) {
- /* Initialize shared config vars if necessary. */
- if (!CONFIG) {
- _parseConfig({});
- }
- var lcTag = stringToLowerCase(tag);
- var lcName = stringToLowerCase(attr);
- return _isValidAttribute(lcTag, lcName, value);
- };
- /**
- * AddHook
- * Public method to add DOMPurify hooks
- *
- * @param {String} entryPoint entry point for the hook to add
- * @param {Function} hookFunction function to execute
- */
- DOMPurify.addHook = function (entryPoint, hookFunction) {
- if (typeof hookFunction !== 'function') {
- return;
- }
- hooks[entryPoint] = hooks[entryPoint] || [];
- arrayPush(hooks[entryPoint], hookFunction);
- };
- /**
- * RemoveHook
- * Public method to remove a DOMPurify hook at a given entryPoint
- * (pops it from the stack of hooks if more are present)
- *
- * @param {String} entryPoint entry point for the hook to remove
- */
- DOMPurify.removeHook = function (entryPoint) {
- if (hooks[entryPoint]) {
- arrayPop(hooks[entryPoint]);
- }
- };
- /**
- * RemoveHooks
- * Public method to remove all DOMPurify hooks at a given entryPoint
- *
- * @param {String} entryPoint entry point for the hooks to remove
- */
- DOMPurify.removeHooks = function (entryPoint) {
- if (hooks[entryPoint]) {
- hooks[entryPoint] = [];
- }
- };
- /**
- * RemoveAllHooks
- * Public method to remove all DOMPurify hooks
- *
- */
- DOMPurify.removeAllHooks = function () {
- hooks = {};
- };
- return DOMPurify;
- }
- var purify = createDOMPurify();
- return purify;
- }));
- //# sourceMappingURL=purify.js.map
- /***/ }),
- /***/ "./node_modules/handlebars-template-loader/runtime/index.js":
- /*!******************************************************************!*\
- !*** ./node_modules/handlebars-template-loader/runtime/index.js ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(/*! handlebars/runtime */ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js");
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js":
- /*!****************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars.runtime.js ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- // istanbul ignore next
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
- var _handlebarsBase = __webpack_require__(/*! ./handlebars/base */ "./node_modules/handlebars/dist/cjs/handlebars/base.js");
- var base = _interopRequireWildcard(_handlebarsBase);
- // Each of these augment the Handlebars object. No need to setup here.
- // (This is done to easily share code between commonjs and browse envs)
- var _handlebarsSafeString = __webpack_require__(/*! ./handlebars/safe-string */ "./node_modules/handlebars/dist/cjs/handlebars/safe-string.js");
- var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
- var _handlebarsException = __webpack_require__(/*! ./handlebars/exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
- var _handlebarsUtils = __webpack_require__(/*! ./handlebars/utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var Utils = _interopRequireWildcard(_handlebarsUtils);
- var _handlebarsRuntime = __webpack_require__(/*! ./handlebars/runtime */ "./node_modules/handlebars/dist/cjs/handlebars/runtime.js");
- var runtime = _interopRequireWildcard(_handlebarsRuntime);
- var _handlebarsNoConflict = __webpack_require__(/*! ./handlebars/no-conflict */ "./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js");
- var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
- // For compatibility and usage outside of module systems, make the Handlebars object a namespace
- function create() {
- var hb = new base.HandlebarsEnvironment();
- Utils.extend(hb, base);
- hb.SafeString = _handlebarsSafeString2['default'];
- hb.Exception = _handlebarsException2['default'];
- hb.Utils = Utils;
- hb.escapeExpression = Utils.escapeExpression;
- hb.VM = runtime;
- hb.template = function (spec) {
- return runtime.template(spec, hb);
- };
- return hb;
- }
- var inst = create();
- inst.create = create;
- _handlebarsNoConflict2['default'](inst);
- inst['default'] = inst;
- exports['default'] = inst;
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLnJ1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OEJBQXNCLG1CQUFtQjs7SUFBN0IsSUFBSTs7Ozs7b0NBSU8sMEJBQTBCOzs7O21DQUMzQix3QkFBd0I7Ozs7K0JBQ3ZCLG9CQUFvQjs7SUFBL0IsS0FBSzs7aUNBQ1Esc0JBQXNCOztJQUFuQyxPQUFPOztvQ0FFSSwwQkFBMEI7Ozs7O0FBR2pELFNBQVMsTUFBTSxHQUFHO0FBQ2hCLE1BQUksRUFBRS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bHQnXSA9IGluc3Q7XG5cbmV4cG9ydCBkZWZhdWx0IGluc3Q7XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/base.js":
- /*!*************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/base.js ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.HandlebarsEnvironment = HandlebarsEnvironment;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var _exception = __webpack_require__(/*! ./exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- var _helpers = __webpack_require__(/*! ./helpers */ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js");
- var _decorators = __webpack_require__(/*! ./decorators */ "./node_modules/handlebars/dist/cjs/handlebars/decorators.js");
- var _logger = __webpack_require__(/*! ./logger */ "./node_modules/handlebars/dist/cjs/handlebars/logger.js");
- var _logger2 = _interopRequireDefault(_logger);
- var _internalProtoAccess = __webpack_require__(/*! ./internal/proto-access */ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js");
- var VERSION = '4.7.7';
- exports.VERSION = VERSION;
- var COMPILER_REVISION = 8;
- exports.COMPILER_REVISION = COMPILER_REVISION;
- var LAST_COMPATIBLE_COMPILER_REVISION = 7;
- exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
- var REVISION_CHANGES = {
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
- 2: '== 1.0.0-rc.3',
- 3: '== 1.0.0-rc.4',
- 4: '== 1.x.x',
- 5: '== 2.0.0-alpha.x',
- 6: '>= 2.0.0-beta.1',
- 7: '>= 4.0.0 <4.3.0',
- 8: '>= 4.3.0'
- };
- exports.REVISION_CHANGES = REVISION_CHANGES;
- var objectType = '[object Object]';
- function HandlebarsEnvironment(helpers, partials, decorators) {
- this.helpers = helpers || {};
- this.partials = partials || {};
- this.decorators = decorators || {};
- _helpers.registerDefaultHelpers(this);
- _decorators.registerDefaultDecorators(this);
- }
- HandlebarsEnvironment.prototype = {
- constructor: HandlebarsEnvironment,
- logger: _logger2['default'],
- log: _logger2['default'].log,
- registerHelper: function registerHelper(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple helpers');
- }
- _utils.extend(this.helpers, name);
- } else {
- this.helpers[name] = fn;
- }
- },
- unregisterHelper: function unregisterHelper(name) {
- delete this.helpers[name];
- },
- registerPartial: function registerPartial(name, partial) {
- if (_utils.toString.call(name) === objectType) {
- _utils.extend(this.partials, name);
- } else {
- if (typeof partial === 'undefined') {
- throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
- }
- this.partials[name] = partial;
- }
- },
- unregisterPartial: function unregisterPartial(name) {
- delete this.partials[name];
- },
- registerDecorator: function registerDecorator(name, fn) {
- if (_utils.toString.call(name) === objectType) {
- if (fn) {
- throw new _exception2['default']('Arg not supported with multiple decorators');
- }
- _utils.extend(this.decorators, name);
- } else {
- this.decorators[name] = fn;
- }
- },
- unregisterDecorator: function unregisterDecorator(name) {
- delete this.decorators[name];
- },
- /**
- * Reset the memory of illegal property accesses that have already been logged.
- * @deprecated should only be used in handlebars test-cases
- */
- resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
- _internalProtoAccess.resetLoggedProperties();
- }
- };
- var log = _logger2['default'].log;
- exports.log = log;
- exports.createFrame = _utils.createFrame;
- exports.logger = _logger2['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ij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YXRvcjogZnVuY3Rpb24obmFtZSwgZm4pIHtcbiAgICBpZiAodG9TdHJpbmcuY2FsbChuYW1lKSA9PT0gb2JqZWN0VHlwZSkge1xuICAgICAgaWYgKGZuKSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ0FyZyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgZGVjb3JhdG9ycycpO1xuICAgICAgfVxuICAgICAgZXh0ZW5kKHRoaXMuZGVjb3JhdG9ycywgbmFtZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMuZGVjb3JhdG9yc1tuYW1lXSA9IGZuO1xuICAgIH1cbiAgfSxcbiAgdW5yZWdpc3RlckRlY29yYXRvcjogZnVuY3Rpb24obmFtZSkge1xuICAgIGRlbGV0ZSB0aGlzLmRlY29yYXRvcnNbbmFtZV07XG4gIH0sXG4gIC8qKlxuICAgKiBSZXNldCB0aGUgbWVtb3J5IG9mIGlsbGVnYWwgcHJvcGVydHkgYWNjZXNzZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBsb2dnZWQuXG4gICAqIEBkZXByZWNhdGVkIHNob3VsZCBvbmx5IGJlIHVzZWQgaW4gaGFuZGxlYmFycyB0ZXN0LWNhc2VzXG4gICAqL1xuICByZXNldExvZ2dlZFByb3BlcnR5QWNjZXNzZXMoKSB7XG4gICAgcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCk7XG4gIH1cbn07XG5cbmV4cG9ydCBsZXQgbG9nID0gbG9nZ2VyLmxvZztcblxuZXhwb3J0IHsgY3JlYXRlRnJhbWUsIGxvZ2dlciB9O1xuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/decorators.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/decorators.js ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.registerDefaultDecorators = registerDefaultDecorators;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _decoratorsInline = __webpack_require__(/*! ./decorators/inline */ "./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js");
- var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
- function registerDefaultDecorators(instance) {
- _decoratorsInline2['default'](instance);
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Z0NBQTJCLHFCQUFxQjs7OztBQUV6QyxTQUFTLHlCQUF5QixDQUFDLFFBQVEsRUFBRTtBQUNsRCxnQ0FBZSxRQUFRLENBQUMsQ0FBQztDQUMxQiIsImZpbGUiOiJkZWNvcmF0b3JzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVySW5saW5lIGZyb20gJy4vZGVjb3JhdG9ycy9pbmxpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVnaXN0ZXJEZWZhdWx0RGVjb3JhdG9ycyhpbnN0YW5jZSkge1xuICByZWdpc3RlcklubGluZShpbnN0YW5jZSk7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js":
- /*!**************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js ***!
- \**************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- exports['default'] = function (instance) {
- instance.registerDecorator('inline', function (fn, props, container, options) {
- var ret = fn;
- if (!props.partials) {
- props.partials = {};
- ret = function (context, options) {
- // Create a new partials stack frame prior to exec.
- var original = container.partials;
- container.partials = _utils.extend({}, original, props.partials);
- var ret = fn(context, options);
- container.partials = original;
- return ret;
- };
- }
- props.partials[options.args[0]] = options.fn;
- return ret;
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMvaW5saW5lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQXVCLFVBQVU7O3FCQUVsQixVQUFTLFFBQVEsRUFBRTtBQUNoQyxVQUFRLENBQUMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVMsRUFBRSxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFO0FBQzNFLFFBQUksR0FBRyxHQUFHLEVBQUUsQ0FBQztBQUNiLFFBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFO0FBQ25CLFdBQUssQ0FBQyxRQUFRLEdBQUcsRUFBRSxDQUFDO0FBQ3BCLFNBQUcsR0FBRyxVQUFTLE9BQU8sRUFBRSxPQUFPLEVBQUU7O0FBRS9CLFlBQUksUUFBUSxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUM7QUFDbEMsaUJBQVMsQ0FBQyxRQUFRLEdBQUcsY0FBTyxFQUFFLEVBQUUsUUFBUSxFQUFFLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMxRCxZQUFJLEdBQUcsR0FBRyxFQUFFLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0FBQy9CLGlCQUFTLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUM5QixlQUFPLEdBQUcsQ0FBQztPQUNaLENBQUM7S0FDSDs7QUFFRCxTQUFLLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDOztBQUU3QyxXQUFPLEdBQUcsQ0FBQztHQUNaLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6ImlubGluZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGV4dGVuZCB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJEZWNvcmF0b3IoJ2lubGluZScsIGZ1bmN0aW9uKGZuLCBwcm9wcywgY29udGFpbmVyLCBvcHRpb25zKSB7XG4gICAgbGV0IHJldCA9IGZuO1xuICAgIGlmICghcHJvcHMucGFydGlhbHMpIHtcbiAgICAgIHByb3BzLnBhcnRpYWxzID0ge307XG4gICAgICByZXQgPSBmdW5jdGlvbihjb250ZXh0LCBvcHRpb25zKSB7XG4gICAgICAgIC8vIENyZWF0ZSBhIG5ldyBwYXJ0aWFscyBzdGFjayBmcmFtZSBwcmlvciB0byBleGVjLlxuICAgICAgICBsZXQgb3JpZ2luYWwgPSBjb250YWluZXIucGFydGlhbHM7XG4gICAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IGV4dGVuZCh7fSwgb3JpZ2luYWwsIHByb3BzLnBhcnRpYWxzKTtcbiAgICAgICAgbGV0IHJldCA9IGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgICAgICBjb250YWluZXIucGFydGlhbHMgPSBvcmlnaW5hbDtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgIH07XG4gICAgfVxuXG4gICAgcHJvcHMucGFydGlhbHNbb3B0aW9ucy5hcmdzWzBdXSA9IG9wdGlvbnMuZm47XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/exception.js":
- /*!******************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/exception.js ***!
- \******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
- function Exception(message, node) {
- var loc = node && node.loc,
- line = undefined,
- endLineNumber = undefined,
- column = undefined,
- endColumn = undefined;
- if (loc) {
- line = loc.start.line;
- endLineNumber = loc.end.line;
- column = loc.start.column;
- endColumn = loc.end.column;
- message += ' - ' + line + ':' + column;
- }
- var tmp = Error.prototype.constructor.call(this, message);
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
- for (var idx = 0; idx < errorProps.length; idx++) {
- this[errorProps[idx]] = tmp[errorProps[idx]];
- }
- /* istanbul ignore else */
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, Exception);
- }
- try {
- if (loc) {
- this.lineNumber = line;
- this.endLineNumber = endLineNumber;
- // Work around issue under safari where we can't directly set the column value
- /* istanbul ignore next */
- if (Object.defineProperty) {
- Object.defineProperty(this, 'column', {
- value: column,
- enumerable: true
- });
- Object.defineProperty(this, 'endColumn', {
- value: endColumn,
- enumerable: true
- });
- } else {
- this.column = column;
- this.endColumn = endColumn;
- }
- }
- } catch (nop) {
- /* Ignore if the browser is very particular */
- }
- }
- Exception.prototype = new Error();
- exports['default'] = Exception;
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2V4Y2VwdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxJQUFNLFVBQVUsR0FBRyxDQUNqQixhQUFhLEVBQ2IsVUFBVSxFQUNWLFlBQVksRUFDWixlQUFlLEVBQ2YsU0FBUyxFQUNULE1BQU0sRUFDTixRQUFRLEVBQ1IsT0FBTyxDQUNSLENBQUM7O0FBRUYsU0FBUyxTQUFTLENBQ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3JlIG5leHQgKi9cbiAgICAgIGlmIChPYmplY3QuZGVmaW5lUHJvcGVydHkpIHtcbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdjb2x1bW4nLCB7XG4gICAgICAgICAgdmFsdWU6IGNvbHVtbixcbiAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlXG4gICAgICAgIH0pO1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2VuZENvbHVtbicsIHtcbiAgICAgICAgICB2YWx1ZTogZW5kQ29sdW1uLFxuICAgICAgICAgIGVudW1lcmFibGU6IHRydWVcbiAgICAgICAgfSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgdGhpcy5lbmRDb2x1bW4gPSBlbmRDb2x1bW47XG4gICAgICB9XG4gICAgfVxuICB9IGNhdGNoIChub3ApIHtcbiAgICAvKiBJZ25vcmUgaWYgdGhlIGJyb3dzZXIgaXMgdmVyeSBwYXJ0aWN1bGFyICovXG4gIH1cbn1cblxuRXhjZXB0aW9uLnByb3RvdHlwZSA9IG5ldyBFcnJvcigpO1xuXG5leHBvcnQgZGVmYXVsdCBFeGNlcHRpb247XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js":
- /*!****************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers.js ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.registerDefaultHelpers = registerDefaultHelpers;
- exports.moveHelperToHooks = moveHelperToHooks;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _helpersBlockHelperMissing = __webpack_require__(/*! ./helpers/block-helper-missing */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js");
- var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
- var _helpersEach = __webpack_require__(/*! ./helpers/each */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js");
- var _helpersEach2 = _interopRequireDefault(_helpersEach);
- var _helpersHelperMissing = __webpack_require__(/*! ./helpers/helper-missing */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js");
- var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
- var _helpersIf = __webpack_require__(/*! ./helpers/if */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js");
- var _helpersIf2 = _interopRequireDefault(_helpersIf);
- var _helpersLog = __webpack_require__(/*! ./helpers/log */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js");
- var _helpersLog2 = _interopRequireDefault(_helpersLog);
- var _helpersLookup = __webpack_require__(/*! ./helpers/lookup */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js");
- var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
- var _helpersWith = __webpack_require__(/*! ./helpers/with */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js");
- var _helpersWith2 = _interopRequireDefault(_helpersWith);
- function registerDefaultHelpers(instance) {
- _helpersBlockHelperMissing2['default'](instance);
- _helpersEach2['default'](instance);
- _helpersHelperMissing2['default'](instance);
- _helpersIf2['default'](instance);
- _helpersLog2['default'](instance);
- _helpersLookup2['default'](instance);
- _helpersWith2['default'](instance);
- }
- function moveHelperToHooks(instance, helperName, keepHelper) {
- if (instance.helpers[helperName]) {
- instance.hooks[helperName] = instance.helpers[helperName];
- if (!keepHelper) {
- delete instance.helpers[helperName];
- }
- }
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O3lDQUF1QyxnQ0FBZ0M7Ozs7M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NpbmcgZnJvbSAnLi9oZWxwZXJzL2hlbHBlci1taXNzaW5nJztcbmltcG9ydCByZWdpc3RlcklmIGZyb20gJy4vaGVscGVycy9pZic7XG5pbXBvcnQgcmVnaXN0ZXJMb2cgZnJvbSAnLi9oZWxwZXJzL2xvZyc7XG5pbXBvcnQgcmVnaXN0ZXJMb29rdXAgZnJvbSAnLi9oZWxwZXJzL2xvb2t1cCc7XG5pbXBvcnQgcmVnaXN0ZXJXaXRoIGZyb20gJy4vaGVscGVycy93aXRoJztcblxuZXhwb3J0IGZ1bmN0aW9uIHJlZ2lzdGVyRGVmYXVsdEhlbHBlcnMoaW5zdGFuY2UpIHtcbiAgcmVnaXN0ZXJCbG9ja0hlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlckVhY2goaW5zdGFuY2UpO1xuICByZWdpc3RlckhlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlcklmKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb2coaW5zdGFuY2UpO1xuICByZWdpc3Rlckxvb2t1cChpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyV2l0aChpbnN0YW5jZSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtb3ZlSGVscGVyVG9Ib29rcyhpbnN0YW5jZSwgaGVscGVyTmFtZSwga2VlcEhlbHBlcikge1xuICBpZiAoaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXSkge1xuICAgIGluc3RhbmNlLmhvb2tzW2hlbHBlck5hbWVdID0gaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICBpZiAoIWtlZXBIZWxwZXIpIHtcbiAgICAgIGRlbGV0ZSBpbnN0YW5jZS5oZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIH1cbiAgfVxufVxuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js":
- /*!*************************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- exports['default'] = function (instance) {
- instance.registerHelper('blockHelperMissing', function (context, options) {
- var inverse = options.inverse,
- fn = options.fn;
- if (context === true) {
- return fn(this);
- } else if (context === false || context == null) {
- return inverse(this);
- } else if (_utils.isArray(context)) {
- if (context.length > 0) {
- if (options.ids) {
- options.ids = [options.name];
- }
- return instance.helpers.each(context, options);
- } else {
- return inverse(this);
- }
- } else {
- if (options.data && options.ids) {
- var data = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
- options = { data: data };
- }
- return fn(context, options);
- }
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvYmxvY2staGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztxQkFBd0QsVUFBVTs7cUJBRW5ELFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsb0JBQW9CLEVBQUUsVUFBUyxPQUFPLEVBQUUsT0FBTyxFQUFFO0FBQ3ZFLFFBQUksT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPO1FBQzNCLEVBQUUsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDOztBQUVsQixRQUFJLE9BQU8sS0FBSyxJQUFJLEVBQUU7QUFDcEIsYUFBTyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDakIsTUFBTSxJQUFJLE9BQU8sS0FBSyxLQUFLLElBQUksT0FBTyxJQUFJLElBQUksRUFBRTtBQUMvQ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Y29udGV4dCwgb3B0aW9ucyk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- exports.__esModule = true;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- exports['default'] = function (instance) {
- instance.registerHelper('each', function (context, options) {
- if (!options) {
- throw new _exception2['default']('Must pass iterator to #each');
- }
- var fn = options.fn,
- inverse = options.inverse,
- i = 0,
- ret = '',
- data = undefined,
- contextPath = undefined;
- if (options.data && options.ids) {
- contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
- }
- if (_utils.isFunction(context)) {
- context = context.call(this);
- }
- if (options.data) {
- data = _utils.createFrame(options.data);
- }
- function execIteration(field, index, last) {
- if (data) {
- data.key = field;
- data.index = index;
- data.first = index === 0;
- data.last = !!last;
- if (contextPath) {
- data.contextPath = contextPath + field;
- }
- }
- ret = ret + fn(context[field], {
- data: data,
- blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
- });
- }
- if (context && typeof context === 'object') {
- if (_utils.isArray(context)) {
- for (var j = context.length; i < j; i++) {
- if (i in context) {
- execIteration(i, i, i === context.length - 1);
- }
- }
- } else if (global.Symbol && context[global.Symbol.iterator]) {
- var newContext = [];
- var iterator = context[global.Symbol.iterator]();
- for (var it = iterator.next(); !it.done; it = iterator.next()) {
- newContext.push(it.value);
- }
- context = newContext;
- for (var j = context.length; i < j; i++) {
- execIteration(i, i, i === context.length - 1);
- }
- } else {
- (function () {
- var priorKey = undefined;
- Object.keys(context).forEach(function (key) {
- // We're running the iterations one step out of sync so we can detect
- // the last iteration without have to scan the object twice and create
- // an itermediate keys array.
- if (priorKey !== undefined) {
- execIteration(priorKey, i - 1);
- }
- priorKey = key;
- i++;
- });
- if (priorKey !== undefined) {
- execIteration(priorKey, i - 1, true);
- }
- })();
- }
- }
- if (i === 0) {
- ret = inverse(this);
- }
- return ret;
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvZWFjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O3FCQU1PLFVBQVU7O3lCQUNLLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLFVBQVMsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN6RCxRQUFJLENBQUMsT0FBTyxFQUFFO0FBQ1osWUFBTSwyQkFBYyw2QkFBNkIsQ0FBQyxDQUFDO0tBQ3BEOztBQUVELFFBQUksRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFO1FBQ2pCLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTztRQUN6QixDQUFDLEdBQUcsQ0FBQztRQUNMLEdBQUcsR0FBRyxFQUFFO1FBQ1IsSUFBSSxZQUFBO1FBQ0osV0FBVyxZQUFBLENBQUM7O0FBRWQsUUFBSSxPQUFPLENBQUMsSUFBSSxJQUFJLE9BQU8sQ0FBQyxHQUFHLEVBQUU7QUFDL0IsaUJBQVcsR0FDVCx5QkFBa0IsT0FBTyxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyx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bnRleHQubGVuZ3RoIC0gMSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGxldCBwcmlvcktleTtcblxuICAgICAgICBPYmplY3Qua2V5cyhjb250ZXh0KS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgLy8gV2UncmUgcnVubmluZyB0aGUgaXRlcmF0aW9ucyBvbmUgc3RlcCBvdXQgb2Ygc3luYyBzbyB3ZSBjYW4gZGV0ZWN0XG4gICAgICAgICAgLy8gdGhlIGxhc3QgaXRlcmF0aW9uIHdpdGhvdXQgaGF2ZSB0byBzY2FuIHRoZSBvYmplY3QgdHdpY2UgYW5kIGNyZWF0ZVxuICAgICAgICAgIC8vIGFuIGl0ZXJtZWRpYXRlIGtleXMgYXJyYXkuXG4gICAgICAgICAgaWYgKHByaW9yS2V5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGV4ZWNJdGVyYXRpb24ocHJpb3JLZXksIGkgLSAxKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcHJpb3JLZXkgPSBrZXk7XG4gICAgICAgICAgaSsrO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKHByaW9yS2V5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBleGVjSXRlcmF0aW9uKHByaW9yS2V5LCBpIC0gMSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgcmV0ID0gaW52ZXJzZSh0aGlzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- exports['default'] = function (instance) {
- instance.registerHelper('helperMissing', function () /* [args, ]options */{
- if (arguments.length === 1) {
- // A missing field in a {{foo}} construct.
- return undefined;
- } else {
- // Someone is actually trying to call something, blow up.
- throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
- }
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozt5QkFBc0IsY0FBYzs7OztxQkFFckIsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxlQUFlLEVBQUUsaUNBQWdDO0FBQ3ZFLFFBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7O0FBRTFCLGFBQU8sU0FBUyxDQUFDO0tBQ2xCLE1BQU07O0FBRUwsWUFBTSwyQkFDSixtQkFBbUIsR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxJQUFJLEdBQUcsR0FBRyxDQUNqRSxDQUFDO0tBQ0g7R0FDRixDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJoZWxwZXItbWlzc2luZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBFeGNlcHRpb24gZnJvbSAnLi4vZXhjZXB0aW9uJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2hlbHBlck1pc3NpbmcnLCBmdW5jdGlvbigvKiBbYXJncywgXW9wdGlvbnMgKi8pIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgLy8gQSBtaXNzaW5nIGZpZWxkIGluIGEge3tmb299fSBjb25zdHJ1Y3QuXG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBTb21lb25lIGlzIGFjdHVhbGx5IHRyeWluZyB0byBjYWxsIHNvbWV0aGluZywgYmxvdyB1cC5cbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oXG4gICAgICAgICdNaXNzaW5nIGhlbHBlcjogXCInICsgYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXS5uYW1lICsgJ1wiJ1xuICAgICAgKTtcbiAgICB9XG4gIH0pO1xufVxuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js ***!
- \*******************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- exports['default'] = function (instance) {
- instance.registerHelper('if', function (conditional, options) {
- if (arguments.length != 2) {
- throw new _exception2['default']('#if requires exactly one argument');
- }
- if (_utils.isFunction(conditional)) {
- conditional = conditional.call(this);
- }
- // Default behavior is to render the positive path if the value is truthy and not empty.
- // The `includeZero` option may be set to treat the condtional as purely not empty based on the
- // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
- if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
- });
- instance.registerHelper('unless', function (conditional, options) {
- if (arguments.length != 2) {
- throw new _exception2['default']('#unless requires exactly one argument');
- }
- return instance.helpers['if'].call(this, conditional, {
- fn: options.inverse,
- inverse: options.fn,
- hash: options.hash
- });
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaWYuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztxQkFBb0MsVUFBVTs7eUJBQ3hCLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFVBQVMsV0FBVyxFQUFFLE9BQU8sRUFBRTtBQUMzRCxRQUFJLFNBQVMsQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO0FBQ3pCLFlBQU0sMkJBQWMsbUNBQW1DLENBQUMsQ0FBQztLQUMxRDtBQUNELFFBQUksa0JBQVcsV0FBVyxDQUFDLEVBQUU7QUFDM0IsaUJBQVcsR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3RDOzs7OztBQUtELFFBQUksQUFBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxJQUFJLENBQUMsV0FBVyxJQUFLLGVBQVEsV0FBVyxDQUFDLEVBQUU7QUFDdkUsYUFBTyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzlCLE1BQU07QUFDTCxhQUFPLE9BQU8sQ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aGFzaDogb3B0aW9ucy5oYXNoXG4gICAgfSk7XG4gIH0pO1xufVxuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js":
- /*!********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports['default'] = function (instance) {
- instance.registerHelper('log', function () /* message, options */{
- var args = [undefined],
- options = arguments[arguments.length - 1];
- for (var i = 0; i < arguments.length - 1; i++) {
- args.push(arguments[i]);
- }
- var level = 1;
- if (options.hash.level != null) {
- level = options.hash.level;
- } else if (options.data && options.data.level != null) {
- level = options.data.level;
- }
- args[0] = level;
- instance.log.apply(instance, args);
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxLQUFLLEVBQUUsa0NBQWlDO0FBQzlELFFBQUksSUFBSSxHQUFHLENBQUMsU0FBUyxDQUFDO1FBQ3BCLE9BQU8sR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztBQUM1QyxTQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDN0MsVUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztLQUN6Qjs7QUFFRCxRQUFJLEtBQUssR0FBR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9ucy5kYXRhLmxldmVsICE9IG51bGwpIHtcbiAgICAgIGxldmVsID0gb3B0aW9ucy5kYXRhLmxldmVsO1xuICAgIH1cbiAgICBhcmdzWzBdID0gbGV2ZWw7XG5cbiAgICBpbnN0YW5jZS5sb2coLi4uYXJncyk7XG4gIH0pO1xufVxuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js ***!
- \***********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports['default'] = function (instance) {
- instance.registerHelper('lookup', function (obj, field, options) {
- if (!obj) {
- // Note for 5.0: Change to "obj == null" in 5.0
- return obj;
- }
- return options.lookupProperty(obj, field);
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9va3VwLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsVUFBUyxHQUFHLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRTtBQUM5RCxRQUFJLENBQUMsR0FBRyxFQUFFOztBQUVSLGFBQU8sR0FBRyxDQUFDO0tBQ1o7QUFDRCxXQUFPLE9BQU8sQ0FBQyxjQUFjLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO0dBQzNDLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6Imxvb2t1cC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCdsb29rdXAnLCBmdW5jdGlvbihvYmosIGZpZWxkLCBvcHRpb25zKSB7XG4gICAgaWYgKCFvYmopIHtcbiAgICAgIC8vIE5vdGUgZm9yIDUuMDogQ2hhbmdlIHRvIFwib2JqID09IG51bGxcIiBpbiA1LjBcbiAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICAgIHJldHVybiBvcHRpb25zLmxvb2t1cFByb3BlcnR5KG9iaiwgZmllbGQpO1xuICB9KTtcbn1cbiJdfQ==
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- exports['default'] = function (instance) {
- instance.registerHelper('with', function (context, options) {
- if (arguments.length != 2) {
- throw new _exception2['default']('#with requires exactly one argument');
- }
- if (_utils.isFunction(context)) {
- context = context.call(this);
- }
- var fn = options.fn;
- if (!_utils.isEmpty(context)) {
- var data = options.data;
- if (options.data && options.ids) {
- data = _utils.createFrame(options.data);
- data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
- }
- return fn(context, {
- data: data,
- blockParams: _utils.blockParams([context], [data && data.contextPath])
- });
- } else {
- return options.inverse(this);
- }
- });
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvd2l0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h0UGF0aCxcbiAgICAgICAgICBvcHRpb25zLmlkc1swXVxuICAgICAgICApO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gZm4oY29udGV4dCwge1xuICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICBibG9ja1BhcmFtczogYmxvY2tQYXJhbXMoW2NvbnRleHRdLCBbZGF0YSAmJiBkYXRhLmNvbnRleHRQYXRoXSlcbiAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgIH1cbiAgfSk7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js":
- /*!******************************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js ***!
- \******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.createNewLookupObject = createNewLookupObject;
- var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- /**
- * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
- * The resulting object can be used with "object[property]" to check if a property exists
- * @param {...object} sources a varargs parameter of source objects that will be merged
- * @returns {object}
- */
- function createNewLookupObject() {
- for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
- sources[_key] = arguments[_key];
- }
- return _utils.extend.apply(undefined, [Object.create(null)].concat(sources));
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL2NyZWF0ZS1uZXctbG9va3VwLW9iamVjdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBdUIsVUFBVTs7Ozs7Ozs7O0FBUTFCLFNBQVMscUJBQXFCLEdBQWE7b0NBQVQsT0FBTztBQUFQLFdBQU87OztBQUM5QyxTQUFPLGdDQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQUssT0FBTyxFQUFDLENBQUM7Q0FDaEQiLCJmaWxlIjoiY3JlYXRlLW5ldy1sb29rdXAtb2JqZWN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZXh0ZW5kIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vKipcbiAqIENyZWF0ZSBhIG5ldyBvYmplY3Qgd2l0aCBcIm51bGxcIi1wcm90b3R5cGUgdG8gYXZvaWQgdHJ1dGh5IHJlc3VsdHMgb24gcHJvdG90eXBlIHByb3BlcnRpZXMuXG4gKiBUaGUgcmVzdWx0aW5nIG9iamVjdCBjYW4gYmUgdXNlZCB3aXRoIFwib2JqZWN0W3Byb3BlcnR5XVwiIHRvIGNoZWNrIGlmIGEgcHJvcGVydHkgZXhpc3RzXG4gKiBAcGFyYW0gey4uLm9iamVjdH0gc291cmNlcyBhIHZhcmFyZ3MgcGFyYW1ldGVyIG9mIHNvdXJjZSBvYmplY3RzIHRoYXQgd2lsbCBiZSBtZXJnZWRcbiAqIEByZXR1cm5zIHtvYmplY3R9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVOZXdMb29rdXBPYmplY3QoLi4uc291cmNlcykge1xuICByZXR1cm4gZXh0ZW5kKE9iamVjdC5jcmVhdGUobnVsbCksIC4uLnNvdXJjZXMpO1xufVxuIl19
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.createProtoAccessControl = createProtoAccessControl;
- exports.resultIsAllowed = resultIsAllowed;
- exports.resetLoggedProperties = resetLoggedProperties;
- // istanbul ignore next
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
- var _createNewLookupObject = __webpack_require__(/*! ./create-new-lookup-object */ "./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js");
- var _logger = __webpack_require__(/*! ../logger */ "./node_modules/handlebars/dist/cjs/handlebars/logger.js");
- var logger = _interopRequireWildcard(_logger);
- var loggedProperties = Object.create(null);
- function createProtoAccessControl(runtimeOptions) {
- var defaultMethodWhiteList = Object.create(null);
- defaultMethodWhiteList['constructor'] = false;
- defaultMethodWhiteList['__defineGetter__'] = false;
- defaultMethodWhiteList['__defineSetter__'] = false;
- defaultMethodWhiteList['__lookupGetter__'] = false;
- var defaultPropertyWhiteList = Object.create(null);
- // eslint-disable-next-line no-proto
- defaultPropertyWhiteList['__proto__'] = false;
- return {
- properties: {
- whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
- defaultValue: runtimeOptions.allowProtoPropertiesByDefault
- },
- methods: {
- whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
- defaultValue: runtimeOptions.allowProtoMethodsByDefault
- }
- };
- }
- function resultIsAllowed(result, protoAccessControl, propertyName) {
- if (typeof result === 'function') {
- return checkWhiteList(protoAccessControl.methods, propertyName);
- } else {
- return checkWhiteList(protoAccessControl.properties, propertyName);
- }
- }
- function checkWhiteList(protoAccessControlForType, propertyName) {
- if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
- return protoAccessControlForType.whitelist[propertyName] === true;
- }
- if (protoAccessControlForType.defaultValue !== undefined) {
- return protoAccessControlForType.defaultValue;
- }
- logUnexpecedPropertyAccessOnce(propertyName);
- return false;
- }
- function logUnexpecedPropertyAccessOnce(propertyName) {
- if (loggedProperties[propertyName] !== true) {
- loggedProperties[propertyName] = true;
- logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
- }
- }
- function resetLoggedProperties() {
- Object.keys(loggedProperties).forEach(function (propertyName) {
- delete loggedProperties[propertyName];
- });
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3Byb3RvLWFjY2Vzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O3FDQUFzQyw0QkFBNEI7O3NCQUMxQyxXQUFXOztJQUF2QixNQUFNOztBQUVsQixJQUFNLGdCQUFnQixHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXRDLFNBQVMsd0JBQXdCLENBQUMsY0FBYyxFQUFFO0FBQ3ZELE1BQUksc0JBQXNCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNqRCx3QkFBc0IsQ0FBQyxhQUFhLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDOUMsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7O0FBRW5ELE1BQUksd0JBQXdCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQzs7QUFFbkQsMEJBQXdCLENBQUMsV0FBVyxDQUFDLEdBQUcsS0FBSyxDQUFDOztBQUU5QyxTQUFPO0FBQ0ws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vIHJlc29sdmUgdGhlIHByb3BlcnR5IFwiJHtwcm9wZXJ0eU5hbWV9XCIgYmVjYXVzZSBpdCBpcyBub3QgYW4gXCJvd24gcHJvcGVydHlcIiBvZiBpdHMgcGFyZW50LlxcbmAgK1xuICAgICAgICBgWW91IGNhbiBhZGQgYSBydW50aW1lIG9wdGlvbiB0byBkaXNhYmxlIHRoZSBjaGVjayBvciB0aGlzIHdhcm5pbmc6XFxuYCArXG4gICAgICAgIGBTZWUgaHR0cHM6Ly9oYW5kbGViYXJzanMuY29tL2FwaS1yZWZlcmVuY2UvcnVudGltZS1vcHRpb25zLmh0bWwjb3B0aW9ucy10by1jb250cm9sLXByb3RvdHlwZS1hY2Nlc3MgZm9yIGRldGFpbHNgXG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCkge1xuICBPYmplY3Qua2V5cyhsb2dnZWRQcm9wZXJ0aWVzKS5mb3JFYWNoKHByb3BlcnR5TmFtZSA9PiB7XG4gICAgZGVsZXRlIGxvZ2dlZFByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcbiAgfSk7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.wrapHelper = wrapHelper;
- function wrapHelper(helper, transformOptionsFn) {
- if (typeof helper !== 'function') {
- // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
- // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
- return helper;
- }
- var wrapper = function wrapper() /* dynamic arguments */{
- var options = arguments[arguments.length - 1];
- arguments[arguments.length - 1] = transformOptionsFn(options);
- return helper.apply(this, arguments);
- };
- return wrapper;
- }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FwcGVyIGxlYXN0LWludmFzaXZlIGJ5IG5vdCB3cmFwcGluZyBpdCwgaWYgdGhlIGhlbHBlciBpcyBub3QgYSBmdW5jdGlvbi5cbiAgICByZXR1cm4gaGVscGVyO1xuICB9XG4gIGxldCB3cmFwcGVyID0gZnVuY3Rpb24oLyogZHluYW1pYyBhcmd1bWVudHMgKi8pIHtcbiAgICBjb25zdCBvcHRpb25zID0gYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXTtcbiAgICBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDFdID0gdHJhbnNmb3JtT3B0aW9uc0ZuKG9wdGlvbnMpO1xuICAgIHJldHVybiBoZWxwZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgfTtcbiAgcmV0dXJuIHdyYXBwZXI7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/logger.js":
- /*!***************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/logger.js ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var logger = {
- methodMap: ['debug', 'info', 'warn', 'error'],
- level: 'info',
- // Maps a given level value to the `methodMap` indexes above.
- lookupLevel: function lookupLevel(level) {
- if (typeof level === 'string') {
- var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
- if (levelMap >= 0) {
- level = levelMap;
- } else {
- level = parseInt(level, 10);
- }
- }
- return level;
- },
- // Can be overridden in the host environment
- log: function log(level) {
- level = logger.lookupLevel(level);
- if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
- var method = logger.methodMap[level];
- // eslint-disable-next-line no-console
- if (!console[method]) {
- method = 'log';
- }
- for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- message[_key - 1] = arguments[_key];
- }
- console[method].apply(console, message); // eslint-disable-line no-console
- }
- }
- };
- exports['default'] = logger;
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2xvZ2dlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O3FCQUF3QixTQUFTOztBQUVqQyxJQUFJLE1BQU0sR0FBRztBQUNYLFdBQVMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUM3QyxPQUFLLEVBQUUsTUFBTTs7O0FBR2IsYUFBVyxFQUFFLHFCQUFTLEtBQUssRUFBRTtBQUMzQixRQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtBQUM3QixVQUFJLFFBQVEsR0FBRyxlQUFRLE1BQU0sQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFDOUQsVUFBSSxRQUFRLElBQUksQ0FBQyxFQUFFO0FBQ2pCLGFBQUssR0FBRyxRQUFRLENBQUM7T0FDbEIsTUFBTTtBQUNMLGFBQUssR0FBRyxRQUFRLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO09BQzdCO0tBQ0Y7O0FBRUQsV0FBTyxLQUFLLENBQUM7R0FDZDs7O0FBR0QsS0FBRyxFQUFFLGFBQVMsS0FBSyxFQUFjO0FBQy9CLFNBQUssR0FBRyxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUssQ0FBQyxDQUFDOztBQUVsQyxRQUNFLE9BQU8sT0FBTyxLQUFLLFdBQVcsSUFDOUIsTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksS0FBSyxFQUN6QztBQUNBLFVBQUksTUFBTSxHQUFHLE1BQ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nOiBmdW5jdGlvbihsZXZlbCwgLi4ubWVzc2FnZSkge1xuICAgIGxldmVsID0gbG9nZ2VyLmxvb2t1cExldmVsKGxldmVsKTtcblxuICAgIGlmIChcbiAgICAgIHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgbG9nZ2VyLmxvb2t1cExldmVsKGxvZ2dlci5sZXZlbCkgPD0gbGV2ZWxcbiAgICApIHtcbiAgICAgIGxldCBtZXRob2QgPSBsb2dnZXIubWV0aG9kTWFwW2xldmVsXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICBpZiAoIWNvbnNvbGVbbWV0aG9kXSkge1xuICAgICAgICBtZXRob2QgPSAnbG9nJztcbiAgICAgIH1cbiAgICAgIGNvbnNvbGVbbWV0aG9kXSguLi5tZXNzYWdlKTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXI7XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js":
- /*!********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- exports.__esModule = true;
- exports['default'] = function (Handlebars) {
- /* istanbul ignore next */
- var root = typeof global !== 'undefined' ? global : window,
- $Handlebars = root.Handlebars;
- /* istanbul ignore next */
- Handlebars.noConflict = function () {
- if (root.Handlebars === Handlebars) {
- root.Handlebars = $Handlebars;
- }
- return Handlebars;
- };
- };
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL25vLWNvbmZsaWN0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxVQUFVLEVBQUU7O0FBRWxDLE1BQUksSUFBSSxHQUFHLE9BQU8sTUFBTSxLQUFLLFdBQVcsR0FBRyxNQUFNLEdBQUcsTUFBTTtNQUN4RCxXQUFXLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQzs7QUFFaEMsWUFBVSxDQUFDLFVBQVUsR0FBRyxZQUFXO0FBQ2pDLFFBQUksSUFBSSxDQUFDLFVBQVUsS0FBSyxVQUFVLEVBQUU7QUFDbEMsVUFBSSxDQUFDLFVBQVUsR0FBRyxXQUFXLENBQUM7S0FDL0I7QUFDRCxXQUFPLFVBQVUsQ0FBQztHQUNuQixDQUFDO0NBQ0giLCJmaWxlIjoibm8tY29uZmxpY3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbihIYW5kbGViYXJzKSB7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIGxldCByb290ID0gdHlwZW9mIGdsb2JhbCAhPT0gJ3VuZGVmaW5lZCcgPyBnbG9iYWwgOiB3aW5kb3csXG4gICAgJEhhbmRsZWJhcnMgPSByb290LkhhbmRsZWJhcnM7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIEhhbmRsZWJhcnMubm9Db25mbGljdCA9IGZ1bmN0aW9uKCkge1xuICAgIGlmIChyb290LkhhbmRsZWJhcnMgPT09IEhhbmRsZWJhcnMpIHtcbiAgICAgIHJvb3QuSGFuZGxlYmFycyA9ICRIYW5kbGViYXJzO1xuICAgIH1cbiAgICByZXR1cm4gSGFuZGxlYmFycztcbiAgfTtcbn1cbiJdfQ==
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/runtime.js":
- /*!****************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/runtime.js ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.checkRevision = checkRevision;
- exports.template = template;
- exports.wrapProgram = wrapProgram;
- exports.resolvePartial = resolvePartial;
- exports.invokePartial = invokePartial;
- exports.noop = noop;
- // istanbul ignore next
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- // istanbul ignore next
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
- var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
- var Utils = _interopRequireWildcard(_utils);
- var _exception = __webpack_require__(/*! ./exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
- var _exception2 = _interopRequireDefault(_exception);
- var _base = __webpack_require__(/*! ./base */ "./node_modules/handlebars/dist/cjs/handlebars/base.js");
- var _helpers = __webpack_require__(/*! ./helpers */ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js");
- var _internalWrapHelper = __webpack_require__(/*! ./internal/wrapHelper */ "./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js");
- var _internalProtoAccess = __webpack_require__(/*! ./internal/proto-access */ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js");
- function checkRevision(compilerInfo) {
- var compilerRevision = compilerInfo && compilerInfo[0] || 1,
- currentRevision = _base.COMPILER_REVISION;
- if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
- return;
- }
- if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
- var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
- compilerVersions = _base.REVISION_CHANGES[compilerRevision];
- throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
- } else {
- // Use the embedded version info since the runtime doesn't know about this revision yet
- throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
- }
- }
- function template(templateSpec, env) {
- /* istanbul ignore next */
- if (!env) {
- throw new _exception2['default']('No environment passed to template');
- }
- if (!templateSpec || !templateSpec.main) {
- throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
- }
- templateSpec.main.decorator = templateSpec.main_d;
- // Note: Using env.VM references rather than local var references throughout this section to allow
- // for external users to override these as pseudo-supported APIs.
- env.VM.checkRevision(templateSpec.compiler);
- // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
- var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
- function invokePartialWrapper(partial, context, options) {
- if (options.hash) {
- context = Utils.extend({}, context, options.hash);
- if (options.ids) {
- options.ids[0] = true;
- }
- }
- partial = env.VM.resolvePartial.call(this, partial, context, options);
- var extendedOptions = Utils.extend({}, options, {
- hooks: this.hooks,
- protoAccessControl: this.protoAccessControl
- });
- var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
- if (result == null && env.compile) {
- options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
- result = options.partials[options.name](context, extendedOptions);
- }
- if (result != null) {
- if (options.indent) {
- var lines = result.split('\n');
- for (var i = 0, l = lines.length; i < l; i++) {
- if (!lines[i] && i + 1 === l) {
- break;
- }
- lines[i] = options.indent + lines[i];
- }
- result = lines.join('\n');
- }
- return result;
- } else {
- throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
- }
- }
- // Just add water
- var container = {
- strict: function strict(obj, name, loc) {
- if (!obj || !(name in obj)) {
- throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
- loc: loc
- });
- }
- return container.lookupProperty(obj, name);
- },
- lookupProperty: function lookupProperty(parent, propertyName) {
- var result = parent[propertyName];
- if (result == null) {
- return result;
- }
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return result;
- }
- if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
- return result;
- }
- return undefined;
- },
- lookup: function lookup(depths, name) {
- var len = depths.length;
- for (var i = 0; i < len; i++) {
- var result = depths[i] && container.lookupProperty(depths[i], name);
- if (result != null) {
- return depths[i][name];
- }
- }
- },
- lambda: function lambda(current, context) {
- return typeof current === 'function' ? current.call(context) : current;
- },
- escapeExpression: Utils.escapeExpression,
- invokePartial: invokePartialWrapper,
- fn: function fn(i) {
- var ret = templateSpec[i];
- ret.decorator = templateSpec[i + '_d'];
- return ret;
- },
- programs: [],
- program: function program(i, data, declaredBlockParams, blockParams, depths) {
- var programWrapper = this.programs[i],
- fn = this.fn(i);
- if (data || depths || blockParams || declaredBlockParams) {
- programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
- } else if (!programWrapper) {
- programWrapper = this.programs[i] = wrapProgram(this, i, fn);
- }
- return programWrapper;
- },
- data: function data(value, depth) {
- while (value && depth--) {
- value = value._parent;
- }
- return value;
- },
- mergeIfNeeded: function mergeIfNeeded(param, common) {
- var obj = param || common;
- if (param && common && param !== common) {
- obj = Utils.extend({}, common, param);
- }
- return obj;
- },
- // An empty object to use as replacement for null-contexts
- nullContext: Object.seal({}),
- noop: env.VM.noop,
- compilerInfo: templateSpec.compiler
- };
- function ret(context) {
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- var data = options.data;
- ret._setup(options);
- if (!options.partial && templateSpec.useData) {
- data = initData(context, data);
- }
- var depths = undefined,
- blockParams = templateSpec.useBlockParams ? [] : undefined;
- if (templateSpec.useDepths) {
- if (options.depths) {
- depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
- } else {
- depths = [context];
- }
- }
- function main(context /*, options*/) {
- return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
- }
- main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
- return main(context, options);
- }
- ret.isTop = true;
- ret._setup = function (options) {
- if (!options.partial) {
- var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
- wrapHelpersToPassLookupProperty(mergedHelpers, container);
- container.helpers = mergedHelpers;
- if (templateSpec.usePartial) {
- // Use mergeIfNeeded here to prevent compiling global partials multiple times
- container.partials = container.mergeIfNeeded(options.partials, env.partials);
- }
- if (templateSpec.usePartial || templateSpec.useDecorators) {
- container.decorators = Utils.extend({}, env.decorators, options.decorators);
- }
- container.hooks = {};
- container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
- var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
- _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
- _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
- } else {
- container.protoAccessControl = options.protoAccessControl; // internal option
- container.helpers = options.helpers;
- container.partials = options.partials;
- container.decorators = options.decorators;
- container.hooks = options.hooks;
- }
- };
- ret._child = function (i, data, blockParams, depths) {
- if (templateSpec.useBlockParams && !blockParams) {
- throw new _exception2['default']('must pass block params');
- }
- if (templateSpec.useDepths && !depths) {
- throw new _exception2['default']('must pass parent depths');
- }
- return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
- };
- return ret;
- }
- function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
- function prog(context) {
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- var currentDepths = depths;
- if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
- currentDepths = [context].concat(depths);
- }
- return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
- }
- prog = executeDecorators(fn, prog, container, depths, data, blockParams);
- prog.program = i;
- prog.depth = depths ? depths.length : 0;
- prog.blockParams = declaredBlockParams || 0;
- return prog;
- }
- /**
- * This is currently part of the official API, therefore implementation details should not be changed.
- */
- function resolvePartial(partial, context, options) {
- if (!partial) {
- if (options.name === '@partial-block') {
- partial = options.data['partial-block'];
- } else {
- partial = options.partials[options.name];
- }
- } else if (!partial.call && !options.name) {
- // This is a dynamic partial that returned a string
- options.name = partial;
- partial = options.partials[partial];
- }
- return partial;
- }
- function invokePartial(partial, context, options) {
- // Use the current closure context to save the partial-block if this partial
- var currentPartialBlock = options.data && options.data['partial-block'];
- options.partial = true;
- if (options.ids) {
- options.data.contextPath = options.ids[0] || options.data.contextPath;
- }
- var partialBlock = undefined;
- if (options.fn && options.fn !== noop) {
- (function () {
- options.data = _base.createFrame(options.data);
- // Wrapper function to get access to currentPartialBlock from the closure
- var fn = options.fn;
- partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
- var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
- // Restore the partial-block from the closure for the execution of the block
- // i.e. the part inside the block of the partial call.
- options.data = _base.createFrame(options.data);
- options.data['partial-block'] = currentPartialBlock;
- return fn(context, options);
- };
- if (fn.partials) {
- options.partials = Utils.extend({}, options.partials, fn.partials);
- }
- })();
- }
- if (partial === undefined && partialBlock) {
- partial = partialBlock;
- }
- if (partial === undefined) {
- throw new _exception2['default']('The partial ' + options.name + ' could not be found');
- } else if (partial instanceof Function) {
- return partial(context, options);
- }
- }
- function noop() {
- return '';
- }
- function initData(context, data) {
- if (!data || !('root' in data)) {
- data = data ? _base.createFrame(data) : {};
- data.root = context;
- }
- return data;
- }
- function executeDecorators(fn, prog, container, depths, data, blockParams) {
- if (fn.decorator) {
- var props = {};
- prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
- Utils.extend(prog, props);
- }
- return prog;
- }
- function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
- Object.keys(mergedHelpers).forEach(function (helperName) {
- var helper = mergedHelpers[helperName];
- mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
- });
- }
- function passLookupPropertyOption(helper, container) {
- var lookupProperty = container.lookupProperty;
- return _internalWrapHelper.wrapHelper(helper, function (options) {
- return Utils.extend({ lookupProperty: lookupProperty }, options);
- });
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3J1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7cUJBQXVCLFNBQVM7O0lBQXBCLEtBQUs7O3lCQUNLLGFBQWE7Ozs7b0JBTTVCLFFBQVE7O3VCQUNtQixXQUFXOztrQ0FDbEIsdUJBQXVCOzttQ0FJM0MseUJBQXlCOztBQUV6QixTQUFTLGFBQWEsQ0FBQyxZQUFZLEVBQUU7QUFDMUMsTUFBTSxnQkFBZ0IsR0FBRyxBQUFDLFlBQVksSUFBSSxZQUFZLENBQUMsQ0FBQyxDQUFDLElBQUssQ0FBQztNQUM3RCxlQUFlLDBCQUFvQixDQUFDOztBQUV0QyxNQUNFLGdCQUFnQiwyQ0FBcUMsSUFDckQsZ0JBQWdCLDJCQUFxQixFQUNyQztBQUNBLFdBQU87R0FDUjs7QUFFRCxNQUFJLGdCQUFnQiwwQ0FBb0MsRUFBRTtBQUN4RCxRQUFNLGVBQWUsR0FBRyx1QkFBaUIsZUFBZSxDQUFDO1FBQ3ZELGdCQUFnQixHQUFHLHVCQUFpQixnQkFBZ0IsQ0FBQyxDQUFDO0FBQ3hELFVBQU0sMkJBQ0oseUZBQXlGLEdBQ3ZGLHFEQUFxRCxHQUNyRCxlQUFlLEdBQ2YsbURBQW1ELEdBQ25ELGdCQUFnQixHQUNoQixJQUFJLENBQ1AsQ0FBQztHQUNILE1BQU07O0FBRUwsVUFBTSwyQkFDSix3RkFBd0YsR0FDdEYsaURBQWlELEdBQ2p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wgZXh0ZW5kZWRPcHRpb25zKTtcbiAgICB9XG4gICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7XG4gICAgICBpZiAob3B0aW9ucy5pbmRlbnQpIHtcbiAgICAgICAgbGV0IGxpbmVzID0gcmVzdWx0LnNwbGl0KCdcXG4nKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSBsaW5lcy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICBpZiAoIWxpbmVzW2ldICYmIGkgKyAxID09PSBsKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBsaW5lc1tpXSA9IG9wdGlvbnMuaW5kZW50ICsgbGluZXNbaV07XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gbGluZXMuam9pbignXFxuJyk7XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKFxuICAgICAgICAnVGhlIHBhcnRpYWwgJyArXG4gICAgICAgICAgb3B0aW9ucy5uYW1lICtcbiAgICAgICAgICAnIGNvdWxkIG5vdCBiZSBjb21waWxlZCB3aGVuIHJ1bm5pbmcgaW4gcnVudGltZS1vbmx5IG1vZGUnXG4gICAgICApO1xuICAgIH1cbiAgfVxuXG4gIC8vIEp1c3QgYWRkIHdhdGVyXG4gIGxldCBjb250YWluZXIgPSB7XG4gICAgc3RyaWN0OiBmdW5jdGlvbihvYmosIG5hbWUsIGxvYykge1xuICAgICAgaWYgKCFvYmogfHwgIShuYW1lIGluIG9iaikpIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbignXCInICsgbmFtZSArICdcIiBub3QgZGVmaW5lZCBpbiAnICsgb2JqLCB7XG4gICAgICAgICAgbG9jOiBsb2NcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gY29udGFpbmVyLmxvb2t1cFByb3BlcnR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tcGxhdGVTcGVjLnVzZURlcHRocykge1xuICAgICAgaWYgKG9wdGlvbnMuZGVwdGhzKSB7XG4gICAgICAgIGRlcHRocyA9XG4gICAgICAgICAgY29udGV4dCAhPSBvcHRpb25zLmRlcHRoc1swXVxuICAgICAgICAgICAgPyBbY29udGV4dF0uY29uY2F0KG9wdGlvbnMuZGVwdGhzKVxuICAgICAgICAgICAgOiBvcHRpb25zLmRlcHRocztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRlcHRocyA9IFtjb250ZXh0XTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYWluKGNvbnRleHQgLyosIG9wdGlvbnMqLykge1xuICAgICAgcmV0dXJuIChcbiAgICAgICAgJycgK1xuICAgICAgICB0ZW1wbGF0ZVNwZWMubWFpbihcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgY29udGV4dCxcbiAgICAgICAgICBjb250YWluZXIuaGVscGVycyxcbiAgICAgICAgICBjb250YWluZXIucGFydGlhbHMsXG4gICAgICAgICAgZGF0YSxcbiAgICAgICAgICBibG9ja1BhcmFtcyxcbiAgICAgICAgICBkZXB0aHNcbiAgICAgICAgKVxuICAgICAgKTtcbiAgICB9XG5cbiAgICBtYWluID0gZXhlY3V0ZURlY29yYXRvcnMoXG4gICAgICB0ZW1wbGF0ZVNwZWMubWFpbixcbiAgICAgIG1haW4sXG4gICAgICBjb250YWluZXIsXG4gICAgICBvcHRpb25zLmRlcHRocyB8fCBbXSxcbiAgICAgIGRhdGEsXG4gICAgICBibG9ja1BhcmFtc1xuICAgICk7XG4gICAgcmV0dXJuIG1haW4oY29udGV4dCwgb3B0aW9ucyk7XG4gIH1cblxuICByZXQuaXNUb3AgPSB0cnVlO1xuXG4gIHJldC5fc2V0dXAgPSBmdW5jdGlvbihvcHRpb25zKSB7XG4gICAgaWYgKCFvcHRpb25zLnBhcnRpYWwpIHtcbiAgICAgIGxldCBtZXJnZWRIZWxwZXJzID0gVXRpbHM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Bjb250YWluZXIsXG4gICAgICBkZXB0aHMgJiYgZGVwdGhzWzBdLFxuICAgICAgZGF0YSxcbiAgICAgIGJsb2NrUGFyYW1zLFxuICAgICAgZGVwdGhzXG4gICAgKTtcbiAgICBVdGlscy5leHRlbmQocHJvZywgcHJvcHMpO1xuICB9XG4gIHJldHVybiBwcm9nO1xufVxuXG5mdW5jdGlvbiB3cmFwSGVscGVyc1RvUGFzc0xvb2t1cFByb3BlcnR5KG1lcmdlZEhlbHBlcnMsIGNvbnRhaW5lcikge1xuICBPYmplY3Qua2V5cyhtZXJnZWRIZWxwZXJzKS5mb3JFYWNoKGhlbHBlck5hbWUgPT4ge1xuICAgIGxldCBoZWxwZXIgPSBtZXJnZWRIZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIG1lcmdlZEhlbHBlcnNbaGVscGVyTmFtZV0gPSBwYXNzTG9va3VwUHJvcGVydHlPcHRpb24oaGVscGVyLCBjb250YWluZXIpO1xuICB9KTtcbn1cblxuZnVuY3Rpb24gcGFzc0xvb2t1cFByb3BlcnR5T3B0aW9uKGhlbHBlciwgY29udGFpbmVyKSB7XG4gIGNvbnN0IGxvb2t1cFByb3BlcnR5ID0gY29udGFpbmVyLmxvb2t1cFByb3BlcnR5O1xuICByZXR1cm4gd3JhcEhlbHBlcihoZWxwZXIsIG9wdGlvbnMgPT4ge1xuICAgIHJldHVybiBVdGlscy5leHRlbmQoeyBsb29rdXBQcm9wZXJ0eSB9LCBvcHRpb25zKTtcbiAgfSk7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/safe-string.js":
- /*!********************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/safe-string.js ***!
- \********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // Build out our basic SafeString type
- exports.__esModule = true;
- function SafeString(string) {
- this.string = string;
- }
- SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
- return '' + this.string;
- };
- exports['default'] = SafeString;
- module.exports = exports['default'];
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3NhZmUtc3RyaW5nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxTQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUU7QUFDMUIsTUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7Q0FDdEI7O0FBRUQsVUFBVSxDQUFDLFNBQVMsQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsWUFBVztBQUN2RSxTQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0NBQ3pCLENBQUM7O3FCQUVhLFVBQVUiLCJmaWxlIjoic2FmZS1zdHJpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBCdWlsZCBvdXQgb3VyIGJhc2ljIFNhZmVTdHJpbmcgdHlwZVxuZnVuY3Rpb24gU2FmZVN0cmluZyhzdHJpbmcpIHtcbiAgdGhpcy5zdHJpbmcgPSBzdHJpbmc7XG59XG5cblNhZmVTdHJpbmcucHJvdG90eXBlLnRvU3RyaW5nID0gU2FmZVN0cmluZy5wcm90b3R5cGUudG9IVE1MID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnJyArIHRoaXMuc3RyaW5nO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgU2FmZVN0cmluZztcbiJdfQ==
- /***/ }),
- /***/ "./node_modules/handlebars/dist/cjs/handlebars/utils.js":
- /*!**************************************************************!*\
- !*** ./node_modules/handlebars/dist/cjs/handlebars/utils.js ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- exports.__esModule = true;
- exports.extend = extend;
- exports.indexOf = indexOf;
- exports.escapeExpression = escapeExpression;
- exports.isEmpty = isEmpty;
- exports.createFrame = createFrame;
- exports.blockParams = blockParams;
- exports.appendContextPath = appendContextPath;
- var escape = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`',
- '=': '='
- };
- var badChars = /[&<>"'`=]/g,
- possible = /[&<>"'`=]/;
- function escapeChar(chr) {
- return escape[chr];
- }
- function extend(obj /* , ...source */) {
- for (var i = 1; i < arguments.length; i++) {
- for (var key in arguments[i]) {
- if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
- obj[key] = arguments[i][key];
- }
- }
- }
- return obj;
- }
- var toString = Object.prototype.toString;
- exports.toString = toString;
- // Sourced from lodash
- // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
- /* eslint-disable func-style */
- var isFunction = function isFunction(value) {
- return typeof value === 'function';
- };
- // fallback for older versions of Chrome and Safari
- /* istanbul ignore next */
- if (isFunction(/x/)) {
- exports.isFunction = isFunction = function (value) {
- return typeof value === 'function' && toString.call(value) === '[object Function]';
- };
- }
- exports.isFunction = isFunction;
- /* eslint-enable func-style */
- /* istanbul ignore next */
- var isArray = Array.isArray || function (value) {
- return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
- };
- exports.isArray = isArray;
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
- function indexOf(array, value) {
- for (var i = 0, len = array.length; i < len; i++) {
- if (array[i] === value) {
- return i;
- }
- }
- return -1;
- }
- function escapeExpression(string) {
- if (typeof string !== 'string') {
- // don't escape SafeStrings, since they're already safe
- if (string && string.toHTML) {
- return string.toHTML();
- } else if (string == null) {
- return '';
- } else if (!string) {
- return string + '';
- }
- // Force a string conversion as this will be done by the append regardless and
- // the regex test will do this transparently behind the scenes, causing issues if
- // an object's to string has escaped characters in it.
- string = '' + string;
- }
- if (!possible.test(string)) {
- return string;
- }
- return string.replace(badChars, escapeChar);
- }
- function isEmpty(value) {
- if (!value && value !== 0) {
- return true;
- } else if (isArray(value) && value.length === 0) {
- return true;
- } else {
- return false;
- }
- }
- function createFrame(object) {
- var frame = extend({}, object);
- frame._parent = object;
- return frame;
- }
- function blockParams(params, ids) {
- params.path = ids;
- return params;
- }
- function appendContextPath(contextPath, id) {
- return (contextPath ? contextPath + '.' : '') + id;
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3V0aWxzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxJQUFNLE1BQU0sR0FBRztBQUNiLEtBQUcsRUFBRSxPQUFPO0FBQ1osS0FBRyxFQUFFLE1BQU07QUFDWCxLQUFHLEVBQUUsTUFBTTtBQUNYLEtBQUcsRUFBRSxRQUFRO0FBQ2IsS0FBRyxFQUFFLFFBQVE7QUFDYixLQUFHLEVBQUUsUUFBUTtBQUNiLEtBQUcsRUFBRSxRQUFRO0NBQ2QsQ0FBQzs7QUFFRixJQUFNLFFBQVEsR0FBRyxZQUFZO0lBQzNCLFFBQVEsR0FBRyxXQUFXLENBQUM7O0FBRXpCLFNBQVMsVUFBVSxDQUFDLEdBQUcsRUFBRTtBQUN2QixTQUFPLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztDQUNwQjs7QUFFTSxTQUFTLE1BQU0sQ0FBQyxHQUFHLG9CQUFvQjtBQUM1QyxPQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUN6QyxTQUFLLElBQUksR0FBRyxJQUFJLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRTtBQUM1QixVQUFJLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDLEVBQUU7QUFDM0Qs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ICsgaWQ7XG59XG4iXX0=
- /***/ }),
- /***/ "./node_modules/handlebars/runtime.js":
- /*!********************************************!*\
- !*** ./node_modules/handlebars/runtime.js ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- // Create a simple path alias to allow browserify to resolve
- // the runtime on a supported path.
- module.exports = __webpack_require__(/*! ./dist/cjs/handlebars.runtime */ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js")['default'];
- /***/ }),
- /***/ "./node_modules/webpack/buildin/global.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/global.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (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;
- /***/ }),
- /***/ "./src/css/main.styl":
- /*!***************************!*\
- !*** ./src/css/main.styl ***!
- \***************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- // extracted by mini-css-extract-plugin
- /***/ }),
- /***/ "./src/index.js":
- /*!**********************!*\
- !*** ./src/index.js ***!
- \**********************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview The entry file of fullcalendar
- * @author NHN FE Development Lab
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Calendar = __webpack_require__(/*! ./js/factory/calendar */ "./src/js/factory/calendar.js");
- __webpack_require__(/*! ./css/main.styl */ "./src/css/main.styl");
- __webpack_require__(/*! ./js/view/template/helper */ "./src/js/view/template/helper.js");
- // for jquery
- if (global.jQuery) {
- global.jQuery.fn.tuiCalendar = function() {
- var options, instance;
- var el = this.get(0);
- var args = Array.prototype.slice.apply(arguments);
- if (el) {
- options = util.pick(args, 0) || {};
- instance = global.jQuery.data(el, 'tuiCalendar');
- if (instance) {
- if (typeof options === 'string' && instance[options]) {
- return instance[options].apply(instance, args.slice(1));
- }
- } else {
- instance = new Calendar(el, options);
- global.jQuery.data(el, 'tuiCalendar', instance);
- }
- }
- return this;
- };
- }
- module.exports = Calendar;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/common/array.js":
- /*!********************************!*\
- !*** ./src/js/common/array.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Utility module for array sort, binary search.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- /**
- * A module for sorting array.
- * @module array
- */
- /**********
- * Search
- **********/
- /**
- * search item index using binary search algorithm.
- *
- * the array must be sorted.
- * @param {array} arr array to search.
- * @param {(string|number|boolean)} search value to search.
- * @param {function} [fn] iteratee for retrieve each element's value to search.
- * @param {function} [compare] compare function for specific sort status. default is string ascending.
- * @returns {number} The number of item index searched. return negative number when no exist that item.
- * It can use insert index after Math.abs()
- * @example
- *
- * var arr = [1, 3, 7, 11, 15, 23];
- *
- * function sortNumber(a, b) {
- * return a - b;
- * }
- *
- * bsearch(arr, 15, null, sortNumber); // 4
- * bsearch(arr, 21, null, sortNumber); // -5
- *
- * arr.splice(Math.abs(bsearch(arr, 21, null, sortNumber)), 0, 21);
- * // [1, 2, 7, 11, 15, 21, 23]
- */
- function bsearch(arr, search, fn, compare) {
- var minIndex = 0,
- maxIndex = arr.length - 1,
- currentIndex,
- value,
- comp;
- compare = compare || stringASC;
- while (minIndex <= maxIndex) {
- currentIndex = (minIndex + maxIndex) / 2 | 0; // Math.floor
- value = fn ? fn(arr[currentIndex]) : arr[currentIndex];
- comp = compare(value, search);
- if (comp < 0) {
- minIndex = currentIndex + 1;
- } else if (comp > 0) {
- maxIndex = currentIndex - 1;
- } else {
- return currentIndex;
- }
- }
- return ~maxIndex;
- }
- /**********
- * Compare Functions
- **********/
- /**
- * compare function for array sort.
- *
- * sort array by ascending.
- * @param {boolean} a The boolean to compare
- * @param {boolean} b The boolean to compare.
- * @returns {number} Result of comparison.
- */
- function booleanASC(a, b) {
- if (a !== b) {
- return a ? -1 : 1;
- }
- return 0;
- }
- /**
- * compare function for array sort.
- *
- * sort array by descending.
- * @param {boolean} a The boolean to compare
- * @param {boolean} b The boolean to compare.
- * @returns {number} Result of comparison.
- */
- function booleanDESC(a, b) {
- if (a !== b) {
- return a ? 1 : -1;
- }
- return 0;
- }
- /**
- * compare function for array sort.
- *
- * sort array by number ascending.
- * @param {number} _a The number to compare.
- * @param {number} _b The number to compare.
- * @returns {number} Result of comparison.
- */
- function numberASC(_a, _b) {
- var a = Number(_a),
- b = Number(_b);
- return a - b;
- }
- /**
- * compare function for array sort.
- *
- * sort array by number descending.
- * @param {number} _a The number to compare.
- * @param {number} _b The number to compare.
- * @returns {number} Result of comparison.
- */
- function numberDESC(_a, _b) {
- var a = Number(_a),
- b = Number(_b);
- return b - a;
- }
- /**
- * compare function for array sort.
- *
- * sort array by string ascending
- * @param {string} _a The string to compare.
- * @param {string} _b The string to compare.
- * @returns {number} Result of comparison.
- */
- function stringASC(_a, _b) {
- var a = String(_a),
- b = String(_b);
- if (a > b) {
- return 1;
- }
- if (a < b) {
- return -1;
- }
- return 0;
- }
- /**
- * compare function for array sort.
- *
- * sort array by string descending
- * @param {string} _a The string to compare.
- * @param {string} _b The string to compare.
- * @returns {number} Result of comparison.
- */
- function stringDESC(_a, _b) {
- var a = String(_a),
- b = String(_b);
- if (a > b) {
- return -1;
- }
- if (a < b) {
- return 1;
- }
- return 0;
- }
- /**
- * compare function for array sort.
- *
- * sort array by string ascending with ignore case.
- * @param {string} _a The string to compare.
- * @param {string} _b The string to compare.
- * @returns {number} Result of comparison.
- */
- function stringASCIgnoreCase(_a, _b) {
- var a = String(_a).toLowerCase(),
- b = String(_b).toLowerCase();
- if (a > b) {
- return 1;
- }
- if (a < b) {
- return -1;
- }
- return 0;
- }
- /**
- * compare function for array sort.
- *
- * sort array by string descending with ignore case.
- * @param {string} _a The string to compare.
- * @param {string} _b The string to compare.
- * @returns {number} Result of comparison.
- */
- function stringDESCIgnoreCase(_a, _b) {
- var a = String(_a).toLowerCase(),
- b = String(_b).toLowerCase();
- if (a > b) {
- return -1;
- }
- if (a < b) {
- return 1;
- }
- return 0;
- }
- /**
- * Compare schedule models for sort.
- *
- * 1. all day schedule first.
- * 2. early start.
- * 3. longest duration.
- * 4. early created.
- * @param {Schedule|ScheduleViewModel} a The object schedule instance.
- * @param {Schedule|ScheduleViewModel} b The object schedule instance.
- * @returns {number} Result of comparison.
- */
- function scheduleASC(a, b) {
- var durationA, durationB;
- var allDayCompare, startsCompare;
- var modelA = a.valueOf();
- var modelB = b.valueOf();
- allDayCompare = booleanASC(modelA.isAllDay || a.hasMultiDates, modelB.isAllDay || b.hasMultiDates);
- if (allDayCompare) {
- return allDayCompare;
- }
- startsCompare = datetime.compare(a.getStarts(), b.getStarts());
- if (startsCompare) {
- return startsCompare;
- }
- durationA = a.duration();
- durationB = b.duration();
- if (durationA < durationB) {
- return 1;
- }
- if (durationA > durationB) {
- return -1;
- }
- return util.stamp(modelA) - util.stamp(modelB);
- }
- module.exports = {
- bsearch: bsearch,
- compare: {
- schedule: {
- asc: scheduleASC
- },
- bool: {
- asc: booleanASC,
- desc: booleanDESC
- },
- num: {
- asc: numberASC,
- desc: numberDESC
- },
- str: {
- asc: stringASC,
- desc: stringDESC,
- ascIgnoreCase: stringASCIgnoreCase,
- descIgnoreCase: stringDESCIgnoreCase
- }
- }
- };
- /***/ }),
- /***/ "./src/js/common/autoScroll.js":
- /*!*************************************!*\
- !*** ./src/js/common/autoScroll.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Add autoscroll feature to elements that prevented text selection.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var domevent = __webpack_require__(/*! ../common/domevent */ "./src/js/common/domevent.js");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
- var Point = __webpack_require__(/*! ../common/point */ "./src/js/common/point.js");
- var SCROLL_INTERVAL = 30;
- var SCROLL_MAX = 15;
- var SCROLL_CLICK_INCREASED = 2; // In IE, the offset of the actual UI pixel when the scroll bar is clicked is offset.
- /**
- * Add autoscroll feature to elements that prevented text selection.
- * @constructor
- * @param {HTMLElement} container - HTMLElement to add autoscroll features.
- */
- function AutoScroll(container) {
- /**
- * @type {HTMLElement}
- */
- this.container = container;
- /**
- * @type {AutoScroll.DIRECTION}
- */
- this._direction = AutoScroll.DIRECTION.INSIDE;
- /**
- * @type {number}
- */
- this._offset = 0;
- /**
- * interval to scrolling
- * @type {number}
- */
- this._intervalID = 0;
- domevent.on(container, {
- 'mousedown': this._onMouseDown
- }, this);
- }
- /**
- * @enum
- */
- AutoScroll.DIRECTION = {
- INSIDE: 0,
- TOP: 1,
- RIGHT: 2,
- BOTTOM: 3,
- LEFT: 4
- };
- /**
- * Instance destroy method.
- */
- AutoScroll.prototype.destroy = function() {
- domevent.off(this.container, {
- 'mousedown': this._onMouseDown,
- 'mousemove': this._onMouseMove,
- 'mouseup': this._onMouseUp
- }, this);
- window.clearInterval(this._intervalID);
- this._intervalID = this._direction = this.container = null;
- };
- /**
- * Normalize ClientRect and calculate each position of edges.
- * @param {ClientRect} clientRect - ClientRect object of element.
- * @returns {object} edges.
- */
- AutoScroll.prototype._getEdgePositions = function(clientRect) {
- return {
- top: clientRect.top,
- right: clientRect.left + clientRect.width,
- bottom: clientRect.bottom,
- left: clientRect.left
- };
- };
- /**
- * Get element real size ("real size" -> size without scrollbar)
- * @param {HTMLElement} el - element want to know real size ("real size" -> size without scrollbar)
- * @returns {number[]} real size [width, height]
- */
- AutoScroll.prototype.getRealSize = function(el) {
- var computed = domutil.getComputedStyle(el),
- border,
- padding;
- border = parseFloat(computed.getPropertyValue('border-top-width')) +
- parseFloat(computed.getPropertyValue('border-bottom-width'));
- padding = parseFloat(computed.getPropertyValue('padding-top')) +
- parseFloat(computed.getPropertyValue('padding-bottom'));
- return [el.clientWidth + border + padding, el.clientHeight + border + padding];
- };
- /**
- * Check supplied element has scrollbar.
- * @param {HTMLElement} el - element want to know has scrollbar.
- * @returns {boolean[]} has scrollbar? [horizontal, vertical]
- */
- AutoScroll.prototype.hasScrollbar = function(el) {
- var realSize = this.getRealSize(el);
- return [
- el.offsetWidth > Math.ceil(realSize[0]),
- el.offsetHeight > Math.ceil(realSize[1])
- ];
- };
- /**
- * @param {HTMLElement} el - element want to know.
- * @param {MouseEvent} mouseEvent - mouse event object.
- * @returns {boolean} mouse pointer is on the scrollbar?
- */
- AutoScroll.prototype.isOnScrollbar = function(el, mouseEvent) {
- var realSize = this.getRealSize(el),
- pos = domevent.getMousePosition(mouseEvent, el),
- mouseInScrollbar = false;
- mouseInScrollbar = (realSize[0] - SCROLL_CLICK_INCREASED < pos[0] ||
- realSize[1] - SCROLL_CLICK_INCREASED < pos[1]);
- return mouseInScrollbar;
- };
- /**
- * MouseDown event handler
- * @param {MouseEvent} mouseDownEvent - mouse down event
- */
- AutoScroll.prototype._onMouseDown = function(mouseDownEvent) {
- // only primary button can start drag.
- if (domevent.getMouseButton(mouseDownEvent) !== 0) {
- return;
- }
- // deactivate autoscroll feature when mouse is on the scrollbar. (IE)
- if (util.browser.msie && this.isOnScrollbar(this.container, mouseDownEvent)) {
- return;
- }
- window.clearInterval(this._intervalID);
- this._intervalID = window.setInterval(this._onTick.bind(this), SCROLL_INTERVAL);
- domevent.on(global, {
- 'mousemove': this._onMouseMove,
- 'mouseup': this._onMouseUp
- }, this);
- };
- /**
- * MouseMove event handler
- * @param {MouseEvent} mouseEvent - mouse move event object.
- */
- AutoScroll.prototype._onMouseMove = function(mouseEvent) {
- var edge = this._getEdgePositions(this.container.getBoundingClientRect()),
- pos = Point.n(domevent.getMousePosition(mouseEvent));
- if (pos.y >= edge.top && pos.y <= edge.bottom &&
- pos.x >= edge.left && pos.x <= edge.right) {
- this._direction = AutoScroll.DIRECTION.INSIDE;
- return;
- }
- if (pos.y < edge.top) {
- this._direction = AutoScroll.DIRECTION.TOP;
- this._offset = edge.top - pos.y;
- return;
- }
- if (pos.y > edge.bottom) {
- this._direction = AutoScroll.DIRECTION.BOTTOM;
- this._offset = pos.y - edge.bottom;
- return;
- }
- if (pos.x < edge.left) {
- this._direction = AutoScroll.DIRECTION.LEFT;
- this._offset = edge.left - pos.x;
- return;
- }
- this._direction = AutoScroll.DIRECTION.RIGHT;
- this._offset = pos.x - edge.right;
- };
- /**
- * MouseUp event handler.
- */
- AutoScroll.prototype._onMouseUp = function() {
- window.clearInterval(this._intervalID);
- this._intervalID = 0;
- this._direction = AutoScroll.DIRECTION.INSIDE;
- this._offset = 0;
- domevent.off(global, {
- 'mousemove': this._onMouseMove,
- 'mouseup': this._onMouseUp
- }, this);
- };
- /**
- * Interval tick event handler
- */
- AutoScroll.prototype._onTick = function() {
- var direction = this._direction,
- container,
- factor;
- if (!direction) {
- return;
- }
- container = this.container;
- factor = Math.min(this._offset, SCROLL_MAX);
- switch (direction) {
- case AutoScroll.DIRECTION.TOP:
- container.scrollTop -= factor;
- break;
- case AutoScroll.DIRECTION.RIGHT:
- container.scrollLeft += factor;
- break;
- case AutoScroll.DIRECTION.BOTTOM:
- container.scrollTop += factor;
- break;
- default:
- container.scrollLeft -= factor;
- break;
- }
- };
- module.exports = AutoScroll;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/common/collection.js":
- /*!*************************************!*\
- !*** ./src/js/common/collection.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Common collections.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var forEachProp = util.forEachOwnProperties,
- forEachArr = util.forEachArray,
- isFunc = util.isFunction,
- isObj = util.isObject;
- var aps = Array.prototype.slice;
- /**
- * Common collection.
- *
- * It need function for get model's unique id.
- *
- * if the function is not supplied then it use default function {@link Collection#getItemID}
- * @constructor
- * @param {function} [getItemIDFn] function for get model's id.
- */
- function Collection(getItemIDFn) {
- /**
- * @type {object.<string, *>}
- */
- this.items = {};
- /**
- * @type {number}
- */
- this.length = 0;
- if (isFunc(getItemIDFn)) {
- /**
- * @type {function}
- */
- this.getItemID = getItemIDFn;
- }
- }
- /**********
- * static props
- **********/
- /**
- * Combind supplied function filters and condition.
- * @param {...function} filters - function filters
- * @returns {function} combined filter
- */
- Collection.and = function(filters) {
- var cnt;
- filters = aps.call(arguments);
- cnt = filters.length;
- return function(item) {
- var i = 0;
- for (; i < cnt; i += 1) {
- if (!filters[i].call(null, item)) {
- return false;
- }
- }
- return true;
- };
- };
- /**********
- * prototype props
- **********/
- /**
- * get model's unique id.
- * @param {object} item model instance.
- * @returns {number} model unique id.
- */
- Collection.prototype.getItemID = function(item) {
- return String(item._id);
- };
- /**
- * add models.
- * @param {...*} item models to add this collection.
- */
- Collection.prototype.add = function(item) {
- var self = this,
- id,
- ownItems;
- if (arguments.length > 1) {
- forEachArr(aps.call(arguments), function(o) {
- self.add(o);
- });
- return;
- }
- id = this.getItemID(item);
- ownItems = this.items;
- if (!ownItems[id]) {
- this.length += 1;
- }
- ownItems[id] = item;
- };
- /**
- * remove models.
- * @param {...(object|string|number)} id model instance or unique id to delete.
- * @returns {array} deleted model list.
- */
- Collection.prototype.remove = function(id) {
- var self = this,
- removed = [],
- ownItems,
- itemToRemove;
- if (!this.length) {
- return removed;
- }
- if (arguments.length > 1) {
- removed = util.map(aps.call(arguments), function(_id) {
- return self.remove(_id);
- });
- return removed;
- }
- ownItems = this.items;
- if (isObj(id)) {
- id = this.getItemID(id);
- }
- if (!ownItems[id]) {
- return removed;
- }
- this.length -= 1;
- itemToRemove = ownItems[id];
- delete ownItems[id];
- return itemToRemove;
- };
- /**
- * remove all models in collection.
- */
- Collection.prototype.clear = function() {
- this.items = {};
- this.length = 0;
- };
- /**
- * check collection has specific model.
- * @param {(object|string|number|function)} id model instance or id or filter function to check
- * @returns {boolean} is has model?
- */
- Collection.prototype.has = function(id) {
- var isFilter,
- has;
- if (!this.length) {
- return false;
- }
- isFilter = isFunc(id);
- has = false;
- if (isFilter) {
- this.each(function(item) {
- if (id(item) === true) {
- has = true;
- return false; // returning false can stop this loop
- }
- return true;
- });
- } else {
- id = isObj(id) ? this.getItemID(id) : id;
- has = util.isExisty(this.items[id]);
- }
- return has;
- };
- /**
- * invoke callback when model exist in collection.
- * @param {(string|number)} id model unique id.
- * @param {function} fn the callback.
- * @param {*} [context] callback context.
- */
- Collection.prototype.doWhenHas = function(id, fn, context) {
- var item = this.items[id];
- if (!util.isExisty(item)) {
- return;
- }
- fn.call(context || this, item);
- };
- /**
- * Search model. and return new collection.
- * @param {function} filter filter function.
- * @returns {Collection} new collection with filtered models.
- * @example
- * collection.find(function(item) {
- * return item.edited === true;
- * });
- *
- * function filter1(item) {
- * return item.edited === false;
- * }
- *
- * function filter2(item) {
- * return item.disabled === false;
- * }
- *
- * collection.find(Collection.and(filter1, filter2));
- */
- Collection.prototype.find = function(filter) {
- var result = new Collection();
- if (this.hasOwnProperty('getItemID')) {
- result.getItemID = this.getItemID;
- }
- this.each(function(item) {
- if (filter(item) === true) {
- result.add(item);
- }
- });
- return result;
- };
- /**
- * Group element by specific key values.
- *
- * if key parameter is function then invoke it and use returned value.
- * @param {(string|number|function|array)} key key property or getter function.
- * if string[] supplied, create each collection before grouping.
- * @param {function} [groupFunc] - function that return each group's key
- * @returns {object.<string, Collection>} grouped object
- * @example
- *
- * // pass `string`, `number`, `boolean` type value then group by property value.
- * collection.groupBy('gender'); // group by 'gender' property value.
- * collection.groupBy(50); // group by '50' property value.
- *
- * // pass `function` then group by return value. each invocation `function` is called with `(item)`.
- * collection.groupBy(function(item) {
- * if (item.score > 60) {
- * return 'pass';
- * }
- * return 'fail';
- * });
- *
- * // pass `array` with first arguments then create each collection before grouping.
- * collection.groupBy(['go', 'ruby', 'javascript']);
- * // result: { 'go': empty Collection, 'ruby': empty Collection, 'javascript': empty Collection }
- *
- * // can pass `function` with `array` then group each elements.
- * collection.groupBy(['go', 'ruby', 'javascript'], function(item) {
- * if (item.isFast) {
- * return 'go';
- * }
- *
- * return item.name;
- * });
- */
- Collection.prototype.groupBy = function(key, groupFunc) {
- var result = {},
- collection,
- baseValue,
- keyIsFunc = isFunc(key),
- getItemIDFn = this.getItemID;
- if (util.isArray(key)) {
- util.forEachArray(key, function(k) {
- result[String(k)] = new Collection(getItemIDFn);
- });
- if (!groupFunc) {
- return result;
- }
- key = groupFunc;
- keyIsFunc = true;
- }
- this.each(function(item) {
- if (keyIsFunc) {
- baseValue = key(item);
- } else {
- baseValue = item[key];
- if (isFunc(baseValue)) {
- baseValue = baseValue.apply(item);
- }
- }
- collection = result[baseValue];
- if (!collection) {
- collection = result[baseValue] = new Collection(getItemIDFn);
- }
- collection.add(item);
- });
- return result;
- };
- /**
- * Return single item in collection.
- *
- * Returned item is inserted in this collection firstly.
- * @param {function} [filter] - function filter
- * @returns {object} item.
- */
- Collection.prototype.single = function(filter) {
- var result,
- useFilter = util.isFunction(filter);
- this.each(function(item) {
- if (!useFilter) {
- result = item;
- return false; // returning false can stop this loop
- }
- if (filter(item)) {
- result = item;
- return false; // returning false can stop this loop
- }
- return true;
- }, this);
- return result;
- };
- /**
- * sort a basis of supplied compare function.
- * @param {function} compareFunction compareFunction
- * @returns {array} sorted array.
- */
- Collection.prototype.sort = function(compareFunction) {
- var arr = [];
- this.each(function(item) {
- arr.push(item);
- });
- if (isFunc(compareFunction)) {
- arr = arr.sort(compareFunction);
- }
- return arr;
- };
- /**
- * iterate each model element.
- *
- * when iteratee return false then break the loop.
- * @param {function} iteratee iteratee(item, index, items)
- * @param {*} [context] context
- */
- Collection.prototype.each = function(iteratee, context) {
- forEachProp(this.items, iteratee, context || this);
- };
- /**
- * return new array with collection items.
- * @returns {array} new array.
- */
- Collection.prototype.toArray = function() {
- if (!this.length) {
- return [];
- }
- return util.map(this.items, function(item) {
- return item;
- });
- };
- module.exports = Collection;
- /***/ }),
- /***/ "./src/js/common/common.js":
- /*!*********************************!*\
- !*** ./src/js/common/common.js ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview common/general utilities.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
- Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- /**
- * Default schedule id getter for collection
- * @param {Schedule} schedule - schedule instance
- * @returns {string} schedule id
- */
- function scheduleIDGetter(schedule) {
- return schedule.cid();
- }
- module.exports = {
- /**
- * @returns {Collection} new collection for schedule models.
- */
- createScheduleCollection: function() {
- return new Collection(scheduleIDGetter);
- },
- /**
- * Get ratio value.
- *
- * a : b = y : X;
- *
- * =
- *
- * X = (b * y) / a;
- * @param {number} a - a
- * @param {number} b - b
- * @param {number} y - y
- * @returns {number} ratio value
- */
- ratio: function(a, b, y) {
- // a : b = y : x;
- return (b * y) / a;
- },
- /**
- * Find nearest value from supplied params.
- * @param {number} value - value to find.
- * @param {array} nearest - nearest array.
- * @returns {number} nearest value
- */
- nearest: function(value, nearest) {
- var diff = util.map(nearest, function(v) {
- return Math.abs(value - v);
- }),
- nearestIndex = util.inArray(Math.min.apply(null, diff), diff);
- return nearest[nearestIndex];
- },
- /**
- * Mixin method.
- *
- * (extend methods except property name 'mixin')
- * @param {object} from - mixin object.
- * @param {object} to - object to mixin.
- */
- mixin: function(from, to) {
- util.extend(to.prototype, from);
- },
- /**
- * Limit supplied value base on `minArr`, `maxArr`
- * @param {number} value - value
- * @param {array} minArr - min
- * @param {array} maxArr - max
- * @returns {number} limited value
- */
- limit: function(value, minArr, maxArr) {
- var v = Math.max.apply(null, [value].concat(minArr));
- v = Math.min.apply(null, [v].concat(maxArr));
- return v;
- },
- /**
- * Limit supplied date base on `min`, `max`
- * @param {TZDate} date - date
- * @param {TZDate} min - min
- * @param {TZDate} max - max
- * @returns {TZDate} limited value
- */
- limitDate: function(date, min, max) {
- if (date < min) {
- return min;
- }
- if (date > max) {
- return max;
- }
- return date;
- },
- /**
- * Max value with TZDate type for timezone calculation
- * @param {TZDate} d1 - date 1
- * @param {TZDate} d2 - date 2
- * @returns {TZDate}
- */
- maxDate: function(d1, d2) {
- if (d1 > d2) {
- return d1;
- }
- return d2;
- },
- stripTags: function(str) {
- return str.replace(/<([^>]+)>/ig, '');
- },
- /**
- * Get first value in 2-dimentional array.
- * @param {Array.<Array>} arr2d - 2-dimentional array
- * @returns {*} first value in 2d array
- */
- firstIn2dArray: function(arr2d) {
- return util.pick(arr2d, '0', '0');
- },
- /**
- * Get last value in 2-dimentional array.
- * @param {Array.<Array>} arr2d - 2-dimentional array
- * @returns {*} last value in 2d array
- */
- lastIn2dArray: function(arr2d) {
- var lastRow = arr2d.length - 1,
- lastCol = arr2d[lastRow].length - 1;
- return util.pick(arr2d, lastRow, lastCol);
- },
- /**
- * Set 'title' attribute for all elements that have exceeded content in
- * container
- * @param {string} selector - CSS selector {@see domutil#find}
- * @param {HTMLElement} container - container element
- * @param {boolean} force - force to apply
- */
- setAutoEllipsis: function(selector, container, force) {
- util.forEach(domutil.find(selector, container, true), function(el) {
- if (force || el.offsetWidth < el.scrollWidth) {
- el.setAttribute('title', domutil.getData(el, 'title'));
- }
- });
- },
- /**
- * Set the value at path of object.
- * @param {object} object - the object to modify
- * @param {string} path -the path of property to set
- * @param {*} value - the value to set
- */
- set: function(object, path, value) {
- var names = path.split('.');
- var store = object;
- util.forEach(names, function(name, index) {
- store[name] = store[name] || {};
- if (index === names.length - 1) {
- store[name] = value;
- } else {
- store = store[name];
- }
- });
- },
- /**
- * shift a array
- * @param {Array.<any>} array - array
- * @param {number} shift - positive or negative integer to shift
- * @returns {Array.<any>} shifted array
- */
- shiftArray: function(array, shift) {
- var length = Math.abs(shift);
- var i;
- if (shift > 0) {
- for (i = 0; i < length; i += 1) {
- array.push(array.shift());
- }
- } else if (shift < 0) {
- for (i = 0; i < length; i += 1) {
- array.unshift(array.pop());
- }
- }
- return array;
- },
- /**
- * take elements from array between start and end.
- * @param {Array.<any>} array - array
- * @param {number} start - start index
- * @param {number} end - end index
- * @returns {Array.<any>}
- */
- takeArray: function(array, start, end) {
- var length = array.length;
- var rightCount = length - end;
- var leftCount = start;
- // remove right
- array.splice(end, rightCount);
- // remove left
- array.splice(0, leftCount);
- return array;
- },
- /**
- * shift hours
- * @param {number} hours - hours
- * @param {number} shift - positive or negative integer to shift
- * @returns {number} shifted hours
- */
- shiftHours: function(hours, shift) {
- if (shift > 0) {
- hours = (hours + shift) % 24;
- } else if (shift < 0) {
- hours += shift;
- hours = hours > 0 ? hours : 24 + hours;
- }
- return hours;
- },
- /**
- * Parse css value into number and units
- * @param {string} cssValue - css value like '72px'
- * @returns {Array} [number, unit]
- */
- parseUnit: function(cssValue) {
- var number = parseFloat(cssValue, 10);
- var unit = cssValue.match(/[\d.\-+]*\s*(.*)/)[1] || '';
- return [number, unit];
- },
- find: function(array, iteratee, contextopt) {
- var found;
- util.forEach(array, function(item) {
- if (iteratee) {
- found = iteratee(item);
- }
- if (found) {
- found = item;
- return false;
- }
- return true;
- }, contextopt);
- return found;
- },
- getScheduleChanges: function(schedule, propNames, data) {
- var changes = {};
- var dateProps = ['start', 'end'];
- util.forEach(propNames, function(propName) {
- if (dateProps.indexOf(propName) > -1) {
- if (datetime.compare(schedule[propName], data[propName])) {
- changes[propName] = data[propName];
- }
- } else if (!util.isUndefined(data[propName]) && schedule[propName] !== data[propName]) {
- changes[propName] = data[propName];
- }
- });
- return util.isEmpty(changes) ? null : changes;
- }
- };
- /***/ }),
- /***/ "./src/js/common/datetime.js":
- /*!***********************************!*\
- !*** ./src/js/common/datetime.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview datetime utility module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var TZDate = __webpack_require__(/*! ./timezone */ "./src/js/common/timezone.js").Date,
- dw = __webpack_require__(/*! ../common/dw */ "./src/js/common/dw.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- /* eslint-disable no-useless-escape */
- var dateFormatRx = /^(\d{4}[-|\/]*\d{2}[-|\/]*\d{2})\s?(\d{2}:\d{2}:\d{2})?$/;
- var datetime, tokenFunc;
- var memo = {
- millisecondsTo: {},
- millisecondsFrom: {}
- };
- tokenFunc = {
- /**
- * @param {TZDate} date date object.
- * @returns {string} YYYYMMDD
- */
- 'YYYYMMDD': function(date) {
- return [
- date.getFullYear(),
- datetime.leadingZero(date.getMonth() + 1, 2),
- datetime.leadingZero(date.getDate(), 2)
- ].join('');
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} four digit year number
- */
- 'YYYY': function(date) {
- return String(date.getFullYear());
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} two digit month number
- */
- 'MM': function(date) {
- return datetime.leadingZero(date.getMonth() + 1, 2);
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} two digit date number
- */
- 'DD': function(date) {
- return datetime.leadingZero(date.getDate(), 2);
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} HH:mm
- */
- 'HH:mm': function(date) {
- var hour = date.getHours(),
- minutes = date.getMinutes();
- return datetime.leadingZero(hour, 2) + ':' +
- datetime.leadingZero(minutes, 2);
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} hh:mm
- */
- 'hh:mm': function(date) {
- var hour = date.getHours();
- var minutes = date.getMinutes();
- if (hour > 12) {
- hour = hour % 12;
- }
- return datetime.leadingZero(hour, 2) + ':' +
- datetime.leadingZero(minutes, 2);
- },
- /**
- * @param {TZDate} date date object
- * @returns {string} tt
- */
- 'tt': function(date) {
- var hour = date.getHours();
- return hour < 12 ? 'am' : 'pm';
- }
- };
- datetime = {
- /**
- * The number of milliseconds one day.
- * @type {number}
- */
- MILLISECONDS_PER_DAY: 86400000,
- /**
- * The number of milliseconds one hour.
- * @type {number}
- */
- MILLISECONDS_PER_HOUR: 3600000,
- /**
- * The number of milliseconds one minutes.
- * @type {number}
- */
- MILLISECONDS_PER_MINUTES: 60000,
- /**
- * The number of milliseconds 20 minutes for schedule min duration
- * @type {number}
- */
- MILLISECONDS_SCHEDULE_MIN_DURATION: 20 * 60000,
- /**
- * convert milliseconds
- * @param {string} type - type of value.
- * @param {number} value - value to convert.
- * @param {function} iteratee - iteratee function to use reduce.
- * @returns {number} converted value.
- */
- _convMilliseconds: function(type, value, iteratee) {
- var conv = [24, 60, 60, 1000],
- index = {
- day: 0,
- hour: 1,
- minutes: 2,
- seconds: 3
- };
- if (!(type in index) || global.isNaN(value)) {
- return false;
- }
- return util.reduce([value].concat(conv.slice(index[type])), iteratee);
- },
- /**
- * Convert milliseconds value to other type
- * @param {type} type convert to type want to. support "day", "hour",
- * "minutes", "seconds" only.
- * @param {value} value - value to convert.
- * @returns {number} converted value.
- */
- millisecondsTo: function(type, value) {
- var cache = memo.millisecondsTo,
- key = type + value;
- if (cache[key]) {
- return cache[key];
- }
- cache[key] = datetime._convMilliseconds(type, value, function(m, v) {
- return m / v;
- });
- return cache[key];
- },
- /**
- * Convert value to milliseconds
- * @param {type} type - type of supplied value. support "hour", "minutes", "seconds" only.
- * @param {value} value - value to convert.
- * @returns {number} converted value.
- */
- millisecondsFrom: function(type, value) {
- var cache = memo.millisecondsFrom,
- key = type + value;
- if (cache[key]) {
- return cache[key];
- }
- cache[key] = datetime._convMilliseconds(type, value, function(m, v) {
- return m * v;
- });
- return cache[key];
- },
- /**
- * Convert hours to minutes
- * @param {number} hours - hours
- * @returns {number} minutes
- */
- minutesFromHours: function(hours) {
- return hours * 60;
- },
- /**
- * Make date array from supplied paramters.
- * @param {TZDate} start Start date.
- * @param {TZDate} end End date.
- * @param {number} step The number of milliseconds to use increment.
- * @returns {TZDate[]} TZDate array.
- */
- range: function(start, end, step) {
- var startTime = start.getTime();
- var endTime = end.getTime();
- var cursor = startTime;
- var date = dw(new TZDate(start));
- var result = [];
- while (cursor <= endTime && endTime >= date.d.getTime()) {
- result.push(datetime.start(date.d));
- cursor = cursor + step;
- date.addDate(1);
- }
- return result;
- },
- /**
- * Clone supplied date.
- * @param {TZDate} date date object to clone.
- * @returns {TZDate} Cloned date object
- */
- clone: function(date) {
- return new TZDate(date);
- },
- /**
- * Compare two dates.
- *
- * when first date is latest then seconds then return -1.
- *
- * return +1 reverse, and return 0 is same.
- * @param {TZDate} d1 Date object to compare.
- * @param {TZDate} d2 Date object to compare.
- * @returns {number} result of compare
- */
- compare: function(d1, d2) {
- var _d1 = d1.getTime(),
- _d2 = d2.getTime();
- if (_d1 < _d2) {
- return -1;
- }
- if (_d1 > _d2) {
- return 1;
- }
- return 0;
- },
- /**
- * @param {TZDate} d1 - date one
- * @param {TZDate} d2 - date two
- * @returns {boolean} is two date are same year, month?
- */
- isSameMonth: function(d1, d2) {
- return (d1.getFullYear() === d2.getFullYear() &&
- d1.getMonth() === d2.getMonth());
- },
- /**
- * @param {TZDate} d1 - date one
- * @param {TZDate} d2 - date two
- * @returns {boolean} is two date are same year, month, date?
- */
- isSameDate: function(d1, d2) {
- var sameMonth = datetime.isSameMonth(d1, d2);
- return sameMonth && (d1.getDate() === d2.getDate());
- },
- /**
- * Check supplied parameter is valid date object.
- * @param {*} d Object to validate.
- * @returns {boolean} return true when parameter is valid date object.
- */
- isValid: function(d) {
- if (d instanceof TZDate) {
- return !window.isNaN(d.getTime());
- }
- return false;
- },
- /**
- * convert non local date to UTC date.
- * @param {TZDate} d Date to convert UTC.
- * @returns {TZDate} The UTC Date.
- */
- toUTC: function(d) {
- var l = d.getTime(),
- offset = datetime.millisecondsFrom('minutes', new Date().getTimezoneOffset());
- return new TZDate(l + offset);
- },
- /**
- * pad left zero characters.
- * @param {number} number number value to pad zero.
- * @param {number} length pad length to want.
- * @returns {string} padded string.
- */
- leadingZero: function(number, length) {
- var zero = '',
- i = 0;
- if (String(number).length > length) {
- return String(number);
- }
- for (; i < (length - 1); i += 1) {
- zero += '0';
- }
- return (zero + number).slice(length * -1);
- },
- /**
- * Convert date string to date object.
- *
- * Only listed below formats avaliable.
- *
- * - YYYYMMDD
- * - YYYY/MM/DD
- * - YYYY-MM-DD
- * - YYYY/MM/DD HH:mm:SS
- * - YYYY-MM-DD HH:mm:SS
- *
- * @param {string} str Formatted string.
- * @param {number} [fixMonth=-1] - number for fix month calculating.
- * @returns {(TZDate|boolean)} Converted Date object. when supplied str is not available then return false.
- */
- parse: function(str, fixMonth) {
- var separator,
- matches = str.match(dateFormatRx),
- ymd,
- hms;
- if (util.isUndefined(fixMonth)) {
- fixMonth = -1;
- }
- if (!matches) {
- return false;
- }
- if (str.length > 8) {
- // YYYY/MM/DD
- // YYYY-MM-DD
- // YYYY/MM/DD HH:mm:SS
- // YYYY-MM-DD HH:mm:SS
- separator = ~str.indexOf('/') ? '/' : '-';
- matches = matches.splice(1);
- ymd = matches[0].split(separator);
- hms = matches[1] ? matches[1].split(':') : [0, 0, 0];
- } else {
- // YYYYMMDD
- matches = matches[0];
- ymd = [matches.substr(0, 4), matches.substr(4, 2), matches.substr(6, 2)];
- hms = [0, 0, 0];
- }
- return new TZDate().setWithRaw(
- Number(ymd[0]),
- Number(ymd[1]) + fixMonth,
- Number(ymd[2]),
- Number(hms[0]),
- Number(hms[1]),
- Number(hms[2]),
- 0
- );
- },
- /**
- * Return date object from Date.
- * @param {TZDate} date date
- * @returns {object} Date object.
- */
- raw: function(date) {
- return {
- y: date.getFullYear(),
- M: date.getMonth(),
- d: date.getDate(),
- h: date.getHours(),
- m: date.getMinutes(),
- s: date.getSeconds(),
- ms: date.getMilliseconds()
- };
- },
- /**
- * Return 00:00:00 supplied date.
- * @param {TZDate} date date. if undefined, use now.
- * @returns {TZDate} start date.
- */
- start: function(date) {
- var d = date ? new TZDate(date) : new TZDate();
- d.setHours(0, 0, 0, 0);
- return d;
- },
- /**
- * Return 23:59:59 supplied date.
- * @param {TZDate} date date. if undefined, use now.
- * @returns {TZDate} end date.
- */
- end: function(date) {
- var d = date ? new TZDate(date) : new TZDate();
- d.setHours(23, 59, 59, 0);
- return d;
- },
- /**
- * Return formatted string as basis of supplied string.
- *
- * Supported Token Lists.
- *
- * - YYYY => 1988
- * - MM => 01 ~ 12
- * - DD => 01 ~ 31
- * - YYYYMMDD => 19880925
- * @param {TZDate} date String want to formatted.
- * @param {string} format format str.
- * @returns {string} Formatted date string.
- */
- format: function(date, format) {
- var result = format;
- util.forEachOwnProperties(tokenFunc, function(converter, token) {
- result = result.replace(token, converter(date));
- });
- return result;
- },
- /**
- * Get start date of specific month
- * @param {TZDate} date - date to get start date
- * @returns {TZDate} start date of supplied month
- */
- startDateOfMonth: function(date) {
- var startDate = new TZDate(date);
- startDate.setDate(1);
- startDate.setHours(0, 0, 0, 0);
- return startDate;
- },
- /**
- * Get end date of specific month
- * @param {TZDate} date - date to get end date
- * @returns {TZDate} end date of supplied month
- */
- endDateOfMonth: function(date) {
- var endDate = datetime.startDateOfMonth(date);
- endDate.setMonth(endDate.getMonth() + 1);
- endDate.setDate(endDate.getDate() - 1);
- endDate.setHours(23, 59, 59);
- return endDate;
- },
- /**
- * Return 2-dimensional array month calendar
- *
- * dates that different month with given date are negative values
- * @param {TZDate} month - date want to calculate month calendar
- * @param {object} options - options
- * @param {number} [options.startDayOfWeek=0] - start day of week
- * @param {boolean} options.isAlways6Week - whether the number of weeks are always 6
- * @param {number} options.visibleWeeksCount visible weeks count
- * @param {boolean} options.workweek - only show work week
- * @param {function} [iteratee] - iteratee for customizing calendar object
- * @returns {Array.<TZDate[]>} calendar 2d array
- */
- arr2dCalendar: function(month, options, iteratee) {
- var weekArr,
- start, end,
- startIndex, endIndex,
- totalDate, afterDates,
- cursor, week,
- calendar = [],
- startDayOfWeek = options.startDayOfWeek,
- isAlways6Week = util.isUndefined(options.isAlways6Week) || options.isAlways6Week,
- visibleWeeksCount = options.visibleWeeksCount,
- workweek = options.workweek;
- if (visibleWeeksCount) {
- start = new TZDate(month);
- end = dw(new TZDate(month));
- end.addDate(7 * (visibleWeeksCount - 1));
- end = end.d;
- } else {
- start = datetime.startDateOfMonth(month);
- end = datetime.endDateOfMonth(month);
- }
- // create day number array by startDayOfWeek number
- // 4 -> [4, 5, 6, 0, 1, 2, 3]
- // 2 -> [2, 3, 4, 5, 6, 0, 1]
- weekArr = util.range(startDayOfWeek, 7).concat(util.range(7)).slice(0, 7);
- startIndex = util.inArray(start.getDay(), weekArr);
- endIndex = util.inArray(end.getDay(), weekArr);
- // free dates after last date of this month
- afterDates = 7 - (endIndex + 1);
- if (visibleWeeksCount) {
- totalDate = 7 * visibleWeeksCount;
- } else {
- totalDate = isAlways6Week ? (7 * 6) : (startIndex + end.getDate() + afterDates);
- }
- cursor = datetime.start(start).addDate(-startIndex);
- // iteratee all dates to render
- util.forEachArray(util.range(totalDate), function(i) {
- var date;
- if (!(i % 7)) {
- // group each date by week
- week = calendar[i / 7] = [];
- }
- date = datetime.start(cursor);
- date = iteratee ? iteratee(date) : date;
- if (!workweek || !datetime.isWeekend(date.getDay())) {
- week.push(date);
- }
- // add date
- cursor.setDate(cursor.getDate() + 1);
- });
- return calendar;
- },
- /**
- * Calculate grid left(%), width(%) by narrowWeekend, startDayOfWeek, workweek
- *
- * @param {number} days - day length of week
- * @param {boolean} narrowWeekend - narrow weekend
- * @param {number} startDayOfWeek - start day of week
- * @param {boolean} workweek - only show work week
- * @returns {Array} day, left, width
- */
- getGridLeftAndWidth: function(days, narrowWeekend, startDayOfWeek, workweek) {
- var limitDaysToApplyNarrowWeekend = 5;
- var uniformWidth = 100 / days;
- var wideWidth = days > limitDaysToApplyNarrowWeekend ? 100 / (days - 1) : uniformWidth;
- var accumulatedWidth = 0;
- var dates = util.range(startDayOfWeek, 7).concat(util.range(days)).slice(0, 7);
- if (workweek) {
- dates = util.filter(dates, function(day) {
- return !datetime.isWeekend(day);
- });
- }
- narrowWeekend = workweek ? false : narrowWeekend;
- return util.map(dates, function(day) {
- var model;
- var width = narrowWeekend ? wideWidth : uniformWidth;
- if (days > limitDaysToApplyNarrowWeekend && narrowWeekend && datetime.isWeekend(day)) {
- width = wideWidth / 2;
- }
- model = {
- day: day,
- width: width,
- left: accumulatedWidth
- };
- accumulatedWidth += width;
- return model;
- });
- },
- /**
- * Get that day is weekend
- * @param {number} day number
- * @returns {boolean} true if weekend or false
- */
- isWeekend: function(day) {
- return day === 0 || day === 6;
- },
- /**
- * Whether date is between supplied dates with date value?
- * @param {TZDate} d - target date
- * @param {TZDate} d1 - from date
- * @param {TZDate} d2 - to date
- * @returns {boolean} is between?
- */
- isBetweenWithDate: function(d, d1, d2) {
- var format = 'YYYYMMDD';
- d = parseInt(datetime.format(d, format), 10);
- d1 = parseInt(datetime.format(d1, format), 10);
- d2 = parseInt(datetime.format(d2, format), 10);
- return d1 <= d && d <= d2;
- },
- isStartOfDay: function(d) {
- return !datetime.compare(datetime.start(d), d);
- },
- convertStartDayToLastDay: function(d) {
- var date = new TZDate(d);
- if (datetime.isStartOfDay(d)) {
- date.setDate(date.getDate() - 1);
- date.setHours(23, 59, 59);
- }
- return date;
- },
- getStartOfNextDay: function(d) {
- var date = datetime.start(d);
- date.setHours(24);
- return date;
- },
- getDateDifference: function(d1, d2) {
- var time1 = new TZDate(d1.getFullYear(), d1.getMonth(), d1.getDate()).getTime();
- var time2 = new TZDate(d2.getFullYear(), d2.getMonth(), d2.getDate()).getTime();
- return Math.round((time1 - time2) / datetime.MILLISECONDS_PER_DAY);
- },
- getHourDifference: function(d1, d2) {
- var time1 = new TZDate(d1).getTime();
- var time2 = new TZDate(d2).getTime();
- return Math.round((time1 - time2) / datetime.MILLISECONDS_PER_HOUR);
- },
- hasMultiDates: function(start, end) {
- var diffDays = datetime.getDateDifference(start, end);
- var diffHours = Math.abs(datetime.getHourDifference(start, end));
- var withinDay = Math.abs(diffDays) === 1 && diffHours < 24 && datetime.isStartOfDay(end);
- return !datetime.isSameDate(start, end) && !withinDay;
- },
- renderEnd: function(start, end) {
- var diffDays = datetime.getDateDifference(start, end);
- return Math.abs(diffDays) >= 1 && datetime.isStartOfDay(end) ?
- datetime.convertStartDayToLastDay(end) :
- datetime.end(end);
- }
- };
- module.exports = datetime;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/common/dirty.js":
- /*!********************************!*\
- !*** ./src/js/common/dirty.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Dirty flagging module for objects.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var common = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var existy = common.isExisty,
- pick = common.pick,
- isFunc = common.isFunction;
- /**
- * Mixin module for dirty flagging on specific objects.
- * @mixin
- * @example
- * var obj = { hello: 'good', test: '123' };
- * dirty.mixin(obj);
- *
- * obj.set('hello', 'world');
- * obj.isDirty(); // true
- * obj.isPropChanged('hello'); // true
- * obj.isPropChanged('test'); // false
- * obj.dirty(false);
- *
- * obj.isDirty(); // false
- * obj.isPropChanged('hello'); // false
- */
- var dirty = {
- /**
- * Set property value with dirty flagging.
- * @param {string} propName Property name.
- * @param {*} value Proprty value.
- */
- set: function(propName, value) {
- var originValue = this[propName];
- if (originValue === value) {
- return;
- }
- this[propName] = value;
- if (!this._changed) {
- /**
- * Save changed properties.
- * @memberof dirty
- * @name _changed
- * @type {Object}
- */
- this._changed = {};
- }
- this._changed[propName] = true;
- /**
- * Dirty flag
- * @type {Boolean}
- * @name _dirty
- * @memberof dirty
- */
- this._dirty = true;
- },
- /**
- * Check dirty flag.
- * @returns {boolean} Property is changed.
- */
- isDirty: function() {
- return !!this._dirty;
- },
- /**
- * Set dirty flag manually.
- * @param {Boolean} [toDirty=true] This will set dirty flag directly.
- */
- dirty: function(toDirty) {
- toDirty = existy(toDirty) ? toDirty : true;
- /* istanbul ignore else */
- if (!toDirty) {
- this._changed = {};
- }
- this._dirty = toDirty;
- },
- /**
- * Delete property safety.
- * @param {String} propName The name of property.
- */
- deleteProp: function(propName) {
- delete this[propName];
- if (this._changed) {
- delete this._changed[propName];
- }
- },
- /**
- * Check the changes with specific property.
- * @param {String} propName The name of property you want.
- * @returns {boolean} Is property changed?
- */
- isPropChanged: function(propName) {
- if (!this._changed) {
- return false;
- }
- return this._changed[propName] === true;
- },
- /**
- * Mixin to specific objects.
- * @param {Object} target The object to mix this module.
- * @memberof module:util/dirty
- * @example
- * function Animal() {}
- * dirty.mixin(Animal.prototype);
- */
- mixin: function(target) {
- var methodFilterR = /(^_|mixin|wrap)/;
- common.forEachOwnProperties(dirty, function(o, k) {
- if (!methodFilterR.test(k)) {
- target[k] = dirty[k];
- }
- });
- },
- /**
- * Wrapper method for dirty flagging.
- *
- * This method invoke after invoked specific method that added by you.
- *
- * The method want to add are must exist before add.
- * @param {object} target Target object to method wrap.
- * @param {(string|object)} methodName
- * Method name to wrap or methodName: flag objects.
- * @param {boolean} [flag=true]
- * this will used to flagging by dirty flagger after invoke the methods added by you.
- * @memberof module:util/dirty
- * @example
- * function Animal(name) {
- * this.name = name;
- * }
- * Animal.prototype.growl = jasmine.createSpy('growl');
- * Animal.prototype.test = function() {
- * return this.name;
- * };
- *
- * dirty.mixin(Animal.prototype);
- * // single
- * dirty.wrap(Animal.prototype, 'growl', true);
- * // multiple
- * dirty.wrap(Animap.prototype, {
- * growl: true,
- * test: false
- * });
- *
- */
- wrap: function(target, methodName, flag) {
- var wrap = dirty.wrap,
- fn;
- if (common.isObject(methodName)) {
- common.forEachOwnProperties(methodName, function(_flag, _name) {
- wrap(target, _name, _flag);
- });
- return;
- }
- flag = existy(flag) ? flag : true;
- if (!target._wrapper) {
- /**
- * @param {function} _fn Original method to wrap.
- * @param {boolean} flagToSet The boolean value to using dirty flagging.
- * @returns {*} The result value of original method.
- * @name _wrapper
- * @memberof dirty
- */
- target._wrapper = function(_fn, flagToSet) {
- return function() {
- var args = Array.prototype.slice.call(arguments);
- var result = _fn.apply(this, args); // eslint-disable-line
- this._dirty = flagToSet; // eslint-disable-line
- return result;
- };
- };
- }
- if (existy(pick(target, methodName)) &&
- isFunc(target[methodName]) &&
- !existy(pick(target, methodName, '_wrapped'))) {
- fn = target[methodName];
- target[methodName] = target._wrapper(fn, flag);
- target[methodName]._wrapped = true;
- }
- }
- };
- module.exports = dirty;
- /***/ }),
- /***/ "./src/js/common/domevent.js":
- /*!***********************************!*\
- !*** ./src/js/common/domevent.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint complexity: 0 */
- /**
- * @fileoverview Utility module for handling DOM events.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var eventKey = '_evt',
- DRAG_START = ['touchstart', 'mousedown'];
- var domevent = {
- /**
- * Bind dom events.
- * @param {HTMLElement} obj HTMLElement to bind events.
- * @param {(string|object)} types Space splitted events names or eventName:handler object.
- * @param {*} fn handler function or context for handler method.
- * @param {*} [context] context object for handler method.
- */
- on: function(obj, types, fn, context) {
- if (util.isString(types)) {
- util.forEach(types.split(' '), function(type) {
- domevent._on(obj, type, fn, context);
- });
- return;
- }
- util.forEachOwnProperties(types, function(handler, type) {
- domevent._on(obj, type, handler, fn);
- });
- },
- /**
- * DOM event binding.
- * @param {HTMLElement} obj HTMLElement to bind events.
- * @param {String} type The name of events.
- * @param {*} fn handler function
- * @param {*} [context] context object for handler method.
- * @private
- */
- _on: function(obj, type, fn, context) {
- var id,
- handler,
- originHandler;
- id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : '');
- if (obj[eventKey] && obj[eventKey][id]) {
- return;
- }
- handler = function(e) {
- fn.call(context || obj, e || window.event);
- };
- originHandler = handler;
- if ('addEventListener' in obj) {
- if (type === 'mouseenter' || type === 'mouseleave') {
- handler = function(e) {
- e = e || window.event;
- if (!domevent._checkMouse(obj, e)) {
- return;
- }
- originHandler(e);
- };
- obj.addEventListener((type === 'mouseenter') ?
- 'mouseover' : 'mouseout', handler, false);
- } else {
- if (type === 'mousewheel') {
- obj.addEventListener('DOMMouseScroll', handler, false);
- }
- obj.addEventListener(type, handler, false);
- }
- } else if ('attachEvent' in obj) {
- obj.attachEvent('on' + type, handler);
- }
- obj[eventKey] = obj[eventKey] || {};
- obj[eventKey][id] = handler;
- },
- /**
- * Unbind DOM Event handler.
- * @param {HTMLElement} obj HTMLElement to unbind.
- * @param {(string|object)} types Space splitted events names or eventName:handler object.
- * @param {*} fn handler function or context for handler method.
- * @param {*} [context] context object for handler method.
- */
- off: function(obj, types, fn, context) {
- if (util.isString(types)) {
- util.forEach(types.split(' '), function(type) {
- domevent._off(obj, type, fn, context);
- });
- return;
- }
- util.forEachOwnProperties(types, function(handler, type) {
- domevent._off(obj, type, handler, fn);
- });
- },
- /**
- * Unbind DOM event handler.
- * @param {HTMLElement} obj HTMLElement to unbind.
- * @param {String} type The name of event to unbind.
- * @param {function()} fn Event handler that supplied when binding.
- * @param {*} context context object that supplied when binding.
- * @private
- */
- _off: function(obj, type, fn, context) {
- var id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : ''),
- handler = obj[eventKey] && obj[eventKey][id];
- if (!handler) {
- return;
- }
- if ('removeEventListener' in obj) {
- if (type === 'mouseenter' || type === 'mouseleave') {
- obj.removeEventListener((type === 'mouseenter') ?
- 'mouseover' : 'mouseout', handler, false);
- } else {
- if (type === 'mousewheel') {
- obj.removeEventListener('DOMMouseScroll', handler, false);
- }
- obj.removeEventListener(type, handler, false);
- }
- } else if ('detachEvent' in obj) {
- try {
- obj.detachEvent('on' + type, handler);
- } catch (e) {} //eslint-disable-line
- }
- delete obj[eventKey][id];
- if (util.keys(obj[eventKey]).length) {
- return;
- }
- delete obj[eventKey];
- },
- /**
- * Bind DOM event. this event will unbind after invokes.
- * @param {HTMLElement} obj HTMLElement to bind events.
- * @param {(string|object)} types Space splitted events names or eventName:handler object.
- * @param {*} fn handler function or context for handler method.
- * @param {*} [context] context object for handler method.
- */
- once: function(obj, types, fn, context) {
- var self = this;
- if (util.isObject(types)) {
- util.forEachOwnProperties(types, function(handler, type) {
- domevent.once(obj, type, handler, fn);
- });
- return;
- }
- /**
- * Handler for temporary usage for once implementation
- */
- function onceHandler() {
- fn.apply(context || obj, arguments);
- self._off(obj, types, onceHandler, context);
- }
- domevent.on(obj, types, onceHandler, context);
- },
- /**
- * Cancel event bubbling.
- * @param {Event} e Event object.
- */
- stopPropagation: function(e) {
- if (e.stopPropagation) {
- e.stopPropagation();
- } else {
- e.cancelBubble = true;
- }
- },
- /**
- * Cancel browser default actions.
- * @param {Event} e Event object.
- */
- preventDefault: function(e) {
- if (e.preventDefault) {
- e.preventDefault();
- } else {
- e.returnValue = false;
- }
- },
- /**
- * Syntatic sugar of stopPropagation and preventDefault
- * @param {Event} e Event object.
- */
- stop: function(e) {
- domevent.preventDefault(e);
- domevent.stopPropagation(e);
- },
- /**
- * Stop scroll events.
- * @param {HTMLElement} el HTML element to prevent scroll.
- */
- disableScrollPropagation: function(el) {
- domevent.on(el, 'mousewheel MozMousePixelScroll', domevent.stopPropagation);
- },
- /**
- * Stop all events related with click.
- * @param {HTMLElement} el HTML element to prevent all event related with click.
- */
- disableClickPropagation: function(el) {
- domevent.on(el, DRAG_START.join(' ') + ' click dblclick', domevent.stopPropagation);
- },
- /**
- * Get mouse position from mouse event.
- *
- * If supplied relatveElement parameter then return relative position based on element.
- * @param {Event} mouseEvent Mouse event object
- * @param {HTMLElement} relativeElement HTML element that calculate relative position.
- * @returns {number[]} mouse position.
- */
- getMousePosition: function(mouseEvent, relativeElement) {
- var rect;
- if (!relativeElement) {
- return [mouseEvent.clientX, mouseEvent.clientY];
- }
- rect = relativeElement.getBoundingClientRect();
- return [
- mouseEvent.clientX - rect.left - relativeElement.clientLeft,
- mouseEvent.clientY - rect.top - relativeElement.clientTop
- ];
- },
- /**
- * Normalize mouse wheel event that different each browsers.
- * @param {MouseEvent} e Mouse wheel event.
- * @returns {Number} delta
- */
- getWheelDelta: function(e) {
- var delta = 0;
- if (e.wheelDelta) {
- delta = e.wheelDelta / 120;
- }
- if (e.detail) {
- delta = -e.detail / 3;
- }
- return delta;
- },
- /**
- * prevent firing mouseleave event when mouse entered child elements.
- * @param {HTMLElement} el HTML element
- * @param {MouseEvent} e Mouse event
- * @returns {Boolean} leave?
- * @private
- */
- _checkMouse: function(el, e) {
- var related = e.relatedTarget;
- if (!related) {
- return true;
- }
- try {
- while (related && (related !== el)) {
- related = related.parentNode;
- }
- } catch (err) {
- return false;
- }
- return (related !== el);
- },
- /**
- * Trigger specific events to html element.
- * @param {HTMLElement} obj HTMLElement
- * @param {string} type Event type name
- * @param {object} [eventData] Event data
- */
- trigger: function(obj, type, eventData) {
- var rMouseEvent = /(mouse|click)/;
- if (util.isUndefined(eventData) && rMouseEvent.exec(type)) {
- eventData = domevent.mouseEvent(type);
- }
- if (obj.dispatchEvent) {
- obj.dispatchEvent(eventData);
- } else if (obj.fireEvent) {
- obj.fireEvent('on' + type, eventData);
- }
- },
- /**
- * Create virtual mouse event.
- *
- * Tested at
- *
- * - IE7 ~ IE11
- * - Chrome
- * - Firefox
- * - Safari
- * @param {string} type Event type
- * @param {object} [eventObj] Event data
- * @returns {MouseEvent} Virtual mouse event.
- */
- mouseEvent: function(type, eventObj) {
- var evt,
- e;
- e = util.extend({
- bubbles: true,
- cancelable: (type !== 'mousemove'),
- view: window,
- wheelDelta: 0,
- detail: 0,
- screenX: 0,
- screenY: 0,
- clientX: 0,
- clientY: 0,
- ctrlKey: false,
- altKey: false,
- shiftKey: false,
- metaKey: false,
- button: 0,
- relatedTarget: undefined // eslint-disable-line
- }, eventObj);
- if (typeof document.createEvent === 'function') {
- evt = document.createEvent('MouseEvents');
- evt.initMouseEvent(type,
- e.bubbles, e.cancelable, e.view, e.detail,
- e.screenX, e.screenY, e.clientX, e.clientY,
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
- e.button, document.body.parentNode
- );
- } else if (document.createEventObject) {
- evt = document.createEventObject();
- util.forEach(e, function(value, propName) {
- evt[propName] = value;
- }, this);
- evt.button = {0: 1,
- 1: 4,
- 2: 2}[evt.button] || evt.button;
- }
- return evt;
- },
- /**
- * Normalize mouse event's button attributes.
- *
- * Can detect which button is clicked by this method.
- *
- * Meaning of return numbers
- *
- * - 0: primary mouse button
- * - 1: wheel button or center button
- * - 2: secondary mouse button
- * @param {MouseEvent} mouseEvent - The mouse event object want to know.
- * @returns {number} - The value of meaning which button is clicked?
- */
- getMouseButton: function(mouseEvent) {
- var button,
- primary = '0,1,3,5,7',
- secondary = '2,6',
- wheel = '4';
- /* istanbul ignore else */
- if (document.implementation.hasFeature('MouseEvents', '2.0')) {
- return mouseEvent.button;
- }
- button = String(mouseEvent.button);
- if (primary.indexOf(button) > -1) {
- return 0;
- }
- if (secondary.indexOf(button) > -1) {
- return 2;
- }
- if (~wheel.indexOf(button)) {
- return 1;
- }
- return -1;
- },
- /**
- * Get target from event object
- *
- * @param {Event} event - The event object
- * @returns {object} - The event target object
- */
- getEventTarget: function(event) {
- return event.target || event.srcElement;
- }
- };
- module.exports = domevent;
- /***/ }),
- /***/ "./src/js/common/domutil.js":
- /*!**********************************!*\
- !*** ./src/js/common/domutil.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint complexity: 0, no-shadow: 0, max-nested-callbacks: 0 */
- /**
- * @fileoverview Utility modules for manipulate DOM elements.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var domevent = __webpack_require__(/*! ./domevent */ "./src/js/common/domevent.js");
- var Collection = __webpack_require__(/*! ./collection */ "./src/js/common/collection.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var posKey = '_pos',
- domutil;
- var CSS_AUTO_REGEX = /^auto$|^$|%/;
- /**
- * Trim leading, trailing whitespace
- * @param {string} str - string to trim
- * @returns {string} trimmed string
- */
- function trim(str) {
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- }
- domutil = {
- /**
- * Create DOM element and return it.
- * @param {string} tagName Tag name to append.
- * @param {HTMLElement} [container] HTML element will be parent to created element.
- * if not supplied, will use **document.body**
- * @param {string} [className] Design class names to appling created element.
- * @returns {HTMLElement} HTML element created.
- */
- appendHTMLElement: function(tagName, container, className) {
- var el;
- className = className || '';
- el = document.createElement(tagName);
- el.className = className;
- if (container) {
- container.appendChild(el);
- } else {
- document.body.appendChild(el);
- }
- return el;
- },
- /**
- * Remove element from parent node.
- * @param {HTMLElement} el - element to remove.
- */
- remove: function(el) {
- if (el && el.parentNode) {
- el.parentNode.removeChild(el);
- }
- },
- /**
- * Get element by id
- * @param {string} id element id attribute
- * @returns {HTMLElement} element
- */
- get: function(id) {
- return document.getElementById(id);
- },
- /**
- * Check supplied element is matched selector.
- * @param {HTMLElement} el - element to check
- * @param {string} selector - selector string to check
- * @returns {boolean} match?
- */
- _matcher: function(el, selector) {
- var cssClassSelector = /^\./,
- idSelector = /^#/;
- if (cssClassSelector.test(selector)) {
- return domutil.hasClass(el, selector.replace('.', ''));
- }
- if (idSelector.test(selector)) {
- return el.id === selector.replace('#', '');
- }
- return el.nodeName.toLowerCase() === selector.toLowerCase();
- },
- /**
- * Find DOM element by specific selectors.
- * below three selector only supported.
- *
- * 1. css selector
- * 2. id selector
- * 3. nodeName selector
- * @param {string} selector selector
- * @param {(HTMLElement|string)} [root] You can assign root element to find
- * if not supplied, document.body will use.
- * @param {boolean|function} [multiple=false] - set true then return all
- * elements that meet condition, if set function then use it filter function.
- * @returns {HTMLElement} HTML element finded.
- */
- find: function(selector, root, multiple) {
- var result = [],
- found = false,
- isFirst = util.isUndefined(multiple) || multiple === false,
- isFilter = util.isFunction(multiple);
- if (util.isString(root)) {
- root = domutil.get(root);
- }
- root = root || window.document.body;
- /**
- * Function for recursive find specific node
- * @param {HTMLElement} el - element to search
- * @param {string} selector - selector
- */
- function recurse(el, selector) {
- var childNodes = el.childNodes,
- i = 0,
- len = childNodes.length,
- cursor;
- for (; i < len; i += 1) {
- cursor = childNodes[i];
- if (cursor.nodeName === '#text') {
- continue;
- }
- if (domutil._matcher(cursor, selector)) {
- if ((isFilter && multiple(cursor)) || !isFilter) {
- result.push(cursor);
- }
- if (isFirst) {
- found = true;
- break;
- }
- } else if (cursor.childNodes.length > 0) {
- recurse(cursor, selector);
- if (found) {
- break;
- }
- }
- }
- }
- recurse(root, selector);
- return isFirst ? (result[0] || null) : result;
- },
- /**
- * Find parent element recursively.
- * @param {HTMLElement} el - base element to start find.
- * @param {string} selector - selector string for find
- * @param {boolean} excludeEl - exclude the base element to find
- * @returns {HTMLElement} - element finded or null.
- */
- closest: function(el, selector, excludeEl) {
- var parent;
- if (!el) {
- return null;
- }
- parent = el.parentNode;
- if (!excludeEl && domutil._matcher(el, selector)) {
- return el;
- }
- while (parent && parent !== window.document.body) {
- if (domutil._matcher(parent, selector)) {
- return parent;
- }
- parent = parent.parentNode;
- }
- return null;
- },
- /**
- * Return texts inside element.
- * @param {HTMLElement} el target element
- * @returns {string} text inside node
- */
- text: function(el) {
- var ret = '',
- i = 0,
- nodeType = el.nodeType;
- if (nodeType) {
- if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
- // nodes that available contain other nodes
- if (typeof el.textContent === 'string') {
- return el.textContent;
- }
- for (el = el.firstChild; el; el = el.nextSibling) {
- ret += domutil.text(el);
- }
- } else if (nodeType === 3 || nodeType === 4) {
- // TEXT, CDATA SECTION
- return el.nodeValue;
- }
- } else {
- for (; el[i]; i += 1) {
- ret += domutil.text(el[i]);
- }
- }
- return ret;
- },
- /**
- * Set data attribute to target element
- * @param {HTMLElement} el - element to set data attribute
- * @param {string} key - key
- * @param {string|number} data - data value
- */
- setData: function(el, key, data) {
- if ('dataset' in el) {
- el.dataset[key] = data;
- return;
- }
- el.setAttribute('data-' + key, data);
- },
- /**
- * Get data value from data-attribute
- * @param {HTMLElement} el - target element
- * @param {string} key - key
- * @returns {string} value
- */
- getData: function(el, key) {
- if ('dataset' in el) {
- return el.dataset[key];
- }
- return el.getAttribute('data-' + key);
- },
- /**
- * Check element has specific design class name.
- * @param {HTMLElement} el target element
- * @param {string} name css class
- * @returns {boolean} return true when element has that css class name
- */
- hasClass: function(el, name) {
- var className;
- if (!util.isUndefined(el.classList)) {
- return el.classList.contains(name);
- }
- className = domutil.getClass(el);
- return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
- },
- /**
- * Add design class to HTML element.
- * @param {HTMLElement} el target element
- * @param {string} name css class name
- */
- addClass: function(el, name) {
- var className;
- if (!util.isUndefined(el.classList)) {
- util.forEachArray(name.split(' '), function(value) {
- el.classList.add(value);
- });
- } else if (!domutil.hasClass(el, name)) {
- className = domutil.getClass(el);
- domutil.setClass(el, (className ? className + ' ' : '') + name);
- }
- },
- /**
- *
- * Overwrite design class to HTML element.
- * @param {HTMLElement} el target element
- * @param {string} name css class name
- */
- setClass: function(el, name) {
- if (util.isUndefined(el.className.baseVal)) {
- el.className = name;
- } else {
- el.className.baseVal = name;
- }
- },
- /**
- * Element에 cssClass속성을 제거하는 메서드
- * Remove specific design class from HTML element.
- * @param {HTMLElement} el target element
- * @param {string} name class name to remove
- */
- removeClass: function(el, name) {
- var removed = '';
- if (!util.isUndefined(el.classList)) {
- el.classList.remove(name);
- } else {
- removed = (' ' + domutil.getClass(el) + ' ').replace(' ' + name + ' ', ' ');
- domutil.setClass(el, trim(removed));
- }
- },
- /**
- * Get HTML element's design classes.
- * @param {HTMLElement} el target element
- * @returns {string} element css class name
- */
- getClass: function(el) {
- if (!el || !el.className) {
- return '';
- }
- return util.isUndefined(el.className.baseVal) ? el.className : el.className.baseVal;
- },
- /**
- * Get specific CSS style value from HTML element.
- * @param {HTMLElement} el target element
- * @param {string} style css attribute name
- * @returns {(string|null)} css style value
- */
- getStyle: function(el, style) {
- var value = el.style[style] || (el.currentStyle && el.currentStyle[style]),
- css;
- if ((!value || value === 'auto') && document.defaultView) {
- css = document.defaultView.getComputedStyle(el, null);
- value = css ? css[style] : null;
- }
- return value === 'auto' ? null : value;
- },
- /**
- * get element's computed style values.
- *
- * in lower IE8. use polyfill function that return object. it has only one function 'getPropertyValue'
- * @param {HTMLElement} el - element want to get style.
- * @returns {object} virtual CSSStyleDeclaration object.
- */
- getComputedStyle: function(el) {
- var defaultView = document.defaultView;
- if (!defaultView || !defaultView.getComputedStyle) {
- return {
- getPropertyValue: function(prop) {
- /* eslint-disable no-useless-escape */
- var re = /(\-([a-z]){1})/g;
- if (prop === 'float') {
- prop = 'styleFloat';
- }
- if (re.test(prop)) {
- prop = prop.replace(re, function() {
- return arguments[2].toUpperCase();
- });
- }
- return el.currentStyle[prop] || null;
- }
- };
- }
- return document.defaultView.getComputedStyle(el);
- },
- /**
- * Set position CSS style.
- * @param {HTMLElement} el target element
- * @param {number} [x=0] left pixel value.
- * @param {number} [y=0] top pixel value.
- */
- setPosition: function(el, x, y) {
- x = util.isUndefined(x) ? 0 : x;
- y = util.isUndefined(y) ? 0 : y;
- el[posKey] = [x, y];
- el.style.left = util.isNumber(x) ? (x + 'px') : x;
- el.style.top = util.isNumber(y) ? (y + 'px') : y;
- },
- /**
- * Set position CSS style with left, top, right, bottom
- * @param {HTMLElement} el target element
- * @param {object} ltrb object of left, top, right, bottom
- * @param {number} [ltrb.left] left pixel value.
- * @param {number} [ltrb.top] top pixel value.
- * @param {number} [ltrb.right] right pixel value.
- * @param {number} [ltrb.bottom] bottom pixel value.
- */
- setLTRB: function(el, ltrb) {
- var props = ['left', 'top', 'right', 'bottom'];
- var value;
- props.forEach(function(prop) {
- value = util.isUndefined(ltrb[prop]) ? '' : ltrb[prop];
- el.style[prop] = util.isNumber(value) ? (value + 'px') : value;
- });
- },
- /**
- * Get position from HTML element.
- * @param {HTMLElement} el target element
- * @param {boolean} [clear=false] clear cache before calculating position.
- * @returns {number[]} point
- */
- getPosition: function(el, clear) {
- var left,
- top,
- bound;
- if (clear) {
- el[posKey] = null;
- }
- if (el[posKey]) {
- return el[posKey];
- }
- left = 0;
- top = 0;
- if ((CSS_AUTO_REGEX.test(el.style.left) || CSS_AUTO_REGEX.test(el.style.top)) &&
- 'getBoundingClientRect' in el) {
- // When the element's left or top is 'auto'
- bound = el.getBoundingClientRect();
- left = bound.left;
- top = bound.top;
- } else {
- left = parseFloat(el.style.left || 0);
- top = parseFloat(el.style.top || 0);
- }
- return [left, top];
- },
- /**
- * Return element's size
- * @param {HTMLElement} el target element
- * @returns {number[]} width, height
- */
- getSize: function(el) {
- var bound,
- width = domutil.getStyle(el, 'width'),
- height = domutil.getStyle(el, 'height');
- if ((CSS_AUTO_REGEX.test(width) || CSS_AUTO_REGEX.test(height) ||
- util.isNull(width) || util.isNull(height)) &&
- 'getBoundingClientRect' in el) {
- bound = el.getBoundingClientRect();
- width = bound.width || el.offsetWidth;
- height = bound.height || el.offsetHeight;
- } else {
- width = parseFloat(width || 0);
- height = parseFloat(height || 0);
- }
- return [width, height];
- },
- /**
- * Fallback of getBoundingClientRect
- * @param {HTMLElement} el - element
- * @returns {object} rect
- */
- getBCRect: function(el) {
- var rect = el.getBoundingClientRect();
- rect = util.extend({
- width: el.offsetWidth,
- height: el.offsetHeight
- }, rect);
- return rect;
- },
- /**
- * Check specific CSS style is available.
- * @param {array} props property name to testing
- * @returns {(string|boolean)} return true when property is available
- * @example
- * var props = ['transform', '-webkit-transform'];
- * domutil.testProp(props); // 'transform'
- */
- testProp: function(props) {
- var style = document.documentElement.style,
- i = 0,
- len = props.length;
- for (; i < len; i += 1) {
- if (props[i] in style) {
- return props[i];
- }
- }
- return false;
- },
- /**
- * Get form data
- * @param {HTMLFormElement} formElement - form element to extract data
- * @returns {object} form data
- */
- getFormData: function(formElement) {
- var groupedByName = new Collection(function() {
- return this.length;
- }),
- noDisabledFilter = function(el) {
- return !el.disabled;
- },
- output = {};
- groupedByName.add.apply(
- groupedByName,
- domutil.find('input', formElement, noDisabledFilter)
- .concat(domutil.find('select', formElement, noDisabledFilter))
- .concat(domutil.find('textarea', formElement, noDisabledFilter))
- );
- groupedByName = groupedByName.groupBy(function(el) {
- return (el && el.getAttribute('name')) || '_other';
- });
- util.forEach(groupedByName, function(elements, name) {
- if (name === '_other') {
- return;
- }
- elements.each(function(el) {
- var nodeName = el.nodeName.toLowerCase(),
- type = el.type,
- result = [];
- if (type === 'radio') {
- result = [elements.find(function(el) {
- return el.checked;
- }).toArray().pop()];
- } else if (type === 'checkbox') {
- result = elements.find(function(el) {
- return el.checked;
- }).toArray();
- } else if (nodeName === 'select') {
- elements.find(function(el) {
- return !!el.childNodes.length;
- }).each(function(el) {
- result = result.concat(
- domutil.find('option', el, function(opt) {
- return opt.selected;
- })
- );
- });
- } else {
- result = elements.find(function(el) {
- return el.value !== '';
- }).toArray();
- }
- result = util.map(result, function(el) {
- return el.value;
- });
- if (!result.length) {
- result = '';
- } else if (result.length === 1) {
- result = result[0];
- }
- output[name] = result;
- });
- });
- return output;
- }
- };
- /* eslint-disable */
- var userSelectProperty = domutil.testProp([
- 'userSelect',
- 'WebkitUserSelect',
- 'OUserSelect',
- 'MozUserSelect',
- 'msUserSelect'
- ]);
- var supportSelectStart = 'onselectstart' in document;
- var prevSelectStyle = '';
- /* eslint-enable */
- /**
- * Disable browser's text selection behaviors.
- * @method
- */
- domutil.disableTextSelection = (function() {
- if (supportSelectStart) {
- return function(dom, onSelectstartHandler) {
- domevent.on(dom, 'selectstart', onSelectstartHandler || domevent.preventDefault);
- };
- }
- return function(dom) {
- var style = dom.style;
- prevSelectStyle = style[userSelectProperty];
- style[userSelectProperty] = 'none';
- };
- })();
- /**
- * Enable browser's text selection behaviors.
- * @method
- */
- domutil.enableTextSelection = (function() {
- if (supportSelectStart) {
- return function(dom, onSelectstartHandler) {
- domevent.off(window, 'selectstart', onSelectstartHandler || domevent.preventDefault);
- };
- }
- return function() {
- document.documentElement.style[userSelectProperty] = prevSelectStyle;
- };
- })();
- /**
- * Disable browser's image drag behaviors.
- */
- domutil.disableImageDrag = function() {
- domevent.on(window, 'dragstart', domevent.preventDefault);
- };
- /**
- * Enable browser's image drag behaviors.
- */
- domutil.enableImageDrag = function() {
- domevent.off(window, 'dragstart', domevent.preventDefault);
- };
- module.exports = domutil;
- /***/ }),
- /***/ "./src/js/common/dw.js":
- /*!*****************************!*\
- !*** ./src/js/common/dw.js ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Wrapper module for easy calc date object
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var TZDate = __webpack_require__(/*! ./timezone */ "./src/js/common/timezone.js").Date;
- /**
- * @constructor
- * @param {TZDate} date to wrapping DW class
- */
- function DW(date) {
- if (!(this instanceof DW)) {
- return new DW(date);
- }
- if (!(date instanceof TZDate)) {
- date = new TZDate(date);
- }
- /**
- * @type {TZDate}
- */
- this.d = date;
- }
- /**
- * Return d property when supplied object is DW. else return itself
- * @param {*} obj - object
- * @returns {TZDate} date
- */
- DW.prototype.safe = function(obj) {
- if (obj.constructor === DW) {
- return obj.d;
- }
- return obj;
- };
- /**
- * Clone DW object
- * @returns {DW} cloned dwrap object
- */
- DW.prototype.clone = function() {
- return new DW(new TZDate(this.d));
- };
- /**
- * Add days
- * @param {number} day - day to add
- * @returns {DW} wrapper object
- */
- DW.prototype.addDate = function(day) {
- this.d.setDate(this.d.getDate() + day);
- return this;
- };
- /**
- * Add month.
- * @param {number} m - month to add
- * @returns {DW} wrapper object
- */
- DW.prototype.addMonth = function(m) {
- var currentMonth = this.d.getMonth();
- var currentDay = this.d.getDate();
- var leapYear = this._isLeapYear();
- var targetMonth = currentMonth + m;
- var clone = this.clone();
- var targetDaysOfMonth = currentDay;
- if (m) {
- if (targetMonth === 1) {
- targetDaysOfMonth = leapYear ? 29 : 28;
- } else {
- if (m > 0) {
- clone.d.setMonth(targetMonth + 1, 0);
- } else {
- clone.d.setMonth(currentMonth, 0);
- }
- targetDaysOfMonth = clone.d.getDate();
- }
- }
- this.d.setMonth(targetMonth, Math.min(currentDay, targetDaysOfMonth));
- return this;
- };
- /**
- * Is leap year or not
- * @returns {boolean}
- */
- DW.prototype._isLeapYear = function() {
- var year = this.d.getFullYear();
- return ((year % 4 === 0) && (year % 100 !== 0)) || !(year % 400);
- };
- /**
- * Set hour, minutes, seconds, milliseconds
- * @param {number} h - hours
- * @param {number} m - minutes
- * @param {number} s - seconds
- * @param {number} ms - milliseconds
- * @returns {DW} wrapper object
- */
- DW.prototype.setHours = function(h, m, s, ms) {
- this.d.setHours(h, m, s, ms);
- return this;
- };
- /**
- * Whether date is between supplied dates?
- * @param {TZDate|DW} d1 - from date
- * @param {TZDate|DW} d2 - to date
- * @returns {boolean} is between?
- */
- DW.prototype.isBetween = function(d1, d2) {
- var safe = this.safe;
- return safe(d1) <= this.d && this.d <= safe(d2);
- };
- module.exports = DW;
- /***/ }),
- /***/ "./src/js/common/floatingLayer.js":
- /*!****************************************!*\
- !*** ./src/js/common/floatingLayer.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Floating layer module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
- View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js");
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - options for floating layer module
- * @param {HTMLElement} container - parent continer for floating layer
- */
- function FloatingLayer(options, container) {
- var sibling = container[FloatingLayer.PROP_KEY],
- layerContainer;
- if (!sibling) {
- sibling = container[FloatingLayer.PROP_KEY] = [];
- }
- sibling.push(this);
- /**
- * @type {Collection}
- */
- this.sibling = sibling;
- /**
- * @type {number}
- */
- this.zIndex = this.getLargestZIndex() || FloatingLayer.INIT_ZINDEX;
- layerContainer = document.createElement('div');
- layerContainer.style.display = 'none';
- layerContainer.style.position = 'absolute';
- domutil.addClass(layerContainer, config.classname('floating-layer'));
- container.appendChild(layerContainer);
- View.call(this, layerContainer);
- /**
- * @type {HTMLElement}
- */
- this.parent = container;
- }
- util.inherit(FloatingLayer, View);
- /**
- * @const
- */
- FloatingLayer.PROP_KEY = '__fe_floating_layer';
- /**
- * @const
- */
- FloatingLayer.INIT_ZINDEX = 999;
- /**
- * Destroy floating layer instance. if there no instnace in parent container
- *
- * remove instance cache property in container element
- */
- FloatingLayer.prototype.destroy = function() {
- var parent = this.parent,
- sibling = this.sibling,
- i = 0, cnt = sibling.length;
- for (; i < cnt; i += 1) {
- if (sibling[i] === this) {
- sibling.splice(i, 1);
- break;
- }
- }
- if (!sibling.length) {
- try {
- delete parent[FloatingLayer.PROP_KEY];
- } catch (e) {
- parent[FloatingLayer.PROP_KEY] = null;
- }
- parent.style.position = '';
- }
- domutil.remove(this.container);
- this.sibling = null;
- View.prototype.destroy.call(this);
- };
- /**
- * @returns {boolean} whether layer is visible?
- */
- FloatingLayer.prototype.isVisible = function() {
- return this.container.style.display !== 'none';
- };
- /**
- * Set layer position
- * @param {number} x - x coordinate of layer
- * @param {number} y - y coordinate of layer
- */
- FloatingLayer.prototype.setPosition = function(x, y) {
- domutil.setPosition(this.container, x, y);
- };
- /**
- * Set layer left, top, right, bottom position
- * @param {object} ltrb object of left, top, right, bottom
- * @param {number} [ltrb.left] left pixel value.
- * @param {number} [ltrb.top] top pixel value.
- * @param {number} [ltrb.right] right pixel value.
- * @param {number} [ltrb.bottom] bottom pixel value.
- */
- FloatingLayer.prototype.setLTRB = function(ltrb) {
- domutil.setLTRB(this.container, ltrb);
- };
- /**
- * Set layer size
- * @param {number|string} w - layer width
- * @param {number|string} h - layer height
- */
- FloatingLayer.prototype.setSize = function(w, h) {
- var container = this.container;
- w = util.isNumber(w) ? w + 'px' : w;
- h = util.isNumber(h) ? h + 'px' : h;
- container.style.width = w;
- container.style.height = h;
- };
- /**
- * Set layer content
- * @param {string} html - html string
- */
- FloatingLayer.prototype.setContent = function(html) {
- this.container.innerHTML = html;
- };
- /**
- * Get largest z-index from sibling layers
- * @returns {number} largest z-index value
- */
- FloatingLayer.prototype.getLargestZIndex = function() {
- var zIndexes = util.map(this.sibling, function(layer) {
- return layer.zIndex;
- });
- return Math.max.apply(null, zIndexes);
- };
- /**
- * Set focus to layer
- */
- FloatingLayer.prototype.focus = function() {
- var zIndexForShow = this.getLargestZIndex() + 1;
- this.container.style.zIndex = this.zIndex = zIndexForShow;
- };
- /**
- * Show layer
- */
- FloatingLayer.prototype.show = function() {
- this.focus();
- this.container.style.display = 'block';
- };
- /**
- * Hide layer
- */
- FloatingLayer.prototype.hide = function() {
- this.container.style.display = 'none';
- };
- module.exports = FloatingLayer;
- /***/ }),
- /***/ "./src/js/common/intlUtil.js":
- /*!***********************************!*\
- !*** ./src/js/common/intlUtil.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var intlFormatter = {};
- var intlUtil;
- var typeToPos = {
- year: 0,
- month: 1,
- day: 2,
- hour: 3,
- minute: 4,
- second: 5
- };
- /**
- * Extract date tokens (y, M, d, h, m, s) using the formatToParts() method.
- * @param {Intl.DateTimeFormat} dtf - Intl.DateTimeFormat instance
- * @param {Date} date - date object
- * @returns {Array.<number>} An array of objects only containing the formatted date
- */
- function parseOffset(dtf, date) {
- var formatted = dtf.formatToParts(date);
- var filled = [];
- var formattedLength = formatted.length;
- var i, pos;
- for (i = 0; i < formattedLength; i += 1) {
- pos = typeToPos[formatted[i].type];
- if (!util.isUndefined(pos)) {
- filled[pos] = parseInt(formatted[i].value, 10);
- }
- }
- return filled;
- }
- /**
- * The time zone offset is calculated from the difference between the current time and the time in a specific time zone.
- * @param {Array.<number>} parts - An array of objects only containing the formatted date (e.g. [2020, 12, 14, 10, 15, 19])
- * @param {Date} date - date object
- * @returns {number} offset
- */
- function calculateOffset(parts, date) {
- var y = parts[0];
- var M = parts[1];
- var d = parts[2];
- var h = parts[3];
- var m = parts[4];
- var s = parts[5];
- var utc = new Date(Date.UTC(y, M - 1, d, h, m, s));
- var offset = (utc - date) / 60 / 1000;
- return Math.round(offset);
- }
- /**
- * Check if browser supports Intl.DateTimeFormat.prototype.formatToParts API
- * @returns {boolean} supported
- */
- function supportIntl() {
- /**
- * IE9 and IE10 do not support Intl.DateTimeFormat
- * IE11 does not support IANA timezone names
- * http://kangax.github.io/compat-table/esintl/#test-DateTimeFormat_accepts_IANA_timezone_names
- */
- return global.Intl && global.Intl.DateTimeFormat &&
- util.isFunction(Intl.DateTimeFormat.prototype.formatToParts);
- }
- /**
- * Return DateTimeFormat instance by timezone
- * @param {string} timezoneName - timezone
- * @returns {DateTimeFormat} Intl.DateTimeFormat instance
- */
- function getIntlFormatter(timezoneName) {
- if (!intlFormatter[timezoneName]) {
- intlFormatter[timezoneName] = new Intl.DateTimeFormat('en-US', {
- hourCycle: 'h23',
- year: 'numeric',
- month: 'numeric',
- day: 'numeric',
- hour: 'numeric',
- minute: 'numeric',
- second: 'numeric',
- timeZone: timezoneName
- });
- }
- return intlFormatter[timezoneName];
- }
- /**
- * Get offset of the time by timezone
- * @param {string} timezoneName - recognize the time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York'
- * @param {number} timestamp - timestamp
- * @returns {number} offset
- */
- function offsetCalculator(timezoneName, timestamp) {
- var formatter = getIntlFormatter(timezoneName);
- var date = new Date(timestamp);
- return -calculateOffset(parseOffset(formatter, date), date);
- }
- intlUtil = {
- supportIntl: supportIntl,
- offsetCalculator: offsetCalculator
- };
- module.exports = intlUtil;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/common/model.js":
- /*!********************************!*\
- !*** ./src/js/common/model.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Mixin module for models.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var TZDate = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js").Date;
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var spaceRx = /^\s*|\s*$/g,
- model;
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- /**
- * Mixin module for models.
- * @mixin
- */
- model = {
- /**
- * string trim
- * @param {string} str string to trim
- * @returns {string} trimed string
- */
- trim: function(str) {
- return str.replace(spaceRx, '');
- },
- /**
- * The collections of validator functions.
- */
- validators: {
- /**
- * check all of supplied fields(property) is not undefined or empty string.
- * @param {object} instance model instance.
- * @param {string[]} fields property names to check.
- * @returns {boolean} return true when supplied fields are not undefined or empty string.
- */
- required: function(instance, fields) {
- var valid = true,
- isValid = function(obj) {
- return !util.isUndefined(obj) && model.trim(obj) !== '';
- };
- util.forEach(fields, function(fieldName) {
- valid = isValid(instance[fieldName]);
- return valid;
- });
- return valid;
- },
- /**
- * check supplied fields are valid dates and valid date ranges.
- * @param {object} instance model instance.
- * @param {Date[]} fields array of date range (start, end)
- * @returns {boolean} is valid date range?
- */
- dateRange: function(instance, fields) {
- var start, end;
- if (!util.isExisty(instance) || fields.length !== 2) {
- return true;
- }
- start = new TZDate(instance[fields[0]]);
- end = new TZDate(instance[fields[1]]);
- if (!datetime.isValid(start) || !datetime.isValid(end)) {
- return false;
- }
- if (datetime.compare(start, end) === 1) {
- return false;
- }
- return true;
- }
- },
- /**
- * Check validate for model instance.
- *
- * The validate are works on a basis of constructor's "schema" property.
- *
- * You can customize validators add some method to model#validators.
- * @returns {Boolean} model is valid?
- */
- isValid: function() {
- var self = this,
- schema = this.constructor.schema,
- validators = model.validators,
- validator,
- valid = true;
- if (!schema) {
- return true;
- }
- util.forEach(schema, function(values, validatorName) {
- validator = validators[validatorName];
- if (validator) {
- valid = validator(self, values);
- return valid; // returning false can stop this loop
- }
- return true;
- });
- return valid;
- },
- /**
- * Make data object form instance.
- *
- * It return object fill with all owned properties but exclude functions.
- * @returns {object} Data object
- */
- parameterize: function() {
- var param = {},
- isFunc = util.isFunction;
- util.forEach(this, function(value, propName) {
- if (!isFunc(value)) {
- param[propName] = value;
- }
- });
- return param;
- },
- /**
- * Mixin model module to supplied target.
- * @param {Object} target The object of want to mixed.
- * @example
- * function Man() {
- * this.name = 'john';
- * }
- * model.mixin(Man.prototype);
- */
- mixin: function(target) {
- util.forEach(model, function(method, name) {
- if (name !== 'mixin') {
- target[name] = method;
- }
- });
- }
- };
- module.exports = model;
- /***/ }),
- /***/ "./src/js/common/point.js":
- /*!********************************!*\
- !*** ./src/js/common/point.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview
- * Class for represent two dimensional x, y coordinates.
- *
- * It suppliy a group of functions for manipulate coordinates.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- * @example
- * var p = point(10, 10);
- * var r1 = p.add(Point(5, 5));
- * console.log(p.toString()) // "Point(10, 10)"
- * console.log(r1.toString()) // "Point(15, 15)"
- *
- * var p2 = new Point(10, 10);
- * p2._add(point(5, 5));
- * console.log(p2.toString()) // "Point(15, 15)"
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- /**
- * Class for represent two dimentional x, y coordinates.
- * @constructor
- * @param {number} x The number of X coordinates.
- * @param {number} y The number of Y coordinates.
- * @param {boolean} [useRound=false] set true when each coordinates are rounded before initialize.
- * @example
- * var t = new Point(13, 5);
- */
- function Point(x, y, useRound) {
- /**
- * @type {number}
- */
- this.x = (useRound ? Math.round(x) : x);
- /**
- * @type {number}
- */
- this.y = (useRound ? Math.round(y) : y);
- }
- /**********
- * static props
- **********/
- /**
- * Calculate point ratio.
- * @param {Point} point The instance of point.
- * @param {number} factor From factor
- * @param {number} toFactor To factor
- * @returns {Point} Point instance calculated.
- */
- Point.getRatio = function(point, factor, toFactor) {
- if (factor === toFactor) {
- return point.clone();
- }
- return point.multiplyBy(toFactor)._divideBy(factor);
- };
- /**
- * Syntatic sugar of new Point()
- * @param {(Point|number|number[])} x X coordinate value.
- * @param {(number|boolean)} [y] Y coordinate value or boolean value for coordinates round.
- * @param {boolean} [useRound] Set true then round initial coordinate values.
- * @returns {Point} The instance of point.
- * @example
- * var p1 = point(10, 15);
- * var p2 = point([10, 15]);
- */
- Point.n = function(x, y, useRound) {
- if (x instanceof Point) {
- return x;
- }
- if (util.isArray(x)) {
- return new Point(x[0], x[1], y);
- }
- return new Point(x, y, useRound);
- };
- /**********
- * prototype props
- **********/
- /**
- * Clone points
- * @returns {Point} The point instance cloned.
- */
- Point.prototype.clone = function() {
- return new Point(this.x, this.y);
- };
- /**
- * Add points.
- * @param {Point} point The point instance to add.
- * @returns {Point} Point calculated.
- */
- Point.prototype.add = function(point) {
- return this.clone()._add(Point.n(point));
- };
- /**
- * Add self points.
- * @param {Point} point The point instance to add.
- * @returns {Point} Point calculated.
- */
- Point.prototype._add = function(point) {
- this.x += point.x;
- this.y += point.y;
- return this;
- };
- /**
- * Subtract points.
- * @param {Point} point The point instance to subtract.
- * @returns {Point} Point calculated.
- */
- Point.prototype.subtract = function(point) {
- return this.clone()._subtract(Point.n(point));
- };
- /**
- * Subtract points. (manipulate self)
- * @param {Point} point The point instance to subtract.
- * @returns {Point} Point calculated.
- */
- Point.prototype._subtract = function(point) {
- this.x -= point.x;
- this.y -= point.y;
- return this;
- };
- /**
- * Divide points.
- * @param {number} num The number to divide.
- * @returns {Point} Point calculated.
- */
- Point.prototype.divideBy = function(num) {
- return this.clone()._divideBy(num);
- };
- /**
- * Divide points. (manipulate self)
- * @param {number} num The number to divide.
- * @returns {Point} Point calculated.
- */
- Point.prototype._divideBy = function(num) {
- this.x /= num;
- this.y /= num;
- return this;
- };
- /**
- * Multiply coordinates.
- * @param {number} num Thyen number to multiply
- * @returns {Point} Point calculated.
- */
- Point.prototype.multiplyBy = function(num) {
- return this.clone()._multiplyBy(num);
- };
- /**
- * Multiply self coordinates.
- * @param {number} num The number to multiply.
- * @returns {Point} Point calculated.
- */
- Point.prototype._multiplyBy = function(num) {
- this.x *= num;
- this.y *= num;
- return this;
- };
- /**
- * Round coordinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype.round = function() {
- return this.clone()._round();
- };
- /**
- * Round self coordinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype._round = function() {
- this.x = Math.round(this.x);
- this.y = Math.round(this.y);
- return this;
- };
- /**
- * Reverse values between positive and negative.
- * @returns {Point} Point calculated.
- */
- Point.prototype.reverse = function() {
- return this.clone()._reverse();
- };
- /**
- * Reverse self values between positive and negative.
- * @returns {Point} Point calculated.
- */
- Point.prototype._reverse = function() {
- this.x *= -1;
- this.y *= -1;
- return this;
- };
- /**
- * Floor coordinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype.floor = function() {
- return this.clone()._floor();
- };
- /**
- * Floor self coordinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype._floor = function() {
- this.x = Math.floor(this.x);
- this.y = Math.floor(this.y);
- return this;
- };
- /**
- * Ceil coordinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype.ceil = function() {
- return this.clone()._ceil();
- };
- /**
- * Ceil self coodinates.
- * @returns {Point} Point calculated.
- */
- Point.prototype._ceil = function() {
- this.x = Math.ceil(this.x);
- this.y = Math.ceil(this.y);
- return this;
- };
- /**
- * Rotate point.
- * @param {number} deg The number of rotate degree.
- * @param {Point} [center=this] Center point instance to use rotate center. use own when not supplied.
- * @param {number} [cos] Cosine values for rotate. it useful when multi point rotate.
- * @param {number} [sin] Sine values for rotate. it useful when multi point rotate.
- * @returns {Point} The point instance rotated.
- */
- Point.prototype.rotate = function(deg, center, cos, sin) {
- return this.clone()._rotate(deg, center, cos, sin);
- };
- /**
- * Rotate self.
- * @param {number} deg The number of rotate degree.
- * @param {Point} [center=this] Center point instance to use rotate center. use own when not supplied.
- * @param {number} [cos] Cosine values for rotate. it useful when multi point rotate.
- * @param {number} [sin] Sine values for rotate. it useful when multi point rotate.
- * @returns {Point} The point instance rotated.
- */
- Point.prototype._rotate = function(deg, center, cos, sin) {
- var rad = deg * (Math.PI / 180),
- x,
- y;
- cos = cos || parseFloat(Math.cos(rad).toFixed(8));
- sin = sin || parseFloat(Math.sin(rad).toFixed(8));
- this._subtract(center);
- x = this.x;
- y = this.y;
- this.x = (x * cos) - (y * sin);
- this.y = (x * sin) + (y * cos);
- this._add(center);
- return this;
- };
- /**
- * Calculate distance between two points.
- * @param {Point} point Point instance.
- * @returns {number} The number of distance between two points.
- */
- Point.prototype.distanceTo = function(point) {
- var x,
- y;
- point = Point.n(point);
- x = point.x - this.x;
- y = point.y - this.y;
- return Math.sqrt((x * x) + (y * y));
- };
- /**
- * Check point equals.
- * @param {Point} point Point instance to compare
- * @returns {boolean} equality
- */
- Point.prototype.equals = function(point) {
- point = Point.n(point);
- return point.x === this.x && point.y === this.y;
- };
- /**
- * Return formatted string. 'Point(x, y)'
- * @returns {string} string
- */
- Point.prototype.toString = function() {
- return 'Point(' + this.x + ', ' + this.y + ')';
- };
- /**
- * Return coodinates to array. [x, y]
- * @returns {number[]} coordinate array.
- */
- Point.prototype.toArray = function() {
- return [this.x, this.y];
- };
- module.exports = Point;
- /***/ }),
- /***/ "./src/js/common/reqAnimFrame.js":
- /*!***************************************!*\
- !*** ./src/js/common/reqAnimFrame.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview RequestAnimFrame
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var requestFn,
- cancelFn;
- /**
- * Get name with vendor prefix
- * @param {string} name - name to prepend prefix
- * @returns {string} vendor prefixed name
- */
- function getPrefixed(name) {
- return global['webkit' + name] || global['moz' + name] || global['ms' + name];
- }
- requestFn = global.requestAnimationFrame ||
- getPrefixed('RequestAnimationFrame') ||
- function(fn, context) {
- fn.call(context);
- };
- cancelFn = global.cancelAnimationFrame ||
- getPrefixed('CancelAnimationFrame') ||
- getPrefixed('CancelRequestAnimationFrame') ||
- function() {};
- /**
- * @module module:reqAnimFrame
- */
- module.exports = {
- /**
- * Shim of requestAnimationFrame
- * @param {function} fn callback function
- * @param {*} context context for callback
- * @returns {number} Unique id
- */
- requestAnimFrame: function(fn, context) {
- return requestFn.call(global, fn.bind(context));
- },
- /**
- * Shim of cancelAnimationFrame
- * @param {number} id requestAnimationFrame id
- */
- cancelAnimFrame: function(id) {
- if (!id) {
- return;
- }
- cancelFn.call(global, id);
- }
- };
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/common/timezone.js":
- /*!***********************************!*\
- !*** ./src/js/common/timezone.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview timezone
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var intlUtil = __webpack_require__(/*! ./intlUtil */ "./src/js/common/intlUtil.js");
- var MIN_TO_MS = 60 * 1000;
- var nativeOffsetMs = getTimezoneOffset();
- var customOffsetMs = nativeOffsetMs;
- var timezoneOffsetCallback = null;
- var setByTimezoneOption = false;
- var offsetCalculator = null;
- var primaryOffset, primaryTimezoneName;
- var getterMethods = [
- 'getDate',
- 'getDay',
- 'getFullYear',
- 'getHours',
- 'getMilliseconds',
- 'getMinutes',
- 'getMonth',
- 'getSeconds'
- ];
- var setterMethods = [
- 'setDate',
- 'setFullYear',
- 'setHours',
- 'setMilliseconds',
- 'setMinutes',
- 'setMonth',
- 'setSeconds'
- ];
- var STANDARD_TO_DST = 1;
- var DST_TO_STANDARD = -1;
- /**
- * Get the timezone offset by timestampe
- * @param {number} timestamp - timestamp
- * @returns {number} timezone offset
- * @private
- */
- function getTimezoneOffset(timestamp) {
- timestamp = !util.isUndefined(timestamp) ? timestamp : Date.now();
- return new Date(timestamp).getTimezoneOffset() * MIN_TO_MS;
- }
- /**
- * Get the custome timezone offset by timestampe
- * @param {number} timestamp - timestamp
- * @returns {number} timezone offset
- * @private
- */
- function getCustomTimezoneOffset(timestamp) {
- if (!setByTimezoneOption && timezoneOffsetCallback) {
- return timezoneOffsetCallback(timestamp) * MIN_TO_MS;
- }
- return customOffsetMs;
- }
- /**
- * Convert to local time
- * @param {number} time - time
- * @returns {number} local time
- */
- function getLocalTime(time) {
- var customTimezoneOffset, localTime;
- if (!setByTimezoneOption) {
- return time;
- }
- customTimezoneOffset = getCustomTimezoneOffset(time);
- localTime = time - customTimezoneOffset + nativeOffsetMs;
- return localTime;
- }
- /**
- * Create a Date instance with multiple arguments
- * @param {Array} args - arguments
- * @returns {Date}
- * @private
- */
- function createDateWithMultipleArgs(args) {
- var utc = Date.UTC.apply(null, args);
- return new Date(utc + getTimezoneOffset(utc));
- }
- /**
- * To convert a Date to TZDate as it is.
- * @param {TZDate|number|null} arg - date
- * @returns {Date}
- */
- function createDateWithUTCTime(arg) {
- var time;
- if (arg instanceof TZDate) {
- time = arg.getUTCTime();
- } else if (typeof arg === 'number') {
- time = arg;
- } else if (arg === null) {
- time = 0;
- } else {
- throw new Error('Invalid Type');
- }
- return new Date(time);
- }
- /**
- * Convert time to local time. Those times are only from API and not from inner source code.
- * @param {Date|string} arg - date
- * @returns {Date}
- */
- function createDateAsLocalTime(arg) {
- var time;
- if (arg instanceof Date) {
- time = arg.getTime();
- } else if (typeof arg === 'string') {
- time = Date.parse(arg);
- } else {
- throw new Error('Invalid Type');
- }
- time = getLocalTime(time);
- return new Date(time);
- }
- /**
- * is it for local time? These type can be used from Calendar API.
- * @param {Date|string} arg - date
- * @returns {boolean}
- */
- function useLocalTimeConverter(arg) {
- return arg instanceof Date || typeof arg === 'string';
- }
- /**
- * Timezone Date Class
- * @param {number|TZDate|Date|string} date - date to be converted
- * @constructor
- */
- function TZDate(date) {
- var nativeDate;
- if (util.isUndefined(date)) {
- date = Date.now();
- }
- if (arguments.length > 1) {
- nativeDate = createDateWithMultipleArgs(arguments);
- } else if (useLocalTimeConverter(date)) {
- nativeDate = createDateAsLocalTime(date);
- } else {
- nativeDate = createDateWithUTCTime(date);
- }
- this._date = nativeDate;
- }
- /**
- * Get milliseconds which is converted by timezone
- * @returns {number} milliseconds
- */
- TZDate.prototype.getTime = function() {
- var time = this._date.getTime();
- return time + getCustomTimezoneOffset(time) - getTimezoneOffset(time);
- };
- /**
- * Get UTC milliseconds
- * @returns {number} milliseconds
- */
- TZDate.prototype.getUTCTime = function() {
- return this._date.getTime();
- };
- /**
- * toUTCString
- * @returns {string}
- */
- TZDate.prototype.toUTCString = function() {
- return this._date.toUTCString();
- };
- /**
- * to Date
- * @returns {Date}
- */
- TZDate.prototype.toDate = function() {
- return this._date;
- };
- TZDate.prototype.valueOf = function() {
- return this.getTime();
- };
- TZDate.prototype.addDate = function(day) {
- this.setDate(this.getDate() + day);
- return this;
- };
- TZDate.prototype.addMinutes = function(minutes) {
- this.setMinutes(this.getMinutes() + minutes);
- return this;
- };
- TZDate.prototype.addMilliseconds = function(milliseconds) {
- this.setMilliseconds(this.getMilliseconds() + milliseconds);
- return this;
- };
- /* eslint-disable max-params*/
- TZDate.prototype.setWithRaw = function(y, M, d, h, m, s, ms) {
- this.setFullYear(y, M, d);
- this.setHours(h, m, s, ms);
- return this;
- };
- /**
- * @returns {TZDate} local time
- */
- TZDate.prototype.toLocalTime = function() {
- var time = this.getTime();
- var utcTime = this.getUTCTime();
- var diff = time - utcTime;
- return new TZDate(utcTime - diff);
- };
- getterMethods.forEach(function(methodName) {
- TZDate.prototype[methodName] = function() {
- return this._date[methodName].apply(this._date, arguments);
- };
- });
- setterMethods.forEach(function(methodName) {
- TZDate.prototype[methodName] = function() {
- this._date[methodName].apply(this._date, arguments);
- return this.getTime();
- };
- });
- /**
- * Set offset
- * @param {number} offset - timezone offset based on minutes
- */
- function setOffset(offset) {
- customOffsetMs = offset * MIN_TO_MS;
- }
- /**
- * Set primary offset
- * @param {number} offset - offset
- */
- function setPrimaryOffset(offset) {
- primaryOffset = offset;
- setOffset(offset);
- }
- /**
- * Return primary offset
- * @returns {number} offset
- */
- function getPrimaryOffset() {
- return util.isNumber(primaryOffset) ? primaryOffset : new Date().getTimezoneOffset();
- }
- /**
- * Set primary timezone name
- * @param {string} timezoneName - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
- */
- function setPrimaryTimezoneCode(timezoneName) {
- primaryTimezoneName = timezoneName;
- }
- /**
- * Get offset by timezoneName
- * @param {string} timezoneName - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
- * @param {number} timestamp - timestamp
- * @returns {number} timezone offset
- */
- function getOffsetByTimezoneName(timezoneName, timestamp) {
- var offset = getPrimaryOffset();
- var calculator;
- if (!timezoneName) {
- return offset;
- }
- calculator = getOffsetCalculator(timezoneName);
- return calculator ? calculator(timezoneName, timestamp) : offset;
- }
- /**
- * Set a calculator function to get timezone offset by timestamp
- * @param {function} calculator - offset calculator
- */
- function setOffsetCalculator(calculator) {
- offsetCalculator = calculator;
- }
- /**
- * Return a function to calculate timezone offset by timestamp
- * @param {string} timezoneName - timezone name
- * @returns {function | null} offset calculator
- */
- function getOffsetCalculator(timezoneName) {
- if (util.isFunction(offsetCalculator)) {
- return offsetCalculator;
- }
- if (intlUtil.supportIntl(timezoneName)) {
- return intlUtil.offsetCalculator;
- }
- return null;
- }
- /**
- * Set timezone and offset by timezone option
- * @param {Timezone} timezoneObj - {@link Timezone}
- */
- function setPrimaryTimezoneByOption(timezoneObj) {
- var timezoneName, offset;
- if (!(timezoneObj && timezoneObj.timezoneName)) {
- return;
- }
- timezoneName = timezoneObj.timezoneName;
- setByTimezoneOption = true;
- setPrimaryTimezoneCode(timezoneName);
- offset = getOffsetByTimezoneName(timezoneName, Date.now());
- if (offset === nativeOffsetMs / MIN_TO_MS) {
- setByTimezoneOption = false;
- }
- setPrimaryOffset(offset);
- }
- /**
- * Get primary timezone name
- * @returns {string} primary timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
- */
- function getPrimaryTimezoneName() {
- return primaryTimezoneName;
- }
- /**
- * Compare the start and end times to see if the time zone is changing.
- * @param {number} startTime - start timestamp
- * @param {number} endTime - end timestamp
- * @returns {object} whether to change the offset and offset difference value
- */
- function isDifferentOffsetStartAndEndTime(startTime, endTime) {
- var offset1 = getOffsetByTimezoneName(primaryTimezoneName, startTime);
- var offset2 = getOffsetByTimezoneName(primaryTimezoneName, endTime);
- var result = 0;
- if (offset1 > offset2) {
- result = STANDARD_TO_DST;
- } else if (offset1 < offset2) {
- result = DST_TO_STANDARD;
- }
- return {
- isOffsetChanged: result,
- offsetDiff: offset1 - offset2
- };
- }
- module.exports = {
- Date: TZDate,
- setOffset: setOffset,
- /**
- * Set offset
- * @param {number} offset - timezone offset based on minutes
- */
- setOffsetByTimezoneOption: function(offset) {
- this.setOffset(-offset);
- primaryOffset = -offset;
- setByTimezoneOption = true;
- },
- /**
- * Get offset in case of `setByTimezoneOption`. Or return 0.
- * @returns {number} timezone offset offset minutes
- */
- getOffset: function() {
- if (setByTimezoneOption) {
- return customOffsetMs / MIN_TO_MS;
- }
- return 0;
- },
- /**
- * Set a callback function to get timezone offset by timestamp
- * @param {function} callback - callback function
- */
- setOffsetCallback: function(callback) {
- timezoneOffsetCallback = callback;
- },
- /**
- * (Use this method only for testing)
- * Reset system timezone and custom timezone
- */
- restoreOffset: function() {
- customOffsetMs = getTimezoneOffset();
- },
- getNativeOffsetMs: function() {
- return nativeOffsetMs;
- },
- /**
- * Check to use custom timezone option
- * @returns {boolean} use custom timezone option
- */
- hasPrimaryTimezoneCustomSetting: function() {
- return setByTimezoneOption;
- },
- resetCustomSetting: function() {
- setByTimezoneOption = false;
- },
- setOffsetCalculator: setOffsetCalculator,
- setPrimaryTimezoneByOption: setPrimaryTimezoneByOption,
- getPrimaryOffset: getPrimaryOffset,
- getOffsetByTimezoneName: getOffsetByTimezoneName,
- getPrimaryTimezoneName: getPrimaryTimezoneName,
- isNativeOsUsingDSTTimezone: function() {
- var year = new Date().getFullYear();
- var jan = new Date(year, 0, 1).getTimezoneOffset();
- var jul = new Date(year, 6, 1).getTimezoneOffset();
- return jan !== jul;
- },
- isPrimaryUsingDSTTimezone: function() {
- var year = new Date().getFullYear();
- var jan = new Date(year, 0, 1);
- var jul = new Date(year, 6, 1);
- return (
- getOffsetByTimezoneName(primaryTimezoneName, jan) !==
- getOffsetByTimezoneName(primaryTimezoneName, jul)
- );
- },
- isDifferentOffsetStartAndEndTime: isDifferentOffsetStartAndEndTime,
- setPrimaryTimezoneCode: setPrimaryTimezoneCode
- };
- /***/ }),
- /***/ "./src/js/common/vlayout.js":
- /*!**********************************!*\
- !*** ./src/js/common/vlayout.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Layout module that supplied split height, resize height features.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
- common = __webpack_require__(/*! ./common */ "./src/js/common/common.js"),
- domutil = __webpack_require__(/*! ./domutil */ "./src/js/common/domutil.js"),
- domevent = __webpack_require__(/*! ./domevent */ "./src/js/common/domevent.js"),
- View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js"),
- VPanel = __webpack_require__(/*! ./vpanel */ "./src/js/common/vpanel.js"),
- Drag = __webpack_require__(/*! ../handler/drag */ "./src/js/handler/drag.js");
- var mAbs = Math.abs;
- /**
- * @typedef PanelOptions
- * @type {object}
- * @property {number} [minHeight=0] - minimum height of panel
- * @property {number} [height=0] - current panel height
- * @property {boolean} [splitter=false] - is this panel uses splitter?
- * @property {boolean} [autoHeight=false] - is this panel uses remain height of container?
- * @property {string} [className=''] - className string for add created element
- */
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - options for VLayout module
- * @param {PanelOptions[]} [options.panels] - panels to add layout when initialize
- * @param {number[]} [options.panelHeights] - panel height list
- * @param {HTMLElement} container - container element
- * @param {Theme} theme - theme instance
- */
- function VLayout(options, container, theme) {
- var opt, tempHeights;
- if (!(this instanceof VLayout)) {
- return new VLayout(options, container);
- }
- View.call(this, container);
- domutil.addClass(container, config.classname('vlayout-container'));
- /**
- * @type {object}
- */
- opt = this.options = util.extend({
- panels: [],
- panelHeights: []
- }, options);
- /**
- * @type {VPanel[]}
- */
- this.panels = [];
- /**
- * @type {Drag}
- */
- this._drag = new Drag({
- distance: 10,
- exclude: function(target) {
- return !domutil.hasClass(target, config.classname('splitter'));
- }
- }, container);
- this._drag.on({
- dragStart: this._onDragStart,
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- /**
- * @type {object}
- */
- this._dragData = null;
- /**
- * @type {Theme}
- */
- this.theme = theme;
- if (opt.panels.length) {
- if (opt.panelHeights.length) {
- tempHeights = opt.panelHeights.slice();
- util.forEach(opt.panels, function(panelOpt) {
- if (!panelOpt.isSplitter && !panelOpt.autoHeight) {
- panelOpt.height = tempHeights.shift();
- }
- });
- }
- this.addPanels(opt.panels, this.container);
- }
- this.refresh();
- }
- util.inherit(VLayout, View);
- /**
- * Get current panels height in layout
- * @returns {number[]} height of panels with `autoHeight` false
- */
- VLayout.prototype.getLayoutData = function() {
- var heightList = [];
- util.forEach(this.panels, function(panel) {
- if (panel.isSplitter() || panel.options.autoHeight) {
- return;
- }
- heightList.push(panel.getHeight());
- });
- return heightList;
- };
- /**
- * Set panels height in layout
- * @param {number[]} heightList of panels with `autoHeight` false
- */
- VLayout.prototype.setLayoutData = function(heightList) {
- if (!heightList.length) {
- return;
- }
- util.forEach(this.panels, function(panel) {
- if (panel.isSplitter() || panel.options.autoHeight) {
- return;
- }
- panel.setHeight(null, heightList.shift());
- });
- this.refresh();
- };
- /**
- * Get next panel instance by specific panel
- * @param {VPanel} panel - panel instance
- * @returns {VPanel} next panel
- */
- VLayout.prototype.nextPanel = function(panel) {
- return this.panels[panel.index + 1];
- };
- /**
- * Get previous panel instance by specific panel
- * @param {VPanel} panel - panel instance
- * @returns {VPanel} previous panel
- */
- VLayout.prototype.prevPanel = function(panel) {
- return this.panels[panel.index - 1];
- };
- /**
- * Initialize resizing guide element
- * @param {HTMLElement} element - element to use guide element after cloned
- * @param {number} top - top pixel value for guide element
- * @returns {HTMLElement} cloned element == guide element
- */
- VLayout.prototype._initializeGuideElement = function(element, top) {
- var cloned = element.cloneNode(true);
- domutil.addClass(cloned, config.classname('splitter-guide'));
- this._refreshGuideElement(cloned, top);
- this.container.appendChild(cloned);
- return cloned;
- };
- /**
- * Refresh guide element position
- * @param {HTMLElement} element - guide element
- * @param {number} top - top pixel value for guide element
- */
- VLayout.prototype._refreshGuideElement = function(element, top) {
- element.style.top = top + 'px';
- };
- /**
- * Clear guide element position
- * @param {HTMLElement} element - guide element
- */
- VLayout.prototype._clearGuideElement = function(element) {
- domutil.remove(element);
- };
- /**
- * Resize overall panels size
- * @param {VPanel} splPanel - splitter panel instance
- * @param {number} startY - dragstart Y position
- * @param {number} mouseY - dragend Y position
- */
- VLayout.prototype._resize = function(splPanel, startY, mouseY) {
- var diffY = startY - mouseY,
- resizedHeight = mAbs(diffY),
- resizeMap = [],
- toDown = mouseY > startY,
- backwardMethod = toDown ? 'prevPanel' : 'nextPanel',
- forwardMethod = toDown ? 'nextPanel' : 'prevPanel',
- cursor, resizeInfo;
- cursor = this[backwardMethod](splPanel);
- resizeInfo = cursor.getResizeInfoByGrowth(resizedHeight);
- resizeMap.push([cursor, resizeInfo[0]]);
- for (cursor = this[forwardMethod](cursor);
- util.isExisty(cursor);
- cursor = this[forwardMethod](cursor)) {
- if (cursor.isSplitter()) {
- continue;
- }
- resizeInfo = cursor.getResizeInfoByGrowth(-resizedHeight);
- resizeMap.push([cursor, resizeInfo[0]]);
- resizedHeight -= resizeInfo[1];
- }
- util.forEach(resizeMap, function(pair) {
- pair[0].setHeight(null, pair[1], true);
- pair[0].fire('resize');
- });
- };
- /**
- * Get summation of splitter and panel's minimum height upper and below of supplied splitter
- * @param {VPanel} splPanel - splitter panel instance
- * @returns {number[]} upper and below splitter's height and panel minimum height summation.
- */
- VLayout.prototype._getMouseYAdditionalLimit = function(splPanel) {
- var upper = 0,
- below = 0,
- cursor,
- func = function(panel) {
- if (panel.isSplitter()) {
- return panel.getHeight();
- }
- return panel.options.minHeight;
- };
- for (cursor = this.prevPanel(splPanel);
- util.isExisty(cursor);
- cursor = this.prevPanel(cursor)) {
- upper += func(cursor);
- }
- for (cursor = this.nextPanel(splPanel);
- util.isExisty(cursor);
- cursor = this.nextPanel(cursor)) {
- below += func(cursor);
- }
- return [upper, below];
- };
- /**********
- * Drag Handlers
- **********/
- /**
- * Drag start schedule handler
- * @param {object} e - drag start schedule data
- */
- VLayout.prototype._onDragStart = function(e) {
- var oEvent = e.originEvent,
- target = e.target,
- splIndex = domutil.getData(target, 'panelIndex'),
- splPanel = this.panels[splIndex],
- splHeight = splPanel.getHeight(),
- splOffsetY = domevent.getMousePosition(oEvent, target)[1],
- mouseY = domevent.getMousePosition(oEvent, this.container)[1],
- guideElement = this._initializeGuideElement(target, mouseY);
- splPanel.addClass(config.classname('splitter-focused'));
- this._dragData = {
- splPanel: splPanel,
- splOffsetY: splOffsetY,
- guideElement: guideElement,
- startY: mouseY - splOffsetY,
- minY: 0,
- maxY: this.getViewBound().height - splHeight
- };
- if (!util.browser.msie) {
- domutil.addClass(document.body, config.classname('resizing'));
- }
- };
- /**
- * Drag schedule handler
- * @param {object} e - drag schedule data
- */
- VLayout.prototype._onDrag = function(e) {
- var dragData = this._dragData,
- mouseY = domevent.getMousePosition(e.originEvent, this.container)[1];
- mouseY = common.limit(mouseY - dragData.splOffsetY, [dragData.minY], [dragData.maxY]);
- this._refreshGuideElement(dragData.guideElement, mouseY);
- };
- /**
- * Drag end schedule handler
- * @fires VLayout#resize
- * @param {object} e - dragend schedule data
- */
- VLayout.prototype._onDragEnd = function(e) {
- var dragData = this._dragData,
- asideMinMax = this._getMouseYAdditionalLimit(dragData.splPanel),
- mouseY = domevent.getMousePosition(e.originEvent, this.container)[1];
- // mouseY value can't exceed summation of splitter height and panel's minimum height based on target splitter.
- mouseY = common.limit(
- mouseY - dragData.splOffsetY,
- [dragData.minY + asideMinMax[0]],
- [dragData.maxY - asideMinMax[1]]
- );
- this._resize(dragData.splPanel, dragData.startY, mouseY);
- /**
- * @event VLayout#resize
- * @type {object}
- * @property {number[]} layoutData - layout data after resized
- */
- this.fire('resize', {
- layoutData: this.getLayoutData()
- });
- this._dragData = null;
- this._clearGuideElement(dragData.guideElement);
- dragData.splPanel.removeClass(config.classname('splitter-focused'));
- domutil.removeClass(document.body, config.classname('resizing'));
- };
- /**********
- * Methods
- **********/
- /**
- * refresh each panels
- */
- VLayout.prototype.refresh = function() {
- var panelToFillHeight = [];
- var layoutHeight = this.getViewBound().height;
- var usedHeight = 0;
- var remainHeight;
- if (!layoutHeight) {
- return;
- }
- util.forEach(this.panels, function(panel) {
- if (panel.options.autoHeight) {
- panelToFillHeight.push(panel);
- } else {
- usedHeight += panel.getHeight();
- }
- });
- remainHeight = (layoutHeight - usedHeight) / panelToFillHeight.length;
- util.forEach(panelToFillHeight, function(panel) {
- panel.setHeight(null, remainHeight);
- });
- };
- /**
- * add panel
- * @param {PanelOptions} options - options for panel
- * @param {container} [container] - container element
- */
- VLayout.prototype.addPanel = function(options, container) {
- var element = document.createElement('div'),
- panels = this.panels,
- index = panels.length;
- options = util.extend({
- index: index
- }, options);
- panels.push(new VPanel(options, element, this.theme));
- container.appendChild(element);
- };
- /**
- * Add multiple panel
- * @param {PanelOptions[]} options - panel options list
- * @param {HTMLElement} container - container element
- */
- VLayout.prototype.addPanels = function(options, container) {
- var self = this,
- frag = document.createDocumentFragment();
- util.forEach(options, function(option) {
- self.addPanel(option, frag);
- });
- container.appendChild(frag);
- };
- /**
- * Get a panel by name
- * @param {string} name - panel's name
- * @returns {VPanel}
- */
- VLayout.prototype.getPanelByName = function(name) {
- var found;
- util.forEach(this.panels, function(panel) {
- if (panel.name === name) {
- found = panel;
- }
- });
- return found;
- };
- module.exports = VLayout;
- /***/ }),
- /***/ "./src/js/common/vpanel.js":
- /*!*********************************!*\
- !*** ./src/js/common/vpanel.js ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Panel class for VLayout module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
- common = __webpack_require__(/*! ./common */ "./src/js/common/common.js"),
- domutil = __webpack_require__(/*! ./domutil */ "./src/js/common/domutil.js"),
- View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js");
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - options for VPanel
- * @param {number} options.index - index of panel in vlayout
- * @param {number} [options.minHeight=0] - minimum height of panel
- * @param {number} [options.height] - initial height of panel
- * @param {boolean} [options.isSplitter=false] - set true then this panel works splitter
- * @param {boolean} [options.autoHeight=false] - set true then this panel use remain height after other panel resized.
- * @param {string} [options.className] - additional class name to add element
- * @param {HTMLElement} container - container element
- * @param {Theme} theme - theme instance
- */
- function VPanel(options, container, theme) {
- View.call(this, container);
- /**
- * @type {object}
- */
- this.options = util.extend({
- index: 0,
- name: '0',
- minHeight: 0,
- maxHeight: null,
- height: null,
- isSplitter: false,
- autoHeight: false,
- className: ''
- }, options);
- /**
- * @type {number}
- */
- this.index = this.options.index;
- /**
- * @type {string}
- */
- this.name = this.options.name || String(this.index);
- this.isHeightForcedSet = false;
- /**
- * @type {Theme}
- */
- this.theme = theme;
- this._initPanel(this.options, container);
- }
- util.inherit(VPanel, View);
- /**
- * whether this panel is splitter?
- * @returns {boolean} panel is splitter?
- */
- VPanel.prototype.isSplitter = function() {
- return this.options.isSplitter;
- };
- /**
- * set max height of panel
- * @param {number} maxHeight - maxHeight
- */
- VPanel.prototype.setMaxHeight = function(maxHeight) {
- if (!this.options.autoHeight) {
- this.options.maxHeight = maxHeight;
- }
- };
- /**
- * set forced height flag
- * @param {boolean} set - enable or not
- */
- VPanel.prototype.setHeightForcedSet = function(set) {
- this.isHeightForcedSet = set;
- };
- /**
- * get forced height flag
- * @returns {boolean} set - enable or not
- */
- VPanel.prototype.getHeightForcedSet = function() {
- return this.isHeightForcedSet;
- };
- /**
- * set height of html element
- * @param {HTMLElement} [container] - container element
- * @param {number} newHeight - height
- * @param {boolean} force - whether ignore max-length
- */
- VPanel.prototype.setHeight = function(container, newHeight, force) {
- var maxHeight = this.options.maxHeight;
- var minHeight = this.options.minHeight;
- var autoHeight = this.options.autoHeight;
- container = container || this.container;
- // 한번 force 호출이 일어난 이후에는 force 호출만 허용한다
- if (!force && this.isHeightForcedSet && !autoHeight) {
- return;
- }
- if (force) {
- this.isHeightForcedSet = true;
- } else if (maxHeight) {
- newHeight = Math.min(newHeight, maxHeight);
- }
- newHeight = Math.max(minHeight, newHeight);
- container.style.height = newHeight + 'px';
- };
- /**
- * Calculate new height of panel and remains by supplied height growth
- * @param {number} growth - growth value
- * @returns {number[]} newHeight, remainHeight
- */
- VPanel.prototype.getResizeInfoByGrowth = function(growth) {
- var height = this.getHeight(),
- newHeight = height + growth,
- resizeTo = Math.max(0, newHeight, this.options.minHeight);
- return [resizeTo, height - resizeTo];
- };
- /**
- * get outer height of panel element
- * @returns {number} outer height of panel element
- */
- VPanel.prototype.getHeight = function() {
- return domutil.getSize(this.container)[1];
- };
- /**
- * add design class to panel element
- * @param {string} className - classname string
- */
- VPanel.prototype.addClass = function(className) {
- domutil.addClass(this.container, className);
- };
- /**
- * remove design class to panel element
- * @param {string} className - classname string
- */
- VPanel.prototype.removeClass = function(className) {
- domutil.removeClass(this.container, className);
- };
- /**
- * initialize panel element
- * @param {PanelOptions} options - options for panel
- * @param {HTMLDivElement} container - panel element
- */
- VPanel.prototype._initPanel = function(options, container) {
- var height;
- domutil.setData(container, 'panelIndex', options.index);
- if (options.isSplitter) {
- domutil.addClass(container, config.classname('splitter'));
- this.applyTheme();
- return;
- }
- if (options.className) {
- domutil.addClass(container, options.className);
- }
- if (options.autoHeight) {
- domutil.setData(container, 'autoHeight', true);
- } else {
- height = common.limit(options.height || 0,
- [options.minHeight],
- [options.maxHeight || options.height]
- );
- options.height = height;
- this.setHeight(container, height);
- }
- };
- VPanel.prototype.applyTheme = function() {
- var style = this.container.style;
- var theme = this.theme;
- if (!theme) {
- return;
- }
- style.borderTop = theme.week.vpanelSplitter.border || theme.common.border;
- style.borderBottom = theme.week.vpanelSplitter.border || theme.common.border;
- style.height = theme.week.vpanelSplitter.height;
- };
- module.exports = VPanel;
- /***/ }),
- /***/ "./src/js/config.js":
- /*!**************************!*\
- !*** ./src/js/config.js ***!
- \**************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Global configuration object module. This @echo syntax will change preprocess context. See gulpfile.js
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var cssPrefix = 'tui-full-calendar-',
- alldayGetViewID = new RegExp('^' + cssPrefix + 'weekday[\\s]tui-view-(\\d+)'),
- alldayCheckPermission = new RegExp('^' + cssPrefix + 'schedule(-title)?$'),
- timeGetViewID = new RegExp('^' + cssPrefix + 'time-date[\\s]tui-view-(\\d+)');
- var config = {
- throwError: function(msg) {
- throw new Error(msg);
- },
- cssPrefix: cssPrefix,
- classname: function(str) {
- str = str || '';
- if (str.charAt(0) === '.') {
- return '.' + config.cssPrefix + str.slice(1);
- }
- return config.cssPrefix + str;
- },
- allday: {
- getViewIDRegExp: alldayGetViewID,
- checkCondRegExp: alldayCheckPermission
- },
- daygrid: {
- getViewIDRegExp: alldayGetViewID,
- checkCondRegExp: alldayCheckPermission
- },
- time: {
- getViewIDRegExp: timeGetViewID
- }
- };
- module.exports = config;
- /***/ }),
- /***/ "./src/js/controller/base.js":
- /*!***********************************!*\
- !*** ./src/js/controller/base.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Base calendar controller
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
- var ScheduleViewModel = __webpack_require__(/*! ../model/viewModel/scheduleViewModel */ "./src/js/model/viewModel/scheduleViewModel.js");
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
- var Theme = __webpack_require__(/*! ../theme/theme */ "./src/js/theme/theme.js");
- var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
- var TZDate = tz.Date;
- var SCHEDULE_VULNERABLE_OPTIONS = ['title', 'body', 'location', 'state', 'category', 'dueDateClass'];
- /**
- * Sanitize option values having possible vulnerabilities
- * @param {object} options options.
- * @returns {object} sanitized options.
- */
- function sanitizeOptions(options) {
- util.forEachArray(SCHEDULE_VULNERABLE_OPTIONS, function(prop) {
- if (options[prop]) {
- options[prop] = DOMPurify.sanitize(options[prop]);
- }
- });
- return options;
- }
- /**
- * Get range date by custom timezone or native timezone
- * @param {Schedule} schedule The instance of schedule.
- * @returns {RangeDate} start and end date
- */
- function getRangeDateByOffset(schedule) {
- var scheduleStart = schedule.getStarts();
- var scheduleEnd = schedule.getEnds();
- var start = datetime.start(scheduleStart);
- var equalStartEnd = datetime.compare(scheduleStart, scheduleEnd) === 0;
- var endDate = equalStartEnd ? scheduleEnd : datetime.convertStartDayToLastDay(scheduleEnd);
- var end = datetime.end(endDate);
- var nativeOffsetMs = tz.getNativeOffsetMs();
- var startOffset = scheduleStart.toDate().getTimezoneOffset();
- var MIN_TO_MS = 60 * 1000;
- var offsetDiffMs = 0;
- var primaryTimezoneName = tz.getPrimaryTimezoneName();
- var primaryOffset = tz.getPrimaryOffset();
- var timezoneOffset = tz.getOffsetByTimezoneName(primaryTimezoneName, scheduleStart.getTime());
- if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startOffset) {
- // When using a custom time zone, the native time zone offset is fixed and rendered.
- // So, The fixed and rendered time should be recalculated as the original time zone offset.
- offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
- }
- if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
- // The custom time zone is a time zone where two offsets including DST are applied.
- // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
- // It should be recalculated with the original time zone offset.
- offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
- }
- start = datetime.start(scheduleStart.getUTCTime() + offsetDiffMs);
- end = datetime.end(
- datetime.convertStartDayToLastDay(new TZDate(scheduleEnd.getUTCTime() + offsetDiffMs))
- );
- return {
- start: start,
- end: end
- };
- }
- /**
- * @constructor
- * @param {object} options - options for base controller
- * @param {function} [options.groupFunc] - function for group each models {@see Collection#groupBy}
- * @param {themeConfig} [options.theme] - theme object
- * @mixes util.CustomEvents
- */
- function Base(options) {
- options = options || {};
- /**
- * function for group each schedule models.
- * @type {function}
- * @param {ScheduleViewModel} viewModel - view model instance
- * @returns {string} group key
- */
- this.groupFunc =
- options.groupFunc ||
- function(viewModel) {
- var model = viewModel.model;
- if (viewModel.model.isAllDay) {
- return 'allday';
- }
- if (
- model.category === 'time' &&
- model.end - model.start > datetime.MILLISECONDS_PER_DAY
- ) {
- return 'allday';
- }
- return model.category;
- };
- /**
- * schedules collection.
- * @type {Collection}
- */
- this.schedules = common.createScheduleCollection();
- /**
- * Matrix for multidate schedules.
- * @type {object.<string, array>}
- */
- this.dateMatrix = {};
- /**
- * Theme
- * @type {Theme}
- */
- this.theme = new Theme(options.theme);
- /**
- * Calendar list
- * @type {Array.<Calendar>}
- */
- this.calendars = [];
- }
- /**
- * Calculate contain dates in schedule.
- * @private
- * @param {Schedule} schedule The instance of schedule.
- * @returns {array} contain dates.
- */
- Base.prototype._getContainDatesInSchedule = function(schedule) {
- var scheduleStart = schedule.getStarts();
- var scheduleEnd = schedule.getEnds();
- var start = datetime.start(scheduleStart);
- var equalStartEnd = datetime.compare(scheduleStart, scheduleEnd) === 0;
- var endDate = equalStartEnd ? scheduleEnd : datetime.convertStartDayToLastDay(scheduleEnd);
- var end = datetime.end(endDate);
- var rangeDateByOffset;
- if (tz.hasPrimaryTimezoneCustomSetting()) {
- rangeDateByOffset = getRangeDateByOffset(schedule);
- start = rangeDateByOffset.start;
- end = rangeDateByOffset.end;
- }
- return datetime.range(start, end, datetime.MILLISECONDS_PER_DAY);
- };
- /****************
- * CRUD Schedule
- ****************/
- /**
- * Create a schedule instance from raw data.
- * @emits Base#beforeCreateSchedule
- * @emits Base#createdSchedule
- * @param {object} options Data object to create schedule.
- * @param {boolean} silent - set true then don't fire events.
- * @returns {Schedule} The instance of Schedule that created.
- */
- Base.prototype.createSchedule = function(options, silent) {
- var schedule,
- scheduleData = {
- data: sanitizeOptions(options)
- };
- /**
- * @event Base#beforeCreateSchedule
- * @type {Calendar~Schedule[]}
- */
- if (!this.invoke('beforeCreateSchedule', scheduleData)) {
- return null;
- }
- schedule = this.addSchedule(Schedule.create(options));
- if (!silent) {
- /**
- * @event Base#createdSchedule
- * @type {Schedule}
- */
- this.fire('createdSchedule', schedule);
- }
- return schedule;
- };
- /**
- * @emits Base#beforeCreateSchedule
- * @emits Base#createdSchedule
- * @param {Calendar~Schedule[]} dataList - dataObject list to create schedule.
- * @param {boolean} [silent=false] - set true then don't fire events.
- * @returns {Schedule[]} The instance list of Schedule that created.
- */
- Base.prototype.createSchedules = function(dataList, silent) {
- var self = this;
- return util.map(dataList, function(data) {
- return self.createSchedule(data, silent);
- });
- };
- /**
- * Update a schedule.
- * @emits Base#updateSchedule
- * @param {Schedule} schedule - schedule instance to update
- * @param {object} options updated object data.
- * @returns {Schedule} updated schedule instance
- */
- // eslint-disable-next-line complexity
- Base.prototype.updateSchedule = function(schedule, options) {
- var start = options.start || schedule.start;
- var end = options.end || schedule.end;
- options = options ? sanitizeOptions(options) : {};
- if (['milestone', 'task', 'allday', 'time'].indexOf(options.category) > -1) {
- schedule.set('category', options.category);
- }
- if (options.category === 'allday') {
- options.isAllDay = true;
- }
- if (!util.isUndefined(options.isAllDay)) {
- schedule.set('isAllDay', options.isAllDay);
- }
- if (!util.isUndefined(options.calendarId)) {
- schedule.set('calendarId', options.calendarId);
- }
- if (options.title) {
- schedule.set('title', options.title);
- }
- if (options.body) {
- schedule.set('body', options.body);
- }
- if (options.start || options.end) {
- if (schedule.isAllDay) {
- schedule.setAllDayPeriod(start, end);
- } else {
- schedule.setTimePeriod(start, end);
- }
- }
- if (options.color) {
- schedule.set('color', options.color);
- }
- if (options.bgColor) {
- schedule.set('bgColor', options.bgColor);
- }
- if (options.borderColor) {
- schedule.set('borderColor', options.borderColor);
- }
- if (options.origin) {
- schedule.set('origin', options.origin);
- }
- if (!util.isUndefined(options.isPending)) {
- schedule.set('isPending', options.isPending);
- }
- if (!util.isUndefined(options.isFocused)) {
- schedule.set('isFocused', options.isFocused);
- }
- if (!util.isUndefined(options.isReadOnly)) {
- schedule.set('isReadOnly', options.isReadOnly);
- }
- if (options.location) {
- schedule.set('location', options.location);
- }
- if (options.state) {
- schedule.set('state', options.state);
- }
- if (options.raw) {
- schedule.set('raw', options.raw);
- }
- if (options.attendees) {
- schedule.set('attendees', options.attendees);
- }
- this._removeFromMatrix(schedule);
- this._addToMatrix(schedule);
- /**
- * @event Base#updateSchedule
- */
- this.fire('updateSchedule');
- return schedule;
- };
- /**
- * Delete schedule instance from controller.
- * @param {Schedule} schedule - schedule instance to delete
- * @returns {Schedule} deleted model instance.
- */
- Base.prototype.deleteSchedule = function(schedule) {
- this._removeFromMatrix(schedule);
- this.schedules.remove(schedule);
- return schedule;
- };
- /**
- * Set date matrix to supplied schedule instance.
- * @param {Schedule} schedule - instance of schedule.
- */
- Base.prototype._addToMatrix = function(schedule) {
- var ownMatrix = this.dateMatrix;
- var containDates = this._getContainDatesInSchedule(schedule);
- util.forEach(containDates, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD'),
- matrix = (ownMatrix[ymd] = ownMatrix[ymd] || []);
- matrix.push(util.stamp(schedule));
- });
- };
- /**
- * Remove schedule's id from matrix.
- * @param {Schedule} schedule - instance of schedule
- */
- Base.prototype._removeFromMatrix = function(schedule) {
- var modelID = util.stamp(schedule);
- util.forEach(
- this.dateMatrix,
- function(matrix) {
- var index = util.inArray(modelID, matrix);
- if (~index) {
- matrix.splice(index, 1);
- }
- },
- this
- );
- };
- /**
- * Add a schedule instance.
- * @emits Base#addedSchedule
- * @param {Schedule} schedule The instance of Schedule.
- * @param {boolean} silent - set true then don't fire events.
- * @returns {Schedule} The instance of Schedule that added.
- */
- Base.prototype.addSchedule = function(schedule, silent) {
- this.schedules.add(schedule);
- this._addToMatrix(schedule);
- if (!silent) {
- /**
- * @event Base#addedSchedule
- * @type {object}
- */
- this.fire('addedSchedule', schedule);
- }
- return schedule;
- };
- /**
- * split schedule model by ymd.
- * @param {Date} start - start date
- * @param {Date} end - end date
- * @param {Collection} scheduleCollection - collection of schedule model.
- * @returns {object.<string, Collection>} splitted schedule model collections.
- */
- Base.prototype.splitScheduleByDateRange = function(start, end, scheduleCollection) {
- var range = datetime.range(
- datetime.start(start),
- datetime.end(end),
- datetime.MILLISECONDS_PER_DAY
- ),
- ownMatrix = this.dateMatrix,
- result = {};
- util.forEachArray(range, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD'),
- matrix = ownMatrix[ymd],
- collection;
- collection = result[ymd] = common.createScheduleCollection();
- if (matrix && matrix.length) {
- util.forEachArray(matrix, function(id) {
- scheduleCollection.doWhenHas(id, function(schedule) {
- collection.add(schedule);
- });
- });
- }
- });
- return result;
- };
- /**
- * Return schedules in supplied date range.
- *
- * available only YMD.
- * @param {TZDate} start start date.
- * @param {TZDate} end end date.
- * @returns {object.<string, Collection>} schedule collection grouped by dates.
- */
- Base.prototype.findByDateRange = function(start, end) {
- var range = datetime.range(
- datetime.start(start),
- datetime.end(end),
- datetime.MILLISECONDS_PER_DAY
- ),
- ownSchedules = this.schedules.items,
- ownMatrix = this.dateMatrix,
- dformat = datetime.format,
- result = {},
- matrix,
- ymd,
- viewModels;
- util.forEachArray(range, function(date) {
- ymd = dformat(date, 'YYYYMMDD');
- matrix = ownMatrix[ymd];
- viewModels = result[ymd] = common.createScheduleCollection();
- if (matrix && matrix.length) {
- viewModels.add.apply(
- viewModels,
- util.map(matrix, function(id) {
- return ScheduleViewModel.create(ownSchedules[id]);
- })
- );
- }
- });
- return result;
- };
- Base.prototype.clearSchedules = function() {
- this.dateMatrix = {};
- this.schedules.clear();
- /**
- * for inner view when clear schedules
- * @event Base#clearSchedules
- * @type {Schedule}
- */
- this.fire('clearSchedules');
- };
- /**
- * Set a theme.
- * @param {themeConfig} theme - theme keys, styles
- * @returns {Array.<string>} keys - error keys not predefined.
- */
- Base.prototype.setTheme = function(theme) {
- return this.theme.setStyles(theme);
- };
- /**
- * Set calendar list
- * @param {Array.<Calendar>} calendars - calendar list
- */
- Base.prototype.setCalendars = function(calendars) {
- this.calendars = calendars;
- };
- // mixin
- util.CustomEvents.mixin(Base);
- module.exports = Base;
- /***/ }),
- /***/ "./src/js/controller/viewMixin/core.js":
- /*!*********************************************!*\
- !*** ./src/js/controller/viewMixin/core.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Core methods for schedule block placing
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var forEachArr = util.forEachArray,
- aps = Array.prototype.slice;
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
- var TZDate = tz.Date;
- var Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
- var ScheduleViewModel = __webpack_require__(/*! ../../model/viewModel/scheduleViewModel */ "./src/js/model/viewModel/scheduleViewModel.js");
- var Core = {
- /**
- * Calculate collision group.
- * @param {array} viewModels List of viewmodels.
- * @returns {array} Collision Group.
- */
- getCollisionGroup: function(viewModels) {
- var collisionGroups = [],
- foundPrevCollisionSchedule = false,
- previousScheduleList;
- if (!viewModels.length) {
- return collisionGroups;
- }
- collisionGroups[0] = [util.stamp(viewModels[0].valueOf())];
- forEachArr(viewModels.slice(1), function(schedule, index) {
- foundPrevCollisionSchedule = false;
- previousScheduleList = aps.apply(viewModels, [0, index + 1]).reverse();
- forEachArr(previousScheduleList, function(previous) {
- if (schedule.collidesWith(previous)) {
- // If overlapping previous schedules, find a Collision Group of overlapping schedules and add this schedules
- foundPrevCollisionSchedule = true;
- forEachArr(collisionGroups.slice(0).reverse(), function(group) {
- if (~util.inArray(util.stamp(previous.valueOf()), group)) {
- // If you find a previous schedule that overlaps, include it in the Collision Group to which it belongs.
- group.push(util.stamp(schedule.valueOf()));
- return false; // returning false can stop this loop
- }
- return true;
- });
- return false; // returning false can stop this loop
- }
- return true;
- });
- if (!foundPrevCollisionSchedule) {
- // This schedule is a schedule that does not overlap with the previous schedule, so a new Collision Group is constructed.
- collisionGroups.push([util.stamp(schedule.valueOf())]);
- }
- });
- return collisionGroups;
- },
- /**
- * Get row length by column index in 2d matrix.
- * @param {array[]} arr2d Matrix
- * @param {number} col Column index.
- * @returns {number} Last row number in column.
- */
- getLastRowInColumn: function(arr2d, col) {
- var row = arr2d.length;
- while (row > 0) {
- row -= 1;
- if (!util.isUndefined(arr2d[row][col])) {
- return row;
- }
- }
- return false;
- },
- /**
- * Calculate matrix for appointment block element placing.
- * @param {Collection} collection model collection.
- * @param {array[]} collisionGroups Collision groups for schedule set.
- * @returns {array} matrices
- */
- getMatrices: function(collection, collisionGroups) {
- var result = [],
- getLastRowInColumn = Core.getLastRowInColumn;
- forEachArr(collisionGroups, function(group) {
- var matrix = [[]];
- forEachArr(group, function(scheduleID) {
- var schedule = collection.items[scheduleID],
- col = 0,
- found = false,
- nextRow,
- lastRowInColumn;
- while (!found) {
- lastRowInColumn = getLastRowInColumn(matrix, col);
- if (lastRowInColumn === false) {
- matrix[0].push(schedule);
- found = true;
- } else if (!schedule.collidesWith(matrix[lastRowInColumn][col])) {
- nextRow = lastRowInColumn + 1;
- if (util.isUndefined(matrix[nextRow])) {
- matrix[nextRow] = [];
- }
- matrix[nextRow][col] = schedule;
- found = true;
- }
- col += 1;
- }
- });
- result.push(matrix);
- });
- return result;
- },
- /**
- * Filter that get schedule model in supplied date ranges.
- * @param {Date} start - start date
- * @param {Date} end - end date
- * @returns {function} schedule filter function
- */
- getScheduleInDateRangeFilter: function(start, end) {
- return function(model) {
- var ownStarts = model.getStarts(),
- ownEnds = model.getEnds();
- var dateByOffset;
- if (tz.hasPrimaryTimezoneCustomSetting()) {
- dateByOffset = recalculateDateByOffset(ownStarts, ownEnds);
- ownStarts = dateByOffset.start;
- ownEnds = dateByOffset.end;
- }
- // shorthand condition of
- //
- // (ownStarts >= start && ownEnds <= end) ||
- // (ownStarts < start && ownEnds >= start) ||
- // (ownEnds > end && ownStarts <= end)
- return !(ownEnds < start || ownStarts > end);
- };
- },
- /**
- * Position each view model for placing into container
- * @param {Date} start - start date to render
- * @param {Date} end - end date to render
- * @param {array} matrices - matrices from controller
- * @param {function} [iteratee] - iteratee function invoke each view models
- */
- positionViewModels: function(start, end, matrices, iteratee) {
- var ymdListToRender;
- ymdListToRender = util.map(
- datetime.range(start, end, datetime.MILLISECONDS_PER_DAY),
- function(date) {
- return datetime.format(date, 'YYYYMMDD');
- }
- );
- forEachArr(matrices, function(matrix) {
- forEachArr(matrix, function(column) {
- forEachArr(column, function(viewModel, index) {
- var ymd, dateLength, startDate, endDate;
- if (!viewModel) {
- return;
- }
- startDate = viewModel.getStarts();
- endDate = viewModel.getEnds();
- dateLength = datetime.range(
- datetime.start(startDate),
- datetime.renderEnd(startDate, endDate),
- datetime.MILLISECONDS_PER_DAY
- ).length;
- ymd = datetime.format(startDate, 'YYYYMMDD');
- viewModel.top = index;
- viewModel.left = util.inArray(ymd, ymdListToRender);
- viewModel.width = dateLength;
- if (iteratee) {
- iteratee(viewModel);
- }
- });
- });
- });
- },
- /**
- * Limit start, end date each view model for render properly
- * @param {TZDate} start - start date to render
- * @param {TZDate} end - end date to render
- * @param {Collection|ScheduleViewModel} viewModelColl - schedule view
- * model collection or ScheduleViewModel
- * @returns {ScheduleViewModel} return view model when third parameter is
- * view model
- */
- limitRenderRange: function(start, end, viewModelColl) {
- /**
- * Limit render range for view models
- * @param {ScheduleViewModel} viewModel - view model instance
- * @returns {ScheduleViewModel} view model that limited render range
- */
- function limit(viewModel) {
- if (viewModel.getStarts() < start) {
- viewModel.exceedLeft = true;
- viewModel.renderStarts = new TZDate(start);
- }
- if (viewModel.getEnds() > end) {
- viewModel.exceedRight = true;
- viewModel.renderEnds = new TZDate(end);
- }
- return viewModel;
- }
- if (viewModelColl.constructor === Collection) {
- viewModelColl.each(limit);
- return null;
- }
- return limit(viewModelColl);
- },
- /**
- * Convert schedule model collection to view model collection.
- * @param {Collection} modelColl - collection of schedule model
- * @returns {Collection} collection of schedule view model
- */
- convertToViewModel: function(modelColl) {
- var viewModelColl;
- viewModelColl = new Collection(function(viewModel) {
- return viewModel.cid();
- });
- modelColl.each(function(model) {
- viewModelColl.add(ScheduleViewModel.create(model));
- });
- return viewModelColl;
- }
- };
- /**
- * Get range date by custom timezone or native timezone
- * @param {TZDate} ownStarts start date.
- * @param {TZDate} ownEnds end date.
- * @returns {RangeDate} recalculated start and end date
- */
- function recalculateDateByOffset(ownStarts, ownEnds) {
- var nativeOffsetMs = tz.getNativeOffsetMs();
- var startOffset = ownStarts.toDate().getTimezoneOffset();
- var MIN_TO_MS = 60 * 1000;
- var offsetDiffMs = 0;
- var primaryTimezoneName = tz.getPrimaryTimezoneName();
- var primaryOffset = tz.getPrimaryOffset();
- var timezoneOffset = tz.getOffsetByTimezoneName(primaryTimezoneName, ownStarts.getTime());
- if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startOffset) {
- // When using a custom time zone, the native time zone offset is fixed and rendered.
- // So, The fixed and rendered time should be recalculated as the original time zone offset.
- offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
- }
- if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
- // The custom time zone is a time zone where two offsets including DST are applied.
- // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
- // It should be recalculated with the original time zone offset.
- offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
- }
- return {
- start: new TZDate(ownStarts.getUTCTime() + offsetDiffMs),
- end: new TZDate(ownEnds.getUTCTime() + offsetDiffMs)
- };
- }
- module.exports = Core;
- /***/ }),
- /***/ "./src/js/controller/viewMixin/month.js":
- /*!**********************************************!*\
- !*** ./src/js/controller/viewMixin/month.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Controller mixin for Month View
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
- var mmax = Math.max;
- var Month = {
- /**
- * Filter function for find time schedule
- * @param {ScheduleViewModel} viewModel - schedule view model
- * @returns {boolean} whether model is time schedule?
- */
- _onlyTimeFilter: function(viewModel) {
- return !viewModel.model.isAllDay && !viewModel.hasMultiDates;
- },
- /**
- * Filter function for find allday schedule
- * @param {ScheduleViewModel} viewModel - schedule view model
- * @returns {boolean} whether model is allday schedule?
- */
- _onlyAlldayFilter: function(viewModel) {
- return viewModel.model.isAllDay || viewModel.hasMultiDates;
- },
- /**
- * Weight top value +1 for month view render
- * @param {ScheduleViewModel} viewModel - schedule view model
- */
- _weightTopValue: function(viewModel) {
- viewModel.top = viewModel.top || 0;
- viewModel.top += 1;
- },
- /**
- * Adjust render range to render properly.
- *
- * Limit start, end for each allday schedules and expand start, end for
- * each time schedules
- * @this Base
- * @param {TZDate} start - render start date
- * @param {TZDate} end - render end date
- * @param {Collection} vColl - view model collection
- * property.
- */
- _adjustRenderRange: function(start, end, vColl) {
- var ctrlCore = this.Core;
- vColl.each(function(viewModel) {
- if (viewModel.model.isAllDay || viewModel.hasMultiDates) {
- ctrlCore.limitRenderRange(start, end, viewModel);
- }
- });
- },
- /**
- * Get max top index value for allday schedules in specific date (YMD)
- * @this Base
- * @param {string} ymd - yyyymmdd formatted value
- * @param {Collection} vAlldayColl - collection of allday schedules
- * @returns {number} max top index value in date
- */
- _getAlldayMaxTopIndexAtYMD: function(ymd, vAlldayColl) {
- var dateMatrix = this.dateMatrix,
- topIndexesInDate = [];
- util.forEach(dateMatrix[ymd], function(cid) {
- vAlldayColl.doWhenHas(cid, function(viewModel) {
- topIndexesInDate.push(viewModel.top);
- });
- });
- if (topIndexesInDate.length > 0) {
- return mmax.apply(null, topIndexesInDate);
- }
- return 0;
- },
- /**
- * Adjust time view model's top index value
- * @this Base
- * @param {Collection} vColl - collection of schedules
- */
- _adjustTimeTopIndex: function(vColl) {
- var ctrlMonth = this.Month;
- var getAlldayMaxTopIndexAtYMD = ctrlMonth._getAlldayMaxTopIndexAtYMD;
- var vAlldayColl = vColl.find(ctrlMonth._onlyAlldayFilter);
- var sortedTimeSchedules = vColl.find(ctrlMonth._onlyTimeFilter).sort(array.compare.schedule.asc);
- var maxIndexInYMD = {};
- sortedTimeSchedules.forEach(function(timeViewModel) {
- var scheduleYMD = datetime.format(timeViewModel.getStarts(), 'YYYYMMDD');
- var alldayMaxTopInYMD = maxIndexInYMD[scheduleYMD];
- if (util.isUndefined(alldayMaxTopInYMD)) {
- alldayMaxTopInYMD = maxIndexInYMD[scheduleYMD] =
- getAlldayMaxTopIndexAtYMD(scheduleYMD, vAlldayColl);
- }
- maxIndexInYMD[scheduleYMD] = timeViewModel.top =
- (alldayMaxTopInYMD + 1);
- });
- },
- /**
- * Adjust time view model's top index value
- * @this Base
- * @param {Collection} vColl - collection of schedules
- */
- _stackTimeFromTop: function(vColl) {
- var ctrlMonth = this.Month;
- var vAlldayColl = vColl.find(ctrlMonth._onlyAlldayFilter);
- var sortedTimeSchedules = vColl.find(ctrlMonth._onlyTimeFilter).sort(array.compare.schedule.asc);
- var indiceInYMD = {};
- var dateMatrix = this.dateMatrix;
- sortedTimeSchedules.forEach(function(timeViewModel) {
- var scheduleYMD = datetime.format(timeViewModel.getStarts(), 'YYYYMMDD');
- var topArrayInYMD = indiceInYMD[scheduleYMD];
- var maxTopInYMD;
- var i;
- if (util.isUndefined(topArrayInYMD)) {
- topArrayInYMD = indiceInYMD[scheduleYMD] = [];
- util.forEach(dateMatrix[scheduleYMD], function(cid) {
- vAlldayColl.doWhenHas(cid, function(viewModel) {
- topArrayInYMD.push(viewModel.top);
- });
- });
- }
- if (util.inArray(timeViewModel.top, topArrayInYMD) >= 0) {
- maxTopInYMD = mmax.apply(null, topArrayInYMD) + 1;
- for (i = 1; i <= maxTopInYMD; i += 1) {
- timeViewModel.top = i;
- if (util.inArray(timeViewModel.top, topArrayInYMD) < 0) {
- break;
- }
- }
- }
- topArrayInYMD.push(timeViewModel.top);
- });
- },
- /**
- * Convert multi-date time schedule to all-day schedule
- * @this Base
- * @param {Collection} vColl - view model collection
- * property.
- */
- _addMultiDatesInfo: function(vColl) {
- vColl.each(function(viewModel) {
- var model = viewModel.model;
- var start = model.getStarts();
- var end = model.getEnds();
- viewModel.hasMultiDates = datetime.hasMultiDates(start, end);
- if (!model.isAllDay && viewModel.hasMultiDates) {
- viewModel.renderStarts = datetime.start(start);
- viewModel.renderEnds = datetime.renderEnd(start, end);
- }
- });
- },
- /**
- * Find schedule and get view model for specific month
- * @this Base
- * @param {TZDate} start - start date to find schedules
- * @param {TZDate} end - end date to find schedules
- * @param {function[]} [andFilters] - optional filters to applying search query
- * @param {boolean} [alldayFirstMode=false] if true, time schedule is lower than all-day schedule. Or stack schedules from the top.
- * @returns {object} view model data
- */
- findByDateRange: function(start, end, andFilters, alldayFirstMode) {
- var ctrlCore = this.Core,
- ctrlMonth = this.Month,
- filter = ctrlCore.getScheduleInDateRangeFilter(start, end),
- coll, vColl, vList,
- collisionGroup,
- matrices;
- alldayFirstMode = alldayFirstMode || false;
- andFilters = andFilters || [];
- filter = Collection.and.apply(null, [filter].concat(andFilters));
- coll = this.schedules.find(filter);
- vColl = ctrlCore.convertToViewModel(coll);
- ctrlMonth._addMultiDatesInfo(vColl);
- ctrlMonth._adjustRenderRange(start, end, vColl);
- vList = vColl.sort(array.compare.schedule.asc);
- collisionGroup = ctrlCore.getCollisionGroup(vList);
- matrices = ctrlCore.getMatrices(vColl, collisionGroup);
- ctrlCore.positionViewModels(start, end, matrices, ctrlMonth._weightTopValue);
- if (alldayFirstMode) {
- ctrlMonth._adjustTimeTopIndex(vColl);
- } else {
- ctrlMonth._stackTimeFromTop(vColl);
- }
- return matrices;
- }
- };
- module.exports = Month;
- /***/ }),
- /***/ "./src/js/controller/viewMixin/week.js":
- /*!*********************************************!*\
- !*** ./src/js/controller/viewMixin/week.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint no-shadow: 0 */
- /**
- * @fileoverview Controller mixin modules for day views.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
- var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
- /**
- * @mixin Base.Week
- */
- var Week = {
- /**********
- * TIME GRID VIEW
- **********/
- /**
- * Make array with start and end times on schedules.
- * @this Base.Week
- * @param {array[]} matrix - matrix from controller.
- * @returns {array[]} starttime, endtime array (exclude first row's schedules)
- */
- generateTimeArrayInRow: function(matrix) {
- var row,
- col,
- schedule,
- start,
- end,
- map = [],
- cursor = [],
- maxColLen = Math.max.apply(null, util.map(matrix, function(col) {
- return col.length;
- }));
- for (col = 1; col < maxColLen; col += 1) {
- row = 0;
- schedule = util.pick(matrix, row, col);
- while (schedule) {
- start = schedule.getStarts().getTime() - datetime.millisecondsFrom('minutes', schedule.valueOf().goingDuration);
- end = schedule.getEnds().getTime() + datetime.millisecondsFrom('minutes', schedule.valueOf().comingDuration);
- if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
- end += SCHEDULE_MIN_DURATION;
- }
- cursor.push([start, end]);
- row += 1;
- schedule = util.pick(matrix, row, col);
- }
- map.push(cursor);
- cursor = [];
- }
- return map;
- },
- /**
- * Get collision information from list
- * @this Base
- * @param {array.<number[]>} arr - list to detecting collision. [[start, end], [start, end]]
- * @param {number} start - schedule start time that want to detect collisions.
- * @param {number} end - schedule end time that want to detect collisions.
- * @returns {boolean} target has collide in supplied array?
- */
- hasCollide: function(arr, start, end) {
- var startStart,
- startEnd,
- endStart,
- endEnd,
- getFunc = function(index) {
- return function(block) {
- return block[index];
- };
- },
- abs = Math.abs,
- compare = array.compare.num.asc,
- hasCollide;
- if (!arr.length) {
- return false;
- }
- startStart = abs(array.bsearch(arr, start, getFunc(0), compare));
- startEnd = abs(array.bsearch(arr, start, getFunc(1), compare));
- endStart = abs(array.bsearch(arr, end, getFunc(0), compare));
- endEnd = abs(array.bsearch(arr, end, getFunc(1), compare));
- hasCollide = !(startStart === startEnd && startEnd === endStart && endStart === endEnd);
- return hasCollide;
- },
- /**
- * Initialize values to viewmodels for detect real collision at rendering phase.
- * @this Base
- * @param {array[]} matrices - Matrix data.
- */
- getCollides: function(matrices) {
- util.forEachArray(matrices, function(matrix) {
- var binaryMap,
- maxRowLength;
- binaryMap = Week.generateTimeArrayInRow(matrix);
- maxRowLength = Math.max.apply(null, util.map(matrix, function(row) {
- return row.length;
- }));
- util.forEachArray(matrix, function(row) {
- util.forEachArray(row, function(viewModel, col) {
- var startTime,
- endTime,
- hasCollide,
- i;
- if (!viewModel) {
- return;
- }
- startTime = viewModel.getStarts().getTime();
- endTime = viewModel.getEnds().getTime();
- if (Math.abs(endTime - startTime) < SCHEDULE_MIN_DURATION) {
- endTime += SCHEDULE_MIN_DURATION;
- }
- startTime -= datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
- endTime += datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
- endTime -= 1;
- for (i = (col + 1); i < maxRowLength; i += 1) {
- hasCollide = Week.hasCollide(binaryMap[i - 1], startTime, endTime);
- if (hasCollide) {
- viewModel.hasCollide = true;
- break;
- }
- viewModel.extraSpace += 1;
- }
- });
- });
- });
- },
- /**
- * create view model for time view part
- * @this Base
- * @param {Date} start - start date.
- * @param {Date} end - end date.
- * @param {Collection} time - view model collection.
- * @param {number} hourStart - start hour to be shown
- * @param {number} hourEnd - end hour to be shown
- * @returns {object} view model for time part.
- */
- getViewModelForTimeView: function(start, end, time, hourStart, hourEnd) {
- var self = this,
- ymdSplitted = this.splitScheduleByDateRange(start, end, time),
- result = {};
- var _getViewModel = Week._makeGetViewModelFuncForTimeView(hourStart, hourEnd);
- util.forEach(ymdSplitted, function(collection, ymd) {
- var viewModels = _getViewModel(collection);
- var collisionGroups, matrices;
- collisionGroups = self.Core.getCollisionGroup(viewModels);
- matrices = self.Core.getMatrices(collection, collisionGroups);
- self.Week.getCollides(matrices);
- result[ymd] = matrices;
- });
- return result;
- },
- /**
- * make view model function depending on start and end hour
- * if time view option has start or end hour condition
- * it add filter
- * @param {number} hourStart - start hour to be shown
- * @param {number} hourEnd - end hour to be shown
- * @returns {function} function
- */
- _makeGetViewModelFuncForTimeView: function(hourStart, hourEnd) {
- if (hourStart === 0 && hourEnd === 24) {
- return function(collection) {
- return collection.sort(array.compare.schedule.asc);
- };
- }
- return function(collection) {
- return collection.find(Week._makeHourRangeFilter(hourStart, hourEnd))
- .sort(array.compare.schedule.asc);
- };
- },
- /**
- * make a filter function that is not included range of start, end hour
- * @param {number} hStart - hour start
- * @param {number} hEnd - hour end
- * @returns {function} - filtering function
- */
- _makeHourRangeFilter: function(hStart, hEnd) {
- // eslint-disable-next-line complexity
- return function(schedule) {
- var ownHourStart = schedule.model.start;
- var ownHourEnd = schedule.model.end;
- var yyyy = ownHourStart.getFullYear();
- var mm = ownHourStart.getMonth();
- var dd = ownHourStart.getDate();
- var hourStart = new TZDate(yyyy, mm, dd).setHours(hStart);
- var hourEnd = new TZDate(yyyy, mm, dd).setHours(hEnd);
- return (ownHourStart >= hourStart && ownHourStart < hourEnd) ||
- (ownHourEnd > hourStart && ownHourEnd <= hourEnd) ||
- (ownHourStart < hourStart && ownHourEnd > hourStart) ||
- (ownHourEnd > hourEnd && ownHourStart < hourEnd);
- };
- },
- /**********
- * ALLDAY VIEW
- **********/
- /**
- * Set hasMultiDates flag to true and set date ranges for rendering
- * @this Base
- * @param {Collection} vColl - view model collection
- */
- _addMultiDatesInfo: function(vColl) {
- vColl.each(function(viewModel) {
- var model = viewModel.model;
- var start = model.getStarts();
- var end = model.getEnds();
- viewModel.hasMultiDates = true;
- viewModel.renderStarts = datetime.start(start);
- viewModel.renderEnds = datetime.renderEnd(start, end);
- });
- },
- /**
- * create view model for allday view part
- * @this Base
- * @param {Date} start start date.
- * @param {Date} end end date.
- * @param {Collection} viewModelColl - allday schedule viewModel viewModels.
- * @returns {object} allday viewModel.
- */
- getViewModelForAlldayView: function(start, end, viewModelColl) {
- var ctrlCore = this.Core,
- ctrlWeek = this.Week,
- viewModels,
- collisionGroups,
- matrices;
- if (!viewModelColl || !viewModelColl.length) {
- return [];
- }
- ctrlWeek._addMultiDatesInfo(viewModelColl);
- ctrlCore.limitRenderRange(start, end, viewModelColl);
- viewModels = viewModelColl.sort(array.compare.schedule.asc);
- collisionGroups = ctrlCore.getCollisionGroup(viewModels);
- matrices = ctrlCore.getMatrices(viewModelColl, collisionGroups);
- ctrlCore.positionViewModels(start, end, matrices);
- return matrices;
- },
- /**********
- * READ
- **********/
- /**
- * Populate schedules in date range.
- * @this Base
- * @param {Date} start start date.
- * @param {Date} end end date.
- * @param {Array.<object>} panels - schedule panels like 'milestone', 'task', 'allday', 'time'
- * @param {function[]} [andFilters] - optional filters to applying search query
- * @param {Object} options - week view options
- * @returns {object} schedules grouped by dates.
- */
- findByDateRange: function(start, end, panels, andFilters, options) {
- var ctrlCore = this.Core,
- ctrlWeek = this.Week,
- filter = ctrlCore.getScheduleInDateRangeFilter(start, end),
- scheduleTypes = util.pluck(panels, 'name'),
- hourStart = util.pick(options, 'hourStart'),
- hourEnd = util.pick(options, 'hourEnd'),
- modelColl,
- group;
- andFilters = andFilters || [];
- filter = Collection.and.apply(null, [filter].concat(andFilters));
- modelColl = this.schedules.find(filter);
- modelColl = ctrlCore.convertToViewModel(modelColl);
- group = modelColl.groupBy(scheduleTypes, this.groupFunc);
- util.forEach(panels, function(panel) {
- var name = panel.name;
- if (panel.type === 'daygrid') {
- group[name] = ctrlWeek.getViewModelForAlldayView(start, end, group[name]);
- } else if (panel.type === 'timegrid') {
- group[name] = ctrlWeek.getViewModelForTimeView(start, end, group[name], hourStart, hourEnd);
- }
- });
- return group;
- },
- /* eslint max-nested-callbacks: 0 */
- /**
- * Make exceed date information
- * @param {number} maxCount - exceed schedule count
- * @param {Array} eventsInDateRange - matrix of ScheduleViewModel
- * @param {Array.<TZDate>} range - date range of one week
- * @returns {object} exceedDate
- */
- getExceedDate: function(maxCount, eventsInDateRange, range) {
- var exceedDate = {};
- util.forEach(range, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD');
- exceedDate[ymd] = 0;
- });
- util.forEach(eventsInDateRange, function(matrix) {
- util.forEach(matrix, function(column) {
- util.forEach(column, function(viewModel) {
- var period;
- if (!viewModel || viewModel.top < maxCount) {
- return;
- }
- period = datetime.range(
- viewModel.getStarts(),
- viewModel.getEnds(),
- datetime.MILLISECONDS_PER_DAY
- );
- util.forEach(period, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD');
- exceedDate[ymd] += 1;
- });
- });
- });
- });
- return exceedDate;
- },
- /**
- * Exclude overflow schedules from matrices
- * @param {array} matrices - The matrices for schedule placing.
- * @param {number} visibleScheduleCount - maximum visible count on panel
- * @returns {array} - The matrices for schedule placing except overflowed schedules.
- */
- excludeExceedSchedules: function(matrices, visibleScheduleCount) {
- return matrices.map(function(matrix) {
- return matrix.map(function(row) {
- if (row.length > visibleScheduleCount) {
- return row.filter(function(item) {
- return item.top < visibleScheduleCount;
- }, this);
- }
- return row;
- }, this);
- }, this);
- }
- };
- module.exports = Week;
- /***/ }),
- /***/ "./src/js/factory/calendar.js":
- /*!************************************!*\
- !*** ./src/js/factory/calendar.js ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Factory module for control all other factory.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var GA_TRACKING_ID = 'UA-129951699-1';
- var DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet"),
- Handlebars = __webpack_require__(/*! handlebars-template-loader/runtime */ "./node_modules/handlebars-template-loader/runtime/index.js");
- var dw = __webpack_require__(/*! ../common/dw */ "./src/js/common/dw.js");
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- var Layout = __webpack_require__(/*! ../view/layout */ "./src/js/view/layout.js");
- var Drag = __webpack_require__(/*! ../handler/drag */ "./src/js/handler/drag.js");
- var controllerFactory = __webpack_require__(/*! ./controller */ "./src/js/factory/controller.js");
- var weekViewFactory = __webpack_require__(/*! ./weekView */ "./src/js/factory/weekView.js");
- var monthViewFactory = __webpack_require__(/*! ./monthView */ "./src/js/factory/monthView.js");
- var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
- var TZDate = tz.Date;
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
- var reqAnimFrame = __webpack_require__(/*! ../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var mmin = Math.min;
- /**
- * Schedule information
- * @typedef {object} Schedule
- * @property {string} [id] - The unique schedule id depends on calendar id
- * @property {string} calendarId - The unique calendar id
- * @property {string} [title] - The schedule title
- * @property {string} [body] - The schedule body text which is text/plain
- * @property {string|TZDate} [start] - The start time. It's 'string' for input. It's 'TZDate' for output like event handler.
- * @property {string|TZDate} [end] - The end time. It's 'string' for input. It's 'TZDate' for output like event handler.
- * @property {number} [goingDuration] - The travel time: Going duration minutes
- * @property {number} [comingDuration] - The travel time: Coming duration minutes
- * @property {boolean} [isAllDay] - The all day schedule
- * @property {string} [category] - The schedule type('milestone', 'task', allday', 'time')
- * @property {string} [dueDateClass] - The task schedule type string
- * (any string value is ok and mandatory if category is 'task')
- * @property {string} [location] - The location
- * @property {Array.<string>} [attendees] - The attendees
- * @property {string} [recurrenceRule] - The recurrence rule
- * @property {boolean} [isPending] - The in progress flag to do something like network job(The schedule will be transparent.)
- * @property {boolean} [isFocused] - The focused schedule flag
- * @property {boolean} [isVisible] - The schedule visibility flag
- * @property {boolean} [isReadOnly] - The schedule read-only flag
- * @property {boolean} [isPrivate] - The private schedule
- * @property {string} [color] - The schedule text color
- * @property {string} [bgColor] - The schedule background color
- * @property {string} [dragBgColor] - The schedule background color when dragging it
- * @property {string} [borderColor] - The schedule left border color
- * @property {string} [customStyle] - The schedule's custom css class
- * @property {any} [raw] - The user data
- * @property {string} [state] - The schedule's state ('busy', 'free')
- */
- /**
- * Template functions to support customer renderer
- * @typedef {object} Template
- * @property {function} [milestoneTitle] - The milestone title(at left column) template function
- * @property {function} [milestone] - The milestone template function
- * @property {function} [taskTitle] - The task title(at left column) template function
- * @property {function} [task] - The task template function
- * @property {function} [alldayTitle] - The allday title(at left column) template function
- * @property {function} [allday] - The allday template function
- * @property {function} [time] - The time template function
- * @property {function} [goingDuration] - The travel time(going duration) template function
- * @property {function} [comingDuration] - The travel time(coming duration) template function
- * @property {function} [monthMoreTitleDate] - The month more layer title template function
- * @property {function} [monthMoreClose] - The month more layer close button template function
- * @property {function} [monthGridHeader] - The month grid header(date, decorator, title) template function
- * @property {function} [monthGridHeaderExceed] - The month grid header(exceed schedule count) template function
- * @property {function} [monthGridFooter] - The month grid footer(date, decorator, title) template function
- * @property {function} [monthGridFooterExceed] - The month grid footer(exceed schedule count) template function
- * @property {function} [monthDayname] - The monthly dayname template function
- * @property {function} [weekDayname] - The weekly dayname template function
- * @property {function} [weekGridFooterExceed] - The week/day grid footer(exceed schedule count) template function
- * @property {function} [dayGridTitle] - The week/day grid title template function(e.g. milestone, task, allday)
- * @property {function} [schedule] - The week/day schedule template function(When the schedule category attribute is milestone, task, or all day)
- * @property {function} [collapseBtnTitle] - The week/day (exceed schedule more view) collapse button title template function
- * @property {function} [timezoneDisplayLabel] - The timezone display label template function in time grid
- * @property {function} [timegridDisplayPrimayTime] - Deprecated: use 'timegridDisplayPrimaryTime'
- * @property {function} [timegridDisplayPrimaryTime] - The display label template function of primary timezone in time grid
- * @property {function} [timegridDisplayTime] - The display time template function in time grid
- * @property {function} [timegridCurrentTime] - The current time template function in time grid
- * @property {function} [popupIsAllDay] - The all day checkbox label text template function in the default creation popup
- * @property {function} [popupStateFree] - The free option template function in the state select box of the default creation popup
- * @property {function} [popupStateBusy] - The busy option template function in the state select box of the default creation popup
- * @property {function} [titlePlaceholder] - The title input placeholder text template function in the default creation popup
- * @property {function} [locationPlaceholder] - The location input placeholder text template function in the default creation popup
- * @property {function} [startDatePlaceholder] - The start date input placeholder text template function in the default creation popup
- * @property {function} [endDatePlaceholder] - The end date input placeholder text template function in the default creation popup
- * @property {function} [popupSave] - The 'Save' button text template function in the default creation popup
- * @property {function} [popupUpdate] - The 'Update' button text template function in the default creation popup when in edit mode
- * @property {function} [popupDetailDate] - The schedule date information's template function on the default detail popup
- * @property {function} [popupDetailLocation] - The schedule location text information's template function on the default detail popup
- * @property {function} [popupDetailUser] - The schedule user text information's template function on the default detail popup
- * @property {function} [popupDetailState] - The schedule state(busy or free) text information's template function on the default detail popup
- * @property {function} [popupDetailRepeat] - The schedule repeat information's template function on the default detail popup
- * @property {function} [popupDetailBody] - The schedule body text information's template function on the default detail popup
- * @property {function} [popupEdit] - The 'Edit' button text template function on the default detail popup
- * @property {function} [popupDelete] - The 'Delete' button text template function on the default detail popup
- * @example
- * var calendar = new tui.Calendar(document.getElementById('calendar'), {
- * ...
- * template: {
- * milestone: function(schedule) {
- * return '<span class="calendar-font-icon ic-milestone-b"></span> <span style="background-color: ' + schedule.bgColor + '">' + schedule.title + '</span>';
- * },
- * milestoneTitle: function() {
- * return '<span class="tui-full-calendar-left-content">MILESTONE</span>';
- * },
- * task: function(schedule) {
- * return '#' + schedule.title;
- * },
- * taskTitle: function() {
- * return '<span class="tui-full-calendar-left-content">TASK</span>';
- * },
- * allday: function(schedule) {
- * return getTimeTemplate(schedule, true);
- * },
- * alldayTitle: function() {
- * return '<span class="tui-full-calendar-left-content">ALL DAY</span>';
- * },
- * time: function(schedule) {
- * return '<strong>' + moment(schedule.start.getTime()).format('HH:mm') + '</strong> ' + schedule.title;
- * },
- * goingDuration: function(schedule) {
- * return '<span class="calendar-icon ic-travel-time"></span>' + schedule.goingDuration + 'min.';
- * },
- * comingDuration: function(schedule) {
- * return '<span class="calendar-icon ic-travel-time"></span>' + schedule.comingDuration + 'min.';
- * },
- * monthMoreTitleDate: function(date, dayname) {
- * var day = date.split('.')[2];
- *
- * return '<span class="tui-full-calendar-month-more-title-day">' + day + '</span> <span class="tui-full-calendar-month-more-title-day-label">' + dayname + '</span>';
- * },
- * monthMoreClose: function() {
- * return '<span class="tui-full-calendar-icon tui-full-calendar-ic-close"></span>';
- * },
- * monthGridHeader: function(dayModel) {
- * var date = parseInt(dayModel.date.split('-')[2], 10);
- * var classNames = ['tui-full-calendar-weekday-grid-date '];
- *
- * if (dayModel.isToday) {
- * classNames.push('tui-full-calendar-weekday-grid-date-decorator');
- * }
- *
- * return '<span class="' + classNames.join(' ') + '">' + date + '</span>';
- * },
- * monthGridHeaderExceed: function(hiddenSchedules) {
- * return '<span class="weekday-grid-more-schedules">+' + hiddenSchedules + '</span>';
- * },
- * monthGridFooter: function() {
- * return '';
- * },
- * monthGridFooterExceed: function(hiddenSchedules) {
- * return '';
- * },
- * monthDayname: function(model) {
- * return (model.label).toString().toLocaleUpperCase();
- * },
- * weekDayname: function(model) {
- * return '<span class="tui-full-calendar-dayname-date">' + model.date + '</span> <span class="tui-full-calendar-dayname-name">' + model.dayName + '</span>';
- * },
- * weekGridFooterExceed: function(hiddenSchedules) {
- * return '+' + hiddenSchedules;
- * },
- * dayGridTitle: function(viewName) {
- *
- * // use another functions instead of 'dayGridTitle'
- * // milestoneTitle: function() {...}
- * // taskTitle: function() {...}
- * // alldayTitle: function() {...}
- *
- * var title = '';
- * switch(viewName) {
- * case 'milestone':
- * title = '<span class="tui-full-calendar-left-content">MILESTONE</span>';
- * break;
- * case 'task':
- * title = '<span class="tui-full-calendar-left-content">TASK</span>';
- * break;
- * case 'allday':
- * title = '<span class="tui-full-calendar-left-content">ALL DAY</span>';
- * break;
- * }
- *
- * return title;
- * },
- * schedule: function(schedule) {
- *
- * // use another functions instead of 'schedule'
- * // milestone: function() {...}
- * // task: function() {...}
- * // allday: function() {...}
- *
- * var tpl;
- *
- * switch(category) {
- * case 'milestone':
- * tpl = '<span class="calendar-font-icon ic-milestone-b"></span> <span style="background-color: ' + schedule.bgColor + '">' + schedule.title + '</span>';
- * break;
- * case 'task':
- * tpl = '#' + schedule.title;
- * break;
- * case 'allday':
- * tpl = getTimeTemplate(schedule, true);
- * break;
- * }
- *
- * return tpl;
- * },
- * collapseBtnTitle: function() {
- * return '<span class="tui-full-calendar-icon tui-full-calendar-ic-arrow-solid-top"></span>';
- * },
- * timezoneDisplayLabel: function(timezoneOffset, displayLabel) {
- * var gmt, hour, minutes;
- *
- * if (!displayLabel) {
- * gmt = timezoneOffset < 0 ? '-' : '+';
- * hour = Math.abs(parseInt(timezoneOffset / 60, 10));
- * minutes = Math.abs(timezoneOffset % 60);
- * displayLabel = gmt + getPadStart(hour) + ':' + getPadStart(minutes);
- * }
- *
- * return displayLabel;
- * },
- * timegridDisplayPrimayTime: function(time) {
- * // will be deprecated. use 'timegridDisplayPrimaryTime'
- * var meridiem = 'am';
- * var hour = time.hour;
- *
- * if (time.hour > 12) {
- * meridiem = 'pm';
- * hour = time.hour - 12;
- * }
- *
- * return hour + ' ' + meridiem;
- * },
- * timegridDisplayPrimaryTime: function(time) {
- * var meridiem = 'am';
- * var hour = time.hour;
- *
- * if (time.hour > 12) {
- * meridiem = 'pm';
- * hour = time.hour - 12;
- * }
- *
- * return hour + ' ' + meridiem;
- * },
- * timegridDisplayTime: function(time) {
- * return getPadStart(time.hour) + ':' + getPadStart(time.hour);
- * },
- * timegridCurrentTime: function(timezone) {
- * var templates = [];
- *
- * if (timezone.dateDifference) {
- * templates.push('[' + timezone.dateDifferenceSign + timezone.dateDifference + ']<br>');
- * }
- *
- * templates.push(moment(timezone.hourmarker).format('HH:mm a'));
- *
- * return templates.join('');
- * },
- * popupIsAllDay: function() {
- * return 'All Day';
- * },
- * popupStateFree: function() {
- * return 'Free';
- * },
- * popupStateBusy: function() {
- * return 'Busy';
- * },
- * titlePlaceholder: function() {
- * return 'Subject';
- * },
- * locationPlaceholder: function() {
- * return 'Location';
- * },
- * startDatePlaceholder: function() {
- * return 'Start date';
- * },
- * endDatePlaceholder: function() {
- * return 'End date';
- * },
- * popupSave: function() {
- * return 'Save';
- * },
- * popupUpdate: function() {
- * return 'Update';
- * },
- * popupDetailDate: function(isAllDay, start, end) {
- * var isSameDate = moment(start).isSame(end);
- * var endFormat = (isSameDate ? '' : 'YYYY.MM.DD ') + 'hh:mm a';
- *
- * if (isAllDay) {
- * return moment(start).format('YYYY.MM.DD') + (isSameDate ? '' : ' - ' + moment(end).format('YYYY.MM.DD'));
- * }
- *
- * return (moment(start).format('YYYY.MM.DD hh:mm a') + ' - ' + moment(end).format(endFormat));
- * },
- * popupDetailLocation: function(schedule) {
- * return 'Location : ' + schedule.location;
- * },
- * popupDetailUser: function(schedule) {
- * return 'User : ' + (schedule.attendees || []).join(', ');
- * },
- * popupDetailState: function(schedule) {
- * return 'State : ' + schedule.state || 'Busy';
- * },
- * popupDetailRepeat: function(schedule) {
- * return 'Repeat : ' + schedule.recurrenceRule;
- * },
- * popupDetailBody: function(schedule) {
- * return 'Body : ' + schedule.body;
- * },
- * popupEdit: function() {
- * return 'Edit';
- * },
- * popupDelete: function() {
- * return 'Delete';
- * }
- * }
- * }
- */
- /**
- * Options for daily, weekly view.
- * @typedef {object} WeekOptions
- * @property {number} [startDayOfWeek=0] - The start day of week,
- * @property {Array.<string>} [daynames] - The day names in weekly and daily. Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
- * @property {boolean} [narrowWeekend=false] - Make weekend column narrow(1/2 width)
- * @property {boolean} [workweek=false] - Show only 5 days except for weekend
- * @property {boolean} [showTimezoneCollapseButton=false] - Show a collapse button to close multiple timezones
- * @property {boolean} [timezonesCollapsed=false] - An initial multiple timezones collapsed state
- * @property {number} [hourStart=0] - Can limit of render hour start.
- * @property {number} [hourEnd=24] - Can limit of render hour end.
- */
- /**
- * Options for monthly view.
- * @typedef {object} MonthOptions
- * @property {Array.<string>} [daynames] - The day names in monthly. Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
- * @property {number} [startDayOfWeek=0] - The start day of week
- * @property {boolean} [narrowWeekend=false] - Make weekend column narrow(1/2 width)
- * @property {number} [visibleWeeksCount=6] - The visible week count in monthly(0 or null are same with 6)
- * @property {boolean} [isAlways6Week=true] - Always show 6 weeks. If false, show 5 weeks or 6 weeks based on the month.
- * @property {boolean} [workweek=false] - Show only 5 days except for weekend
- * @property {number} [visibleScheduleCount] - The visible schedule count in monthly grid
- * @property {object} [moreLayerSize] - The more layer size
- * @property {object} [moreLayerSize.width=null] - The css width value(px, 'auto').
- * The default value 'null' is to fit a grid cell.
- * @property {object} [moreLayerSize.height=null] - The css height value(px, 'auto').
- * The default value 'null' is to fit a grid cell.
- * @property {object} [grid] - The grid's header and footer information
- * @property {object} [grid.header] - The grid's header informatioin
- * @property {number} [grid.header.height=34] - The grid's header height
- * @property {object} [grid.footer] - The grid's footer informatioin
- * @property {number} [grid.footer.height=34] - The grid's footer height
- * @property {function} [scheduleFilter=null] - The filter schedules on month view. A parameter is {Schedule} object.
- */
- /**
- * @typedef {object} CalendarColor
- * @property {string} [color] - The calendar color
- * @property {string} [bgColor] - The calendar background color
- * @property {string} [borderColor] - The calendar left border color
- * @property {string} [dragBgColor] - The Background color displayed when you drag a calendar's schedule
- */
- /**
- * @typedef {object} Timezone
- * @property {Array.<Zone>} [zones] - {@link Zone} array. Set the list of time zones.
- * The first zone element is primary
- * The rest zone elements are shown in left timegrid of weekly/daily view
- * @property {function} [offsetCalculator = null] - If you define the 'offsetCalculator' property, the offset calculation is done with this function.
- * The offsetCalculator option allows you to set up a function that returns the timezone offset for that time using date libraries like ['js-joda'](https://js-joda.github.io/js-joda/) and ['moment-timezone'](https://momentjs.com/timezone/).
- * The 'offsetCalculator' option is useful when your browser does not support 'Intl.DateTimeFormat' and 'formatToPart', or you want to use the date library you are familiar with.
- *
- * @example
- * var cal = new Calendar('#calendar', {
- * timezone: {
- * zones: [
- * {
- * timezoneName: 'Asia/Seoul',
- * displayLabel: 'GMT+09:00',
- * tooltip: 'Seoul'
- * },
- * {
- * timezoneName: 'America/New_York',
- * displayLabel: 'GMT-05:00',
- * tooltip: 'New York',
- * }
- * ],
- * offsetCalculator: function(timezoneName, timestamp){
- * // matches 'getTimezoneOffset()' of Date API
- * // e.g. +09:00 => -540, -04:00 => 240
- * return moment.tz.zone(timezoneName).utcOffset(timestamp);
- * },
- * }
- * });
- */
- /**
- * @typedef {object} Zone
- * @property {string} [timezoneName] - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York').
- * Basically, it will calculate the offset using 'Intl.DateTimeFormat' with the value of the this property entered.
- * This property is required.
- * @property {string} [displayLabel] - The display label of your timezone at weekly/daily view(e.g. 'GMT+09:00')
- * @property {string} [tooltip] - The tooltip(e.g. 'Seoul')
- * @property {number} [timezoneOffset] - The minutes for your timezone offset. If null, use the browser's timezone. Refer to Date.prototype.getTimezoneOffset().
- * This property will be deprecated. (since version 1.13)
- *
- * @example
- * var cal = new Calendar('#calendar', {
- * timezone: {
- * zones: [
- * {
- * timezoneName: 'Asia/Seoul',
- * displayLabel: 'GMT+09:00',
- * tooltip: 'Seoul'
- * },
- * {
- * timezoneName: 'America/New_York',
- * displayLabel: 'GMT-05:00',
- * tooltip: 'New York',
- * }
- * ],
- * }
- * });
- */
- /**
- * @typedef {object} CalendarProps
- * @property {string|number} id - The calendar id
- * @property {string} name - The calendar name
- * @property {string} color - The text color when schedule is displayed
- * @property {string} bgColor - The background color schedule is displayed
- * @property {string} borderColor - The color of left border or bullet point when schedule is displayed
- * @property {string} dragBgColor - The background color when schedule dragging
- * @example
- * var cal = new Calendar('#calendar', {
- * ...
- * calendars: [
- * {
- * id: '1',
- * name: 'My Calendar',
- * color: '#ffffff',
- * bgColor: '#9e5fff',
- * dragBgColor: '#9e5fff',
- * borderColor: '#9e5fff'
- * },
- * {
- * id: '2',
- * name: 'Company',
- * color: '#00a9ff',
- * bgColor: '#00a9ff',
- * dragBgColor: '#00a9ff',
- * borderColor: '#00a9ff'
- * },
- * ]
- * });
- */
- /**
- * @typedef {object} Options - Calendar option object
- * @property {string} [defaultView='week'] - Default view of calendar. The default value is 'week'.
- * @property {boolean|Array.<string>} [taskView=true] - Show the milestone and task in weekly, daily view. The default value is true. If the value is array, it can be ['milestone', 'task'].
- * @property {boolean|Array.<string>} [scheduleView=true] - Show the all day and time grid in weekly, daily view. The default value is false. If the value is array, it can be ['allday', 'time'].
- * @property {themeConfig} [theme=themeConfig] - {@link themeConfig} for custom style.
- * @property {Template} [template={}] - {@link Template} for further information
- * @property {WeekOptions} [week={}] - {@link WeekOptions} for week view
- * @property {MonthOptions} [month={}] - {@link MonthOptions} for month view
- * @property {Array.<CalendarProps>} [calendars=[]] - {@link CalendarProps} List that can be used to add new schedule. The default value is [].
- * @property {boolean} [useCreationPopup=false] - Whether use default creation popup or not. The default value is false.
- * @property {boolean} [useDetailPopup=false] - Whether use default detail popup or not. The default value is false.
- * @property {Timezone} [timezone] - {@link Timezone} - Set a custom time zone. You can add secondary timezone in the weekly/daily view.
- * @property {boolean} [disableDblClick=false] - Disable double click to create a schedule. The default value is false.
- * @property {boolean} [disableClick=false] - Disable click to create a schedule. The default value is false.
- * @property {boolean} [isReadOnly=false] - {@link Calendar} is read-only mode and a user can't create and modify any schedule. The default value is false.
- * @property {boolean} [usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.
- * @property {Array.<Timezone>} [timezones] - This property will be deprecated. (since version 1.13) Please use timezone property.
- */
- /**
- * {@link https://nhn.github.io/tui.code-snippet/latest/CustomEvents CustomEvents} document at {@link https://github.com/nhn/tui.code-snippet tui-code-snippet}
- * @typedef {class} CustomEvents
- */
- /**
- * @typedef {object} TimeCreationGuide - Time creation guide instance to present selected time period
- * @property {HTMLElement} guideElement - Guide element
- * @property {Object.<string, HTMLElement>} guideElements - Map by key. It can be used in monthly view
- * @property {function} clearGuideElement - Hide the creation guide
- * @example
- * calendar.on('beforeCreateSchedule', function(event) {
- * var guide = event.guide;
- * // Use guideEl$'s left, top to locate your schedule creation popup
- * var guideEl$ = guide.guideElement ?
- * guide.guideElement : guide.guideElements[Object.keys(guide.guideElements)[0]];
- *
- * // After that call this to hide the creation guide
- * guide.clearGuideElement();
- * });
- */
- /**
- * Calendar class
- * @constructor
- * @mixes CustomEvents
- * @param {HTMLElement|string} container - The container element or selector id
- * @param {Options} options - The calendar {@link Options} object
- * @example
- * var calendar = new tui.Calendar(document.getElementById('calendar'), {
- * defaultView: 'week',
- * taskView: true, // Can be also ['milestone', 'task']
- * scheduleView: true, // Can be also ['allday', 'time']
- * template: {
- * milestone: function(schedule) {
- * return '<span style="color:red;"><i class="fa fa-flag"></i> ' + schedule.title + '</span>';
- * },
- * milestoneTitle: function() {
- * return 'Milestone';
- * },
- * task: function(schedule) {
- * return ' #' + schedule.title;
- * },
- * taskTitle: function() {
- * return '<label><input type="checkbox" />Task</label>';
- * },
- * allday: function(schedule) {
- * return schedule.title + ' <i class="fa fa-refresh"></i>';
- * },
- * alldayTitle: function() {
- * return 'All Day';
- * },
- * time: function(schedule) {
- * return schedule.title + ' <i class="fa fa-refresh"></i>' + schedule.start;
- * }
- * },
- * month: {
- * daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- * startDayOfWeek: 0,
- * narrowWeekend: true
- * },
- * week: {
- * daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- * startDayOfWeek: 0,
- * narrowWeekend: true
- * }
- * });
- */
- function Calendar(container, options) {
- options = util.extend(
- {
- usageStatistics: true
- },
- options
- );
- if (options.usageStatistics === true && util.sendHostname) {
- util.sendHostname('calendar', GA_TRACKING_ID);
- }
- if (util.isString(container)) {
- container = document.querySelector(container);
- }
- /**
- * Calendar color map
- * @type {object}
- * @private
- */
- this._calendarColor = {};
- /**
- * Current rendered date
- * @type {TZDate}
- * @private
- */
- this._renderDate = datetime.start();
- /**
- * start and end date of weekly, monthly
- * @type {object}
- * @private
- */
- this._renderRange = {
- start: null,
- end: null
- };
- /**
- * base controller
- * @type {Base}
- * @private
- */
- this._controller = _createController(options);
- this._controller.setCalendars(options.calendars);
- /**
- * layout view (layout manager)
- * @type {Layout}
- * @private
- */
- this._layout = new Layout(container, this._controller.theme);
- /**
- * global drag handler
- * @type {Drag}
- * @private
- */
- this._dragHandler = new Drag({distance: 10}, this._layout.container);
- /**
- * current rendered view name. ('day', 'week', 'month')
- * @type {string}
- * @default 'week'
- * @private
- */
- this._viewName = options.defaultView || 'week';
- /**
- * Refresh method. it can be ref different functions for each view modes.
- * @type {function}
- * @private
- */
- this._refreshMethod = null;
- /**
- * Scroll to now. It can be called for 'week', 'day' view modes.
- * @type {function}
- * @private
- */
- this._scrollToNowMethod = null;
- /**
- * It's true if Calendar.prototype.scrollToNow() is called.
- * @type {boolean}
- * @private
- */
- this._requestScrollToNow = false;
- /**
- * Open schedule creation popup
- * @type {function}
- * @private
- */
- this._openCreationPopup = null;
- /**
- * Hide the more view
- * @type {function}
- * @private
- */
- this._hideMoreView = null;
- /**
- * Unique id for requestAnimFrame()
- * @type {number}
- * @private
- */
- this._requestRender = 0;
- /**
- * calendar options
- * @type {Options}
- * @private
- */
- this._options = {};
- this._initialize(options);
- }
- /**
- * destroy calendar instance.
- */
- Calendar.prototype.destroy = function() {
- this._dragHandler.destroy();
- this._controller.off();
- this._layout.clear();
- this._layout.destroy();
- util.forEach(this._options.template, function(func, name) {
- if (func) {
- Handlebars.unregisterHelper(name + '-tmpl');
- }
- });
- this._options = this._renderDate = this._controller
- = this._layout = this._dragHandler = this._viewName = this._refreshMethod
- = this._scrollToNowMethod = null;
- };
- /**
- * Initialize calendar
- * @param {Options} options - calendar options
- * @private
- */
- // eslint-disable-next-line complexity
- Calendar.prototype._initialize = function(options) {
- var controller = this._controller,
- viewName = this._viewName;
- this._options = util.extend(
- {
- defaultView: viewName,
- taskView: true,
- scheduleView: true,
- template: util.extend(
- {
- allday: null,
- time: null
- },
- util.pick(options, 'template') || {}
- ),
- week: util.extend({}, util.pick(options, 'week') || {}),
- month: util.extend({}, util.pick(options, 'month') || {}),
- calendars: [],
- useCreationPopup: false,
- useDetailPopup: false,
- timezones: options.timezone && options.timezone.zones ? options.timezone.zones : [],
- disableDblClick: false,
- disableClick: false,
- isReadOnly: false
- },
- options
- );
- this._options.week = util.extend(
- {
- startDayOfWeek: 0,
- workweek: false
- },
- util.pick(this._options, 'week') || {}
- );
- this._options.timezone = util.extend({zones: []}, util.pick(options, 'timezone') || {});
- this._options.month = util.extend(
- {
- startDayOfWeek: 0,
- workweek: false,
- scheduleFilter: function(schedule) {
- return (
- Boolean(schedule.isVisible) &&
- (schedule.category === 'allday' || schedule.category === 'time')
- );
- }
- },
- util.pick(options, 'month') || {}
- );
- if (this._options.isReadOnly) {
- this._options.useCreationPopup = false;
- }
- this._layout.controller = controller;
- this._setAdditionalInternalOptions(this._options);
- this.changeView(viewName, true);
- };
- /**
- * Set additional internal options
- * 1. Register to the template handlebar
- * 2. Update the calendar list and set the color of the calendar.
- * 3. Change the primary timezone offset of the timezones.
- * @param {Options} options - calendar options
- * @private
- */
- Calendar.prototype._setAdditionalInternalOptions = function(options) {
- var timezone = options.timezone;
- var templateWithSanitizer = function(templateFn) {
- return function() {
- var template = templateFn.apply(null, arguments);
- return DOMPurify.sanitize(template);
- };
- };
- var zones, offsetCalculator;
- util.forEach(options.template, function(func, name) {
- if (func) {
- Handlebars.registerHelper(name + '-tmpl', templateWithSanitizer(func));
- }
- });
- util.forEach(
- options.calendars || [],
- function(calendar) {
- this.setCalendarColor(calendar.id, calendar, true);
- },
- this
- );
- if (timezone) {
- offsetCalculator = timezone.offsetCalculator;
- if (util.isFunction(offsetCalculator)) {
- tz.setOffsetCalculator(offsetCalculator);
- }
- zones = timezone.zones;
- if (zones.length) {
- tz.setPrimaryTimezoneByOption(zones[0]);
- if (util.isNumber(zones[0].timezoneOffset)) {
- // @deprecated timezoneOffset property will be deprecated. use timezone property
- tz.setOffsetByTimezoneOption(zones[0].timezoneOffset);
- }
- }
- }
- };
- /**********
- * CRUD Methods
- **********/
- /**
- * Create schedules and render calendar.
- * @param {Array.<Schedule>} schedules - {@link Schedule} data list
- * @param {boolean} [silent=false] - no auto render after creation when set true
- * @example
- * calendar.createSchedules([
- * {
- * id: '1',
- * calendarId: '1',
- * title: 'my schedule',
- * category: 'time',
- * dueDateClass: '',
- * start: '2018-01-18T22:30:00+09:00',
- * end: '2018-01-19T02:30:00+09:00'
- * },
- * {
- * id: '2',
- * calendarId: '1',
- * title: 'second schedule',
- * category: 'time',
- * dueDateClass: '',
- * start: '2018-01-18T17:30:00+09:00',
- * end: '2018-01-19T17:31:00+09:00'
- * }
- * ]);
- */
- Calendar.prototype.createSchedules = function(schedules, silent) {
- util.forEach(
- schedules,
- function(obj) {
- this._setScheduleColor(obj.calendarId, obj);
- },
- this
- );
- this._controller.createSchedules(schedules, silent);
- if (!silent) {
- this.render();
- }
- };
- /**
- * Get a {@link Schedule} object by schedule id and calendar id.
- * @param {string} scheduleId - ID of schedule
- * @param {string} calendarId - calendarId of the schedule
- * @returns {Schedule} schedule object
- * @example
- * var schedule = calendar.getSchedule(scheduleId, calendarId);
- * console.log(schedule.title);
- */
- Calendar.prototype.getSchedule = function(scheduleId, calendarId) {
- return this._controller.schedules.single(function(model) {
- return model.id === scheduleId && model.calendarId === calendarId;
- });
- };
- /**
- * Update the schedule
- * @param {string} scheduleId - ID of the original schedule to update
- * @param {string} calendarId - The calendarId of the original schedule to update
- * @param {object} changes - The {@link Schedule} properties and values with changes to update
- * @param {boolean} [silent=false] - No auto render after creation when set true
- * @example
- * calendar.updateSchedule(schedule.id, schedule.calendarId, {
- * title: 'Changed schedule',
- * start: new Date('2019-11-05T09:00:00'),
- * end: new Date('2019-11-05T10:00:00'),
- * category: 'time'
- * });
- */
- Calendar.prototype.updateSchedule = function(scheduleId, calendarId, changes, silent) {
- var ctrl = this._controller,
- ownSchedules = ctrl.schedules,
- schedule = ownSchedules.single(function(model) {
- return model.id === scheduleId && model.calendarId === calendarId;
- });
- var hasChangedCalendar = false;
- if (!changes || !schedule) {
- return;
- }
- hasChangedCalendar = this._hasChangedCalendar(schedule, changes);
- changes = hasChangedCalendar ? this._setScheduleColor(changes.calendarId, changes) : changes;
- ctrl.updateSchedule(schedule, changes);
- if (!silent) {
- this.render();
- }
- };
- Calendar.prototype._hasChangedCalendar = function(schedule, changes) {
- return schedule && changes.calendarId && schedule.calendarId !== changes.calendarId;
- };
- Calendar.prototype._setScheduleColor = function(calendarId, schedule) {
- var calColor = this._calendarColor;
- var color = calColor[calendarId];
- if (color) {
- schedule.color = schedule.color || color.color;
- schedule.bgColor = schedule.bgColor || color.bgColor;
- schedule.borderColor = schedule.borderColor || color.borderColor;
- schedule.dragBgColor = schedule.dragBgColor || color.dragBgColor;
- }
- return schedule;
- };
- /**
- * Delete a schedule.
- * @param {string} scheduleId - ID of schedule to delete
- * @param {string} calendarId - The CalendarId of the schedule to delete
- * @param {boolean} [silent=false] - No auto render after creation when set true
- */
- Calendar.prototype.deleteSchedule = function(scheduleId, calendarId, silent) {
- var ctrl = this._controller,
- ownSchedules = ctrl.schedules,
- schedule = ownSchedules.single(function(model) {
- return model.id === scheduleId && model.calendarId === calendarId;
- });
- if (!schedule) {
- return;
- }
- ctrl.deleteSchedule(schedule);
- if (!silent) {
- this.render();
- }
- };
- /**********
- * Private Methods
- **********/
- /**
- * @param {string|Date} date - The Date to show in calendar
- * @param {number} [startDayOfWeek=0] - The Start day of week
- * @param {boolean} [workweek=false] - The only show work week
- * @returns {array} render range
- * @private
- */
- Calendar.prototype._getWeekDayRange = function(date, startDayOfWeek, workweek) {
- var day;
- var start;
- var end;
- var range;
- startDayOfWeek = (startDayOfWeek || 0); // eslint-disable-line
- date = util.isDate(date) ? date : new TZDate(date);
- day = date.getDay();
- // calculate default render range first.
- start = new TZDate(date).addDate(-day + startDayOfWeek);
- end = new TZDate(start).addDate(6);
- if (day < startDayOfWeek) {
- start = new TZDate(start).addDate(-7);
- end = new TZDate(end).addDate(-7);
- }
- if (workweek) {
- range = datetime.range(
- datetime.start(start),
- datetime.end(end),
- datetime.MILLISECONDS_PER_DAY
- );
- range = util.filter(range, function(weekday) {
- return !datetime.isWeekend(weekday.getDay());
- });
- start = range[0];
- end = range[range.length - 1];
- }
- start = datetime.start(start);
- end = datetime.start(end);
- return [start, end];
- };
- /**
- * Toggle schedules' visibility by calendar ID
- * @param {string} calendarId - The calendar id value
- * @param {boolean} toHide - Set true to hide schedules
- * @param {boolean} [render=true] - set true then render after change visible property each models
- */
- Calendar.prototype.toggleSchedules = function(calendarId, toHide, render) {
- var ownSchedules = this._controller.schedules;
- render = util.isExisty(render) ? render : true;
- calendarId = util.isArray(calendarId) ? calendarId : [calendarId];
- ownSchedules.each(function(schedule) {
- if (~util.inArray(schedule.calendarId, calendarId)) {
- schedule.set('isVisible', !toHide);
- }
- });
- if (render) {
- this.render();
- }
- };
- /**********
- * General Methods
- **********/
- /**
- * Render the calendar. The real rendering occurs after requestAnimationFrame.
- * If you have to render immediately, use the 'immediately' parameter as true.
- * @param {boolean} [immediately=false] - Render it immediately
- * @example
- * var silent = true;
- * calendar.clear();
- * calendar.createSchedules(schedules, silent);
- * calendar.render();
- * @example
- * // Render a calendar when resizing a window.
- * window.addEventListener('resize', function() {
- * calendar.render();
- * });
- */
- Calendar.prototype.render = function(immediately) {
- if (this._requestRender) {
- reqAnimFrame.cancelAnimFrame(this._requestRender);
- }
- if (immediately) {
- this._renderFunc();
- } else {
- this._requestRender = reqAnimFrame.requestAnimFrame(this._renderFunc, this);
- }
- };
- /**
- * Render and refresh all layout and process requests.
- * @private
- */
- Calendar.prototype._renderFunc = function() {
- if (this._refreshMethod) {
- this._refreshMethod();
- }
- if (this._layout) {
- this._layout.render();
- }
- if (this._scrollToNowMethod && this._requestScrollToNow) {
- this._scrollToNowMethod();
- }
- this._requestScrollToNow = false;
- this._requestRender = null;
- };
- /**
- * Delete all schedules and clear view. The real rendering occurs after requestAnimationFrame.
- * If you have to render immediately, use the 'immediately' parameter as true.
- * @param {boolean} [immediately=false] - Render it immediately
- * @example
- * calendar.clear();
- * calendar.createSchedules(schedules, true);
- * calendar.render();
- */
- Calendar.prototype.clear = function(immediately) {
- this._controller.clearSchedules();
- this.render(immediately);
- };
- /**
- * Scroll to current time on today in case of daily, weekly view
- * @example
- * function onNewSchedules(schedules) {
- * calendar.createSchedules(schedules);
- * if (calendar.getViewName() !== 'month') {
- * calendar.scrollToNow();
- * }
- * }
- */
- Calendar.prototype.scrollToNow = function() {
- if (this._scrollToNowMethod) {
- this._requestScrollToNow = true;
- // this._scrollToNowMethod() will be called at next frame rendering.
- }
- };
- /**
- * Move to today.
- * @example
- * function onClickTodayBtn() {
- * calendar.today();
- * }
- */
- Calendar.prototype.today = function() {
- this._renderDate = datetime.start();
- this._setViewName(this._viewName);
- this.move();
- this.render();
- };
- /**
- * Move the calendar amount of offset value
- * @param {number} offset - The offset value.
- * @private
- * @example
- * // move previous week when "week" view.
- * // move previous month when "month" view.
- * calendar.move(-1);
- */
- // eslint-disable-next-line complexity
- Calendar.prototype.move = function(offset) {
- var renderDate = dw(datetime.start(this._renderDate)),
- viewName = this._viewName,
- view = this._getCurrentView(),
- recursiveSet = _setOptionRecurseively,
- startDate,
- endDate,
- tempDate,
- startDayOfWeek,
- visibleWeeksCount,
- workweek,
- isAlways6Week,
- datetimeOptions;
- offset = util.isExisty(offset) ? offset : 0;
- if (viewName === 'month') {
- startDayOfWeek = util.pick(this._options, 'month', 'startDayOfWeek') || 0;
- visibleWeeksCount = mmin(util.pick(this._options, 'month', 'visibleWeeksCount') || 0, 6);
- workweek = util.pick(this._options, 'month', 'workweek') || false;
- isAlways6Week = util.pick(this._options, 'month', 'isAlways6Week');
- if (visibleWeeksCount) {
- datetimeOptions = {
- startDayOfWeek: startDayOfWeek,
- isAlways6Week: false,
- visibleWeeksCount: visibleWeeksCount,
- workweek: workweek
- };
- renderDate.addDate(offset * 7 * datetimeOptions.visibleWeeksCount);
- tempDate = datetime.arr2dCalendar(renderDate.d, datetimeOptions);
- recursiveSet(view, function(childView, opt) {
- opt.renderMonth = new TZDate(renderDate.d);
- });
- } else {
- datetimeOptions = {
- startDayOfWeek: startDayOfWeek,
- isAlways6Week: isAlways6Week,
- workweek: workweek
- };
- renderDate.addMonth(offset);
- tempDate = datetime.arr2dCalendar(renderDate.d, datetimeOptions);
- recursiveSet(view, function(childView, opt) {
- opt.renderMonth = new TZDate(renderDate.d);
- });
- }
- startDate = tempDate[0][0];
- endDate = tempDate[tempDate.length - 1][tempDate[tempDate.length - 1].length - 1];
- } else if (viewName === 'week') {
- renderDate.addDate(offset * 7);
- startDayOfWeek = util.pick(this._options, 'week', 'startDayOfWeek') || 0;
- workweek = util.pick(this._options, 'week', 'workweek') || false;
- tempDate = this._getWeekDayRange(renderDate.d, startDayOfWeek, workweek);
- startDate = tempDate[0];
- endDate = tempDate[1];
- recursiveSet(view, function(childView, opt) {
- opt.renderStartDate = new TZDate(startDate);
- opt.renderEndDate = new TZDate(endDate);
- childView.setState({
- collapsed: true
- });
- });
- } else if (viewName === 'day') {
- renderDate.addDate(offset);
- startDate = datetime.start(renderDate.d);
- endDate = datetime.end(renderDate.d);
- recursiveSet(view, function(childView, opt) {
- opt.renderStartDate = new TZDate(startDate);
- opt.renderEndDate = new TZDate(endDate);
- childView.setState({
- collapsed: true
- });
- });
- }
- this._renderDate = renderDate.d;
- this._renderRange = {
- start: startDate,
- end: endDate
- };
- };
- /**
- * Move to specific date
- * @param {(Date|string)} date - The date to move
- * @example
- * calendar.on('clickDayname', function(event) {
- * if (calendar.getViewName() === 'week') {
- * calendar.setDate(new Date(event.date));
- * calendar.changeView('day', true);
- * }
- * });
- */
- Calendar.prototype.setDate = function(date) {
- if (util.isString(date)) {
- date = datetime.parse(date);
- }
- this._renderDate = new TZDate(date);
- this._setViewName(this._viewName);
- this.move(0);
- this.render();
- };
- /**
- * Move the calendar forward a day, a week, a month, 2 weeks, 3 weeks.
- * @example
- * function moveToNextOrPrevRange(val) {
- if (val === -1) {
- calendar.prev();
- } else if (val === 1) {
- calendar.next();
- }
- }
- */
- Calendar.prototype.next = function() {
- this.move(1);
- this.render();
- };
- /**
- * Move the calendar backward a day, a week, a month, 2 weeks, 3 weeks.
- * @example
- * function moveToNextOrPrevRange(val) {
- if (val === -1) {
- calendar.prev();
- } else if (val === 1) {
- calendar.next();
- }
- }
- */
- Calendar.prototype.prev = function() {
- this.move(-1);
- this.render();
- };
- /**
- * Return current rendered view.
- * @returns {View} current view instance
- * @private
- */
- Calendar.prototype._getCurrentView = function() {
- var viewName = this._viewName;
- if (viewName === 'day') {
- viewName = 'week';
- }
- return util.pick(this._layout.children.items, viewName);
- };
- /**
- * Change calendar's schedule color with option
- * @param {string} calendarId - The calendar ID
- * @param {CalendarColor} option - The {@link CalendarColor} object
- * @param {boolean} [silent=false] - No auto render after creation when set true
- * @example
- * calendar.setCalendarColor('1', {
- * color: '#e8e8e8',
- * bgColor: '#585858',
- * borderColor: '#a1b56c'
- * dragBgColor: '#585858',
- * });
- * calendar.setCalendarColor('2', {
- * color: '#282828',
- * bgColor: '#dc9656',
- * borderColor: '#a1b56c',
- * dragBgColor: '#dc9656',
- * });
- * calendar.setCalendarColor('3', {
- * color: '#a16946',
- * bgColor: '#ab4642',
- * borderColor: '#a1b56c',
- * dragBgColor: '#ab4642',
- * });
- */
- Calendar.prototype.setCalendarColor = function(calendarId, option, silent) {
- var calColor = this._calendarColor,
- ownSchedules = this._controller.schedules,
- ownColor = calColor[calendarId];
- if (!util.isObject(option)) {
- config.throwError(
- "Calendar#changeCalendarColor(): color 는 {color: '', bgColor: ''} 형태여야 합니다."
- );
- }
- ownColor = calColor[calendarId] = util.extend(
- {
- color: '#000',
- bgColor: '#a1b56c',
- borderColor: '#a1b56c',
- dragBgColor: '#a1b56c'
- },
- option
- );
- ownSchedules.each(function(model) {
- if (model.calendarId !== calendarId) {
- return;
- }
- model.color = ownColor.color;
- model.bgColor = ownColor.bgColor;
- model.borderColor = ownColor.borderColor;
- model.dragBgColor = ownColor.dragBgColor;
- });
- if (!silent) {
- this.render();
- }
- };
- /**********
- * Custom Events
- **********/
- /**
- * A bridge-based event handler for connecting a click handler to a user click event handler for each view
- * @fires Calendar#clickSchedule
- * @param {object} clickScheduleData - The event data of 'clickSchedule' handler
- * @private
- */
- Calendar.prototype._onClick = function(clickScheduleData) {
- /**
- * Fire this event when click a schedule.
- * @event Calendar#clickSchedule
- * @type {object}
- * @property {Schedule} schedule - The {@link Schedule} instance
- * @property {MouseEvent} event - MouseEvent
- * @example
- * calendar.on('clickSchedule', function(event) {
- * var schedule = event.schedule;
- *
- * if (lastClickSchedule) {
- * calendar.updateSchedule(lastClickSchedule.id, lastClickSchedule.calendarId, {
- * isFocused: false
- * });
- * }
- * calendar.updateSchedule(schedule.id, schedule.calendarId, {
- * isFocused: true
- * });
- *
- * lastClickSchedule = schedule;
- * // open detail view
- * });
- */
- this.fire('clickSchedule', clickScheduleData);
- };
- /**
- * A bridge-based event handler for connecting a click handler to a user click event handler for each view
- * @fires Calendar#clickMore
- * @param {object} clickMoreSchedule - The event data of 'clickMore' handler
- * @private
- */
- Calendar.prototype._onClickMore = function(clickMoreSchedule) {
- /**
- * Fire this event when click a schedule.
- * @event Calendar#clickMore
- * @type {object}
- * @property {Date} date - The Clicked date
- * @property {HTMLElement} target - The more element
- * @example
- * calendar.on('clickMore', function(event) {
- * console.log('clickMore', event.date, event.target);
- * });
- */
- this.fire('clickMore', clickMoreSchedule);
- };
- /**
- * dayname click event handler
- * @fires Calendar#clickDayname
- * @param {object} clickScheduleData - The event data of 'clickDayname' handler
- * @private
- */
- Calendar.prototype._onClickDayname = function(clickScheduleData) {
- /**
- * Fire this event when click a day name in weekly.
- * @event Calendar#clickDayname
- * @type {object}
- * @property {string} date - The date string by format 'YYYY-MM-DD'
- * @example
- * calendar.on('clickDayname', function(event) {
- * if (calendar.getViewName() === 'week') {
- * calendar.setDate(new Date(event.date));
- * calendar.changeView('day', true);
- * }
- * });
- */
- this.fire('clickDayname', clickScheduleData);
- };
- /**
- * @fires {Calendar#n('beforeCreateSchedule', function}
- * @param {object} createScheduleData - select schedule data from allday, time
- * @private
- */
- Calendar.prototype._onBeforeCreate = function(createScheduleData) {
- if (this._options.useCreationPopup && !createScheduleData.useCreationPopup) {
- if (this._showCreationPopup) {
- this._showCreationPopup(createScheduleData);
- return;
- }
- }
- /**
- * Fire this event when select time period in daily, weekly, monthly.
- * @event Calendar#beforeCreateSchedule
- * @type {object}
- * @property {boolean} isAllDay - The allday schedule
- * @property {Date} start - The selected start time
- * @property {Date} end - The selected end time
- * @property {TimeCreationGuide} guide - {@link TimeCreationGuide} instance
- * @property {string} triggerEventName - The event name like 'click', 'dblclick'
- * @example
- * calendar.on('beforeCreateSchedule', function(event) {
- * var startTime = event.start;
- * var endTime = event.end;
- * var isAllDay = event.isAllDay;
- * var guide = event.guide;
- * var triggerEventName = event.triggerEventName;
- * var schedule;
- *
- * if (triggerEventName === 'click') {
- * // open writing simple schedule popup
- * schedule = {...};
- * } else if (triggerEventName === 'dblclick') {
- * // open writing detail schedule popup
- * schedule = {...};
- * }
- *
- * calendar.createSchedules([schedule]);
- * });
- */
- this.fire('beforeCreateSchedule', createScheduleData);
- };
- /**
- * @fires Calendar#beforeUpdateSchedule
- * @param {object} updateScheduleData - update {@link Schedule} data
- * @private
- */
- Calendar.prototype._onBeforeUpdate = function(updateScheduleData) {
- /**
- * Fire this event when drag a schedule to change time in daily, weekly, monthly.
- * @event Calendar#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original {@link Schedule} instance
- * @property {object} changes - The {@link Schedule} properties and values with changes to update
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @example
- * calendar.on('beforeUpdateSchedule', function(event) {
- * var schedule = event.schedule;
- * var changes = event.changes;
- *
- * calendar.updateSchedule(schedule.id, schedule.calendarId, changes);
- * });
- */
- this.fire('beforeUpdateSchedule', updateScheduleData);
- };
- /**
- * @fires Calendar#beforeDeleteSchedule
- * @param {object} deleteScheduleData - delete schedule data
- * @private
- */
- Calendar.prototype._onBeforeDelete = function(deleteScheduleData) {
- /**
- * Fire this event when delete a schedule.
- * @event Calendar#beforeDeleteSchedule
- * @type {object}
- * @property {Schedule} schedule - The {@link Schedule} instance to delete
- * @example
- * calendar.on('beforeDeleteSchedule', function(event) {
- * var schedule = event.schedule;
- * alert('The schedule is removed.', schedule);
- * });
- */
- this.fire('beforeDeleteSchedule', deleteScheduleData);
- };
- /**
- * @fires Calendar#afterRenderSchedule
- * @param {Schedule} scheduleData - The schedule data
- * @private
- */
- Calendar.prototype._onAfterRenderSchedule = function(scheduleData) {
- /**
- * Fire this event by every single schedule after rendering whole calendar.
- * @event Calendar#afterRenderSchedule
- * @type {object}
- * @property {Schedule} schedule - A rendered {@link Schedule} instance
- * @example
- * calendar.on('afterRenderSchedule', function(event) {
- * var schedule = event.schedule;
- * var element = calendar.getElement(schedule.id, schedule.calendarId);
- * // use the element
- * console.log(element);
- * });
- */
- this.fire('afterRenderSchedule', scheduleData);
- };
- /**
- * @fires Calendar#clickTimezonesCollapseBtn
- * @param {boolean} timezonesCollapsed - timezones collapsed flag
- * @private
- */
- Calendar.prototype._onClickTimezonesCollapseBtn = function(timezonesCollapsed) {
- /**
- * Fire this event by clicking timezones collapse button
- * @event Calendar#clickTimezonesCollapseBtn
- * @type {object}
- * @property {boolean} timezonesCollapsed - The timezones collapes flag
- * @example
- * calendar.on('clickTimezonesCollapseBtn', function(timezonesCollapsed) {
- * console.log(timezonesCollapsed);
- * });
- */
- this.fire('clickTimezonesCollapseBtn', timezonesCollapsed);
- };
- /**
- * Toggle calendar factory class, main view, wallview event connection
- * @param {boolean} isAttach - attach events if true.
- * @param {Week|Month} view - Weekly view or Monthly view
- * @private
- */
- Calendar.prototype._toggleViewSchedule = function(isAttach, view) {
- var self = this,
- handler = view.handler,
- method = isAttach ? 'on' : 'off';
- util.forEach(handler.click, function(clickHandler) {
- clickHandler[method]('clickSchedule', self._onClick, self);
- });
- util.forEach(handler.dayname, function(clickHandler) {
- clickHandler[method]('clickDayname', self._onClickDayname, self);
- });
- util.forEach(handler.creation, function(creationHandler) {
- creationHandler[method]('beforeCreateSchedule', self._onBeforeCreate, self);
- creationHandler[method]('beforeDeleteSchedule', self._onBeforeDelete, self);
- });
- util.forEach(handler.move, function(moveHandler) {
- moveHandler[method]('beforeUpdateSchedule', self._onBeforeUpdate, self);
- });
- util.forEach(handler.resize, function(resizeHandler) {
- resizeHandler[method]('beforeUpdateSchedule', self._onBeforeUpdate, self);
- });
- // bypass events from view
- view[method]('afterRenderSchedule', self._onAfterRenderSchedule, self);
- view[method]('clickTimezonesCollapseBtn', self._onClickTimezonesCollapseBtn, self);
- view[method]('clickMore', self._onClickMore, self);
- };
- /**
- * Change current view with view name('day', 'week', 'month')
- * @param {string} newViewName - The New view name to render
- * @param {boolean} force - Force render despite of current view and new view are equal
- * @example
- * // daily view
- * calendar.changeView('day', true);
- *
- * // weekly view
- * calendar.changeView('week', true);
- *
- * // monthly view(default 6 weeks view)
- * calendar.setOptions({month: {visibleWeeksCount: 6}}, true); // or null
- * calendar.changeView('month', true);
- *
- * // 2 weeks monthly view
- * calendar.setOptions({month: {visibleWeeksCount: 2}}, true);
- * calendar.changeView('month', true);
- *
- * // 3 weeks monthly view
- * calendar.setOptions({month: {visibleWeeksCount: 3}}, true);
- * calendar.changeView('month', true);
- *
- * // narrow weekend
- * calendar.setOptions({month: {narrowWeekend: true}}, true);
- * calendar.setOptions({week: {narrowWeekend: true}}, true);
- * calendar.changeView(calendar.getViewName(), true);
- *
- * // change start day of week(from monday)
- * calendar.setOptions({week: {startDayOfWeek: 1}}, true);
- * calendar.setOptions({month: {startDayOfWeek: 1}}, true);
- * calendar.changeView(calendar.getViewName(), true);
- *
- * // work week
- * calendar.setOptions({week: {workweek: true}}, true);
- * calendar.setOptions({month: {workweek: true}}, true);
- * calendar.changeView(calendar.getViewName(), true);
- */
- // eslint-disable-next-line complexity
- Calendar.prototype.changeView = function(newViewName, force) {
- var self = this,
- layout = this._layout,
- controller = this._controller,
- dragHandler = this._dragHandler,
- options = this._options,
- viewName = this._viewName,
- created;
- if (!force && viewName === newViewName) {
- return;
- }
- this._setViewName(newViewName);
- // convert day to week
- if (viewName === 'day') {
- viewName = 'week';
- }
- if (newViewName === 'day') {
- newViewName = 'week';
- }
- layout.children.doWhenHas(viewName, function(view) {
- self._toggleViewSchedule(false, view);
- });
- layout.clear();
- if (newViewName === 'month') {
- created = _createMonthView(controller, layout.container, dragHandler, options);
- } else if (newViewName === 'week') {
- created = _createWeekView(
- controller,
- layout.container,
- dragHandler,
- options,
- this.getViewName()
- );
- }
- layout.addChild(created.view);
- layout.children.doWhenHas(newViewName, function(view) {
- self._toggleViewSchedule(true, view);
- });
- this._refreshMethod = created.refresh;
- this._scrollToNowMethod = created.scrollToNow;
- this._openCreationPopup = created.openCreationPopup;
- this._showCreationPopup = created.showCreationPopup;
- this._hideMoreView = created.hideMoreView;
- this.move();
- this.render();
- };
- /**
- * @deprecated
- * Toggle task view('Milestone', 'Task') panel
- * @param {boolean} enabled - use task view
- * @example
- * // There is no milestone, task, so hide those view panel
- * calendar.toggleTaskView(false);
- *
- * // There are some milestone, task, so show those view panel.
- * calendar.toggleTaskView(true);
- */
- Calendar.prototype.toggleTaskView = function(enabled) {
- var viewName = this._viewName,
- options = this._options;
- options.taskView = enabled;
- this.changeView(viewName, true);
- };
- /**
- * @deprecated
- * Toggle schedule view('AllDay', TimeGrid') panel
- * @param {boolean} enabled - use task view
- * @example
- * // hide those view panel to show only 'Milestone', 'Task'
- * calendar.toggleScheduleView(false);
- *
- * // show those view panel.
- * calendar.toggleScheduleView(true);
- */
- Calendar.prototype.toggleScheduleView = function(enabled) {
- var viewName = this._viewName,
- options = this._options;
- options.scheduleView = enabled;
- this.changeView(viewName, true);
- };
- /**
- * Set current view name
- * @param {string} viewName - new view name to render
- * @private
- */
- Calendar.prototype._setViewName = function(viewName) {
- this._viewName = viewName;
- };
- /**
- * Get a schedule element by schedule id and calendar id.
- * @param {string} scheduleId - ID of schedule
- * @param {string} calendarId - calendarId of schedule
- * @returns {HTMLElement} schedule element if found or null
- * @example
- * var element = calendar.getElement(scheduleId, calendarId);
- * console.log(element);
- */
- Calendar.prototype.getElement = function(scheduleId, calendarId) {
- var schedule = this.getSchedule(scheduleId, calendarId);
- if (schedule) {
- return document.querySelector(
- '[data-schedule-id="' + scheduleId + '"][data-calendar-id="' + calendarId + '"]'
- );
- }
- return null;
- };
- /**
- * Set a theme. If some keys are not defined in the preset, will be return.
- * @param {object} theme - multiple styles map
- * @returns {Array.<string>} keys - error keys not predefined.
- * @example
- * cal.setTheme({
- 'month.dayname.height': '31px',
- 'common.dayname.color': '#333',
- 'month.dayname.borderBottom': '1px solid #e5e5e5' // Not valid key will be return.
- * });
- */
- Calendar.prototype.setTheme = function(theme) {
- var result = this._controller.setTheme(theme);
- this.render(true);
- return result;
- };
- /**
- * Set options of calendar
- * @param {Options} options - set {@link Options}
- * @param {boolean} [silent=false] - no auto render after creation when set true
- */
- Calendar.prototype.setOptions = function(options, silent) {
- util.forEach(
- options,
- function(value, name) {
- if (util.isObject(value) && !util.isArray(value)) {
- util.forEach(
- value,
- function(innerValue, innerName) {
- this._options[name][innerName] = innerValue;
- },
- this
- );
- } else {
- this._options[name] = value;
- }
- },
- this
- );
- this._setAdditionalInternalOptions(options);
- if (!silent) {
- this.changeView(this._viewName, true);
- }
- };
- /**
- * Get current {@link Options}.
- * @returns {Options} options
- */
- Calendar.prototype.getOptions = function() {
- return this._options;
- };
- /**
- * Current rendered date ({@link TZDate} for further information)
- * @returns {TZDate}
- */
- Calendar.prototype.getDate = function() {
- return this._renderDate;
- };
- /**
- * Start time of rendered date range ({@link TZDate} for further information)
- * @returns {TZDate}
- */
- Calendar.prototype.getDateRangeStart = function() {
- return this._renderRange.start;
- };
- /**
- * End time of rendered date range ({@link TZDate} for further information)
- * @returns {TZDate}
- */
- Calendar.prototype.getDateRangeEnd = function() {
- return this._renderRange.end;
- };
- /**
- * Get current view name('day', 'week', 'month')
- * @returns {string} view name
- */
- Calendar.prototype.getViewName = function() {
- return this._viewName;
- };
- /**
- * Set calendar list
- * @param {Array.<CalendarProps>} calendars - {@link CalendarProps} List
- */
- Calendar.prototype.setCalendars = function(calendars) {
- util.forEach(
- calendars || [],
- function(calendar) {
- this.setCalendarColor(calendar.id, calendar, true);
- },
- this
- );
- this._controller.setCalendars(calendars);
- this.render();
- };
- /**
- * Open schedule creation popup
- * @param {Schedule} schedule - The preset {@link Schedule} data
- */
- Calendar.prototype.openCreationPopup = function(schedule) {
- if (this._openCreationPopup) {
- this._openCreationPopup(schedule);
- }
- };
- /**
- * Hide the more view
- */
- Calendar.prototype.hideMoreView = function() {
- if (this._hideMoreView) {
- this._hideMoreView();
- }
- };
- /**
- * Set timezone offset
- * @param {number} offset - The offset (min)
- * @static
- * @deprecated
- * @example
- * var timezoneName = moment.tz.guess();
- * tui.Calendar.setTimezoneOffset(moment.tz.zone(timezoneName).utcOffset(moment()));
- */
- Calendar.setTimezoneOffset = function(offset) {
- tz.setOffset(offset);
- };
- /**
- * Set a callback function to get timezone offset by timestamp
- * @param {function} callback - The callback function
- * @static
- * @deprecated
- * @example
- * var timezoneName = moment.tz.guess();
- * tui.Calendar.setTimezoneOffsetCallback(function(timestamp) {
- * return moment.tz.zone(timezoneName).utcOffset(timestamp));
- * });
- */
- Calendar.setTimezoneOffsetCallback = function(callback) {
- tz.setOffsetCallback(callback);
- };
- /**
- * Create controller instance
- * @returns {Base} controller instance
- * @param {Options} options - calendar options
- * @private
- */
- function _createController(options) {
- return controllerFactory(options);
- }
- /**
- * Create week view instance by dependent module instances
- * @param {Base} controller - controller
- * @param {HTMLElement} container - container element
- * @param {Drag} dragHandler - global drag handler
- * @param {object} options - options for week view
- * @param {string} viewName - 'week', 'day'
- * @returns {Week} week view instance
- * @private
- */
- function _createWeekView(controller, container, dragHandler, options, viewName) {
- return weekViewFactory(controller, container, dragHandler, options, viewName);
- }
- /**
- * Create week view instance by dependent module instances
- * @param {Base} controller - controller
- * @param {HTMLElement} container - container element
- * @param {Drag} dragHandler - global drag handler
- * @param {object} options - options for week view
- * @returns {Month} month view instance
- * @private
- */
- function _createMonthView(controller, container, dragHandler, options) {
- return monthViewFactory(controller, container, dragHandler, options);
- }
- /**
- * Set child view's options recursively
- * @param {View} view - parent view
- * @param {function} func - option manipulate function
- * @private
- */
- function _setOptionRecurseively(view, func) {
- view.recursive(function(childView) {
- var opt = childView.options;
- if (!opt) {
- return;
- }
- func(childView, opt);
- });
- }
- util.CustomEvents.mixin(Calendar);
- module.exports = Calendar;
- /***/ }),
- /***/ "./src/js/factory/controller.js":
- /*!**************************************!*\
- !*** ./src/js/factory/controller.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Controller factory module.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Base = __webpack_require__(/*! ../controller/base */ "./src/js/controller/base.js"),
- Core = __webpack_require__(/*! ../controller/viewMixin/core */ "./src/js/controller/viewMixin/core.js"),
- Week = __webpack_require__(/*! ../controller/viewMixin/week */ "./src/js/controller/viewMixin/week.js"),
- Month = __webpack_require__(/*! ../controller/viewMixin/month */ "./src/js/controller/viewMixin/month.js");
- /**
- * Mixin object. create object property to target and mix to that
- * @param {object} from - source object
- * @param {object} to - target object
- * @param {string} propertyName - property name
- */
- function mixin(from, to, propertyName) {
- var obj = to[propertyName] = {};
- util.forEach(from, function(method, methodName) {
- obj[methodName] = method.bind(to);
- });
- }
- /**
- * @param {object} options - options for base controller
- * @param {function} [options.groupFunc] - function for group each models {@see Collection#groupBy}
- * @returns {Base} The controller instance.
- */
- module.exports = function(options) {
- var controller = new Base(options);
- mixin(Core, controller, 'Core');
- mixin(Week, controller, 'Week');
- mixin(Month, controller, 'Month');
- // for Theme
- controller.Core.theme = controller.theme;
- controller.Week.theme = controller.theme;
- controller.Month.theme = controller.theme;
- return controller;
- };
- /***/ }),
- /***/ "./src/js/factory/monthView.js":
- /*!*************************************!*\
- !*** ./src/js/factory/monthView.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Month view factory module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
- array = __webpack_require__(/*! ../common/array */ "./src/js/common/array.js"),
- datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js"),
- domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
- common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js"),
- Month = __webpack_require__(/*! ../view/month/month */ "./src/js/view/month/month.js"),
- MonthClick = __webpack_require__(/*! ../handler/month/click */ "./src/js/handler/month/click.js"),
- MonthCreation = __webpack_require__(/*! ../handler/month/creation */ "./src/js/handler/month/creation.js"),
- MonthResize = __webpack_require__(/*! ../handler/month/resize */ "./src/js/handler/month/resize.js"),
- MonthMove = __webpack_require__(/*! ../handler/month/move */ "./src/js/handler/month/move.js"),
- More = __webpack_require__(/*! ../view/month/more */ "./src/js/view/month/more.js"),
- ScheduleCreationPopup = __webpack_require__(/*! ../view/popup/scheduleCreationPopup */ "./src/js/view/popup/scheduleCreationPopup.js"),
- ScheduleDetailPopup = __webpack_require__(/*! ../view/popup/scheduleDetailPopup */ "./src/js/view/popup/scheduleDetailPopup.js"),
- Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
- /**
- * Get the view model for more layer
- * @param {TZDate} date - date has more schedules
- * @param {HTMLElement} target - target element
- * @param {Collection} schedules - schedule collection
- * @param {string[]} daynames - daynames to use upside of month more view
- * @returns {object} view model
- */
- function getViewModelForMoreLayer(date, target, schedules, daynames) {
- schedules.each(function(schedule) {
- var model = schedule.model;
- schedule.hasMultiDates = datetime.hasMultiDates(model.start, model.end);
- });
- return {
- target: target,
- date: datetime.format(date, 'YYYY.MM.DD'),
- dayname: daynames[date.getDay()],
- schedules: schedules.sort(array.compare.schedule.asc)
- };
- }
- /**
- * @param {Base} baseController - controller instance
- * @param {HTMLElement} layoutContainer - container element for month view
- * @param {Drag} dragHandler - drag handler instance
- * @param {object} options - options
- * @returns {object} view instance and refresh method
- */
- function createMonthView(baseController, layoutContainer, dragHandler, options) {
- var monthViewContainer, monthView, moreView, createView;
- var clickHandler, creationHandler, resizeHandler, moveHandler, clearSchedulesHandler, onUpdateSchedule;
- var onShowCreationPopup, onSaveNewSchedule, onShowEditPopup;
- var detailView, onShowDetailPopup, onDeleteSchedule, onEditSchedule;
- monthViewContainer = domutil.appendHTMLElement(
- 'div', layoutContainer, config.classname('month'));
- monthView = new Month(options, monthViewContainer, baseController.Month);
- moreView = new More(options.month, layoutContainer, baseController.theme);
- // handlers
- clickHandler = new MonthClick(dragHandler, monthView, baseController);
- if (!options.isReadOnly) {
- creationHandler = new MonthCreation(dragHandler, monthView, baseController, options);
- resizeHandler = new MonthResize(dragHandler, monthView, baseController);
- moveHandler = new MonthMove(dragHandler, monthView, baseController);
- }
- clearSchedulesHandler = function() {
- if (moreView) {
- moreView.hide();
- }
- };
- onUpdateSchedule = function() {
- if (moreView) {
- moreView.refresh();
- }
- };
- // binding +n click schedule
- clickHandler.on('clickMore', function(clickMoreSchedule) {
- var date = clickMoreSchedule.date,
- target = clickMoreSchedule.target,
- schedules = util.pick(baseController.findByDateRange(
- datetime.start(date),
- datetime.end(date)
- ), clickMoreSchedule.ymd);
- schedules.items = util.filter(schedules.items, function(item) {
- return options.month.scheduleFilter(item.model);
- });
- if (schedules && schedules.length) {
- moreView.render(getViewModelForMoreLayer(date, target, schedules, monthView.options.daynames));
- schedules.each(function(scheduleViewModel) {
- if (scheduleViewModel) {
- /**
- * @event More#afterRenderSchedule
- */
- monthView.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
- }
- });
- monthView.fire('clickMore', {
- date: clickMoreSchedule.date,
- target: moreView.getMoreViewElement()
- });
- }
- });
- // binding popup for schedules creation
- if (options.useCreationPopup) {
- createView = new ScheduleCreationPopup(layoutContainer, baseController.calendars, options.usageStatistics);
- onSaveNewSchedule = function(scheduleData) {
- creationHandler.fire('beforeCreateSchedule', util.extend(scheduleData, {
- useCreationPopup: true
- }));
- };
- createView.on('beforeCreateSchedule', onSaveNewSchedule);
- }
- // binding popup for schedule detail
- if (options.useDetailPopup) {
- detailView = new ScheduleDetailPopup(layoutContainer, baseController.calendars);
- onShowDetailPopup = function(eventData) {
- var scheduleId = eventData.schedule.calendarId;
- eventData.calendar = common.find(baseController.calendars, function(calendar) {
- return calendar.id === scheduleId;
- });
- if (options.isReadOnly) {
- eventData.schedule = util.extend({}, eventData.schedule, {isReadOnly: true});
- }
- detailView.render(eventData);
- };
- onDeleteSchedule = function(eventData) {
- if (creationHandler) {
- creationHandler.fire('beforeDeleteSchedule', eventData);
- }
- };
- onEditSchedule = function(eventData) {
- moveHandler.fire('beforeUpdateSchedule', eventData);
- };
- clickHandler.on('clickSchedule', onShowDetailPopup);
- detailView.on('beforeDeleteSchedule', onDeleteSchedule);
- if (options.useCreationPopup) {
- onShowEditPopup = function(eventData) {
- createView.setCalendars(baseController.calendars);
- createView.render(eventData);
- };
- createView.on('beforeUpdateSchedule', onEditSchedule);
- detailView.on('beforeUpdateSchedule', onShowEditPopup);
- } else {
- detailView.on('beforeUpdateSchedule', onEditSchedule);
- }
- }
- // binding clear schedules
- baseController.on('clearSchedules', clearSchedulesHandler);
- // bind update schedule event
- baseController.on('updateSchedule', onUpdateSchedule);
- if (moveHandler) {
- moveHandler.on('monthMoveStart_from_morelayer', function() {
- moreView.hide();
- });
- }
- monthView.handler = {
- click: {
- 'default': clickHandler
- }
- };
- if (!options.isReadOnly) {
- monthView.handler = util.extend(monthView.handler, {
- creation: {
- 'default': creationHandler
- },
- resize: {
- 'default': resizeHandler
- },
- move: {
- 'default': moveHandler
- }
- });
- }
- monthView._beforeDestroy = function() {
- moreView.destroy();
- baseController.off('clearSchedules', clearSchedulesHandler);
- baseController.off('updateSchedule', onUpdateSchedule);
- util.forEach(monthView.handler, function(type) {
- util.forEach(type, function(handler) {
- handler.off();
- handler.destroy();
- });
- });
- if (options.useCreationPopup && options.useDetailPopup) {
- createView.off('beforeUpdateSchedule', onUpdateSchedule);
- }
- if (options.useCreationPopup) {
- if (creationHandler) {
- creationHandler.off('beforeCreateSchedule', onShowCreationPopup);
- }
- createView.off('saveSchedule', onSaveNewSchedule);
- createView.destroy();
- }
- if (options.useDetailPopup) {
- clickHandler.off('clickSchedule', onShowDetailPopup);
- detailView.off('beforeUpdateSchedule', onUpdateSchedule);
- detailView.off('beforeDeleteSchedule', onDeleteSchedule);
- detailView.destroy();
- }
- };
- // add controller
- monthView.controller = baseController.Month;
- return {
- view: monthView,
- refresh: function() {
- monthView.vLayout.refresh();
- },
- openCreationPopup: function(schedule) {
- if (createView && creationHandler) {
- creationHandler.invokeCreationClick(Schedule.create(schedule));
- }
- },
- showCreationPopup: function(eventData) {
- if (createView) {
- createView.setCalendars(baseController.calendars);
- createView.render(eventData);
- }
- },
- hideMoreView: function() {
- if (moreView) {
- moreView.hide();
- }
- }
- };
- }
- module.exports = createMonthView;
- /***/ }),
- /***/ "./src/js/factory/weekView.js":
- /*!************************************!*\
- !*** ./src/js/factory/weekView.js ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Factory module for WeekView
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
- var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
- var VLayout = __webpack_require__(/*! ../common/vlayout */ "./src/js/common/vlayout.js");
- var reqAnimFrame = __webpack_require__(/*! ../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
- // Parent views
- var Week = __webpack_require__(/*! ../view/week/week */ "./src/js/view/week/week.js");
- // Sub views
- var DayName = __webpack_require__(/*! ../view/week/dayname */ "./src/js/view/week/dayname.js");
- var DayGrid = __webpack_require__(/*! ../view/week/dayGrid */ "./src/js/view/week/dayGrid.js");
- var TimeGrid = __webpack_require__(/*! ../view/week/timeGrid */ "./src/js/view/week/timeGrid.js");
- var ScheduleCreationPopup = __webpack_require__(/*! ../view/popup/scheduleCreationPopup */ "./src/js/view/popup/scheduleCreationPopup.js");
- var ScheduleDetailPopup = __webpack_require__(/*! ../view/popup/scheduleDetailPopup */ "./src/js/view/popup/scheduleDetailPopup.js");
- // Handlers
- var DayNameClick = __webpack_require__(/*! ../handler/time/clickDayname */ "./src/js/handler/time/clickDayname.js");
- var DayGridClick = __webpack_require__(/*! ../handler/daygrid/click */ "./src/js/handler/daygrid/click.js");
- var DayGridCreation = __webpack_require__(/*! ../handler/daygrid/creation */ "./src/js/handler/daygrid/creation.js");
- var DayGridMove = __webpack_require__(/*! ../handler/daygrid/move */ "./src/js/handler/daygrid/move.js");
- var DayGridResize = __webpack_require__(/*! ../handler/daygrid/resize */ "./src/js/handler/daygrid/resize.js");
- var TimeClick = __webpack_require__(/*! ../handler/time/click */ "./src/js/handler/time/click.js");
- var TimeCreation = __webpack_require__(/*! ../handler/time/creation */ "./src/js/handler/time/creation.js");
- var TimeMove = __webpack_require__(/*! ../handler/time/move */ "./src/js/handler/time/move.js");
- var TimeResize = __webpack_require__(/*! ../handler/time/resize */ "./src/js/handler/time/resize.js");
- var DAYGRID_HANDLDERS = {
- 'click': DayGridClick,
- 'creation': DayGridCreation,
- 'move': DayGridMove,
- 'resize': DayGridResize
- };
- var TIMEGRID_HANDLERS = {
- 'click': TimeClick,
- 'creation': TimeCreation,
- 'move': TimeMove,
- 'resize': TimeResize
- };
- var DEFAULT_PANELS = [
- {
- name: 'milestone',
- type: 'daygrid',
- minHeight: 20,
- maxHeight: 80,
- showExpandableButton: true,
- maxExpandableHeight: 210,
- handlers: ['click'],
- show: true
- },
- {
- name: 'task',
- type: 'daygrid',
- minHeight: 40,
- maxHeight: 120,
- showExpandableButton: true,
- maxExpandableHeight: 210,
- handlers: ['click', 'move'],
- show: true
- },
- {
- name: 'allday',
- type: 'daygrid',
- minHeight: 30,
- maxHeight: 80,
- showExpandableButton: true,
- maxExpandableHeight: 210,
- handlers: ['click', 'creation', 'move', 'resize'],
- show: true
- },
- {
- name: 'time',
- type: 'timegrid',
- autoHeight: true,
- handlers: ['click', 'creation', 'move', 'resize'],
- show: true
- }
- ];
- /* eslint-disable complexity*/
- module.exports = function(baseController, layoutContainer, dragHandler, options, viewName) {
- var panels = [],
- vpanels = [];
- var weekView, dayNameContainer, dayNameView, vLayoutContainer, vLayout;
- var createView, onSaveNewSchedule, onSetCalendars, lastVPanel;
- var detailView, onShowDetailPopup, onDeleteSchedule, onShowEditPopup, onEditSchedule;
- var taskView = options.taskView;
- var scheduleView = options.scheduleView;
- var viewVisibilities = {
- 'milestone': util.isArray(taskView) ? util.inArray('milestone', taskView) >= 0 : taskView,
- 'task': util.isArray(taskView) ? util.inArray('task', taskView) >= 0 : taskView,
- 'allday': util.isArray(scheduleView) ? util.inArray('allday', scheduleView) >= 0 : scheduleView,
- 'time': util.isArray(scheduleView) ? util.inArray('time', scheduleView) >= 0 : scheduleView
- };
- // Make panels by view sequence and visibilities
- util.forEach(DEFAULT_PANELS, function(panel) {
- var name = panel.name;
- panel = util.extend({}, panel);
- panels.push(panel);
- // Change visibilities
- panel.show = viewVisibilities[name];
- if (panel.show) {
- if (vpanels.length) {
- vpanels.push({
- isSplitter: true
- });
- }
- vpanels.push(util.extend({}, panel));
- }
- });
- if (vpanels.length) {
- lastVPanel = vpanels[vpanels.length - 1];
- lastVPanel.autoHeight = true;
- lastVPanel.maxHeight = null;
- lastVPanel.showExpandableButton = false;
- util.forEach(panels, function(panel) {
- if (panel.name === lastVPanel.name) {
- panel.showExpandableButton = false;
- return false;
- }
- return true;
- });
- }
- util.extend(options.week, {panels: panels});
- weekView = new Week(null, options.week, layoutContainer, panels, viewName);
- weekView.handler = {
- click: {},
- dayname: {},
- creation: {},
- move: {},
- resize: {}
- };
- dayNameContainer = domutil.appendHTMLElement('div', weekView.container, config.classname('dayname-layout'));
- /**********
- * Day name (top row(Mon, Tue, Wed...))
- **********/
- dayNameView = new DayName(options, dayNameContainer, baseController.theme);
- weekView.handler.dayname.date = new DayNameClick(dragHandler, dayNameView, baseController);
- weekView.addChild(dayNameView);
- /**********
- * Initialize vertical layout module
- **********/
- vLayoutContainer = domutil.appendHTMLElement('div', weekView.container, config.classname('vlayout-area'));
- vLayoutContainer.style.height = (domutil.getSize(weekView.container)[1] - dayNameView.container.offsetHeight) + 'px';
- vLayout = new VLayout({
- panels: vpanels,
- panelHeights: options.week.panelHeights || []
- }, vLayoutContainer, baseController.theme);
- weekView.vLayout = vLayout;
- util.forEach(panels, function(panel) {
- var name = panel.name;
- var handlers = panel.handlers;
- var view;
- if (!panel.show) {
- return;
- }
- if (panel.type === 'daygrid') {
- /**********
- * Schedule panel by Grid
- **********/
- view = new DayGrid(name, options, vLayout.getPanelByName(panel.name).container, baseController.theme);
- view.on('afterRender', function(viewModel) {
- vLayout.getPanelByName(name).setHeight(null, viewModel.height);
- });
- weekView.addChild(view);
- util.forEach(handlers, function(type) {
- if (!options.isReadOnly || type === 'click') {
- weekView.handler[type][name] =
- new DAYGRID_HANDLDERS[type](dragHandler, view, baseController, options);
- view.addHandler(type, weekView.handler[type][name], vLayout.getPanelByName(name));
- }
- });
- } else if (panel.type === 'timegrid') {
- /**********
- * Schedule panel by TimeGrid
- **********/
- view = new TimeGrid(name, options, vLayout.getPanelByName(name).container);
- weekView.addChild(view);
- util.forEach(handlers, function(type) {
- if (!options.isReadOnly || type === 'click') {
- weekView.handler[type][name] =
- new TIMEGRID_HANDLERS[type](dragHandler, view, baseController, options);
- }
- });
- view.on('clickTimezonesCollapsedBtn', function() {
- var timezonesCollapsed = !weekView.state.timezonesCollapsed;
- weekView.setState({
- timezonesCollapsed: timezonesCollapsed
- });
- reqAnimFrame.requestAnimFrame(function() {
- if (!weekView.invoke('clickTimezonesCollapseBtn', timezonesCollapsed)) {
- weekView.render();
- }
- });
- });
- }
- });
- vLayout.on('resize', function() {
- reqAnimFrame.requestAnimFrame(function() {
- weekView.render();
- });
- });
- // binding create schedules event
- if (options.useCreationPopup) {
- createView = new ScheduleCreationPopup(layoutContainer, baseController.calendars, options.usageStatistics);
- onSaveNewSchedule = function(scheduleData) {
- util.extend(scheduleData, {
- useCreationPopup: true
- });
- if (scheduleData.isAllDay) {
- weekView.handler.creation.allday.fire('beforeCreateSchedule', scheduleData);
- } else {
- weekView.handler.creation.time.fire('beforeCreateSchedule', scheduleData);
- }
- };
- createView.on('beforeCreateSchedule', onSaveNewSchedule);
- }
- onSetCalendars = function(calendars) {
- if (createView) {
- createView.setCalendars(calendars);
- }
- };
- baseController.on('setCalendars', onSetCalendars);
- // binding popup for schedule detail
- if (options.useDetailPopup) {
- detailView = new ScheduleDetailPopup(layoutContainer, baseController.calendars);
- onShowDetailPopup = function(eventData) {
- var scheduleId = eventData.schedule.calendarId;
- eventData.calendar = common.find(baseController.calendars, function(calendar) {
- return calendar.id === scheduleId;
- });
- if (options.isReadOnly) {
- eventData.schedule = util.extend({}, eventData.schedule, {isReadOnly: true});
- }
- detailView.render(eventData);
- };
- onDeleteSchedule = function(eventData) {
- if (eventData.isAllDay) {
- weekView.handler.creation.allday.fire('beforeDeleteSchedule', eventData);
- } else {
- weekView.handler.creation.time.fire('beforeDeleteSchedule', eventData);
- }
- };
- onEditSchedule = function(eventData) {
- if (eventData.isAllDay) {
- weekView.handler.move.allday.fire('beforeUpdateSchedule', eventData);
- } else {
- weekView.handler.move.time.fire('beforeUpdateSchedule', eventData);
- }
- };
- util.forEach(weekView.handler.click, function(panel) {
- panel.on('clickSchedule', onShowDetailPopup);
- });
- if (options.useCreationPopup) {
- onShowEditPopup = function(eventData) {
- var calendars = baseController.calendars;
- eventData.isEditMode = true;
- createView.setCalendars(calendars);
- createView.render(eventData);
- };
- createView.on('beforeUpdateSchedule', onEditSchedule);
- detailView.on('beforeUpdateSchedule', onShowEditPopup);
- } else {
- detailView.on('beforeUpdateSchedule', onEditSchedule);
- }
- detailView.on('beforeDeleteSchedule', onDeleteSchedule);
- }
- weekView.on('afterRender', function() {
- vLayout.refresh();
- });
- // add controller
- weekView.controller = baseController.Week;
- // add destroy
- weekView._beforeDestroy = function() {
- util.forEach(weekView.handler, function(type) {
- util.forEach(type, function(handler) {
- handler.off();
- handler.destroy();
- });
- });
- if (options.useCreationPopup) {
- createView.off('beforeCreateSchedule', onSaveNewSchedule);
- createView.destroy();
- }
- if (options.useDetailPopup) {
- detailView.off('beforeDeleteSchedule', onDeleteSchedule);
- detailView.destroy();
- }
- weekView.off();
- };
- return {
- view: weekView,
- refresh: function() {
- var weekViewHeight = weekView.getViewBound().height,
- daynameViewHeight = domutil.getBCRect(
- dayNameView.container
- ).height;
- vLayout.container.style.height =
- weekViewHeight - daynameViewHeight + 'px';
- vLayout.refresh();
- },
- scrollToNow: function() {
- weekView.children.each(function(childView) {
- if (childView.scrollToNow) {
- childView.scrollToNow();
- }
- });
- },
- openCreationPopup: function(schedule) {
- if (createView) {
- if (schedule.isAllDay) {
- weekView.handler.creation.allday.invokeCreationClick(Schedule.create(schedule));
- } else {
- weekView.handler.creation.time.invokeCreationClick(Schedule.create(schedule));
- }
- }
- },
- showCreationPopup: function(eventData) {
- if (createView) {
- createView.setCalendars(baseController.calendars);
- createView.render(eventData);
- }
- }
- };
- };
- /***/ }),
- /***/ "./src/js/handler/daygrid/click.js":
- /*!*****************************************!*\
- !*** ./src/js/handler/daygrid/click.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Click handle module for daygrid schedules
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var DayGridMove = __webpack_require__(/*! ./move */ "./src/js/handler/daygrid/move.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {DayGrid} [view] - daygrid view instance.
- * @param {Base} [controller] - Base controller instance.
- */
- function DayGridClick(dragHandler, view, controller) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {DayGrid}
- */
- this.view = view;
- /**
- * @type {Base}
- */
- this.controller = controller;
- dragHandler.on({
- 'click': this._onClick
- }, this);
- }
- /**
- * Destroy handler module
- */
- DayGridClick.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.view = this.controller = this.dragHandler = null;
- };
- /**
- * Check target element is expected condition for activate this plugins.
- * @param {HTMLElement} target - The element to check
- * @returns {string} - model id
- */
- DayGridClick.prototype.checkExpectCondition = DayGridMove.prototype.checkExpectedCondition;
- /**
- * Click event handler
- * @param {object} clickEvent - click event data
- * @emits DayGridClick#clickSchedule
- * @emits DayGridClick#collapse
- * @emits DayGridClick#expand
- */
- DayGridClick.prototype._onClick = function(clickEvent) {
- var self = this,
- target = clickEvent.target,
- dayGridScheduleView = this.checkExpectCondition(target),
- scheduleCollection = this.controller.schedules,
- collapseBtnElement = domutil.closest(
- target,
- config.classname('.weekday-collapse-btn')
- ),
- expandBtnElement = domutil.closest(
- target,
- config.classname('.weekday-exceed-in-week')
- ),
- containsTarget = this.view.container.contains(target);
- var blockElement, scheduleElement;
- if (!containsTarget) {
- return;
- }
- if (collapseBtnElement) {
- /**
- * click collpase btn event
- * @events DayGridClick#collapse
- */
- self.fire('collapse');
- return;
- }
- if (expandBtnElement) {
- this.view.setState({
- clickedExpandBtnIndex: parseInt(domutil.getData(expandBtnElement, 'index'), 10)
- });
- /**
- * click expand btn event
- * @events DayGridClick#expand
- */
- self.fire('expand');
- return;
- }
- if (!dayGridScheduleView) {
- return;
- }
- scheduleElement = domutil.closest(target, config.classname('.weekday-schedule'));
- if (scheduleElement) {
- blockElement = domutil.closest(target, config.classname('.weekday-schedule-block'));
- scheduleCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
- /**
- * @events DayGridClick#clickSchedule
- * @type {object}
- * @property {Schedule} schedule - schedule instance
- * @property {MouseEvent} event - MouseEvent object
- */
- self.fire('clickSchedule', {
- schedule: schedule,
- event: clickEvent.originEvent
- });
- });
- }
- };
- util.CustomEvents.mixin(DayGridClick);
- module.exports = DayGridClick;
- /***/ }),
- /***/ "./src/js/handler/daygrid/core.js":
- /*!****************************************!*\
- !*** ./src/js/handler/daygrid/core.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint no-shadow: 0 */
- /**
- * @fileoverview Base mixin object for handler/daygrid
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var mmax = Math.max,
- mmin = Math.min;
- /**
- * @mixin dayGridCore
- */
- var dayGridCore = {
- /**
- * @param {view} view - view instance.
- * @param {MouseEvent} mouseEvent - mouse schedule object.
- * @returns {function|boolean} function that return schedule data by mouse events.
- */
- _retriveScheduleData: function(view, mouseEvent) {
- var weekdayView = view.children.single(),
- container,
- datesInRange,
- containerWidth,
- mousePos,
- dragStartXIndex,
- grids,
- range;
- if (!weekdayView) {
- return false;
- }
- container = weekdayView.container;
- range = weekdayView.getRenderDateRange();
- datesInRange = range.length;
- grids = weekdayView.getRenderDateGrids();
- containerWidth = domutil.getSize(container)[0];
- mousePos = domevent.getMousePosition(mouseEvent, container);
- dragStartXIndex = getX(grids, common.ratio(containerWidth, 100, mousePos[0]));
- /**
- * @param {MouseEvent} mouseEvent - mouse schedule in drag actions.
- * @returns {object} schedule data.
- */
- return function(mouseEvent) {
- var pos = domevent.getMousePosition(mouseEvent, container),
- mouseX = pos[0],
- xIndex = getX(grids, common.ratio(containerWidth, 100, mouseX));
- // apply limitation of creation schedule X index.
- xIndex = mmax(xIndex, 0);
- xIndex = mmin(xIndex, datesInRange - 1);
- return {
- relatedView: view,
- dragStartXIndex: dragStartXIndex,
- datesInRange: datesInRange,
- xIndex: xIndex,
- triggerEvent: mouseEvent.type,
- grids: grids,
- range: range
- };
- };
- },
- /**
- * @param {view} view - view instance.
- * @param {TZDate} startDate - start date
- * @returns {object} schedule data by mouse events.
- */
- _retriveScheduleDataFromDate: function(view, startDate) {
- var weekdayView = view.children.single(),
- xIndex = 0,
- datesInRange,
- dragStartXIndex = 0,
- grids,
- range;
- if (!weekdayView) {
- return false;
- }
- range = weekdayView.getRenderDateRange();
- datesInRange = range.length;
- grids = weekdayView.getRenderDateGrids();
- util.forEach(range, function(date, index) {
- if (datetime.isSameDate(date, startDate)) {
- xIndex = dragStartXIndex = index;
- }
- });
- // apply limitation of creation schedule X index.
- xIndex = mmax(xIndex, 0);
- xIndex = mmin(xIndex, datesInRange - 1);
- return {
- relatedView: view,
- dragStartXIndex: dragStartXIndex,
- datesInRange: datesInRange,
- xIndex: xIndex,
- triggerEvent: 'manual',
- grids: grids,
- range: range
- };
- }
- };
- /**
- * Get the left index
- * @param {Array} grids - grid size information
- * @param {number} left - left position(percent)
- * @returns {number} grid left index
- */
- function getX(grids, left) {
- var i = 0;
- var length = grids.length;
- var grid;
- if (left < 0) {
- left = 0;
- }
- for (; i < length; i += 1) {
- grid = grids[i];
- if (grid.left <= left && left <= (grid.left + grid.width)) {
- return i;
- }
- }
- return i;
- }
- module.exports = dayGridCore;
- /***/ }),
- /***/ "./src/js/handler/daygrid/creation.js":
- /*!********************************************!*\
- !*** ./src/js/handler/daygrid/creation.js ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Handler module for WeekdayInWeek view's creation actions.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
- var DayGridCreationGuide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/daygrid/creationGuide.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var CLICK_DELAY = 300;
- /**
- * @constructor
- * @implements {Handler}
- * @mixes dayGridCore
- * @mixes CutomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {DayGrid} [view] - DayGrid view instance.
- * @param {Base} [controller] - Base controller instance.
- * @param {Options} [options] - calendar Options
- */
- function DayGridCreation(dragHandler, view, controller, options) {
- /**
- * Drag handler instance.
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * view instance.
- * @type {DayGrid}
- */
- this.view = view;
- /**
- * Base controller instance.
- * @type {Base}
- */
- this.controller = controller;
- /**
- * @type {function}
- */
- this.getScheduleDataFunc = null;
- /**
- * @type {DayGridCreationGuide}
- */
- this.guide = new DayGridCreationGuide(this);
- /**
- * @type {boolean}
- */
- this._requestOnClick = false;
- /**
- * @type {boolean}
- */
- this._disableDblClick = options.disableDblClick;
- /**
- * @type {boolean}
- */
- this._disableClick = options.disableClick;
- dragHandler.on('dragStart', this._onDragStart, this);
- dragHandler.on('click', this._onClick, this);
- if (this._disableDblClick) {
- CLICK_DELAY = 0;
- } else {
- domevent.on(view.container, 'dblclick', this._onDblClick, this);
- }
- }
- /**
- * Destroy method
- */
- DayGridCreation.prototype.destroy = function() {
- this.guide.destroy();
- this.dragHandler.off(this);
- if (this.view && this.view.container) {
- domevent.off(this.view.container, 'dblclick', this._onDblClick, this);
- }
- this.dragHandler = this.view = this.controller = this.getScheduleDataFunc = null;
- };
- /**
- * Check dragstart target is expected conditions for this handler.
- * @param {HTMLElement} target - dragstart event handler's target element.
- * @returns {boolean|WeekdayInWeek} return WeekdayInWeek view instance when satiate condition.
- */
- DayGridCreation.prototype.checkExpectedCondition = function(target) {
- var cssClass = domutil.getClass(target).trim();
- var excludeTarget = true;
- var matches, schedulesElement;
- if (domutil.closest(target, config.classname('.weekday-exceed-in-week'))
- || domutil.closest(target, config.classname('.weekday-collapse-btn'))
- ) {
- return false;
- }
- if (domutil.closest(target, config.classname('.weekday-schedule-block'), excludeTarget)) {
- return false;
- }
- schedulesElement = domutil.closest(target, config.classname('.weekday-schedules'));
- if (!schedulesElement && cssClass !== config.classname('weekday-schedules')) {
- return false;
- }
- target = schedulesElement ? schedulesElement.parentNode : target.parentNode;
- cssClass = domutil.getClass(target);
- matches = cssClass.match(config.daygrid.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.view.children.items, matches[1]);
- };
- /**
- * Request schedule model creation to controller by custom schedules.
- * @fires {DayGridCreation#beforeCreateSchedule}
- * @param {object} scheduleData - schedule data from DayGridCreation module.
- */
- DayGridCreation.prototype._createSchedule = function(scheduleData) {
- var dateRange = scheduleData.range,
- startXIndex = scheduleData.dragStartXIndex,
- xIndex = scheduleData.xIndex,
- start, end;
- // when inverse start, end then change it.
- if (xIndex < startXIndex) {
- startXIndex = xIndex + startXIndex;
- xIndex = startXIndex - xIndex;
- startXIndex = startXIndex - xIndex;
- }
- start = new TZDate(dateRange[startXIndex]);
- end = datetime.end(dateRange[xIndex]);
- /**
- * @event {DayGridCreation#beforeCreateSchedule}
- * @type {object}
- * @property {string} category - schedule category
- * @property {boolean} isAllDay - whether schedule is fired in view area?
- * @property {Date} start - select start time
- * @property {Date} end - select end time
- * @property {DayGridCreationGuide} guide - DayGridCreationGuide instance
- * @property {string} triggerEventName - event name
- */
- this.fire('beforeCreateSchedule', {
- category: this.view.options.viewName,
- isAllDay: true,
- start: start,
- end: end,
- guide: this.guide,
- triggerEventName: scheduleData.triggerEvent
- });
- };
- /**
- * DragStart event handler method.
- * @emits DayGridCreation#dragstart
- * @param {object} dragStartEventData - Drag#dragStart event handler schedule data.
- */
- DayGridCreation.prototype._onDragStart = function(dragStartEventData) {
- var target = dragStartEventData.target,
- result = this.checkExpectedCondition(target),
- getScheduleDataFunc,
- scheduleData;
- if (!result) {
- return;
- }
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
- this.getScheduleDataFunc = getScheduleDataFunc;
- scheduleData = getScheduleDataFunc(dragStartEventData.originEvent);
- /**
- * @event DayGridCreation#dragstart
- * @type {object}
- * @property {DayGridView} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire('dragstart', scheduleData);
- };
- /**
- * Drag event handler method.
- * @emits DayGridCreation#drag
- * @param {object} dragEventData - Drag#drag event handler scheduledata.
- */
- DayGridCreation.prototype._onDrag = function(dragEventData) {
- var getScheduleDataFunc = this.getScheduleDataFunc,
- scheduleData;
- if (!getScheduleDataFunc) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEventData.originEvent);
- /**
- * @event DayGridCreation#drag
- * @type {object}
- * @property {DayGridView} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire('drag', scheduleData);
- };
- /**
- * DragEnd event hander method.
- * @emits DayGridCreation#dragend
- * @param {object} dragEndEventData - Drag#dragEnd event handler data.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- */
- DayGridCreation.prototype._onDragEnd = function(dragEndEventData, overrideEventName) {
- var getScheduleDataFunc = this.getScheduleDataFunc;
- var scheduleData;
- if (!getScheduleDataFunc) {
- return;
- }
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
- this._createSchedule(scheduleData);
- /**
- * @event DayGridCreation#dragend
- * @type {object}
- * @property {DayGridView} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire(overrideEventName || 'dragend', scheduleData);
- this.getScheduleDataFunc = null;
- };
- /**
- * Click event handler method.
- * @emits DayGridCreation#click
- * @param {object} clickEventData - Drag#click event handler data.
- */
- DayGridCreation.prototype._onClick = function(clickEventData) {
- var self = this;
- var getScheduleDataFunc, scheduleData;
- if (!this.checkExpectedCondition(clickEventData.target) || this._disableClick) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(this.view, clickEventData.originEvent);
- scheduleData = getScheduleDataFunc(clickEventData.originEvent);
- this._requestOnClick = true;
- setTimeout(function() {
- if (self._requestOnClick) {
- self.fire('click', scheduleData);
- self._createSchedule(scheduleData);
- }
- self._requestOnClick = false;
- }, CLICK_DELAY);
- };
- /**
- * Dblclick event handler method.
- * @emits DayGridCreation#click
- * @param {object} clickEventData - Drag#Click event handler data.
- */
- DayGridCreation.prototype._onDblClick = function(clickEventData) {
- var getScheduleDataFunc, scheduleData;
- if (!this.checkExpectedCondition(clickEventData.target)) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(this.view, clickEventData);
- scheduleData = getScheduleDataFunc(clickEventData);
- this.fire('click', scheduleData);
- this._createSchedule(scheduleData);
- this._requestOnClick = false;
- };
- /**
- * Invoke creation click
- * @param {Schedule} schedule - schedule instance
- */
- DayGridCreation.prototype.invokeCreationClick = function(schedule) {
- var scheduleData = this._retriveScheduleDataFromDate(this.view, schedule.start);
- this.fire('click', scheduleData);
- this._createSchedule(scheduleData);
- };
- common.mixin(dayGridCore, DayGridCreation);
- util.CustomEvents.mixin(DayGridCreation);
- module.exports = DayGridCreation;
- /***/ }),
- /***/ "./src/js/handler/daygrid/creationGuide.js":
- /*!*************************************************!*\
- !*** ./src/js/handler/daygrid/creationGuide.js ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Guide element for DayGrid.Creation
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- /**
- * Class for DayGrid.Creation dragging effect.
- * @constructor
- * @param {DayGridCreation} creation - instance of DayGridCreation.
- */
- function DayGridCreationGuide(creation) {
- /**
- * @type {DayGridCreation}
- */
- this.creation = creation;
- /**
- * @type {HTMLDIVElement}
- */
- this.scheduleContainer = null;
- /**
- * @type {HTMLDIVElement}
- */
- this.guideElement = document.createElement('div');
- this.initializeGuideElement();
- this.applyTheme(creation.controller.theme);
- creation.on({
- dragstart: this._createGuideElement,
- drag: this._onDrag,
- click: this._createGuideElement
- }, this);
- }
- /**
- * Destroy method
- */
- DayGridCreationGuide.prototype.destroy = function() {
- this.clearGuideElement();
- this.creation.off(this);
- this.creation = this.scheduleContainer = this.guideElement = null;
- };
- /**
- * initialize guide element's default style.
- */
- DayGridCreationGuide.prototype.initializeGuideElement = function() {
- domutil.addClass(this.guideElement, config.classname('daygrid-guide-creation-block'));
- };
- /**
- * Drag event handler
- * @param {object} scheduleData - schedule data from DayGrid.Creation handler.
- */
- DayGridCreationGuide.prototype._onDrag = function(scheduleData) {
- this._refreshGuideElement(scheduleData, true);
- };
- /**
- * Get element width based on narrowWeekend
- * @param {number} dragStartIndex - grid start index
- * @param {number} dragEndIndex - grid end index
- * @param {Array} grids - dates information
- * @returns {number} element width
- */
- DayGridCreationGuide.prototype._getGuideWidth = function(dragStartIndex, dragEndIndex, grids) {
- var width = 0;
- var i = dragStartIndex;
- for (; i <= dragEndIndex; i += 1) {
- width += grids[i] ? grids[i].width : 0;
- }
- return width;
- };
- /**
- * Refresh guide element.
- * @param {object} scheduleData - schedule data from DayGrid.Creation handler.
- * @param {boolean} defer - If set to true, set style in the next frame
- */
- DayGridCreationGuide.prototype._refreshGuideElement = function(scheduleData, defer) {
- var guideElement = this.guideElement,
- data = scheduleData,
- dragStartXIndex = data.dragStartXIndex < data.xIndex ? data.dragStartXIndex : data.xIndex,
- dragEndXIndex = data.dragStartXIndex < data.xIndex ? data.xIndex : data.dragStartXIndex,
- leftPercent,
- widthPercent;
- leftPercent = data.grids[dragStartXIndex] ? data.grids[dragStartXIndex].left : 0;
- widthPercent = this._getGuideWidth(dragStartXIndex, dragEndXIndex, data.grids);
- /** eslint-disable require-jsdoc */
- function setStyle() {
- guideElement.style.display = 'block';
- guideElement.style.left = leftPercent + '%';
- guideElement.style.width = widthPercent + '%';
- }
- if (defer) {
- reqAnimFrame.requestAnimFrame(setStyle);
- } else {
- setStyle();
- }
- };
- /**
- * Clear guide element.
- */
- DayGridCreationGuide.prototype.clearGuideElement = function() {
- var guideElement = this.guideElement;
- domutil.remove(guideElement);
- guideElement.style.display = 'none';
- guideElement.style.left = '';
- guideElement.style.width = '';
- };
- /**
- * Create guide element
- * @param {object} dragStartEventData - schedule data object of DayGrid.Creation.
- */
- DayGridCreationGuide.prototype._createGuideElement = function(dragStartEventData) {
- var creation = this.creation,
- view = creation.view,
- container = view.container,
- scheduleContainer = domutil.find(config.classname('.weekday-grid'), container);
- scheduleContainer.appendChild(this.guideElement);
- this._refreshGuideElement(dragStartEventData);
- };
- /**
- * Drag event handler.
- * @param {object} dragEventData - event data object of DayGrid.Creation.
- */
- DayGridCreationGuide.prototype._onDrag = function(dragEventData) {
- this._refreshGuideElement(dragEventData);
- };
- DayGridCreationGuide.prototype.applyTheme = function(theme) {
- var style = this.guideElement.style;
- style.backgroundColor = theme.common.creationGuide.backgroundColor;
- style.border = theme.common.creationGuide.border;
- };
- module.exports = DayGridCreationGuide;
- /***/ }),
- /***/ "./src/js/handler/daygrid/move.js":
- /*!****************************************!*\
- !*** ./src/js/handler/daygrid/move.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Move handler for DayGrid view.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
- var DayGridMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/daygrid/moveGuide.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- /**
- * @constructor
- * @implements {Handler}
- * @mixes dayGridCore
- * @mixes CustomEvents
- * @param {Drag} dragHandler - Drag handler instance.
- * @param {DayGrid} view - view instance.
- * @param {Base} controller - Base controller instance.
- */
- function DayGridMove(dragHandler, view, controller) {
- /**
- * Drag handler instance.
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * view instance.
- * @type {DayGrid}
- */
- this.view = view;
- /**
- * Base controller instance.
- * @type {Base}
- */
- this.controller = controller;
- /**
- * Temporary variable for dragstart event data.
- * @type {object}
- */
- this._dragStart = null;
- dragHandler.on({
- dragStart: this._onDragStart
- }, this);
- /**
- * @type {DayGridMoveGuide}
- */
- this.guide = new DayGridMoveGuide(this);
- }
- DayGridMove.prototype.destroy = function() {
- this.guide.destroy();
- this.dragHandler.off(this);
- this.dragHandler = this.view = this.controller =
- this.guide = this._dragStart = null;
- };
- /**
- * Check dragstart target is expected conditions for this handler.
- * @param {HTMLElement} target - dragstart event handler's target element.
- * @returns {boolean|DayGridSchedule} return DayGridSchedule view instance when satiate condition.
- */
- DayGridMove.prototype.checkExpectedCondition = function(target) {
- var cssClass = domutil.getClass(target),
- parentView,
- matches;
- if (~cssClass.indexOf(config.classname('weekday-resize-handle'))) {
- return false;
- }
- parentView = domutil.closest(target, config.classname('.weekday'));
- if (!parentView) {
- return false;
- }
- cssClass = domutil.getClass(parentView);
- matches = cssClass.match(config.daygrid.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.view.children.items, matches[1]);
- };
- /**
- * DragStart event handler method.
- * @emits DayGridMove#dragstart
- * @param {object} dragStartEventData - Drag#dragStart event handler event data.
- */
- DayGridMove.prototype._onDragStart = function(dragStartEventData) {
- var target = dragStartEventData.target,
- result = this.checkExpectedCondition(target),
- controller = this.controller,
- excludeTarget = true,
- scheduleBlockElement,
- modelID,
- targetModel,
- getScheduleDataFunc,
- scheduleData;
- if (!result) {
- return;
- }
- scheduleBlockElement = domutil.closest(target, config.classname('.weekday-schedule-block'), excludeTarget);
- if (!scheduleBlockElement) {
- return;
- }
- modelID = domutil.getData(scheduleBlockElement, 'id');
- targetModel = controller.schedules.items[modelID];
- if (!targetModel) {
- return;
- }
- if (targetModel.isReadOnly) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
- this.getScheduleDataFunc = getScheduleDataFunc;
- scheduleData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
- util.extend(scheduleData, {
- scheduleBlockElement: scheduleBlockElement,
- model: targetModel
- });
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- /**
- * @event DayGridMove#dragstart
- * @type {object}
- * @property {DayGrid} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- * @property {Schedule} model - data object of model isntance.
- * @property {HTMLDivElement} scheduleBlockElement - target schedule block element.
- */
- this.fire('dragstart', scheduleData);
- };
- /**
- * Drag event handler method.
- * @emits DayGridMove#drag
- * @param {object} dragEventData - Drag#drag event handler eventdata.
- */
- DayGridMove.prototype._onDrag = function(dragEventData) {
- var getScheduleDataFunc = this.getScheduleDataFunc;
- if (!getScheduleDataFunc) {
- return;
- }
- /**
- * @schedule DayGridMove#drag
- * @type {object}
- * @property {DayGrid} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire('drag', getScheduleDataFunc(dragEventData.originEvent));
- };
- /**
- * Request update schedule model to base controller.
- * @fires DayGridMove#beforeUpdateSchedule
- * @param {object} scheduleData - schedule data from DayGridMove handler module.
- */
- DayGridMove.prototype._updateSchedule = function(scheduleData) {
- var schedule = scheduleData.targetModel,
- dateOffset = scheduleData.xIndex - scheduleData.dragStartXIndex,
- newStarts = new TZDate(schedule.start),
- newEnds = new TZDate(schedule.end);
- newStarts = newStarts.addDate(dateOffset);
- newEnds = newEnds.addDate(dateOffset);
- /**
- * @event DayGridMove#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - start and end time to update
- * @property {Date} start - start time to update
- * @property {Date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: {
- start: newStarts,
- end: newEnds
- },
- start: newStarts,
- end: newEnds
- });
- };
- /**
- * DragEnd event hander method.
- * @emits DayGridMove#dragend
- * @param {object} dragEndEventData - Drag#DragEnd event handler data.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- * @param {?boolean} skipUpdate - true then skip update schedule model.
- */
- DayGridMove.prototype._onDragEnd = function(dragEndEventData, overrideEventName, skipUpdate) {
- var getScheduleDataFunc = this.getScheduleDataFunc,
- dragStart = this._dragStart,
- scheduleData;
- if (!getScheduleDataFunc || !dragStart) {
- return;
- }
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
- util.extend(scheduleData, {
- targetModel: dragStart.model
- });
- if (!skipUpdate) {
- this._updateSchedule(scheduleData);
- }
- /**
- * @event DayGridMove#dragend
- * @type {object}
- * @property {DayGrid} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire(overrideEventName || 'dragend', scheduleData);
- this.getScheduleDataFunc = this._dragStart = null;
- };
- /**
- * Click event handler method.
- * @emits DayGridMove#click
- * @param {object} clickEventData - Drag#Click event handler data.
- */
- DayGridMove.prototype._onClick = function(clickEventData) {
- /**
- * @event DayGridMove#click
- * @type {object}
- * @property {DayGrid} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this._onDragEnd(clickEventData, 'click', true);
- };
- common.mixin(dayGridCore, DayGridMove);
- util.CustomEvents.mixin(DayGridMove);
- module.exports = DayGridMove;
- /***/ }),
- /***/ "./src/js/handler/daygrid/moveGuide.js":
- /*!*********************************************!*\
- !*** ./src/js/handler/daygrid/moveGuide.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Effect module for DayGrid.Move
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- /**
- * Class for DayGrid.Move dragging effect.
- * @constructor
- * @param {DayGridMove} daygridMove - instance of DayGridMove.
- */
- function DayGridMoveGuide(daygridMove) {
- /**
- * @type {DayGridMove}
- */
- this.daygridMove = daygridMove;
- /**
- * The element that actually contains the event element
- * @type {HTMLDIVElement}
- */
- this.scheduleContainer = null;
- /**
- * @type {number}
- */
- this._dragStartXIndex = null;
- /**
- * @type {HTMLDIVElement}
- */
- this.guideElement = null;
- /**
- * @type {HTMLElement[]}
- */
- this.elements = null;
- daygridMove.on({
- 'dragstart': this._onDragStart,
- 'drag': this._onDrag,
- 'dragend': this._clearGuideElement,
- 'click': this._clearGuideElement
- }, this);
- }
- /**
- * Destroy method
- */
- DayGridMoveGuide.prototype.destroy = function() {
- this._clearGuideElement();
- this.daygridMove.off(this);
- this.daygridMove = this.scheduleContainer = this._dragStartXIndex =
- this.elements = this.guideElement = null;
- };
- /**
- * Clear guide element.
- */
- DayGridMoveGuide.prototype._clearGuideElement = function() {
- this._showOriginScheduleBlocks();
- domutil.remove(this.guideElement);
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('dragging'));
- }
- this._dragStartXIndex = this.getScheduleDataFunc = this.guideElement = null;
- };
- /**
- * Dim element blocks
- * @param {number} modelID - Schedule model instance ID
- */
- DayGridMoveGuide.prototype._hideOriginScheduleBlocks = function(modelID) {
- var className = config.classname('weekday-schedule-block-dragging-dim');
- var scheduleBlocks = domutil.find(
- config.classname('.weekday-schedule-block'),
- this.daygridMove.view.container,
- true
- );
- this.elements = util.filter(scheduleBlocks, function(schedule) {
- return domutil.getData(schedule, 'id') === modelID;
- });
- util.forEach(this.elements, function(el) {
- domutil.addClass(el, className);
- });
- };
- /**
- * Show element blocks
- */
- DayGridMoveGuide.prototype._showOriginScheduleBlocks = function() {
- var className = config.classname('weekday-schedule-block-dragging-dim');
- util.forEach(this.elements, function(el) {
- domutil.removeClass(el, className);
- });
- };
- /**
- * Highlight element blocks
- * @param {Schedule} model - model
- * @param {HTMLElement} parent - parent element
- */
- DayGridMoveGuide.prototype._highlightScheduleBlocks = function(model, parent) {
- var elements = domutil.find(config.classname('.weekday-schedule'), parent, true);
- util.forEach(elements, function(el) {
- el.style.margin = '0';
- if (!model.isFocused) {
- el.style.backgroundColor = model.dragBgColor;
- el.style.borderLeftColor = model.borderColor;
- el.style.color = '#ffffff';
- }
- });
- };
- /**
- * Refresh guide element.
- * @param {number} leftPercent - left percent of guide element.
- * @param {number} widthPercent - width percent of guide element.
- * @param {boolean} isExceededLeft - schedule start is faster then render start date?
- * @param {boolean} isExceededRight - schedule end is later then render end date?
- */
- DayGridMoveGuide.prototype.refreshGuideElement = function(leftPercent, widthPercent, isExceededLeft, isExceededRight) {
- var guideElement = this.guideElement;
- reqAnimFrame.requestAnimFrame(function() {
- guideElement.style.left = leftPercent + '%';
- guideElement.style.width = widthPercent + '%';
- if (isExceededLeft) {
- domutil.addClass(guideElement, config.classname('weekday-exceed-left'));
- } else {
- domutil.removeClass(guideElement, config.classname('weekday-exceed-left'));
- }
- if (isExceededRight) {
- domutil.addClass(guideElement, config.classname('weekday-exceed-right'));
- } else {
- domutil.removeClass(guideElement, config.classname('weekday-exceed-right'));
- }
- });
- };
- /**
- * Get schedule block information from schedule data.
- *
- * For example, there is single schedule has 10 length. but render range in view is 5 then
- * rendered block must be cut out to render properly. in this case, this method return
- * how many block are cut before rendering.
- *
- * @param {object} dragStartEventData - schedule data from DayGrid.Move handler.
- * @returns {function} function that return schedule block information.
- */
- DayGridMoveGuide.prototype._getScheduleBlockDataFunc = function(dragStartEventData) {
- var model = dragStartEventData.model,
- datesInRange = dragStartEventData.datesInRange,
- range = dragStartEventData.range,
- baseWidthPercent = (100 / datesInRange),
- originScheduleStarts = datetime.start(model.start),
- originScheduleEnds = datetime.end(model.end),
- renderStartDate = datetime.start(range[0]),
- renderEndDate = datetime.end(range[range.length - 1]),
- fromLeft = Math.ceil((originScheduleStarts.getTime() -
- renderStartDate.getTime()) / datetime.MILLISECONDS_PER_DAY) || 0,
- fromRight = Math.ceil((originScheduleEnds.getTime() -
- renderEndDate.getTime()) / datetime.MILLISECONDS_PER_DAY) || 0;
- return function(indexOffset) {
- return {
- baseWidthPercent: baseWidthPercent,
- fromLeft: fromLeft + indexOffset,
- fromRight: fromRight + indexOffset
- };
- };
- };
- /**
- * DragStart event handler.
- * @param {object} dragStartEventData - schedule data.
- */
- DayGridMoveGuide.prototype._onDragStart = function(dragStartEventData) {
- var container = this.daygridMove.view.container,
- guideElement = this.guideElement = dragStartEventData.scheduleBlockElement.cloneNode(true),
- scheduleContainer;
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('dragging'));
- }
- this._hideOriginScheduleBlocks(String(dragStartEventData.model.cid()));
- scheduleContainer = domutil.find(config.classname('.weekday-schedules'), container);
- domutil.appendHTMLElement('div', guideElement, config.classname('weekday-schedule-cover'));
- scheduleContainer.appendChild(guideElement);
- this._dragStartXIndex = dragStartEventData.xIndex;
- this.getScheduleDataFunc = this._getScheduleBlockDataFunc(dragStartEventData);
- this._highlightScheduleBlocks(dragStartEventData.model, guideElement);
- };
- /**
- * Drag event handler.
- * @param {object} dragEventData - schedule data.
- */
- DayGridMoveGuide.prototype._onDrag = function(dragEventData) {
- var getScheduleDataFunc = this.getScheduleDataFunc,
- dragStartXIndex = this._dragStartXIndex,
- datesInRange = dragEventData.datesInRange,
- grids = dragEventData.grids,
- scheduleData,
- isExceededLeft,
- isExceededRight,
- originLength,
- leftIndex,
- size,
- newLeft,
- newWidth;
- if (!getScheduleDataFunc) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEventData.xIndex - dragStartXIndex);
- isExceededLeft = scheduleData.fromLeft < 0;
- isExceededRight = scheduleData.fromRight > 0;
- leftIndex = Math.max(0, scheduleData.fromLeft);
- originLength = (scheduleData.fromLeft * -1) + (datesInRange + scheduleData.fromRight);
- size = isExceededLeft ? (originLength + scheduleData.fromLeft) : originLength;
- size = isExceededRight ? (size - scheduleData.fromRight) : size;
- newLeft = grids[leftIndex] ? grids[leftIndex].left : 0;
- newWidth = getScheduleBlockWidth(leftIndex, size, grids);
- this.refreshGuideElement(newLeft, newWidth, isExceededLeft, isExceededRight);
- };
- /**
- * Get schedule width based on grids
- * @param {number} left - left index
- * @param {number} size - schedule width
- * @param {Array} grids - dates information
- * @returns {number} element width
- */
- function getScheduleBlockWidth(left, size, grids) {
- var width = 0;
- var i = 0;
- var length = grids.length;
- for (; i < size; i += 1) {
- left = (left + i) % length;
- if (left < length) {
- width += grids[left] ? grids[left].width : 0;
- }
- }
- return width;
- }
- module.exports = DayGridMoveGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/daygrid/resize.js":
- /*!******************************************!*\
- !*** ./src/js/handler/daygrid/resize.js ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Resize handler module for DayGrid view.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
- var DayGridResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/daygrid/resizeGuide.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- /**
- * @constructor
- * @implements {Handler}
- * @mixes dayGridCore
- * @mixes CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {DayGrid} [view] - view instance.
- * @param {Base} [controller] - Base controller instance.
- */
- function DayGridResize(dragHandler, view, controller) {
- /**
- * Drag handler instance.
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * view instance.
- * @type {DayGrid}
- */
- this.view = view;
- /**
- * Base controller instance.
- * @type {Base}
- */
- this.controller = controller;
- /**
- * Temporary variable for dragStart event data.
- * @type {object}
- */
- this._dragStart = null;
- dragHandler.on({
- dragStart: this._onDragStart
- }, this);
- /**
- * @type {DayGridResizeGuide}
- */
- this.guide = new DayGridResizeGuide(this);
- }
- /**
- * Destroy method
- */
- DayGridResize.prototype.destroy = function() {
- this.guide.destroy();
- this.dragHandler.off(this);
- this.dragHandler = this.view = this.controller =
- this.guide = this._dragStart = null;
- };
- /**
- * Check dragstart target is expected conditions for this handler.
- * @param {HTMLElement} target - dragstart event handler's target element.
- * @returns {boolean|WeekdayInWeek} return WeekdayInWeek view instance when satiate condition.
- */
- DayGridResize.prototype.checkExpectedCondition = function(target) {
- var cssClass = domutil.getClass(target),
- matches;
- if (!~cssClass.indexOf(config.classname('weekday-resize-handle'))) {
- return false;
- }
- target = domutil.closest(target, config.classname('.weekday'));
- if (!target) {
- return false;
- }
- cssClass = domutil.getClass(target);
- matches = cssClass.match(config.daygrid.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.view.children.items, matches[1]);
- };
- /**
- * DragStart event handler.
- * @emits DayGridResize#dragstart
- * @param {object} dragStartEventData - schedule data.
- */
- DayGridResize.prototype._onDragStart = function(dragStartEventData) {
- var target = dragStartEventData.target,
- result = this.checkExpectedCondition(target),
- controller = this.controller,
- scheduleBlockElement,
- modelID,
- targetModel,
- getScheduleDataFunc,
- scheduleData;
- if (!result) {
- return;
- }
- scheduleBlockElement = domutil.closest(target, config.classname('.weekday-schedule-block'));
- modelID = domutil.getData(scheduleBlockElement, 'id');
- targetModel = controller.schedules.items[modelID];
- if (!targetModel) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
- this.getScheduleDataFunc = getScheduleDataFunc;
- scheduleData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
- util.extend(scheduleData, {
- scheduleBlockElement: scheduleBlockElement,
- model: targetModel
- });
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- /**
- * @event DayGridResize#dragstart
- * @type {object}
- * @property {View} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- * @property {Schedule} model - data object of model isntance.
- * @property {HTMLDivElement} scheduleBlockElement - target schedule block element.
- */
- this.fire('dragstart', scheduleData);
- };
- /**
- * Drag event handler method.
- * @emits DayGridResize#drag
- * @param {object} dragEventData - Drag#drag event handler scheduledata.
- */
- DayGridResize.prototype._onDrag = function(dragEventData) {
- var getScheduleDataFunc = this.getScheduleDataFunc;
- if (!getScheduleDataFunc) {
- return;
- }
- /**
- * @event DayGridResize#drag
- * @type {object}
- * @property {View} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire('drag', getScheduleDataFunc(dragEventData.originEvent));
- };
- /**
- * Request update schedule instance to base controller.
- * @fires DayGridResize#beforeUpdateSchedule
- * @param {object} scheduleData - schedule data from DayGridResize handler.
- */
- DayGridResize.prototype._updateSchedule = function(scheduleData) {
- var schedule = scheduleData.targetModel,
- dateOffset = scheduleData.xIndex - scheduleData.dragStartXIndex,
- newEnds = new TZDate(schedule.end);
- var changes;
- newEnds = newEnds.addDate(dateOffset);
- newEnds = new TZDate(common.maxDate(datetime.end(schedule.start), newEnds));
- changes = common.getScheduleChanges(
- schedule,
- ['end'],
- {end: newEnds}
- );
- /**
- * @event DayGridResize#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - end time to update
- * @property {date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: changes,
- start: schedule.getStarts(),
- end: newEnds
- });
- };
- /**
- * DragEnd event hander method.
- * @emits DayGridResize#dragend
- * @param {object} dragEndEventData - Drag#DragEnd event handler data.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- * @param {?boolean} skipUpdate - true then skip update schedule model.
- */
- DayGridResize.prototype._onDragEnd = function(dragEndEventData, overrideEventName, skipUpdate) {
- var getScheduleDataFunc = this.getScheduleDataFunc,
- dragStart = this._dragStart,
- scheduleData;
- if (!getScheduleDataFunc || !dragStart) {
- return;
- }
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
- util.extend(scheduleData, {
- targetModel: dragStart.model
- });
- if (!skipUpdate) {
- this._updateSchedule(scheduleData);
- }
- /**
- * @event DayGridResize#dragend
- * @type {object}
- * @property {View} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this.fire(overrideEventName || 'dragend', scheduleData);
- this.getScheduleDataFunc = this._dragStart = null;
- };
- /**
- * Click event handler method.
- * @emits DayGridResize#click
- * @param {object} clickEventData - Drag#Click event handler data.
- */
- DayGridResize.prototype._onClick = function(clickEventData) {
- /**
- * @event DayGridResize#click
- * @type {object}
- * @property {View} relatedView - view instance.
- * @property {number} datesInRange - date count of this view.
- * @property {number} dragStartXIndex - index number of dragstart grid index.
- * @property {number} xIndex - index number of mouse positions.
- */
- this._onDragEnd(clickEventData, 'click', true);
- };
- common.mixin(dayGridCore, DayGridResize);
- util.CustomEvents.mixin(DayGridResize);
- module.exports = DayGridResize;
- /***/ }),
- /***/ "./src/js/handler/daygrid/resizeGuide.js":
- /*!***********************************************!*\
- !*** ./src/js/handler/daygrid/resizeGuide.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Resize Guide module.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- /**
- * @constructor
- * @param {DayGridResize} resizeHandler - instance of DayGridResize
- */
- function DayGridResizeGuide(resizeHandler) {
- /**
- * @type {DayGridResize}
- */
- this.resizeHandler = resizeHandler;
- /**
- * The element that actually contains the event element
- * @type {HTMLDIVElement}
- */
- this.scheduleContainer = null;
- /**
- * @type {function}
- */
- this.getScheduleDataFunc = null;
- /**
- * @type {HTMLDIVElement}
- */
- this.guideElement = null;
- /**
- * @type {HTMLDIVElement}
- */
- this.scheduleBlockElement = null;
- resizeHandler.on({
- 'dragstart': this._onDragStart,
- 'drag': this._onDrag,
- 'dragend': this._clearGuideElement,
- 'click': this._clearGuideElement
- }, this);
- }
- /**
- * Destroy method
- */
- DayGridResizeGuide.prototype.destroy = function() {
- this._clearGuideElement();
- this.resizeHandler.off(this);
- this.resizeHandler = this.scheduleContainer = this.getScheduleDataFunc =
- this.guideElement = this.scheduleBlockElement = null;
- };
- /**
- * Clear guide element.
- */
- DayGridResizeGuide.prototype._clearGuideElement = function() {
- domutil.remove(this.guideElement);
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('resizing-x'));
- }
- if (this.scheduleBlockElement) {
- domutil.removeClass(this.scheduleBlockElement, config.classname('weekday-schedule-block-dragging-dim'));
- }
- this.getScheduleDataFunc = null;
- };
- /**
- * Refresh guide element
- * @param {number} newWidth - new width percentage value to resize guide element.
- */
- DayGridResizeGuide.prototype.refreshGuideElement = function(newWidth) {
- var guideElement = this.guideElement;
- reqAnimFrame.requestAnimFrame(function() {
- guideElement.style.width = newWidth + '%';
- });
- };
- /**
- * Return function that calculate guide element's new width percentage value.
- * @param {object} dragStartEventData - dragstart schedule data.
- * @returns {function} return function that calculate guide element new width percentage.
- */
- DayGridResizeGuide.prototype.getGuideElementWidthFunc = function(dragStartEventData) {
- var model = dragStartEventData.model,
- viewOptions = this.resizeHandler.view.options,
- fromLeft = Math.ceil(
- (model.start - viewOptions.renderStartDate) / datetime.MILLISECONDS_PER_DAY
- ) || 0,
- grids = dragStartEventData.grids;
- return function(xIndex) {
- var width = 0;
- var i = 0;
- var length = grids.length;
- width += grids[fromLeft] ? grids[fromLeft].width : 0;
- for (; i < length; i += 1) {
- if (i > fromLeft && i <= xIndex) {
- width += grids[i] ? grids[i].width : 0;
- }
- }
- return width;
- };
- };
- /**
- * DragStart event handler.
- * @param {object} dragStartEventData - schedule data.
- */
- DayGridResizeGuide.prototype._onDragStart = function(dragStartEventData) {
- var container = this.resizeHandler.view.container,
- scheduleBlockElement = this.scheduleBlockElement = dragStartEventData.scheduleBlockElement,
- guideElement = this.guideElement = scheduleBlockElement.cloneNode(true),
- scheduleContainer;
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('resizing-x'));
- }
- scheduleContainer = domutil.find(config.classname('.weekday-schedules'), container);
- domutil.addClass(guideElement, config.classname('daygrid-guide-move'));
- domutil.addClass(scheduleBlockElement, config.classname('weekday-schedule-block-dragging-dim'));
- scheduleContainer.appendChild(guideElement);
- this.getScheduleDataFunc = this.getGuideElementWidthFunc(dragStartEventData);
- };
- /**
- * Drag event handler.
- * @param {object} dragEventData - schedule data.
- */
- DayGridResizeGuide.prototype._onDrag = function(dragEventData) {
- var func = this.getScheduleDataFunc;
- if (!func) {
- return;
- }
- this.refreshGuideElement(func(dragEventData.xIndex));
- };
- module.exports = DayGridResizeGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/drag.js":
- /*!********************************!*\
- !*** ./src/js/handler/drag.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Drag handler for calendar.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../common/domevent */ "./src/js/common/domevent.js");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
- /**
- * @constructor
- * @mixes CustomEvents
- * @param {object} options - options for drag handler
- * @param {number} [options.distance=10] - distance in pixels after mouse must move before dragging should start
- * @param {function} [options.exclude] - filter function for don't fire drag events that specific conditions.
- * @param {HTMLElement} container element to watching drag interaction.
- */
- function Drag(options, container) {
- domevent.on(container, 'mousedown', this._onMouseDown, this);
- this.options = util.extend({
- distance: 10,
- exclude: null
- }, options);
- /**
- * @type {HTMLElement}
- */
- this.container = container;
- /**
- * Flag for represent current dragging session has been cancelled for exclude option.
- * @type {boolean}
- */
- this._cancelled = false;
- /**
- * @type {boolean}
- */
- this._isMoved = false;
- /**
- * dragging distance in pixel between mousedown and firing dragStart events
- * @type {number}
- */
- this._distance = 0;
- /**
- * @type {boolean}
- */
- this._dragStartFired = false;
- /**
- * @type {object}
- */
- this._dragStartEventData = null;
- }
- /**
- * Destroy method.
- */
- Drag.prototype.destroy = function() {
- domevent.off(this.container, 'mousedown', this._onMouseDown, this);
- this._isMoved = null;
- this.container = null;
- };
- /**
- * Clear cache data for single dragging session.
- */
- Drag.prototype._clearData = function() {
- this._cancelled = false;
- this._distance = 0;
- this._isMoved = false;
- this._dragStartFired = false;
- this._dragStartEventData = null;
- };
- /**
- * Toggle events for mouse dragging.
- * @param {boolean} toBind - bind events related with dragging when supplied "true"
- */
- Drag.prototype._toggleDragEvent = function(toBind) {
- var container = this.container,
- domMethod,
- method;
- if (toBind) {
- domMethod = 'on';
- method = 'disable';
- } else {
- domMethod = 'off';
- method = 'enable';
- }
- domutil[method + 'TextSelection'](container, preventDefaultWhenNotPopup);
- domutil[method + 'ImageDrag'](container, preventDefaultWhenNotPopup);
- domevent[domMethod](global.document, {
- mousemove: this._onMouseMove,
- mouseup: this._onMouseUp
- }, this);
- };
- /**
- * Normalize mouse event object.
- * @param {MouseEvent} mouseEvent - mouse event object.
- * @returns {object} normalized mouse event data.
- */
- Drag.prototype._getEventData = function(mouseEvent) {
- return {
- target: domevent.getEventTarget(mouseEvent),
- originEvent: mouseEvent
- };
- };
- /**
- * MouseDown DOM event handler.
- * @param {MouseEvent} mouseDownEvent MouseDown event object.
- */
- Drag.prototype._onMouseDown = function(mouseDownEvent) {
- var opt = this.options,
- target = domevent.getEventTarget(mouseDownEvent);
- // only primary button can start drag.
- if (domevent.getMouseButton(mouseDownEvent) !== 0) {
- return;
- }
- if (opt.exclude && opt.exclude(target)) {
- this._cancelled = true;
- return;
- }
- this._clearData();
- this._dragStartEventData = this._getEventData(mouseDownEvent);
- this._toggleDragEvent(true);
- /**
- * mousedown event for firefox bug. cancelable.
- * @event Drag#mouseDown
- * @type {object}
- * @property {HTMLElement} target - target element in this event.
- * @property {MouseEvent} originEvent - original mouse event object.
- */
- this.fire('mousedown', this._dragStartEventData);
- };
- /**
- * MouseMove DOM event handler.
- * @emits Drag#drag
- * @emits Drag#dragStart
- * @param {MouseEvent} mouseMoveEvent MouseMove event object.
- */
- Drag.prototype._onMouseMove = function(mouseMoveEvent) {
- var distance;
- if (this._cancelled) {
- this._clearData();
- return;
- }
- distance = this.options.distance;
- // prevent automatic scrolling.
- preventDefaultWhenNotPopup(mouseMoveEvent);
- if (this._distance < distance) {
- this._distance += 1;
- return;
- }
- this._isMoved = true;
- if (!this._dragStartFired) {
- this._dragStartFired = true;
- /**
- * Drag start events. cancelable.
- * @event Drag#dragStart
- * @type {object}
- * @property {HTMLElement} target - target element in this event.
- * @property {MouseEvent} originEvent - original mouse event object.
- */
- if (!this.invoke('dragStart', this._dragStartEventData)) {
- this._toggleDragEvent(false);
- this._clearData();
- return;
- }
- }
- /**
- * CalEvents while dragging.
- * @event Drag#drag
- * @type {object}
- * @property {HTMLElement} target - target element in this event.
- * @property {MouseEvent} originEvent - original mouse event object.
- */
- this.fire('drag', this._getEventData(mouseMoveEvent));
- };
- /**
- * MouseUp DOM event handler.
- * @param {MouseEvent} mouseUpEvent MouseUp event object.
- * @emits Drag#dragEnd
- * @emits Drag#click
- */
- Drag.prototype._onMouseUp = function(mouseUpEvent) {
- if (this._cancelled) {
- return;
- }
- this._toggleDragEvent(false);
- // emit "click" event when not emitted drag event between mousedown and mouseup.
- if (this._isMoved) {
- this._isMoved = false;
- /**
- * Drag end events.
- * @event Drag#dragEnd
- * @type {MouseEvent}
- * @property {HTMLElement} target - target element in this event.
- * @property {MouseEvent} originEvent - original mouse event object.
- */
- this.fire('dragEnd', this._getEventData(mouseUpEvent));
- } else {
- /**
- * Click events.
- * @event Drag#click
- * @type {MouseEvent}
- * @property {HTMLElement} target - target element in this event.
- * @property {MouseEvent} originEvent - original mouse event object.
- */
- this.fire('click', this._getEventData(mouseUpEvent));
- }
- this._clearData();
- };
- /**
- * If the target is not a popup, it prevents the default.
- * @method
- * @param {MouseEvent} event - Mouse event object
- */
- function preventDefaultWhenNotPopup(event) {
- var popup = domutil.closest(event.target, config.classname('.popup'));
- if (!popup) {
- domevent.preventDefault(event);
- }
- }
- util.CustomEvents.mixin(Drag);
- module.exports = Drag;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/month/click.js":
- /*!***************************************!*\
- !*** ./src/js/handler/month/click.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Click handler for month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes util.CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {Month} [monthView] - Month view instance.
- * @param {Base} [baseController] - Base controller instance.
- */
- function MonthClick(dragHandler, monthView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {Month}
- */
- this.monthView = monthView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- dragHandler.on({
- 'click': this._onClick
- }, this);
- }
- /**
- * Destructor
- */
- MonthClick.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.monthView = this.baseController = this.dragHandler = null;
- };
- /**
- * @fires MonthClick#clickMore
- * @param {object} clickEvent - click event object
- */
- MonthClick.prototype._onClick = function(clickEvent) {
- var self = this,
- moreElement,
- scheduleCollection = this.baseController.schedules,
- blockElement = domutil.closest(clickEvent.target, config.classname('.weekday-schedule-block'))
- || domutil.closest(clickEvent.target, config.classname('.month-more-schedule'));
- moreElement = domutil.closest(
- clickEvent.target,
- config.classname('.weekday-exceed-in-month')
- );
- if (moreElement) {
- self.fire('clickMore', {
- date: datetime.parse(domutil.getData(moreElement, 'ymd')),
- target: moreElement,
- ymd: domutil.getData(moreElement, 'ymd')
- });
- }
- if (blockElement) {
- scheduleCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
- /**
- * @events AlldayClick#clickSchedule
- * @type {object}
- * @property {Schedule} schedule - schedule instance
- * @property {MouseEvent} event - MouseEvent object
- */
- self.fire('clickSchedule', {
- schedule: schedule,
- event: clickEvent.originEvent
- });
- });
- }
- };
- util.CustomEvents.mixin(MonthClick);
- module.exports = MonthClick;
- /***/ }),
- /***/ "./src/js/handler/month/core.js":
- /*!**************************************!*\
- !*** ./src/js/handler/month/core.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint-disable complexity */
- /**
- * @fileoverview Module for calculate date by month view and mouse event object
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var mfloor = Math.floor;
- /**
- * Get high order function that can calc date in mouse point
- * @param {Month} monthView - month view
- * @returns {function} function return event data by mouse event object
- */
- function getMousePosDate(monthView) {
- var weekColl = monthView.children,
- weeks = weekColl.sort(function(a, b) {
- return util.stamp(a) - util.stamp(b);
- }),
- weekCount = weekColl.length,
- days = weekColl.single().getRenderDateRange(),
- dayCount = days.length,
- relativeContainer = util.pick(monthView.vLayout.panels[1], 'container'),
- size = domutil.getSize(relativeContainer),
- grids = monthView.grids;
- /**
- * Get the left index
- * @param {number} left - left position(percent)
- * @returns {number} grid left index
- */
- function getX(left) {
- var i = 0;
- var length = grids.length;
- var grid;
- for (; i < length; i += 1) {
- grid = grids[i];
- if (grid.left <= left && left <= (grid.left + grid.width)) {
- return i;
- }
- }
- return left < 0 ? -1 : i;
- }
- /**
- * Get date related with mouse event object
- * @param {object} mouseEvent - click event data
- * @returns {object} data related with mouse event
- */
- function getDate(mouseEvent) {
- var pos = domevent.getMousePosition(mouseEvent, relativeContainer),
- x = getX(common.ratio(size[0], 100, pos[0])),
- y = mfloor(common.ratio(size[1], weekCount, pos[1])),
- weekdayView,
- date,
- dateRange;
- if (y < 0) {
- y = 0;
- }
- if (y >= weeks.length) {
- y = weeks.length - 1;
- }
- weekdayView = util.pick(weeks, y);
- if (!weekdayView) {
- return null;
- }
- dateRange = weekdayView.getRenderDateRange();
- if (x < 0) {
- x = 0;
- }
- if (x >= dateRange.length) {
- x = dateRange.length - 1;
- }
- date = util.pick(dateRange, x);
- if (!date) {
- return null;
- }
- return {
- x: x,
- y: y,
- sizeX: dayCount,
- sizeY: weekCount,
- date: datetime.end(date),
- weekdayView: weekdayView,
- triggerEvent: mouseEvent.type
- };
- }
- return getDate;
- }
- module.exports = getMousePosDate;
- /***/ }),
- /***/ "./src/js/handler/month/creation.js":
- /*!******************************************!*\
- !*** ./src/js/handler/month/creation.js ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Creation handler for month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var getMousePosDate = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js");
- var Guide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/month/creationGuide.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var CLICK_DELAY = 300;
- /**
- * @constructor
- * @param {Drag} dragHandler - Drag handler instance.
- * @param {Month} monthView - Month view instance.
- * @param {Base} baseController - Base controller instance.
- * @param {Options} [options] - calendar Options
- */
- function MonthCreation(dragHandler, monthView, baseController, options) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {Month}
- */
- this.monthView = monthView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {function}
- */
- this.getScheduleData = null;
- /**
- * Cache for dragging session
- * @type {object}
- */
- this._cache = null;
- /**
- * @type {MonthCreationGuide}
- */
- this.guide = new Guide(this);
- /**
- * @type {boolean}
- */
- this._requestOnClick = false;
- /**
- * @type {boolean}
- */
- this._disableDblClick = options.disableDblClick;
- /**
- * @type {boolean}
- */
- this._disableClick = options.disableClick;
- dragHandler.on('dragStart', this._onDragStart, this);
- dragHandler.on('click', this._onClick, this);
- if (this._disableDblClick) {
- CLICK_DELAY = 0;
- } else {
- domevent.on(monthView.container, 'dblclick', this._onDblClick, this);
- }
- }
- /**
- * Destructor
- */
- MonthCreation.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.guide.destroy();
- if (this.monthView && this.monthView.container) {
- domevent.off(this.monthView.container, 'dblclick', this._onDblClick, this);
- }
- this.dragHandler = this.monthView = this.baseController =
- this.getScheduleData = this._cache = this.guide = null;
- };
- /**
- * Fire before create schedule
- * @fires {MonthCreation#beforeCreateSchedule}
- * @param {object} eventData - cache data from single dragging session
- */
- MonthCreation.prototype._createSchedule = function(eventData) {
- /**
- * @event {MonthCreation#beforeCreateSchedule}
- * @type {object}
- * @property {boolean} isAllDay - whether schedule is fired in allday view area?
- * @property {Date} start - select start time
- * @property {Date} end - select end time
- * @property {TimeCreationGuide} guide - TimeCreationGuide instance
- * @property {string} triggerEventName - event name
- */
- this.fire('beforeCreateSchedule', {
- isAllDay: eventData.isAllDay,
- start: eventData.start,
- end: eventData.end,
- guide: this.guide.guide,
- triggerEventName: eventData.triggerEvent
- });
- };
- /**
- * DragStart event handler
- * @fires {MonthCreation#monthCreationDragstart}
- * @param {object} dragStartEvent - dragStart event data
- */
- MonthCreation.prototype._onDragStart = function(dragStartEvent) {
- var eventData;
- if (!isElementWeekdayGrid(dragStartEvent.target)) {
- return;
- }
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- this.getScheduleData = getMousePosDate(this.monthView);
- eventData = this.getScheduleData(dragStartEvent.originEvent);
- this._cache = {
- start: new TZDate(eventData.date)
- };
- /**
- * @event {MonthCreation#monthCreationDragstart}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthCreationDragstart', eventData);
- };
- /**
- * Drag event handler
- * @fires {MonthCreation#monthCreationDrag}
- * @param {object} dragEvent - drag event data
- */
- MonthCreation.prototype._onDrag = function(dragEvent) {
- var eventData;
- if (!this.getScheduleData) {
- return;
- }
- eventData = this.getScheduleData(dragEvent.originEvent);
- if (!eventData) {
- return;
- }
- /**
- * @event {MonthCreation#monthCreationDrag}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthCreationDrag', eventData);
- };
- /**
- * DragEnd event handler
- * @fires {MonthCreation#monthCreationDragend}
- * @param {object} dragEndEvent - drag end event data
- */
- MonthCreation.prototype._onDragEnd = function(dragEndEvent) {
- var cache = this._cache;
- var eventData;
- var times;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- if (!this.getScheduleData) {
- return;
- }
- eventData = this.getScheduleData(dragEndEvent.originEvent);
- if (eventData) {
- cache.end = new TZDate(eventData.date);
- cache.isAllDay = true;
- times = [
- cache.start,
- cache.end
- ].sort(array.compare.num.asc);
- cache.start = new TZDate(times[0]);
- cache.end = datetime.end(times[1]);
- this._createSchedule(cache);
- }
- /**
- * @event {MonthCreation#monthCreationDragend}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthCreationDragend', eventData);
- this.getScheduleData = this._cache = null;
- };
- /**
- * Dblclick event handler
- * @fires {MonthCreation#monthCreationDragstart}
- * @param {MouseEvent} e - Native MouseEvent
- */
- MonthCreation.prototype._onDblClick = function(e) {
- var eventData, range;
- if (!isElementWeekdayGrid(e.target)) {
- return;
- }
- eventData = getMousePosDate(this.monthView)(e);
- this.fire('monthCreationClick', eventData);
- range = this._adjustStartAndEndTime(new TZDate(eventData.date), new TZDate(eventData.date));
- this._createSchedule({
- start: range.start,
- end: range.end,
- isAllDay: false,
- triggerEvent: eventData.triggerEvent
- });
- this._requestOnClick = false;
- };
- /**
- * Click event handler
- * @fires {MonthCreation#monthCreationDragstart}
- * @param {MouseEvent} e - Native MouseEvent
- */
- MonthCreation.prototype._onClick = function(e) {
- var self = this;
- var eventData, range;
- if (!isElementWeekdayGrid(e.target) || this._disableClick) {
- return;
- }
- eventData = getMousePosDate(this.monthView)(e.originEvent);
- this._requestOnClick = true;
- setTimeout(function() {
- if (self._requestOnClick) {
- self.fire('monthCreationClick', eventData);
- range = self._adjustStartAndEndTime(new TZDate(eventData.date), new TZDate(eventData.date));
- self._createSchedule({
- start: range.start,
- end: range.end,
- isAllDay: false,
- triggerEvent: eventData.triggerEvent
- });
- }
- self._requestOnClick = false;
- }, CLICK_DELAY);
- };
- /**
- * Adjust time to our o'clock
- * @param {TZDate} start - start time
- * @param {TZDate} end - end time
- * @returns {Object} start and end
- */
- MonthCreation.prototype._adjustStartAndEndTime = function(start, end) {
- var now = new TZDate();
- var hours = now.getHours();
- var minutes = now.getMinutes();
- // adjust start to less time. Adjusting had been greater time in monthly view when clicking grid
- if (minutes <= 30) {
- minutes = 0;
- } else {
- minutes = 30;
- }
- start.setHours(hours, minutes, 0, 0);
- end.setHours(hours + 1, minutes, 0, 0);
- return {
- start: start,
- end: end
- };
- };
- /**
- * Invoke creation click
- * @param {Schedule} schedule - schedule instance
- */
- MonthCreation.prototype.invokeCreationClick = function(schedule) {
- var eventData = {
- model: schedule
- };
- this.fire('monthCreationClick', eventData);
- this._createSchedule({
- start: schedule.start,
- end: schedule.end,
- isAllDay: schedule.isAllDay,
- triggerEvent: 'manual'
- });
- };
- /**
- * Returns whether the given element is Weekday-Schedule.
- * @param {HTMLElement} el - target element
- * @returns {boolean}
- */
- function isElementWeekdayGrid(el) {
- return domutil.closest(el, config.classname('.weekday-grid'))
- && !domutil.closest(el, config.classname('.weekday-exceed-in-month'));
- }
- util.CustomEvents.mixin(MonthCreation);
- module.exports = MonthCreation;
- /***/ }),
- /***/ "./src/js/handler/month/creationGuide.js":
- /*!***********************************************!*\
- !*** ./src/js/handler/month/creationGuide.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Creation guide module for month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var MonthGuide = __webpack_require__(/*! ./guide */ "./src/js/handler/month/guide.js");
- /**
- * @constructor
- * @param {MonthCreation} monthCreation - instance of MonthCreation
- */
- function MonthCreationGuide(monthCreation) {
- /**
- * @type {MonthCreation}
- */
- this.monthCreation = monthCreation;
- /**
- * @type {MonthGuide}
- */
- this.guide = null;
- monthCreation.on({
- monthCreationDragstart: this._createGuideElement,
- monthCreationDrag: this._onDrag,
- monthCreationDragend: this._onDragEnd,
- monthCreationClick: this._createGuideElement
- }, this);
- }
- /**
- * Destructor
- */
- MonthCreationGuide.prototype.destroy = function() {
- this.monthCreation.off(this);
- if (this.guide) {
- this.guide.destroy();
- }
- this.guide = this.monthCreation = null;
- };
- /**
- * Drag start event handler
- * @param {object} dragStartEvent - schedule data from MonthCreation
- */
- MonthCreationGuide.prototype._createGuideElement = function(dragStartEvent) {
- var options = {
- isCreationMode: true,
- height: '100%',
- top: 0
- };
- this.guide = new MonthGuide(options, this.monthCreation.monthView);
- this.guide.start(dragStartEvent);
- };
- /**
- * Drag event handler
- * @param {object} dragEvent - schedule data from MonthCreation
- */
- MonthCreationGuide.prototype._onDrag = function(dragEvent) {
- this.guide.update(dragEvent.x, dragEvent.y);
- };
- /**
- * Drag end event handler
- */
- MonthCreationGuide.prototype._onDragEnd = function() {
- // Do nothing. User calls destroy directly.
- this.guide = null;
- };
- module.exports = MonthCreationGuide;
- /***/ }),
- /***/ "./src/js/handler/month/guide.hbs":
- /*!****************************************!*\
- !*** ./src/js/handler/month/guide.hbs ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.escapeExpression, alias2=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":30}}}) : helper)))
- + "month-creation-guide\" style=\"border: "
- + alias1(alias2(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"border") : stack1), depth0))
- + "; background-color: "
- + alias1(alias2(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
- + ";\"></div>\n";
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":30}}}) : helper)))
- + "weekday-schedule\"\n style=\"height: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + "; line-height: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + "; margin-top: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleGutter") : stack1), depth0))
- + "; border-radius:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
- + "; margin-left: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginLeft") : stack1), depth0))
- + "; margin-right: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginRight") : stack1), depth0))
- + ";\n color:"
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":7,"column":18},"end":{"line":7,"column":27}}}) : helper)))
- + ";border-color:"
- + alias4(((helper = (helper = lookupProperty(helpers,"borderColor") || (depth0 != null ? lookupProperty(depth0,"borderColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"borderColor","hash":{},"data":data,"loc":{"start":{"line":7,"column":41},"end":{"line":7,"column":56}}}) : helper)))
- + ";background-color:"
- + alias4(((helper = (helper = lookupProperty(helpers,"bgColor") || (depth0 != null ? lookupProperty(depth0,"bgColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"bgColor","hash":{},"data":data,"loc":{"start":{"line":7,"column":74},"end":{"line":7,"column":85}}}) : helper)))
- + "\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":34}}}) : helper)))
- + "weekday-schedule-title\">\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAllDay") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":13,"column":19}}})) != null ? stack1 : "")
- + " </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":15,"column":20},"end":{"line":15,"column":34}}}) : helper)))
- + "weekday-resize-handle handle-y\" style=\"line-height: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + ";\"> </div>\n </div>\n";
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":38}}})) != null ? stack1 : "")
- + "\n";
- },"6":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":16},"end":{"line":12,"column":36}}})) != null ? stack1 : "")
- + "\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "month-guide-block\" style=\"top:"
- + alias4(((helper = (helper = lookupProperty(helpers,"top") || (depth0 != null ? lookupProperty(depth0,"top") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"top","hash":{},"data":data,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":63}}}) : helper)))
- + ";height:"
- + alias4(((helper = (helper = lookupProperty(helpers,"height") || (depth0 != null ? lookupProperty(depth0,"height") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"height","hash":{},"data":data,"loc":{"start":{"line":1,"column":71},"end":{"line":1,"column":81}}}) : helper)))
- + ";display:none\">\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isCreationMode") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":17,"column":11}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/handler/month/guide.js":
- /*!***************************************!*\
- !*** ./src/js/handler/month/guide.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Guide element controller for creation, resize in month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
- tmpl = __webpack_require__(/*! ./guide.hbs */ "./src/js/handler/month/guide.hbs");
- var mmax = Math.max,
- mmin = Math.min,
- mabs = Math.abs,
- mfloor = Math.floor;
- /**
- * @constructor
- * @param {object} [options] - options
- * @param {boolean} [options.useHandle=false] - whether displaying resize handle on
- * guide element?
- * @param {boolean} [options.isResizeMode=false] - whether resize mode?
- * @param {Month} monthView - Month view instance
- */
- function MonthGuide(options, monthView) {
- /**
- * @type {object}
- */
- this.options = util.extend({
- top: 0,
- height: '20px',
- bgColor: '#f7ca88',
- label: 'New event',
- isResizeMode: false,
- isCreationMode: false,
- styles: this._getStyles(monthView.controller.theme)
- }, options);
- /**
- * @type {Month}
- */
- this.view = monthView;
- /**
- * @type {WeekdayInMonth[]}
- */
- this.weeks = monthView.children.sort(function(a, b) {
- return util.stamp(a) - util.stamp(b);
- });
- /**
- * @type {number}
- */
- this.days = monthView.children.single().getRenderDateRange().length;
- /**
- * start coordinate of guide effect. (x, y) (days, weeks) effect can't
- * start lower than this coordinate.
- * @type {number[]}
- */
- this.startCoord = [0, 0];
- /**
- * @type {Object.<string, HTMLElement>}
- */
- this.guideElements = {};
- /**
- * horizontal grid information
- * @type {Object}
- */
- this.grids = monthView.grids;
- }
- /**
- * Destructor
- */
- MonthGuide.prototype.destroy = function() {
- this.clear();
- this.options = this.view = this.weeks = this.days =
- this.startCoord = this.guideElements = null;
- };
- MonthGuide.prototype.clearGuideElement = function() {
- this.destroy();
- };
- /**
- * Get ratio value in week.
- * @param {number} value - value for calc ratio in week
- * @returns {number} percent value
- */
- MonthGuide.prototype._getRatioValueInWeek = function(value) {
- var grid = this.grids[value] || {left: 100};
- return grid.left;
- };
- /**
- * Create guide element
- * @returns {HTMLElement} guide element
- */
- MonthGuide.prototype._createGuideElement = function() {
- var guide = document.createElement('div');
- guide.innerHTML = tmpl(this.options);
- return guide.firstChild;
- };
- /**
- * Get guide element. if not exist then create one
- * @param {number} y - y coordinate
- * @returns {?HTMLElement} guide element
- */
- MonthGuide.prototype._getGuideElement = function(y) {
- var guideElements = this.guideElements,
- guide = guideElements[y],
- weekdayView = this.weeks[y],
- container;
- if (!weekdayView) {
- return null;
- }
- if (!guide) {
- guide = this._createGuideElement();
- container = weekdayView.container;
- container.appendChild(guide);
- guideElements[y] = guide;
- }
- return guide;
- };
- /**
- * Get coordinate by supplied date in month
- * @param {TZDate} date - date to find coordinate
- * @returns {number[]} coordinate (x, y)
- */
- MonthGuide.prototype._getCoordByDate = function(date) {
- var WEEKEND_DAYS = 2;
- var weeks = this.weeks;
- var isWorkWeek = util.pick(this.view, 'options', 'workweek');
- var days = isWorkWeek ? this.days + WEEKEND_DAYS : this.days;
- var getIdxFromDiff = function(d1, d2) {
- return mfloor(datetime.millisecondsTo('day', mabs(d2 - d1)));
- },
- monthStart = datetime.start(weeks[0].options.renderStartDate),
- isBefore = date < monthStart,
- start = new TZDate(monthStart),
- end = new TZDate(monthStart).addDate(isBefore ? -days : days).addDate(-1),
- x = getIdxFromDiff(date, start),
- y = 0;
- while (!datetime.isBetweenWithDate(date, start, end)) {
- start.addDate(isBefore ? -days : days);
- end = new TZDate(start).addDate(days - 1);
- x = getIdxFromDiff(date, start);
- y += (isBefore ? -1 : 1);
- }
- return [x, y];
- };
- /**
- * Get limited coordinate by supplied coodinates
- * @param {number[]} coord - coordinate need to limit
- * @param {number[]} [min] - minimum limitaion of coordinate
- * @param {number[]} [max] - maximum limitation of coordinate
- * @returns {number[]} limited coordiate
- */
- MonthGuide.prototype._getLimitedCoord = function(coord, min, max) {
- var toIndex = 1,
- x = coord[0],
- y = coord[1],
- result;
- min = min || [0, 0];
- max = max || [this.days - toIndex, this.weeks.length - toIndex];
- if (y < min[1]) {
- result = min.slice(0);
- } else if (y > max[1]) {
- result = max.slice(0);
- } else {
- x = mmax(min[0], x);
- x = mmin(max[0], x);
- result = [x, y];
- }
- return result;
- };
- /**
- * Prepare guide element modification
- * @param {object} dragStartEvent - dragStart schedule data from *guide
- */
- MonthGuide.prototype.start = function(dragStartEvent) {
- var opt = this.options,
- target = dragStartEvent.target,
- model = dragStartEvent.model,
- x = dragStartEvent.x,
- y = dragStartEvent.y,
- renderMonth = new TZDate(this.view.options.renderMonth),
- temp;
- if (opt.isCreationMode) {
- if (model && !datetime.isSameMonth(renderMonth, model.start)) {
- model.start.setMonth(renderMonth.getMonth());
- model.start.setDate(1);
- model.end.setMonth(renderMonth.getMonth());
- model.end.setDate(1);
- }
- } else {
- temp = this._getCoordByDate(model.getStarts());
- x = temp[0];
- y = temp[1];
- util.extend(this.options, {
- top: parseInt(target.style.top, 10) + 'px',
- height: parseInt(target.style.height, 10) + 'px',
- label: model.title
- }, model);
- }
- if (util.isUndefined(x) || util.isUndefined(y)) {
- temp = this._getCoordByDate(model.getStarts());
- x = temp[0];
- y = temp[1];
- }
- this.startCoord = [x, y];
- this.update(x, y);
- };
- /**
- * Data for update several guide elements
- * @typedef UpdateIndication
- * @type {object}
- * @property {HTMLElement} guide - guide element
- * @property {number} left - left style value
- * @property {number} width - width style value
- * @property {boolean} [exceedL=false] - whether schedule is exceeded past weeks?
- * @property {boolean} [exceedR=false] - whether schedule is exceeded future weeks?
- */
- /**
- * Modify HTML element that uses for guide element
- * @param {UpdateIndication[]} inds - indication of update severel guide element
- */
- MonthGuide.prototype._updateGuides = function(inds) {
- util.forEach(inds, function(ind) {
- var guide = ind.guide,
- exceedLClass = config.classname('month-exceed-left'),
- exceedRClass = config.classname('month-exceed-right');
- guide.style.display = 'block';
- guide.style.left = ind.left + '%';
- guide.style.width = ind.width + '%';
- if (ind.exceedL) {
- domutil.addClass(guide, exceedLClass);
- } else {
- domutil.removeClass(guide, exceedLClass);
- }
- if (ind.exceedR) {
- domutil.addClass(guide, exceedRClass);
- } else {
- domutil.removeClass(guide, exceedRClass);
- }
- });
- };
- /**
- * Get guide element indicate for origin week
- * @param {number[]} startCoord - drag start coordinate
- * @param {number[]} mouseCoord - mouse coordinate
- * @returns {object} indicate
- */
- MonthGuide.prototype._getOriginIndicate = function(startCoord, mouseCoord) {
- var left = mmin(startCoord[0], mouseCoord[0]),
- right = mmax(startCoord[0], mouseCoord[0]) + 1,
- exceedL, exceedR;
- if (mouseCoord[1] > startCoord[1]) {
- left = startCoord[0];
- right = this.days;
- exceedR = true;
- } else if (mouseCoord[1] < startCoord[1]) {
- left = 0;
- right = startCoord[0] + 1;
- exceedL = true;
- }
- return {
- left: this._getRatioValueInWeek(left),
- width: this._getRatioValueInWeek(right) -
- this._getRatioValueInWeek(left),
- exceedL: exceedL,
- exceedR: exceedR
- };
- };
- /**
- * Get guide element indicate for week related with mouse position
- * @param {number[]} startCoord - drag start coordinate
- * @param {number[]} mouseCoord - mouse coordinate
- * @returns {object} indicate
- */
- MonthGuide.prototype._getMouseIndicate = function(startCoord, mouseCoord) {
- var left = mouseCoord[0],
- right = mouseCoord[0] + 1,
- exceedL, exceedR;
- if (mouseCoord[1] > startCoord[1]) {
- left = 0;
- exceedL = true;
- } else if (mouseCoord[1] < startCoord[1]) {
- right = this.days;
- exceedR = true;
- }
- return {
- left: this._getRatioValueInWeek(left),
- width: this._getRatioValueInWeek(right) -
- this._getRatioValueInWeek(left),
- exceedL: exceedL,
- exceedR: exceedR
- };
- };
- /**
- * Get guide element indicate for contained weeks
- * @returns {object} indicate
- */
- MonthGuide.prototype._getContainIndicate = function() {
- return {
- left: 0,
- width: 100,
- exceedL: true,
- exceedR: true
- };
- };
- /**
- * Remove several guide element that supplied by parameter
- * @param {number[]} yCoords - array of y coordinate to remove guide element
- */
- MonthGuide.prototype._removeGuideElements = function(yCoords) {
- var guides = this.guideElements;
- util.forEach(yCoords, function(y) {
- domutil.remove(guides[y]);
- delete guides[y];
- });
- };
- /**
- * Get excluded numbers in range
- * @param {number[]} range - the range. value must be sequencial.
- * @param {number[]} numbers - numbers to check
- * @returns {number[]} excluded numbers
- */
- MonthGuide.prototype._getExcludesInRange = function(range, numbers) {
- var min = mmin.apply(null, range),
- max = mmax.apply(null, range),
- excludes = [];
- util.forEach(numbers, function(num) {
- num = parseInt(num, 10);
- if (num < min || num > max) {
- excludes.push(num);
- }
- });
- return excludes;
- };
- /**
- * Update guide elements by coordinate in month grid from mousemove event
- * @param {number} x - x coordinate
- * @param {number} y - y coordinate
- */
- MonthGuide.prototype.update = function(x, y) {
- var self = this,
- startCoord = this.startCoord,
- mouseCoord = [x, y],
- limitedCoord = this.options.isResizeMode ?
- this._getLimitedCoord(mouseCoord, startCoord) : mouseCoord,
- renderedYIndex = util.keys(this.guideElements),
- yCoordsToUpdate = util.range(
- mmin(startCoord[1], limitedCoord[1]),
- mmax(startCoord[1], limitedCoord[1]) + 1
- ),
- yCoordsToRemove = this._getExcludesInRange(
- yCoordsToUpdate,
- renderedYIndex
- ),
- renderIndication = {};
- this._removeGuideElements(yCoordsToRemove);
- util.forEach(yCoordsToUpdate, function(guideYCoord) {
- var guide = self._getGuideElement(guideYCoord),
- indicate;
- if (!guide) {
- return;
- }
- if (guideYCoord === startCoord[1]) {
- indicate = self._getOriginIndicate(startCoord, limitedCoord);
- } else if (guideYCoord === mouseCoord[1]) {
- indicate = self._getMouseIndicate(startCoord, mouseCoord);
- } else {
- indicate = self._getContainIndicate();
- }
- renderIndication[guideYCoord] = util.extend({
- guide: guide
- }, indicate);
- });
- this._updateGuides(renderIndication);
- };
- /**
- * Clear all guide elements
- */
- MonthGuide.prototype.clear = function() {
- util.forEach(this.guideElements, function(element) {
- domutil.remove(element);
- });
- this.guideElements = {};
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- MonthGuide.prototype._getStyles = function(theme) {
- var styles = {};
- if (theme) {
- styles.border = theme.common.creationGuide.border;
- styles.backgroundColor = theme.common.creationGuide.backgroundColor;
- styles.scheduleHeight = theme.month.schedule.height;
- styles.scheduleGutter = theme.month.schedule.marginTop;
- styles.marginLeft = theme.month.schedule.marginLeft;
- styles.marginRight = theme.month.schedule.marginRight;
- styles.borderRadius = theme.month.schedule.borderRadius;
- }
- return styles;
- };
- module.exports = MonthGuide;
- /***/ }),
- /***/ "./src/js/handler/month/move.js":
- /*!**************************************!*\
- !*** ./src/js/handler/month/move.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Move handler for month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- getMousePosData = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js"),
- MonthMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/month/moveGuide.js"),
- TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- /**
- * @constructor
- * @mixes CustomEvents
- * @param {Drag} dragHandler - Drag handler instance.
- * @param {Month} monthView - Month view instance.
- * @param {Base} baseController - Base controller instance.
- */
- function MonthMove(dragHandler, monthView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {Month}
- */
- this.monthView = monthView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {function}
- */
- this.getScheduleData = null;
- /**
- * @type {object}
- */
- this._cache = null;
- /**
- * @type {MonthMoveGuide}
- */
- this.guide = new MonthMoveGuide(this);
- dragHandler.on('dragStart', this._onDragStart, this);
- }
- /**
- * Destructor
- */
- MonthMove.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.dragHandler = this.monthView = this.baseController = null;
- };
- /**
- * Update target schedule
- * @fires {MonthMove#beforeUpdateSchedule}
- * @param {object} scheduleCache - cache object that result of single dragging
- * session.
- */
- MonthMove.prototype.updateSchedule = function(scheduleCache) {
- var schedule = scheduleCache.model;
- var duration = schedule.duration();
- var startDateRaw = datetime.raw(schedule.start);
- var dragEndTime = new TZDate(scheduleCache.end);
- var newStartDate = new TZDate(dragEndTime);
- newStartDate.setHours(startDateRaw.h, startDateRaw.m, startDateRaw.s, startDateRaw.ms);
- /**
- * @event MonthMove#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - start and end time to update
- * @property {Date} start - start time to update
- * @property {Date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: {
- start: newStartDate,
- end: new TZDate(newStartDate).addMilliseconds(duration)
- },
- start: newStartDate,
- end: new TZDate(newStartDate).addMilliseconds(duration)
- });
- };
- /**
- * Get schedule block to clone for month guide effect
- * @param {HTMLElement} target - target element that related with drag schedule
- * @returns {HTMLElement} element to create guide effect
- */
- MonthMove.prototype.getMonthScheduleBlock = function(target) {
- var blockSelector = config.classname('.weekday-schedule-block');
- return domutil.closest(target, blockSelector);
- };
- /**
- * Get schedule block from more layer
- * @param {HTMLElement} target - element to check
- * @returns {HTMLElement} schedule element
- */
- MonthMove.prototype.getMoreLayerScheduleBlock = function(target) {
- var className = config.classname('.month-more-schedule');
- return domutil.closest(target, className);
- };
- /**
- * Check handler has permission to handle fired schedule
- * @fires {MonthMove#monthMoveStart_from_morelayer}
- * @param {HTMLElement} target - target element of fired schedule
- * @returns {(string|null)} model instance ID related with schedule. if handle
- * has not permission to handle the schedule then return null.
- */
- MonthMove.prototype.hasPermissionToHandle = function(target) {
- var modelID = null;
- var blockElement;
- if (domutil.hasClass(target, config.classname('weekday-resize-handle'))) {
- return null;
- }
- blockElement = this.getMonthScheduleBlock(target);
- if (blockElement) {
- modelID = domutil.getData(blockElement, 'id');
- } else {
- blockElement = this.getMoreLayerScheduleBlock(target);
- if (blockElement) {
- modelID = domutil.getData(blockElement, 'id');
- /**
- * Fire for notificate that the drag schedule start at more layer view.
- * @event {MonthMove#monthMoveStart_from_morelayer}
- */
- this.fire('monthMoveStart_from_morelayer');
- }
- }
- return modelID;
- };
- /**
- * Event handler for Drag#dragStart
- * @fires {MonthMove#monthMoveDragstart}
- * @param {object} dragStartEvent - drag start schedule data
- */
- MonthMove.prototype._onDragStart = function(dragStartEvent) {
- var target = dragStartEvent.target,
- modelID = this.hasPermissionToHandle(target),
- model = this.baseController.schedules.items[modelID],
- scheduleData;
- if (!modelID || !model || model.isReadOnly || model.isPending) {
- return;
- }
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- this.getScheduleData = getMousePosData(this.monthView);
- scheduleData = this.getScheduleData(dragStartEvent.originEvent);
- scheduleData.originEvent = dragStartEvent.originEvent;
- scheduleData.target = this.getMonthScheduleBlock(target);
- scheduleData.model = model;
- this._cache = {
- model: model,
- target: target,
- start: new TZDate(Number(scheduleData.date))
- };
- /**
- * @event {MonthMove#monthMoveDragstart}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- * @property {HTMLElement} target - schedule block element
- * @property {Schedule} model - model instance
- */
- this.fire('monthMoveDragstart', scheduleData);
- };
- /**
- * @fires {MonthMove#monthMoveDrag}
- * @param {object} dragEvent - drag event data
- */
- MonthMove.prototype._onDrag = function(dragEvent) {
- var scheduleData;
- if (!this.getScheduleData) {
- return;
- }
- scheduleData = util.extend({
- originEvent: dragEvent.originEvent
- }, this.getScheduleData(dragEvent.originEvent));
- if (!scheduleData) {
- return;
- }
- /**
- * @event {MonthMove#monthMoveDrag}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthMoveDrag', scheduleData);
- };
- /**
- * Event handler for Drag#dragEnd
- * @fires {MonthMove#monthMoveDragend}
- * @param {object} dragEndEvent - dragend event data
- */
- MonthMove.prototype._onDragEnd = function(dragEndEvent) {
- var cache = this._cache;
- var scheduleData;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- if (!this.getScheduleData) {
- return;
- }
- scheduleData = this.getScheduleData(dragEndEvent.originEvent);
- if (scheduleData) {
- cache.end = new TZDate(scheduleData.date);
- this.updateSchedule(cache);
- }
- /**
- * @event {MonthResize#monthMoveDragend}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthMoveDragend', scheduleData);
- this.getScheduleData = this._cache = null;
- };
- util.CustomEvents.mixin(MonthMove);
- module.exports = MonthMove;
- /***/ }),
- /***/ "./src/js/handler/month/moveGuide.hbs":
- /*!********************************************!*\
- !*** ./src/js/handler/month/moveGuide.hbs ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-left:3px solid "
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n ";
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":31}}}) : helper)))
- + "weekday-schedule-bullet "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":55},"end":{"line":14,"column":69}}}) : helper)))
- + "weekday-schedule-bullet-focused\" style=\"top: "
- + alias4(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleBulletTop") : stack1), depth0))
- + "px;\"></span>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":110},"end":{"line":16,"column":124}}}) : helper)))
- + "weekday-schedule-title-focused";
- },"7":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":12},"end":{"line":18,"column":35}}})) != null ? stack1 : "")
- + "\n";
- },"9":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":12},"end":{"line":20,"column":33}}})) != null ? stack1 : "")
- + "\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "month-guide "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":52}}}) : helper)))
- + "month-guide-focused\"\n style=\"top: -50%;\n left: -50%;\n width: 100%;\n color: #ffffff;\n background-color:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"dragBgColor") : stack1), depth0))
- + ";\n height:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + "px;\n line-height:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + "px;\n border-radius: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":12,"column":19}}})) != null ? stack1 : "")
- + "\">\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":4},"end":{"line":15,"column":15}}})) != null ? stack1 : "")
- + " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":16},"end":{"line":16,"column":30}}}) : helper)))
- + "month-move-guide "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":47},"end":{"line":16,"column":61}}}) : helper)))
- + "weekday-schedule-title "
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":84},"end":{"line":16,"column":165}}})) != null ? stack1 : "")
- + "\">\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.program(9, data, 0),"data":data,"loc":{"start":{"line":17,"column":8},"end":{"line":21,"column":15}}})) != null ? stack1 : "")
- + " </div>\n</div>\n<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":12},"end":{"line":24,"column":26}}}) : helper)))
- + "month-guide-cover\" style=\"height:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
- + "px; border-radius: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
- + ";\"></div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/handler/month/moveGuide.js":
- /*!*******************************************!*\
- !*** ./src/js/handler/month/moveGuide.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Module for modification of guide element for move in month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
- FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js"),
- tmpl = __webpack_require__(/*! ./moveGuide.hbs */ "./src/js/handler/month/moveGuide.hbs"),
- Schedule = __webpack_require__(/*! ../../model/schedule */ "./src/js/model/schedule.js");
- /**
- * @constructor
- * @param {MonthMove} monthMove - month/move module instance
- */
- function MonthMoveGuide(monthMove) {
- /**
- * @type {MonthMove}
- */
- this.monthMove = monthMove;
- /**
- * @type {HTMLElement[]}
- */
- this.elements = null;
- /**
- * @type {FloatingLayer}
- */
- this.layer = null;
- monthMove.on({
- monthMoveDragstart: this._onDragStart,
- monthMoveDrag: this._onDrag,
- monthMoveDragend: this._onDragEnd
- }, this);
- }
- /**
- * Destructor
- */
- MonthMoveGuide.prototype.destroy = function() {
- this.monthMove.off(this);
- this._clearGridBgColor();
- if (this.layer) {
- this.layer.destroy();
- }
- if (this.element) {
- domutil.remove(this.element);
- }
- this.monthMove = this.elements = this.layer = null;
- };
- /**
- * Hide element blocks for resize effect
- * @param {number} modelID - Schedule model instance ID
- */
- MonthMoveGuide.prototype._hideOriginScheduleBlocks = function(modelID) {
- var className = config.classname('weekday-schedule-block-dragging-dim');
- this.elements = domutil.find(
- config.classname('.weekday-schedule-block-' + modelID),
- this.monthMove.monthView.container,
- true
- );
- util.forEach(this.elements, function(el) {
- domutil.addClass(el, className);
- });
- };
- /**
- * Show element blocks
- */
- MonthMoveGuide.prototype._showOriginScheduleBlocks = function() {
- var className = config.classname('weekday-schedule-block-dragging-dim');
- util.forEach(this.elements, function(el) {
- domutil.removeClass(el, className);
- });
- };
- /**
- * Clear background color for filled grid element.
- */
- MonthMoveGuide.prototype._clearGridBgColor = function() {
- var selector = config.classname('.weekday-filled'),
- className = config.classname('weekday-filled'),
- beforeGridElement = domutil.find(selector,
- this.monthMove.monthView.container);
- if (beforeGridElement) {
- domutil.removeClass(beforeGridElement, className);
- }
- };
- /**
- * Fill background color of date grids relatied with model updates.
- * @param {object} dragEvent - drag event data from MonthMoveGuide#_onDrag
- */
- MonthMoveGuide.prototype._updateGridBgColor = function(dragEvent) {
- var gridElements = domutil.find(config.classname('.weekday-grid-line'), this.monthMove.monthView.container, true),
- className = config.classname('weekday-filled'),
- targetIndex = (dragEvent.x + (dragEvent.sizeX * dragEvent.y));
- this._clearGridBgColor();
- if (!gridElements || !gridElements[targetIndex]) {
- return;
- }
- domutil.addClass(gridElements[targetIndex], className);
- };
- /**
- * Handler for MonthMove#dragStart
- * @param {object} dragStartEvent - dragStart schedule data object
- */
- MonthMoveGuide.prototype._onDragStart = function(dragStartEvent) {
- var monthView = this.monthMove.monthView,
- firstWeekdayView = monthView.children.single(),
- weekdayOptions = firstWeekdayView.options,
- widthPercent = 100 / firstWeekdayView.getRenderDateRange().length,
- height = weekdayOptions.scheduleGutter + weekdayOptions.scheduleHeight,
- container = monthView.container,
- mousePos = domevent.getMousePosition(dragStartEvent.originEvent, container),
- model = dragStartEvent.model,
- layer = new FloatingLayer(null, container);
- this._hideOriginScheduleBlocks(model.cid());
- this.layer = layer;
- layer.setSize(widthPercent + '%', height);
- layer.setPosition(mousePos[0], mousePos[1]);
- layer.setContent(tmpl({
- model: util.extend(
- Schedule.create(model),
- model
- ),
- styles: {
- scheduleHeight: weekdayOptions.scheduleHeight,
- scheduleBulletTop: weekdayOptions.scheduleHeight / 3,
- borderRadius: monthView.controller.theme.month.schedule.borderRadius
- }
- }));
- layer.show();
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('dragging'));
- }
- };
- /**
- * Handler for MonthMove#drag
- * @param {object} dragEvent - drag event data object
- */
- MonthMoveGuide.prototype._onDrag = function(dragEvent) {
- var container = this.monthMove.monthView.container,
- mousePos = domevent.getMousePosition(
- dragEvent.originEvent,
- container
- );
- this._updateGridBgColor(dragEvent);
- if (!this.layer) {
- return;
- }
- this.layer.setPosition(mousePos[0], mousePos[1]);
- };
- /**
- * Handler for MonthMove#dragEnd
- */
- MonthMoveGuide.prototype._onDragEnd = function() {
- this._showOriginScheduleBlocks();
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('dragging'));
- }
- this._clearGridBgColor();
- this.layer.destroy();
- this.layer = null;
- };
- module.exports = MonthMoveGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/month/resize.js":
- /*!****************************************!*\
- !*** ./src/js/handler/month/resize.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Module for resize schedule in month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- getMousePosData = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js"),
- MonthResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/month/resizeGuide.js"),
- TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- /**
- * @constructor
- * @param {Drag} dragHandler - Drag handler instance.
- * @param {Month} monthView - Month view instance.
- * @param {Base} baseController - Base controller instance.
- */
- function MonthResize(dragHandler, monthView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {Month}
- */
- this.monthView = monthView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {function}
- */
- this.getScheduleData = null;
- /**
- * @type {object}
- */
- this._cache = null;
- /**
- * @type {MonthResizeGuide}
- */
- this.guide = new MonthResizeGuide(this);
- dragHandler.on('dragStart', this._onDragStart, this);
- }
- /**
- * Destructor
- */
- MonthResize.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.dragHandler = this.monthView = this.baseController = null;
- };
- /**
- * Fire event for update model
- * @fires {MonthResize#beforeUpdateSchedule}
- * @param {object} scheduleCache - cache object that result of single dragging
- * session.
- */
- MonthResize.prototype._updateSchedule = function(scheduleCache) {
- // You can not change the start date of the event. Only the end time can be changed.
- var newEnd = datetime.end(new TZDate(scheduleCache.end)),
- schedule = scheduleCache.schedule;
- var changes = common.getScheduleChanges(
- schedule,
- ['end'],
- {end: newEnd}
- );
- /**
- * @event MonthResize#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - end time to update
- * @property {date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: changes,
- start: new TZDate(schedule.getStarts()),
- end: newEnd
- });
- };
- /**
- * Event handler for Drag#dragStart
- * @fires {MonthResize#monthResizeDragstart}
- * @param {object} dragStartEvent - drag start event data
- */
- MonthResize.prototype._onDragStart = function(dragStartEvent) {
- var target = dragStartEvent.target,
- modelID, schedule,
- scheduleData;
- if (!domutil.hasClass(target, config.classname('weekday-resize-handle'))) {
- return;
- }
- target = domutil.closest(target, config.classname('.weekday-schedule-block'));
- if (!target) {
- return;
- }
- modelID = domutil.getData(target, 'id');
- schedule = this.baseController.schedules.items[modelID];
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- this.getScheduleData = getMousePosData(this.monthView);
- scheduleData = this.getScheduleData(dragStartEvent.originEvent);
- scheduleData.target = target;
- scheduleData.model = schedule;
- this._cache = {
- schedule: schedule,
- target: target,
- start: new TZDate(scheduleData.date)
- };
- /**
- * @event {MonthCreation#monthResizeDragstart}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- * @property {HTMLElement} target - schedule block element
- * @property {Schedule} model - model instance
- */
- this.fire('monthResizeDragstart', scheduleData);
- };
- /**
- * @fires {MonthResize#monthResizeDrag}
- * @param {object} dragEvent - drag event data
- */
- MonthResize.prototype._onDrag = function(dragEvent) {
- var scheduleData;
- if (!this.getScheduleData) {
- return;
- }
- scheduleData = this.getScheduleData(dragEvent.originEvent);
- if (!scheduleData) {
- return;
- }
- /**
- * @event {MonthResize#monthResizeDrag}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthResizeDrag', scheduleData);
- };
- /**
- * @fires {MonthResize#monthResizeDragend}
- * @param {object} dragEndEvent - drag end event data
- */
- MonthResize.prototype._onDragEnd = function(dragEndEvent) {
- var cache = this._cache;
- var scheduleData;
- var start, end;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- if (!this.getScheduleData) {
- return;
- }
- scheduleData = this.getScheduleData(dragEndEvent.originEvent);
- if (scheduleData) {
- start = new TZDate(cache.schedule.getStarts());
- end = new TZDate(scheduleData.date);
- cache.end = end;
- if (start <= cache.end) {
- this._updateSchedule(cache);
- }
- }
- /**
- * @event {MonthResize#monthResizeDragend}
- * @type {object}
- * @property {number} x - x index
- * @property {number} y - y index
- * @property {Date} date - drag date
- */
- this.fire('monthResizeDragend', scheduleData);
- this.getScheduleData = this._cache = null;
- };
- util.CustomEvents.mixin(MonthResize);
- module.exports = MonthResize;
- /***/ }),
- /***/ "./src/js/handler/month/resizeGuide.js":
- /*!*********************************************!*\
- !*** ./src/js/handler/month/resizeGuide.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Module for modification of guide element in schedule resize
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- MonthGuide = __webpack_require__(/*! ./guide */ "./src/js/handler/month/guide.js");
- /**
- * @constructor
- * @param {MonthResize} monthResize - month/resize module instance
- */
- function MonthResizeGuide(monthResize) {
- /**
- * @type {MonthResize}
- */
- this.monthResize = monthResize;
- /**
- * @type {HTMLElement[]}
- */
- this.elements = null;
- /**
- * @type {MonthGuide}
- */
- this.guide = null;
- monthResize.on({
- monthResizeDragstart: this._onDragStart,
- monthResizeDrag: this._onDrag,
- monthResizeDragend: this._onDragEnd
- }, this);
- }
- /**
- * Destructor
- */
- MonthResizeGuide.prototype.destroy = function() {
- this.monthResize.off(this);
- this.guide.destroy();
- this.guide = this.monthResize = null;
- };
- /**
- * Hide element blocks for resize effect
- * @param {number} modelID - Schedule model instance ID
- */
- MonthResizeGuide.prototype._hideScheduleBlocks = function(modelID) {
- this.elements = domutil.find(
- config.classname('.weekday-schedule-block-' + modelID),
- this.monthResize.monthView.container,
- true
- );
- util.forEach(this.elements, function(el) {
- el.style.display = 'none';
- });
- };
- /**
- * Show element blocks
- */
- MonthResizeGuide.prototype._showScheduleBlocks = function() {
- util.forEach(this.elements, function(el) {
- el.style.display = 'block';
- });
- };
- /**
- * Drag start event handler
- * @param {object} dragStartEvent - schedule data from MonthResize
- */
- MonthResizeGuide.prototype._onDragStart = function(dragStartEvent) {
- this.guide = new MonthGuide({
- isResizeMode: true
- }, this.monthResize.monthView);
- this.guide.start(dragStartEvent);
- this._hideScheduleBlocks(dragStartEvent.model.cid());
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('resizing-x'));
- }
- };
- /**
- * Drag event handler
- * @param {object} dragEvent - event data from MonthCreation
- */
- MonthResizeGuide.prototype._onDrag = function(dragEvent) {
- this.guide.update(dragEvent.x, dragEvent.y);
- };
- /**
- * Drag end event handler
- */
- MonthResizeGuide.prototype._onDragEnd = function() {
- this._showScheduleBlocks();
- this.guide.destroy();
- this.elements = this.guide = null;
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('resizing-x'));
- }
- };
- module.exports = MonthResizeGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/time/click.js":
- /*!**************************************!*\
- !*** ./src/js/handler/time/click.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Allday event click event hander module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes util.CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
- * @param {Base} [baseController] - Base controller instance.
- */
- function TimeClick(dragHandler, timeGridView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {TimeGrid}
- */
- this.timeGridView = timeGridView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- dragHandler.on({
- 'click': this._onClick
- }, this);
- }
- /**
- * Destroy method
- */
- TimeClick.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.timeGridView = this.baseController = this.dragHandler = null;
- };
- /**
- * Check target element is expected condition for activate this plugins.
- * @param {HTMLElement} target - The element to check
- * @returns {string} - model id
- */
- TimeClick.prototype.checkExpectCondition = function(target) {
- var container,
- matches;
- container = domutil.closest(target, config.classname('.time-date'));
- if (!container) {
- return false;
- }
- matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.timeGridView.children.items, Number(matches[1]));
- };
- /**
- * Click event hander
- * @param {object} clickEvent - click event from {@link Drag}
- * @emits TimeClick#clickEvent
- */
- TimeClick.prototype._onClick = function(clickEvent) {
- var self = this,
- target = clickEvent.target,
- timeView = this.checkExpectCondition(target),
- blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
- schedulesCollection = this.baseController.schedules;
- if (!timeView || !blockElement) {
- return;
- }
- schedulesCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
- /**
- * @events TimeClick#clickSchedule
- * @type {object}
- * @property {Schedule} schedule - schedule instance
- * @property {MouseEvent} event - MouseEvent object
- */
- self.fire('clickSchedule', {
- schedule: schedule,
- event: clickEvent.originEvent
- });
- });
- };
- util.CustomEvents.mixin(TimeClick);
- module.exports = TimeClick;
- /***/ }),
- /***/ "./src/js/handler/time/clickDayname.js":
- /*!*********************************************!*\
- !*** ./src/js/handler/time/clickDayname.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Dayname click event hander module
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes util.CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {DayName} [dayNameView] - DayName view instance.
- * @param {Base} [baseController] - Base controller instance.
- */
- function DayNameClick(dragHandler, dayNameView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {DayName}
- */
- this.dayNameView = dayNameView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- dragHandler.on({
- 'click': this._onClick
- }, this);
- }
- /**
- * Destroy method
- */
- DayNameClick.prototype.destroy = function() {
- this.dragHandler.off(this);
- this.dayNameView = this.baseController = this.dragHandler = null;
- };
- /**
- * Check target element is expected condition for activate this plugins.
- * @param {HTMLElement} target - The element to check
- * @returns {string} - model id
- */
- DayNameClick.prototype.checkExpectCondition = function(target) {
- var container = domutil.closest(target, config.classname('.dayname-date-area'));
- if (!container) {
- return false;
- }
- return true;
- };
- /**
- * Click event hander
- * @param {object} clickEvent - click event from {@link Drag}
- * @emits DayNameClick#clickDayname
- */
- DayNameClick.prototype._onClick = function(clickEvent) {
- var self = this,
- target = clickEvent.target,
- daynameView = this.checkExpectCondition(target),
- blockElement = domutil.closest(target, config.classname('.dayname'));
- if (!daynameView || !blockElement) {
- return;
- }
- /**
- * @events DayNameClick#clickDayname
- * @type {object}
- * @property {string} date - click date
- */
- self.fire('clickDayname', {
- date: domutil.getData(blockElement, 'date')
- });
- };
- util.CustomEvents.mixin(DayNameClick);
- module.exports = DayNameClick;
- /***/ }),
- /***/ "./src/js/handler/time/core.js":
- /*!*************************************!*\
- !*** ./src/js/handler/time/core.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Core methods for dragging actions
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var Point = __webpack_require__(/*! ../../common/point */ "./src/js/common/point.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- /**
- * @mixin Time.Core
- */
- var timeCore = {
- /**
- * Get Y index ratio(hour) in time grids by supplied parameters.
- * @param {number} baseMil - base milliseconds number for supplied height.
- * @param {number} height - container element height.
- * @param {number} y - Y coordinate to calculate hour ratio.
- * @returns {number} hour index ratio value.
- */
- _calcGridYIndex: function(baseMil, height, y) {
- // get ratio from right expression > point.y : x = session.height : baseMil
- // and convert milliseconds value to hours.
- var result = datetime.millisecondsTo('hour', (y * baseMil) / height),
- floored = result | 0,
- nearest = common.nearest(result - floored, [0, 1]);
- return floored + (nearest ? 0.5 : 0);
- },
- /**
- * Get function to makes event data from Time and mouseEvent
- * @param {Time} timeView - Instance of time view.
- * @returns {function} - Function that return event data from mouse event.
- */
- _retriveScheduleData: function(timeView) {
- var self = this,
- container = timeView.container,
- options = timeView.options,
- viewHeight = timeView.getViewBound().height,
- viewTime = timeView.getDate(),
- hourLength = options.hourEnd - options.hourStart,
- baseMil = datetime.millisecondsFrom('hour', hourLength);
- /**
- * @param {MouseEvent} mouseEvent - mouse event object to get common event data.
- * @param {object} [extend] - object to extend event data before return.
- * @returns {object} - common event data for time
- */
- return function(mouseEvent, extend) {
- var mouseY = Point.n(domevent.getMousePosition(mouseEvent, container)).y,
- gridY = common.ratio(viewHeight, hourLength, mouseY),
- timeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(gridY)),
- nearestGridY = self._calcGridYIndex(baseMil, viewHeight, mouseY),
- nearestGridTimeY = new TZDate(viewTime).addMinutes(
- datetime.minutesFromHours(nearestGridY + options.hourStart)
- );
- return util.extend({
- target: domevent.getEventTarget(mouseEvent),
- relatedView: timeView,
- originEvent: mouseEvent,
- mouseY: mouseY,
- gridY: gridY,
- timeY: timeY,
- nearestGridY: nearestGridY,
- nearestGridTimeY: nearestGridTimeY,
- triggerEvent: mouseEvent.type
- }, extend);
- };
- },
- /**
- * Get function to makes event data from Time and mouseEvent
- * @param {Time} timeView - Instance of time view.
- * @param {TZDate} startDate - start date
- * @param {TZDate} endDate - end date
- * @param {number} hourStart Can limit of render hour start.
- * @returns {object} - common event data for time from mouse event.
- */
- _retriveScheduleDataFromDate: function(timeView, startDate, endDate, hourStart) {
- var viewTime = timeView.getDate();
- var gridY, timeY, nearestGridY, nearestGridTimeY, nearestGridEndY, nearestGridEndTimeY;
- gridY = startDate.getHours() - hourStart + getNearestHour(startDate.getMinutes());
- timeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(gridY));
- nearestGridY = gridY;
- nearestGridTimeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(nearestGridY));
- nearestGridEndY = endDate.getHours() - hourStart + getNearestHour(endDate.getMinutes());
- nearestGridEndTimeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(nearestGridEndY));
- return {
- target: timeView,
- relatedView: timeView,
- gridY: gridY,
- timeY: timeY,
- nearestGridY: nearestGridY,
- nearestGridTimeY: nearestGridTimeY,
- nearestGridEndY: nearestGridEndY,
- nearestGridEndTimeY: nearestGridEndTimeY,
- triggerEvent: 'manual',
- hourStart: hourStart
- };
- },
- /**
- * Mixin method.
- * @param {(TimeCreation|TimeMove)} obj - Constructor functions
- */
- mixin: function(obj) {
- var proto = obj.prototype;
- util.forEach(timeCore, function(method, methodName) {
- if (methodName === 'mixin') {
- return;
- }
- proto[methodName] = method;
- });
- }
- };
- /**
- * Get the nearest hour
- * @param {number} minutes - minutes
- * @returns {number} hour
- */
- function getNearestHour(minutes) {
- var nearestHour;
- if (minutes === 0) {
- nearestHour = 0;
- } else if (minutes > 30) {
- nearestHour = 1;
- } else if (minutes <= 30) {
- nearestHour = 0.5;
- }
- return nearestHour;
- }
- module.exports = timeCore;
- /***/ }),
- /***/ "./src/js/handler/time/creation.js":
- /*!*****************************************!*\
- !*** ./src/js/handler/time/creation.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Handling creation events from drag handler and time grid view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var TimeCreationGuide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/time/creationGuide.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
- var CLICK_DELAY = 300;
- /**
- * @constructor
- * @implements {Handler}
- * @mixes timeCore
- * @mixes CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
- * @param {Base} [baseController] - Base controller instance.
- * @param {Options} [options] - calendar Options
- */
- function TimeCreation(dragHandler, timeGridView, baseController, options) {
- /**
- * Drag handler instance.
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * TimeGrid view instance.
- * @type {TimeGrid}
- */
- this.timeGridView = timeGridView;
- /**
- * Base controller instance.
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {TimeCreationGuide}
- */
- this.guide = new TimeCreationGuide(this);
- /**
- * Temporary function for single drag session's calc.
- * @type {function}
- */
- this._getScheduleDataFunc = null;
- /**
- * Temporary function for drag start data cache.
- * @type {object}
- */
- this._dragStart = null;
- /**
- * @type {boolean}
- */
- this._requestOnClick = false;
- /**
- * @type {boolean}
- */
- this._disableDblClick = options.disableDblClick;
- /**
- * @type {boolean}
- */
- this._disableClick = options.disableClick;
- dragHandler.on('dragStart', this._onDragStart, this);
- dragHandler.on('click', this._onClick, this);
- if (this._disableDblClick) {
- CLICK_DELAY = 0;
- } else {
- domevent.on(timeGridView.container, 'dblclick', this._onDblClick, this);
- }
- }
- /**
- * Destroy method
- */
- TimeCreation.prototype.destroy = function() {
- var timeGridView = this.timeGridView;
- this.guide.destroy();
- this.dragHandler.off(this);
- if (timeGridView && timeGridView.container) {
- domevent.off(timeGridView.container, 'dblclick', this._onDblClick, this);
- }
- this.dragHandler = this.timeGridView = this.baseController =
- this._getScheduleDataFunc = this._dragStart = this.guide = null;
- };
- /**
- * Check target element is expected condition for activate this plugins.
- * @param {HTMLElement} target - The element to check
- * @returns {(boolean|Time)} - return Time view instance when satiate condition.
- */
- TimeCreation.prototype.checkExpectedCondition = function(target) {
- var cssClass = domutil.getClass(target),
- matches;
- if (cssClass === config.classname('time-date-schedule-block-wrap')) {
- target = target.parentNode;
- cssClass = domutil.getClass(target);
- }
- matches = cssClass.match(config.time.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.timeGridView.children.items, matches[1]);
- };
- /**
- * Drag#dragStart event handler.
- * @emits TimeCreation#timeCreationDragstart
- * @param {object} dragStartEventData - Drag#dragStart event data.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- * @param {function} [revise] - supply function for revise event data before emit.
- */
- TimeCreation.prototype._onDragStart = function(dragStartEventData, overrideEventName, revise) {
- var target = dragStartEventData.target,
- result = this.checkExpectedCondition(target),
- getScheduleDataFunc,
- eventData;
- if (!result) {
- return;
- }
- getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(result);
- eventData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
- if (revise) {
- revise(eventData);
- }
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- /**
- * @event TimeCreation#timeCreationDragstart
- * @type {object}
- * @property {Time} relatedView - time view instance related with mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- */
- this.fire(overrideEventName || 'timeCreationDragstart', eventData);
- };
- /**
- * Drag#drag event handler
- * @emits TimeCreation#timeCreationDrag
- * @param {object} dragEventData - event data from Drag#drag.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- * @param {function} [revise] - supply function for revise event data before emit.
- */
- TimeCreation.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- eventData;
- if (!getScheduleDataFunc) {
- return;
- }
- eventData = getScheduleDataFunc(dragEventData.originEvent);
- if (revise) {
- revise(eventData);
- }
- /**
- * @event TimeCreation#timeCreationDrag
- * @type {object}
- * @property {Time} relatedView - time view instance related with mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- */
- this.fire(overrideEventName || 'timeCreationDrag', eventData);
- };
- /**
- * @fires TimeCreation#beforeCreateSchedule
- * @param {object} eventData - event data object from TimeCreation#timeCreationDragend
- * or TimeCreation#timeCreationClick
- */
- TimeCreation.prototype._createSchedule = function(eventData) {
- var relatedView = eventData.relatedView,
- createRange = eventData.createRange,
- nearestGridTimeY = eventData.nearestGridTimeY,
- nearestGridEndTimeY = eventData.nearestGridEndTimeY
- ? eventData.nearestGridEndTimeY
- : new TZDate(nearestGridTimeY).addMinutes(30),
- baseDate,
- dateStart,
- dateEnd,
- start,
- end;
- if (!createRange) {
- createRange = [
- nearestGridTimeY,
- nearestGridEndTimeY
- ];
- }
- baseDate = new TZDate(relatedView.getDate());
- dateStart = datetime.start(baseDate);
- dateEnd = datetime.getStartOfNextDay(baseDate);
- start = common.limitDate(createRange[0], dateStart, dateEnd);
- end = common.limitDate(createRange[1], dateStart, dateEnd);
- /**
- * @event TimeCreation#beforeCreateSchedule
- * @type {object}
- * @property {boolean} isAllDay - whether schedule is fired in allday view area?
- * @property {Date} start - select start time
- * @property {Date} end - select end time
- * @property {TimeCreationGuide} guide - TimeCreationGuide instance
- * @property {string} triggerEventName - event name
- */
- this.fire('beforeCreateSchedule', {
- isAllDay: false,
- start: new TZDate(start),
- end: new TZDate(end),
- guide: this.guide,
- triggerEventName: eventData.triggerEvent
- });
- };
- /**
- * Drag#dragEnd event handler
- * @emits TimeCreation#timeCreationDragend
- * @param {object} dragEndEventData - event data from Drag#dragend
- */
- TimeCreation.prototype._onDragEnd = function(dragEndEventData) {
- var self = this,
- dragStart = this._dragStart;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- /**
- * Function for manipulate event data before firing event
- * @param {object} eventData - event data
- */
- function reviseFunc(eventData) {
- var range = [
- dragStart.nearestGridTimeY,
- eventData.nearestGridTimeY
- ].sort(array.compare.num.asc);
- range[1].addMinutes(30);
- eventData.createRange = range;
- self._createSchedule(eventData);
- }
- /**
- * @event TimeCreation#timeCreationDragend
- * @type {object}
- * @property {Time} relatedView - time view instance related with mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {number[]} createRange - milliseconds range between drag start and end to create.
- */
- this._onDrag(dragEndEventData, 'timeCreationDragend', reviseFunc);
- this._dragStart = this._getScheduleDataFunc = null;
- };
- /**
- * Drag#click event handler
- * @emits TimeCreation#timeCreationClick
- * @param {object} clickEventData - event data from Drag#click.
- */
- TimeCreation.prototype._onClick = function(clickEventData) {
- var self = this;
- var condResult, getScheduleDataFunc, eventData;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd
- }, this);
- condResult = this.checkExpectedCondition(clickEventData.target);
- if (!condResult || this._disableClick) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(condResult);
- eventData = getScheduleDataFunc(clickEventData.originEvent);
- this._requestOnClick = true;
- setTimeout(function() {
- if (self._requestOnClick) {
- self.fire('timeCreationClick', eventData);
- self._createSchedule(eventData);
- }
- self._requestOnClick = false;
- }, CLICK_DELAY);
- this._dragStart = this._getScheduleDataFunc = null;
- };
- /**
- * Dblclick event handler
- * @param {MouseEvent} e - Native MouseEvent
- */
- TimeCreation.prototype._onDblClick = function(e) {
- var condResult, getScheduleDataFunc, eventData;
- condResult = this.checkExpectedCondition(e.target);
- if (!condResult) {
- return;
- }
- getScheduleDataFunc = this._retriveScheduleData(condResult);
- eventData = getScheduleDataFunc(e);
- this.fire('timeCreationClick', eventData);
- this._createSchedule(eventData);
- this._requestOnClick = false;
- };
- /**
- * Invoke creation click
- * @param {Schedule} schedule - schedule instance
- */
- TimeCreation.prototype.invokeCreationClick = function(schedule) {
- var opt = this.timeGridView.options,
- range = datetime.range(
- opt.renderStartDate,
- opt.renderEndDate,
- datetime.MILLISECONDS_PER_DAY),
- hourStart = opt.hourStart,
- targetDate = schedule.start;
- var eventData, timeView;
- util.forEach(range, function(date, index) {
- if (datetime.isSameDate(date, targetDate)) {
- timeView = this.timeGridView.children.toArray()[index];
- }
- }, this);
- // If start date is not in current date, set start date as first date.
- if (!timeView) {
- timeView = this.timeGridView.children.toArray()[0];
- }
- eventData = this._retriveScheduleDataFromDate(timeView, schedule.start, schedule.end, hourStart);
- this.fire('timeCreationClick', eventData);
- this._createSchedule(eventData);
- };
- timeCore.mixin(TimeCreation);
- util.CustomEvents.mixin(TimeCreation);
- module.exports = TimeCreation;
- /***/ }),
- /***/ "./src/js/handler/time/creationGuide.js":
- /*!**********************************************!*\
- !*** ./src/js/handler/time/creationGuide.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Module for Time.Creation effect while dragging.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var MIN60 = (datetime.MILLISECONDS_PER_MINUTES * 60);
- /**
- * Class for Time.Creation dragging effect.
- * @constructor
- * @param {TimeCreation} timeCreation - instance of TimeCreation.
- */
- function TimeCreationGuide(timeCreation) {
- /**
- * Guide element for creation effect.
- * @type {HTMLElement}
- */
- this.guideElement = global.document.createElement('div');
- /**
- * @type {HTMLDivElement}
- */
- this.guideTimeElement = domutil.appendHTMLElement(
- 'span',
- this.guideElement,
- config.classname('time-guide-creation-label')
- );
- domutil.addClass(this.guideElement, config.classname('time-guide-creation'));
- /**
- * @type {TimeCreation}
- */
- this.timeCreation = timeCreation;
- /**
- * @type {array}
- */
- this._styleUnit = null;
- /**
- * @type {array}
- */
- this._styleStart = null;
- /**
- * @type {function}
- */
- this._styleFunc = null;
- timeCreation.on({
- timeCreationDragstart: this._createGuideElement,
- timeCreationDrag: this._onDrag,
- timeCreationClick: this._createGuideElement
- }, this);
- this.applyTheme(timeCreation.baseController.theme);
- }
- /**
- * Destroy method.
- */
- TimeCreationGuide.prototype.destroy = function() {
- this.clearGuideElement();
- this.timeCreation.off(this);
- this.timeCreation = this._styleUnit = this._styleStart =
- this._styleFunc = this.guideElement = this.guideTimeElement = null;
- };
- /**
- * Clear guide element.
- */
- TimeCreationGuide.prototype.clearGuideElement = function() {
- var guideElement = this.guideElement,
- timeElement = this.guideTimeElement;
- domutil.remove(guideElement);
- reqAnimFrame.requestAnimFrame(function() {
- guideElement.style.display = 'none';
- guideElement.style.top = '';
- guideElement.style.height = '';
- timeElement.innerHTML = '';
- });
- };
- /**
- * Refresh guide element
- * @param {number} top - The number of guide element's style top
- * @param {number} height - The number of guide element's style height
- * @param {TZDate} start - start time of schedule to create
- * @param {TZDate} end - end time of schedule to create
- * @param {boolean} bottomLabel - is label need to render bottom of guide element?
- */
- TimeCreationGuide.prototype._refreshGuideElement = function(top, height, start, end, bottomLabel) {
- var guideElement = this.guideElement;
- var timeElement = this.guideTimeElement;
- guideElement.style.top = top + 'px';
- guideElement.style.height = height + 'px';
- guideElement.style.display = 'block';
- timeElement.innerHTML = datetime.format(start, 'HH:mm') +
- ' - ' + datetime.format(end, 'HH:mm');
- if (bottomLabel) {
- domutil.removeClass(timeElement, config.classname('time-guide-bottom'));
- } else {
- domutil.addClass(timeElement, config.classname('time-guide-bottom'));
- }
- };
- /**
- * Get unit data of calculating new style of guide element by user interaction
- * @param {Time} relatedView - time view instance related with schedule
- * @returns {array} unit data.
- */
- TimeCreationGuide.prototype._getUnitData = function(relatedView) {
- var viewOpt = relatedView.options,
- viewHeight = relatedView.getViewBound().height,
- hourLength = viewOpt.hourEnd - viewOpt.hourStart,
- todayStart = datetime.parse(viewOpt.ymd),
- todayEnd = datetime.getStartOfNextDay(todayStart);
- todayStart.setHours(0, 0, 0, 0);
- todayStart.setHours(viewOpt.hourStart);
- // [0] height of view
- // [1] hour length of view
- // [2] start time of view
- // [3] end time of view
- // [4] height of view for one hour
- return [
- viewHeight,
- hourLength,
- todayStart,
- todayEnd,
- viewHeight / hourLength
- ];
- };
- /**
- * Applying limitation to supplied data and return it.
- * @param {number} top - top pixel of guide element
- * @param {number} height - height pixel of guide element
- * @param {TZDate} start - relative time value of dragstart point
- * @param {TZDate} end - relative time value of dragend point
- * @returns {array} limited style data
- */
- TimeCreationGuide.prototype._limitStyleData = function(top, height, start, end) {
- var unitData = this._styleUnit;
- top = common.limit(top, [0], [unitData[0]]);
- height = common.limit(top + height, [0], [unitData[0]]) - top;
- start = common.limitDate(start, unitData[2], unitData[3]);
- end = common.limitDate(end, unitData[2], unitData[3]);
- return [top, height, start, end];
- };
- /**
- * Get function to calculate guide element UI data from supplied units
- * @param {number} viewHeight - total height of view's container element
- * @param {number} hourLength - hour length that rendered in time view
- * @param {TZDate} todayStart - time for view's start date
- * @returns {function} UI data calculator function
- */
- TimeCreationGuide.prototype._getStyleDataFunc = function(viewHeight, hourLength, todayStart) {
- var todayStartTime = todayStart;
- var todayEndTime = datetime.end(todayStart);
- /**
- * Get top, time value from schedule data
- * @param {object} scheduleData - schedule data object
- * @returns {number[]} top, time
- */
- function getStyleData(scheduleData) {
- var minMinutes = 30;
- var gridY = scheduleData.nearestGridY,
- gridTimeY = scheduleData.nearestGridTimeY,
- gridEndTimeY = scheduleData.nearestGridEndTimeY || new TZDate(gridTimeY).addMinutes(minMinutes),
- top, startTime, endTime;
- top = common.limit(ratio(hourLength, viewHeight, gridY), [0], [viewHeight]);
- startTime = common.limitDate(gridTimeY, todayStartTime, todayEndTime);
- endTime = common.limitDate(gridEndTimeY, todayStartTime, todayEndTime);
- return [top, startTime, endTime];
- }
- return getStyleData;
- };
- /**
- * DragStart event handler
- * @param {object} dragStartEventData - dragStart schedule data.
- */
- TimeCreationGuide.prototype._createGuideElement = function(dragStartEventData) {
- var relatedView = dragStartEventData.relatedView,
- hourStart = datetime.millisecondsFrom('hour', dragStartEventData.hourStart) || 0,
- unitData, styleFunc, styleData, result, top, height, start, end;
- unitData = this._styleUnit = this._getUnitData(relatedView);
- styleFunc = this._styleFunc = this._getStyleDataFunc.apply(this, unitData);
- styleData = this._styleStart = styleFunc(dragStartEventData);
- start = new TZDate(styleData[1]).addMinutes(datetime.minutesFromHours(hourStart));
- end = new TZDate(styleData[2]).addMinutes(datetime.minutesFromHours(hourStart));
- top = styleData[0];
- height = (unitData[4] * (end - start) / MIN60);
- result = this._limitStyleData(
- top,
- height,
- start,
- end
- );
- this._refreshGuideElement.apply(this, result);
- relatedView.container.appendChild(this.guideElement);
- };
- /**
- * Drag event handler
- * @param {object} dragEventData - drag schedule data.
- */
- TimeCreationGuide.prototype._onDrag = function(dragEventData) {
- var minutes30 = 30;
- var styleFunc = this._styleFunc,
- unitData = this._styleUnit,
- startStyle = this._styleStart,
- refreshGuideElement = this._refreshGuideElement.bind(this),
- heightOfHalfHour,
- endStyle,
- result;
- if (!styleFunc || !unitData || !startStyle) {
- return;
- }
- heightOfHalfHour = (unitData[4] / 2);
- endStyle = styleFunc(dragEventData);
- if (endStyle[0] > startStyle[0]) {
- result = this._limitStyleData(
- startStyle[0],
- (endStyle[0] - startStyle[0]) + heightOfHalfHour,
- startStyle[1],
- new TZDate(endStyle[1]).addMinutes(minutes30)
- );
- } else {
- result = this._limitStyleData(
- endStyle[0],
- (startStyle[0] - endStyle[0]) + heightOfHalfHour,
- endStyle[1],
- new TZDate(startStyle[1]).addMinutes(minutes30)
- );
- result.push(true);
- }
- reqAnimFrame.requestAnimFrame(function() {
- refreshGuideElement.apply(null, result);
- });
- };
- TimeCreationGuide.prototype.applyTheme = function(theme) {
- var style = this.guideElement.style;
- var timeStyle = this.guideTimeElement.style;
- // block
- style.backgroundColor = theme.common.creationGuide.backgroundColor;
- style.border = theme.common.creationGuide.border;
- // label
- timeStyle.color = theme.week.creationGuide.color;
- timeStyle.fontSize = theme.week.creationGuide.fontSize;
- timeStyle.fontWeight = theme.week.creationGuide.fontWeight;
- };
- module.exports = TimeCreationGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/time/move.js":
- /*!*************************************!*\
- !*** ./src/js/handler/time/move.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Handling move schedules from drag handler and time grid view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
- var TimeMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/time/moveGuide.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes timeCore
- * @mixes util.CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
- * @param {Base} [baseController] - Base controller instance.
- */
- function TimeMove(dragHandler, timeGridView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {TimeGrid}
- */
- this.timeGridView = timeGridView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {function}
- */
- this._getScheduleDataFunc = null;
- /**
- * @type {object}
- */
- this._dragStart = null;
- /**
- * @type {TimeMoveGuide}
- */
- this._guide = new TimeMoveGuide(this);
- dragHandler.on('dragStart', this._onDragStart, this);
- dragHandler.on('mousedown', this._onMouseDown, this);
- }
- /**
- * Destroy method.
- */
- TimeMove.prototype.destroy = function() {
- this._guide.destroy();
- this.dragHandler.off(this);
- this.dragHandler = this.timeGridView = this.baseController =
- this._getScheduleDataFunc = this._dragStart = this._guide = null;
- };
- /**
- * Check target element is expected condition for activate this plugins.
- * @param {HTMLElement} target - The element to check
- * @returns {boolean|object} - return object when satiate condition.
- */
- TimeMove.prototype.checkExpectCondition = function(target) {
- if (!domutil.closest(target, config.classname('.time-schedule'))) {
- return false;
- }
- return this._getTimeView(target);
- };
- /**
- * Get Time view container from supplied element.
- * @param {HTMLElement} target - element to find time view container.
- * @returns {object|boolean} - return time view instance when finded.
- */
- TimeMove.prototype._getTimeView = function(target) {
- var container = domutil.closest(target, config.classname('.time-date')),
- matches;
- if (!container) {
- return false;
- }
- matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.timeGridView.children.items, Number(matches[1]));
- };
- /**
- * @emits TimeMove#mousedown
- * @param {object} mouseDownEventData - Drag#mousedown schedule data.
- */
- TimeMove.prototype._onMouseDown = function(mouseDownEventData) {
- var target = mouseDownEventData.target,
- timeView = this.checkExpectCondition(target),
- blockElement = domutil.closest(target, config.classname('.time-date-schedule-block'));
- if (!timeView || !blockElement) {
- return;
- }
- // EventTarget.target is not changed in mousemove event even if mouse is over the other element.
- // It's different with other browsers(IE, Chrome, Safari)
- if (util.browser.firefox) {
- domevent.preventDefault(mouseDownEventData.originEvent);
- }
- };
- /**
- * @emits TimeMove#timeMoveDragstart
- * @param {object} dragStartEventData - Drag#dragStart schedule data.
- */
- TimeMove.prototype._onDragStart = function(dragStartEventData) {
- var target = dragStartEventData.target,
- timeView = this.checkExpectCondition(target),
- blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
- getScheduleDataFunc,
- scheduleData,
- ctrl = this.baseController,
- targetModelID,
- targetModel;
- if (!timeView || !blockElement) {
- return;
- }
- targetModelID = domutil.getData(blockElement, 'id');
- targetModel = ctrl.schedules.items[targetModelID];
- if (targetModel.isReadOnly) {
- return;
- }
- getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(timeView);
- scheduleData = this._dragStart = getScheduleDataFunc(
- dragStartEventData.originEvent, {
- targetModelID: targetModelID,
- model: targetModel
- }
- );
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- /**
- * @event TimeMove#timeMoveDragstart
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- * @property {Schedule} model - model instance
- */
- this.fire('timeMoveDragstart', scheduleData);
- };
- /**
- * @emits TimeMove#timeMoveDrag
- * @param {MouseEvent} dragEventData - mousemove event object
- * @param {string} [overrideEventName] - name of emitting event to override.
- * @param {function} [revise] - supply function for revise schedule data before emit.
- */
- TimeMove.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- timeView = this._getTimeView(dragEventData.target),
- dragStart = this._dragStart,
- scheduleData;
- if (!timeView || !getScheduleDataFunc || !dragStart) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEventData.originEvent, {
- currentView: timeView,
- targetModelID: dragStart.targetModelID
- });
- if (revise) {
- revise(scheduleData);
- }
- /**
- * @event TimeMove#timeMoveDrag
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with drag start position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {Time} currentView - time view instance related with current mouse position.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- */
- this.fire(overrideEventName || 'timeMoveDrag', scheduleData);
- };
- /**
- * Update model instance by dragend event results.
- * @fires TimeMove#beforeUpdateSchedule
- * @param {object} scheduleData - schedule data from TimeMove#timeMoveDragend
- */
- TimeMove.prototype._updateSchedule = function(scheduleData) {
- var ctrl = this.baseController,
- modelID = scheduleData.targetModelID,
- range = scheduleData.nearestRange,
- timeDiff = range[1] - range[0],
- dateDiff = 0,
- schedule = ctrl.schedules.items[modelID],
- relatedView = scheduleData.relatedView,
- currentView = scheduleData.currentView,
- newStarts,
- newEnds;
- if (!schedule || !currentView) {
- return;
- }
- timeDiff -= datetime.millisecondsFrom('minutes', 30);
- newStarts = new TZDate(schedule.getStarts()).addMilliseconds(timeDiff);
- newEnds = new TZDate(schedule.getEnds()).addMilliseconds(timeDiff);
- if (currentView) {
- dateDiff = currentView.getDate() - relatedView.getDate();
- }
- newStarts.addMilliseconds(dateDiff);
- newEnds.addMilliseconds(dateDiff);
- /**
- * @event TimeMove#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - start and end time to update
- * @property {Date} start - start time to update
- * @property {Date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: {
- start: newStarts,
- end: newEnds
- },
- start: newStarts,
- end: newEnds
- });
- };
- /**
- * @emits TimeMove#timeMoveDragend
- * @param {MouseEvent} dragEndEventData - mouseup mouse event object.
- */
- TimeMove.prototype._onDragEnd = function(dragEndEventData) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- currentView = this._getTimeView(dragEndEventData.target),
- dragStart = this._dragStart,
- scheduleData;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- if (!getScheduleDataFunc || !dragStart) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEndEventData.originEvent, {
- currentView: currentView,
- targetModelID: dragStart.targetModelID
- });
- scheduleData.range = [
- dragStart.timeY,
- new TZDate(scheduleData.timeY).addMinutes(30)
- ];
- scheduleData.nearestRange = [
- dragStart.nearestGridTimeY,
- new TZDate(scheduleData.nearestGridTimeY).addMinutes(30)
- ];
- this._updateSchedule(scheduleData);
- /**
- * @event TimeMove#timeMoveDragend
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with drag start position.
- * @property {Time} currentView - time view instance related with current mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- * @property {number[]} range - milliseconds range between drag start and end.
- * @property {number[]} nearestRange - milliseconds range related with nearestGridY between start and end.
- */
- this.fire('timeMoveDragend', scheduleData);
- };
- /**
- * @emits TimeMove#timeMoveClick
- * @param {MouseEvent} clickEventData - click mouse event object.
- */
- TimeMove.prototype._onClick = function(clickEventData) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- dragStart = this._dragStart,
- scheduleData;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- if (!getScheduleDataFunc || !dragStart) {
- return;
- }
- scheduleData = getScheduleDataFunc(clickEventData.originEvent, {
- targetModelID: dragStart.targetModelID
- });
- /**
- * @event TimeMove#timeMoveClick
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with drag start position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- */
- this.fire('timeMoveClick', scheduleData);
- };
- timeCore.mixin(TimeMove);
- util.CustomEvents.mixin(TimeMove);
- module.exports = TimeMove;
- /***/ }),
- /***/ "./src/js/handler/time/moveGuide.js":
- /*!******************************************!*\
- !*** ./src/js/handler/time/moveGuide.js ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Module for Time.Move effect while dragging.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
- var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
- var tmpl = __webpack_require__(/*! ../../view/template/week/timeMoveGuide.hbs */ "./src/js/view/template/week/timeMoveGuide.hbs");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var Schedule = __webpack_require__(/*! ../../model/schedule */ "./src/js/model/schedule.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
- /**
- * Class for Time.Move effect.
- * @constructor
- * @param {TimeMove} timeMove - The instance of TimeMove.
- */
- function TimeMoveGuide(timeMove) {
- /**
- * @type {FloatingLayer}
- */
- this._guideLayer = null;
- /**
- * @Type {Schedule}
- */
- this._model = null;
- /**
- * @type {object}
- */
- this._viewModel = null;
- /**
- * @type {object}
- */
- this._lastDrag = null;
- /**
- * @type {HTMLElement}
- */
- this.guideElement = null;
- /**
- * @type {TimeMove}
- */
- this.timeMove = timeMove;
- /**
- * @type {HTMLElement}
- */
- this._container = null;
- /**
- * @type {function}
- */
- this._getTopFunc = null;
- /**
- * @type {number}
- */
- this._startGridY = 0;
- /**
- * @type {number}
- */
- this._startTopPixel = 0;
- timeMove.on({
- 'timeMoveDragstart': this._onDragStart,
- 'timeMoveDrag': this._onDrag,
- 'timeMoveDragend': this._clearGuideElement,
- 'timeMoveClick': this._clearGuideElement
- }, this);
- }
- /**
- * Destroy method
- */
- TimeMoveGuide.prototype.destroy = function() {
- this._clearGuideElement();
- this.timeMove.off(this);
- if (this._guideLayer) {
- this._guideLayer.destroy();
- }
- this.guideElement = this.timeMove = this._container = this._guideLayer = this._lastDrag =
- this._getTopFunc = this._startGridY = this._startTopPixel = this._viewModel = null;
- };
- /**
- * Clear guide element.
- */
- TimeMoveGuide.prototype._clearGuideElement = function() {
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('dragging'));
- }
- if (this._guideLayer) {
- this._guideLayer.destroy();
- }
- this._showOriginScheduleBlocks();
- this.guideElement = this._getTopFunc = this._guideLayer = this._model = this._lastDrag =
- this._startGridY = this._startTopPixel = this._viewModel = null;
- };
- /**
- * Dim element blocks
- * @param {number} modelID - Schedule model instance ID
- */
- TimeMoveGuide.prototype._hideOriginScheduleBlocks = function() {
- var className = config.classname('time-date-schedule-block-dragging-dim');
- if (this.guideElement) {
- domutil.addClass(this.guideElement, className);
- }
- };
- /**
- * Show element blocks
- */
- TimeMoveGuide.prototype._showOriginScheduleBlocks = function() {
- var className = config.classname('time-date-schedule-block-dragging-dim');
- if (this.guideElement) {
- domutil.removeClass(this.guideElement, className);
- }
- };
- /**
- * Refresh guide element
- * @param {string} top - guide element's style top.
- * @param {Schedule} model - updated model
- * @param {object} viewModel - view model
- */
- TimeMoveGuide.prototype._refreshGuideElement = function(top, model, viewModel) {
- var self = this;
- reqAnimFrame.requestAnimFrame(function() {
- if (!self._guideLayer) {
- return;
- }
- self._guideLayer.setPosition(0, top);
- self._guideLayer.setContent(tmpl(util.extend({model: model}, viewModel)));
- });
- };
- /**
- * TimeMove#timeMoveDragstart event handler
- * @param {object} dragStartEventData - dragstart event data
- */
- TimeMoveGuide.prototype._onDragStart = function(dragStartEventData) {
- var guideElement = domutil.closest(
- dragStartEventData.target,
- config.classname('.time-date-schedule-block')
- );
- var duration, modelDuration, goingDuration, comingDuration;
- if (!guideElement) {
- return;
- }
- this._startTopPixel = parseFloat(guideElement.style.top);
- this._startGridY = dragStartEventData.nearestGridY;
- this.guideElement = guideElement;
- this._container = dragStartEventData.relatedView.container;
- this._model = util.extend(
- Schedule.create(dragStartEventData.model),
- dragStartEventData.model
- );
- modelDuration = this._model.duration();
- modelDuration = modelDuration > SCHEDULE_MIN_DURATION ? modelDuration : SCHEDULE_MIN_DURATION;
- goingDuration = datetime.millisecondsFrom('minutes', this._model.goingDuration);
- comingDuration = datetime.millisecondsFrom('minutes', this._model.comingDuration);
- duration = goingDuration + modelDuration + comingDuration;
- this._lastDrag = dragStartEventData;
- this._viewModel = {
- hasGoingDuration: goingDuration > 0,
- hasComingDuration: comingDuration > 0,
- goingDurationHeight: common.ratio(duration, goingDuration, 100),
- modelDurationHeight: common.ratio(duration, modelDuration, 100),
- comingDurationHeight: common.ratio(duration, comingDuration, 100)
- };
- this._resetGuideLayer();
- this._hideOriginScheduleBlocks();
- };
- /**
- * TimeMove#timeMoveDrag event handler
- * @param {object} dragEventData - drag event data
- */
- TimeMoveGuide.prototype._onDrag = function(dragEventData) {
- var timeView = dragEventData.currentView,
- viewOptions = timeView.options,
- viewHeight = timeView.getViewBound().height,
- guideHeight = parseFloat(this.guideElement.style.height),
- hourLength = viewOptions.hourEnd - viewOptions.hourStart,
- gridYOffset = dragEventData.nearestGridY - this._startGridY,
- gridYOffsetPixel = ratio(hourLength, viewHeight, gridYOffset),
- gridDiff = dragEventData.nearestGridY - this._lastDrag.nearestGridY,
- bottomLimit,
- top;
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('dragging'));
- }
- if (this._container !== timeView.container) {
- this._container = timeView.container;
- this._resetGuideLayer();
- }
- top = this._startTopPixel + gridYOffsetPixel;
- bottomLimit = viewHeight - guideHeight;
- top = Math.max(top, 0);
- top = Math.min(top, bottomLimit);
- // update time
- this._model.start = new TZDate(this._model.getStarts()).addMinutes(datetime.minutesFromHours(gridDiff));
- this._model.end = new TZDate(this._model.getEnds()).addMinutes(datetime.minutesFromHours(gridDiff));
- this._lastDrag = dragEventData;
- this._refreshGuideElement(top, this._model, this._viewModel);
- };
- TimeMoveGuide.prototype._resetGuideLayer = function() {
- if (this._guideLayer) {
- this._guideLayer.destroy();
- this._guideLayer = null;
- }
- this._guideLayer = new FloatingLayer(null, this._container);
- this._guideLayer.setSize(this._container.getBoundingClientRect().width, this.guideElement.style.height);
- this._guideLayer.setPosition(0, this.guideElement.style.top);
- this._guideLayer.setContent(tmpl(util.extend({model: this._model}, this._viewModel)));
- this._guideLayer.show();
- };
- module.exports = TimeMoveGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/handler/time/resize.js":
- /*!***************************************!*\
- !*** ./src/js/handler/time/resize.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Handling resize schedules from drag handler and time grid view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
- var TimeResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/time/resizeGuide.js");
- /**
- * @constructor
- * @implements {Handler}
- * @mixes timeCore
- * @mixes util.CustomEvents
- * @param {Drag} [dragHandler] - Drag handler instance.
- * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
- * @param {Base} [baseController] - Base controller instance.
- */
- function TimeResize(dragHandler, timeGridView, baseController) {
- /**
- * @type {Drag}
- */
- this.dragHandler = dragHandler;
- /**
- * @type {TimeGrid}
- */
- this.timeGridView = timeGridView;
- /**
- * @type {Base}
- */
- this.baseController = baseController;
- /**
- * @type {function}
- */
- this._getScheduleDataFunc = null;
- /**
- * @type {object}
- */
- this._dragStart = null;
- /**
- * @type {TimeResizeGuide}
- */
- this._guide = new TimeResizeGuide(this);
- dragHandler.on('dragStart', this._onDragStart, this);
- }
- /**
- * Destroy method
- */
- TimeResize.prototype.destroy = function() {
- this._guide.destroy();
- this.dragHandler.off(this);
- this.dragHandler = this.timeGridView = this.baseController =
- this._getScheduleDataFunc = this._dragStart = this._guide = null;
- };
- /**
- * @param {HTMLElement} target - element to check condition.
- * @returns {object|boolean} - return time view instance or false
- */
- TimeResize.prototype.checkExpectCondition = function(target) {
- var container,
- matches;
- if (!domutil.hasClass(target, config.classname('time-resize-handle'))) {
- return false;
- }
- container = domutil.closest(target, config.classname('.time-date'));
- if (!container) {
- return false;
- }
- matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
- if (!matches || matches.length < 2) {
- return false;
- }
- return util.pick(this.timeGridView.children.items, Number(matches[1]));
- };
- /**
- * @emits TimeResize#timeResizeDragstart
- * @param {object} dragStartEventData - event data of Drag#dragstart
- */
- TimeResize.prototype._onDragStart = function(dragStartEventData) {
- var target = dragStartEventData.target,
- timeView = this.checkExpectCondition(target),
- blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
- ctrl = this.baseController,
- targetModelID,
- getScheduleDataFunc,
- scheduleData;
- if (!timeView || !blockElement) {
- return;
- }
- targetModelID = domutil.getData(blockElement, 'id');
- getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(timeView);
- scheduleData = this._dragStart = getScheduleDataFunc(
- dragStartEventData.originEvent, {
- targetModelID: targetModelID,
- schedule: ctrl.schedules.items[targetModelID]
- }
- );
- this.dragHandler.on({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- /**
- * @event TimeResize#timeResizeDragstart
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with mouse position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- * @property {Schedule} schedule - schedule data
- */
- this.fire('timeResizeDragstart', scheduleData);
- };
- /**
- * Drag#drag event handler
- * @emits TimeResize#timeResizeDrag
- * @param {object} dragEventData - event data of Drag#drag custom event.
- * @param {string} [overrideEventName] - override emitted event name when supplied.
- * @param {function} [revise] - supply function for revise schedule data before emit.
- */
- TimeResize.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- startScheduleData = this._dragStart,
- scheduleData;
- if (!getScheduleDataFunc || !startScheduleData) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEventData.originEvent, {
- targetModelID: startScheduleData.targetModelID
- });
- if (revise) {
- revise(scheduleData);
- }
- /**
- * @event TimeResize#timeResizeDrag
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with drag start position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- */
- this.fire(overrideEventName || 'timeResizeDrag', scheduleData);
- };
- /**
- * Update model instance by dragend event results.
- * @fires TimeResize#beforeUpdateSchedule
- * @param {object} scheduleData - schedule data from TimeResize#timeResizeDragend
- */
- TimeResize.prototype._updateSchedule = function(scheduleData) {
- var ctrl = this.baseController,
- modelID = scheduleData.targetModelID,
- range = scheduleData.nearestRange,
- timeDiff = range[1] - range[0],
- schedule = ctrl.schedules.items[modelID],
- relatedView = scheduleData.relatedView,
- dateEnd,
- newEnds,
- baseDate;
- var changes;
- if (!schedule) {
- return;
- }
- timeDiff -= datetime.millisecondsFrom('minutes', 30);
- baseDate = new TZDate(relatedView.getDate());
- dateEnd = datetime.end(baseDate);
- newEnds = new TZDate(schedule.getEnds()).addMilliseconds(timeDiff);
- if (newEnds > dateEnd) {
- newEnds = new TZDate(dateEnd);
- }
- if (newEnds.getTime() - schedule.getStarts().getTime() < datetime.millisecondsFrom('minutes', 30)) {
- newEnds = new TZDate(schedule.getStarts()).addMinutes(30);
- }
- changes = common.getScheduleChanges(
- schedule,
- ['end'],
- {end: newEnds}
- );
- /**
- * @event TimeResize#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - The original schedule instance
- * @property {Date} start - Deprecated: start time to update
- * @property {Date} end - Deprecated: end time to update
- * @property {object} changes - end time to update
- * @property {date} end - end time to update
- */
- this.fire('beforeUpdateSchedule', {
- schedule: schedule,
- changes: changes,
- start: schedule.getStarts(),
- end: newEnds
- });
- };
- /**
- * Drag#dragEnd event handler
- * @emits TimeResize#timeResizeDragend
- * @param {MouseEvent} dragEndEventData - Mouse event of Drag#dragEnd custom event.
- */
- TimeResize.prototype._onDragEnd = function(dragEndEventData) {
- var getScheduleDataFunc = this._getScheduleDataFunc,
- dragStart = this._dragStart,
- scheduleData;
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- if (!getScheduleDataFunc || !dragStart) {
- return;
- }
- scheduleData = getScheduleDataFunc(dragEndEventData.originEvent, {
- targetModelID: dragStart.targetModelID
- });
- scheduleData.range = [
- dragStart.timeY,
- new TZDate(scheduleData.timeY).addMinutes(30)
- ];
- scheduleData.nearestRange = [
- dragStart.nearestGridTimeY,
- scheduleData.nearestGridTimeY.addMinutes(30)
- ];
- this._updateSchedule(scheduleData);
- /**
- * @event TimeResize#timeResizeDragend
- * @type {object}
- * @property {HTMLElement} target - current target in mouse event object.
- * @property {Time} relatedView - time view instance related with drag start position.
- * @property {MouseEvent} originEvent - mouse event object.
- * @property {number} mouseY - mouse Y px mouse event.
- * @property {number} gridY - grid Y index value related with mouseY value.
- * @property {number} timeY - milliseconds value of mouseY points.
- * @property {number} nearestGridY - nearest grid index related with mouseY value.
- * @property {number} nearestGridTimeY - time value for nearestGridY.
- * @property {string} targetModelID - The model unique id emitted move schedule.
- * @property {number[]} range - milliseconds range between drag start and end.
- * @property {number[]} nearestRange - milliseconds range related with nearestGridY between start and end.
- */
- this.fire('timeResizeDragend', scheduleData);
- this._getScheduleDataFunc = this._dragStart = null;
- };
- /**
- * @emits TimeResize#timeResizeClick
- */
- TimeResize.prototype._onClick = function() {
- this.dragHandler.off({
- drag: this._onDrag,
- dragEnd: this._onDragEnd,
- click: this._onClick
- }, this);
- /**
- * @event TimeResize#timeResizeClick
- */
- this.fire('timeResizeClick');
- };
- timeCore.mixin(TimeResize);
- util.CustomEvents.mixin(TimeResize);
- module.exports = TimeResize;
- /***/ }),
- /***/ "./src/js/handler/time/resizeGuide.js":
- /*!********************************************!*\
- !*** ./src/js/handler/time/resizeGuide.js ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * @fileoverview Module for Time.Resize effect while dragging.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- /**
- * Class for Time.Resize effect.
- * @constructor
- * @param {TimeResize} timeResize - the instance of TimeResize handler.
- */
- function TimeResizeGuide(timeResize) {
- /**
- * @type {HTMLElement}
- */
- this.guideElement = null;
- /**
- * @type {TimeResize}
- */
- this.timeResize = timeResize;
- /**
- * @type {function}
- */
- this._getTopFunc = null;
- /**
- * @type {HTMLElement}
- */
- this._originScheduleElement = null;
- /**
- * @type {number}
- */
- this._startTopPixel = 0;
- /**
- * @type {number}
- */
- this._startHeightPixel = 0;
- /**
- * @type {number}
- */
- this._startGridY = 0;
- /**
- * @type {Schedule}
- */
- this._schedule = null;
- timeResize.on({
- 'timeResizeDragstart': this._onDragStart,
- 'timeResizeDrag': this._onDrag,
- 'timeResizeDragend': this._clearGuideElement,
- 'timeResizeClick': this._clearGuideElement
- }, this);
- }
- /**
- * Destroy method
- */
- TimeResizeGuide.prototype.destroy = function() {
- this._clearGuideElement();
- this.timeResize.off(this);
- this.guideElement = this.timeResize = this._getTopFunc =
- this._originScheduleElement = this._startHeightPixel =
- this._startGridY = this._startTopPixel = null;
- };
- /**
- * Clear guide element.
- */
- TimeResizeGuide.prototype._clearGuideElement = function() {
- var guideElement = this.guideElement,
- originElement = this._originScheduleElement;
- if (!util.browser.msie) {
- domutil.removeClass(global.document.body, config.classname('resizing'));
- }
- if (originElement) {
- originElement.style.display = 'block';
- }
- domutil.remove(guideElement);
- this.guideElement = this._getTopFunc = this._originScheduleElement =
- this._startHeightPixel = this._startGridY = this._startTopPixel = null;
- };
- /**
- * Refresh guide element
- * @param {number} guideHeight - guide element's style height.
- * @param {number} minTimeHeight - time element's min height
- * @param {number} timeHeight - time element's height.
- */
- TimeResizeGuide.prototype._refreshGuideElement = function(guideHeight, minTimeHeight, timeHeight) {
- var guideElement = this.guideElement;
- var timeElement;
- if (!guideElement) {
- return;
- }
- timeElement = domutil.find(config.classname('.time-schedule-content-time'), guideElement);
- reqAnimFrame.requestAnimFrame(function() {
- guideElement.style.height = guideHeight + 'px';
- guideElement.style.display = 'block';
- if (timeElement) {
- timeElement.style.height = timeHeight + 'px';
- timeElement.style.minHeight = minTimeHeight + 'px';
- }
- });
- };
- /**
- * TimeMove#timeMoveDragstart event handler
- * @param {object} dragStartEventData - dragstart event data
- */
- TimeResizeGuide.prototype._onDragStart = function(dragStartEventData) {
- var originElement = domutil.closest(
- dragStartEventData.target,
- config.classname('.time-date-schedule-block')
- ),
- schedule = dragStartEventData.schedule,
- guideElement;
- if (!util.browser.msie) {
- domutil.addClass(global.document.body, config.classname('resizing'));
- }
- if (!originElement || !schedule) {
- return;
- }
- this._startGridY = dragStartEventData.nearestGridY;
- this._startHeightPixel = parseFloat(originElement.style.height);
- this._startTopPixel = parseFloat(originElement.style.top);
- this._originScheduleElement = originElement;
- this._schedule = schedule;
- guideElement = this.guideElement = originElement.cloneNode(true);
- domutil.addClass(guideElement, config.classname('time-guide-resize'));
- originElement.style.display = 'none';
- dragStartEventData.relatedView.container.appendChild(guideElement);
- };
- /**
- * @param {object} dragEventData - event data from Drag#drag.
- */
- TimeResizeGuide.prototype._onDrag = function(dragEventData) {
- var timeView = dragEventData.relatedView,
- viewOptions = timeView.options,
- viewHeight = timeView.getViewBound().height,
- hourLength = viewOptions.hourEnd - viewOptions.hourStart,
- guideElement = this.guideElement,
- guideTop = parseFloat(guideElement.style.top),
- gridYOffset = dragEventData.nearestGridY - this._startGridY,
- // hourLength : viewHeight = gridYOffset : X;
- gridYOffsetPixel = ratio(hourLength, viewHeight, gridYOffset),
- goingDuration = this._schedule.goingDuration,
- modelDuration = this._schedule.duration() / datetime.MILLISECONDS_PER_MINUTES,
- comingDuration = this._schedule.comingDuration,
- minutesLength = hourLength * 60,
- timeHeight,
- timeMinHeight,
- minHeight,
- maxHeight,
- height;
- height = (this._startHeightPixel + gridYOffsetPixel);
- // at least large than 30min from schedule start time.
- minHeight = guideTop + ratio(hourLength, viewHeight, 0.5);
- minHeight -= this._startTopPixel;
- timeMinHeight = minHeight;
- minHeight += ratio(minutesLength, viewHeight, goingDuration) + ratio(minutesLength, viewHeight, comingDuration);
- // smaller than 24h
- maxHeight = viewHeight - guideTop;
- height = Math.max(height, minHeight);
- height = Math.min(height, maxHeight);
- timeHeight = ratio(minutesLength, viewHeight, modelDuration) + gridYOffsetPixel;
- this._refreshGuideElement(height, timeMinHeight, timeHeight);
- };
- module.exports = TimeResizeGuide;
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "./src/js/model/schedule.js":
- /*!**********************************!*\
- !*** ./src/js/model/schedule.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint complexity: 0 */
- /**
- * @fileoverview Model of schedule.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
- var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
- var dirty = __webpack_require__(/*! ../common/dirty */ "./src/js/common/dirty.js");
- var model = __webpack_require__(/*! ../common/model */ "./src/js/common/model.js");
- var TZDate = tz.Date;
- var MIN_TO_MS = 60 * 1000;
- var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
- /**
- * Schedule category
- * @readonly
- * @enum {string}
- */
- var SCHEDULE_CATEGORY = {
- /** milestone */
- MILESTONE: 'milestone',
- /** task */
- TASK: 'task',
- /** all-day schedule */
- ALLDAY: 'allday',
- /** normal schedule */
- TIME: 'time'
- };
- /**
- * Get duration by primary timezone
- * @param {Date} start render start date
- * @param {Date} end render end date
- * @returns {number} duration
- */
- function getDurationByPrimaryTimezone(start, end) {
- var checkOffset = tz.isDifferentOffsetStartAndEndTime(start.getTime(), end.getTime());
- var isOffsetChanged = checkOffset.isOffsetChanged;
- var duration = end - start;
- if (isOffsetChanged !== 0) {
- duration += checkOffset.offsetDiff * MIN_TO_MS;
- }
- return duration;
- }
- /**
- * Get duration by native timezone
- * @param {TZDate} start render start date
- * @param {TZDate} end render end date
- * @returns {number} duration
- */
- function getDurationByNativeTimezone(start, end) {
- var startOffset = start.toDate().getTimezoneOffset();
- var endOffset = end.toDate().getTimezoneOffset();
- return (end - start) + ((endOffset - startOffset) * MIN_TO_MS);
- }
- /**
- * The model of calendar schedules.
- * @constructor
- * @mixes dirty
- * @mixes model
- */
- function Schedule() {
- /**
- * `Optional` unique id for various use.
- * @type {string}
- */
- this.id = '';
- /**
- * title for schedule.
- * @type {string}
- */
- this.title = '';
- /**
- * body for schedule.
- * @type {string}
- */
- this.body = '';
- /**
- * is schedule is all day schedule?
- * @type {boolean}
- */
- this.isAllDay = false;
- /**
- * schedule start
- * @type {TZDate}
- */
- this.start = null;
- /**
- * schedule end
- * @type {TZDate}
- */
- this.end = null;
- /**
- * schedule text color
- * @type {string}
- */
- this.color = '#000';
- /**
- * schedule block visibility
- * @type {boolean}
- */
- this.isVisible = true;
- /**
- * schedule background color
- * @type {string}
- */
- this.bgColor = '#a1b56c';
- /**
- * schedule background color when dragging it
- * @type {string}
- */
- this.dragBgColor = '#a1b56c';
- /**
- * schedule left border color
- * @type {string}
- */
- this.borderColor = '#000';
- /**
- * calendar ID
- * @type {string}
- */
- this.calendarId = '';
- /**
- * Schedule category(milestone, task, allday, time)
- * @type {string}
- */
- this.category = '';
- /**
- * Classification of work schedules (before work, before lunch, before work)
- * @type {string}
- */
- this.dueDateClass = '';
- /**
- * Custom style for schedule element
- * @type {string}
- */
- this.customStyle = '';
- /**
- * in progress flag to do something
- * @type {boolean}
- */
- this.isPending = false;
- /**
- * focused schedule flag
- * @type {boolean}
- */
- this.isFocused = false;
- /**
- * read-only schedule flag
- * @type {boolean}
- */
- this.isReadOnly = false;
- /**
- * private schedule
- * @type {boolean}
- */
- this.isPrivate = false;
- /**
- * location
- * @type {string}
- */
- this.location = '';
- /**
- * attendees
- * @type {Array.<string>}
- */
- this.attendees = [];
- /**
- * recurrence rule
- * @type {any}
- */
- this.recurrenceRule = '';
- /**
- * state. 'Busy' is default.
- * @type {string}
- */
- this.state = '';
- /**
- * travelTime: going-Duration minutes
- * @type {number}
- */
- this.goingDuration = 0;
- /**
- * travelTime: coming-Duration minutes
- * @type {number}
- */
- this.comingDuration = 0;
- /**
- * Separate data storage space independent of rendering.
- * @type {object}
- */
- this.raw = null;
- // initialize model id
- util.stamp(this);
- }
- /**********
- * static props
- **********/
- Schedule.schema = {
- required: ['title'],
- dateRange: ['start', 'end']
- };
- /**
- * create schedule model from json(object) data.
- * @param {object} data object for model.
- * @returns {Schedule} Schedule model instance.
- */
- Schedule.create = function(data) {
- var inst = new Schedule();
- inst.init(data);
- return inst;
- };
- /**********
- * prototype props
- **********/
- /**
- * Initialize schedule instance.
- * @param {object} options options.
- */
- Schedule.prototype.init = function(options) {
- options = util.extend({}, options);
- if (options.category === SCHEDULE_CATEGORY.ALLDAY) {
- options.isAllDay = true;
- }
- this.id = options.id || '';
- this.title = options.title || '';
- this.body = options.body || '';
- this.isAllDay = util.isExisty(options.isAllDay) ? options.isAllDay : false;
- this.isVisible = util.isExisty(options.isVisible) ? options.isVisible : true;
- this.color = options.color || this.color;
- this.bgColor = options.bgColor || this.bgColor;
- this.dragBgColor = options.dragBgColor || this.dragBgColor;
- this.borderColor = options.borderColor || this.borderColor;
- this.calendarId = options.calendarId || '';
- this.category = options.category || '';
- this.dueDateClass = options.dueDateClass || '';
- this.customStyle = options.customStyle || '';
- this.location = options.location || '';
- this.attendees = options.attendees || [];
- this.recurrenceRule = options.recurrenceRule || '';
- this.isPrivate = options.isPrivate || false;
- this.isPending = options.isPending || false;
- this.isFocused = options.isFocused || false;
- this.isReadOnly = options.isReadOnly || false;
- this.goingDuration = options.goingDuration || 0;
- this.comingDuration = options.comingDuration || 0;
- this.state = options.state || '';
- if (this.isAllDay) {
- this.setAllDayPeriod(options.start, options.end);
- } else {
- this.setTimePeriod(options.start, options.end);
- }
- this.raw = options.raw || null;
- };
- Schedule.prototype.setAllDayPeriod = function(start, end) {
- // If it is an all-day schedule, only the date information of the string is used.
- if (util.isString(start) && start.length === 10) {
- start = datetime.parse(start);
- } else {
- start = new TZDate(start || Date.now());
- }
- if (util.isString(end) && end.length === 10) {
- end = datetime.parse(end);
- end.setHours(23, 59, 59);
- } else {
- end = new TZDate(end || start);
- }
- this.start = datetime.start(start);
- this.end = datetime.renderEnd(start, end);
- };
- Schedule.prototype.setTimePeriod = function(start, end) {
- this.start = new TZDate(start || Date.now());
- this.end = new TZDate(end || this.start);
- if (!end) {
- this.end.setMinutes(this.end.getMinutes() + 30);
- }
- };
- /**
- * @returns {Date} render start date.
- */
- Schedule.prototype.getStarts = function() {
- return this.start;
- };
- /**
- * @returns {Date} render end date.
- */
- Schedule.prototype.getEnds = function() {
- return this.end;
- };
- /**
- * @returns {number} instance unique id.
- */
- Schedule.prototype.cid = function() {
- return util.stamp(this);
- };
- /**
- * Check two schedule are equals (means title, isAllDay, start, end are same)
- * @param {Schedule} schedule Schedule model instance to compare.
- * @returns {boolean} Return false when not same.
- */
- Schedule.prototype.equals = function(schedule) {
- if (this.id !== schedule.id) {
- return false;
- }
- if (this.title !== schedule.title) {
- return false;
- }
- if (this.body !== schedule.body) {
- return false;
- }
- if (this.isAllDay !== schedule.isAllDay) {
- return false;
- }
- if (datetime.compare(this.getStarts(), schedule.getStarts()) !== 0) {
- return false;
- }
- if (datetime.compare(this.getEnds(), schedule.getEnds()) !== 0) {
- return false;
- }
- if (this.color !== schedule.color) {
- return false;
- }
- if (this.bgColor !== schedule.bgColor) {
- return false;
- }
- if (this.dragBgColor !== schedule.dragBgColor) {
- return false;
- }
- if (this.borderColor !== schedule.borderColor) {
- return false;
- }
- return true;
- };
- /**
- * return duration between start and end.
- * @returns {Date} duration (UTC)
- */
- Schedule.prototype.duration = function() {
- var start = this.getStarts(),
- end = this.getEnds(),
- duration;
- var hasPrimaryTimezoneCustomSetting = tz.hasPrimaryTimezoneCustomSetting();
- if (this.isAllDay) {
- duration = datetime.end(end) - datetime.start(start);
- } else if (hasPrimaryTimezoneCustomSetting && tz.isPrimaryUsingDSTTimezone()) {
- duration = getDurationByPrimaryTimezone(start, end);
- } else if (hasPrimaryTimezoneCustomSetting && tz.isNativeOsUsingDSTTimezone()) {
- duration = getDurationByNativeTimezone(start, end);
- } else {
- duration = end - start;
- }
- return duration;
- };
- /**
- * Returns true if the given Schedule coincides with the same time as the
- * calling Schedule.
- * @param {Schedule} schedule The other schedule to compare with this Schedule.
- * @returns {boolean} If the other schedule occurs within the same time as the first object.
- */
- Schedule.prototype.collidesWith = function(schedule) {
- var ownStarts = this.getStarts(),
- ownEnds = this.getEnds(),
- start = schedule.getStarts(),
- end = schedule.getEnds();
- var ownGoingDuration = datetime.millisecondsFrom('minutes', this.goingDuration),
- ownComingDuration = datetime.millisecondsFrom('minutes', this.comingDuration),
- goingDuration = datetime.millisecondsFrom('minutes', schedule.goingDuration),
- comingDuration = datetime.millisecondsFrom('minutes', schedule.comingDuration);
- if (Math.abs(ownEnds - ownStarts) < SCHEDULE_MIN_DURATION) {
- ownEnds += SCHEDULE_MIN_DURATION;
- }
- if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
- end += SCHEDULE_MIN_DURATION;
- }
- ownStarts -= ownGoingDuration;
- ownEnds += ownComingDuration;
- start -= goingDuration;
- end += comingDuration;
- if (
- (start > ownStarts && start < ownEnds) ||
- (end > ownStarts && end < ownEnds) ||
- (start <= ownStarts && end >= ownEnds)
- ) {
- return true;
- }
- return false;
- };
- model.mixin(Schedule.prototype);
- dirty.mixin(Schedule.prototype);
- module.exports = Schedule;
- /***/ }),
- /***/ "./src/js/model/viewModel/scheduleViewModel.js":
- /*!*****************************************************!*\
- !*** ./src/js/model/viewModel/scheduleViewModel.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Model for views
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
- /**
- * Schedule ViewModel
- * @constructor
- * @param {Schedule} schedule Schedule instance.
- */
- function ScheduleViewModel(schedule) {
- /**
- * The model of schedule.
- * @type {Schedule}
- */
- this.model = schedule;
- /**
- * @type {number}
- */
- this.top = 0;
- /**
- * @type {number}
- */
- this.left = 0;
- /**
- * @type {number}
- */
- this.width = 0;
- /**
- * @type {number}
- */
- this.height = 0;
- /**
- * Represent schedule has collide with other schedules when rendering.
- * @type {boolean}
- */
- this.hasCollide = false;
- /**
- * Extra space at rigth side of this schedule.
- * @type {number}
- */
- this.extraSpace = 0;
- /**
- * represent this schedule block is not visible after rendered.
- *
- * in month view, some viewmodel in date need to hide when already rendered before dates.
- *
- * set true then it just shows empty space.
- * @type {boolean}
- */
- this.hidden = false;
- /**
- * whether the schedule includes multiple dates
- */
- this.hasMultiDates = false;
- /**
- * represent render start date used at rendering.
- *
- * if set null then use model's 'start' property.
- * @type {TZDate}
- */
- this.renderStarts = null;
- /**
- * whether the actual start-date is before the render-start-date
- * @type {boolean}
- */
- this.exceedLeft = false;
- /**
- * represent render end date used at rendering.
- *
- * if set null then use model's 'end' property.
- * @type {TZDate}
- */
- this.renderEnds = null;
- /**
- * whether the actual end-date is after the render-end-date
- * @type {boolean}
- */
- this.exceedRight = false;
- }
- /**********
- * static props
- **********/
- /**
- * ScheduleViewModel factory method.
- * @param {Schedule} schedule Schedule instance.
- * @returns {ScheduleViewModel} ScheduleViewModel instance.
- */
- ScheduleViewModel.create = function(schedule) {
- return new ScheduleViewModel(schedule);
- };
- /**********
- * prototype props
- **********/
- /**
- * return renderStarts property to render properly when specific schedule that exceed rendering date range.
- *
- * if renderStarts is not set. return model's start property.
- * @override
- * @returns {Date} render start date.
- */
- ScheduleViewModel.prototype.getStarts = function() {
- if (this.renderStarts) {
- return this.renderStarts;
- }
- return this.model.start;
- };
- /**
- * return renderStarts property to render properly when specific schedule that exceed rendering date range.
- *
- * if renderEnds is not set. return model's end property.
- * @override
- * @returns {Date} render end date.
- */
- ScheduleViewModel.prototype.getEnds = function() {
- if (this.renderEnds) {
- return this.renderEnds;
- }
- return this.model.end;
- };
- /**
- * @returns {number} unique number for model.
- */
- ScheduleViewModel.prototype.cid = function() {
- return util.stamp(this.model);
- };
- /**
- * Shadowing valueOf method for schedule sorting.
- * @returns {Schedule} The model of schedule.
- */
- ScheduleViewModel.prototype.valueOf = function() {
- return this.model;
- };
- /**
- * Link duration method
- * @returns {number} Schedule#duration result.
- */
- ScheduleViewModel.prototype.duration = function() {
- return this.model.duration();
- };
- /**
- * Link collidesWith method
- * @param {Schedule|ScheduleViewModel} viewModel - Model or viewmodel instance of Schedule.
- * @returns {boolean} Schedule#collidesWith result.
- */
- ScheduleViewModel.prototype.collidesWith = function(viewModel) {
- var ownStarts = this.getStarts(),
- ownEnds = this.getEnds(),
- start = viewModel.getStarts(),
- end = viewModel.getEnds();
- var ownGoingDuration = datetime.millisecondsFrom('minutes', this.valueOf().goingDuration),
- ownComingDuration = datetime.millisecondsFrom('minutes', this.valueOf().comingDuration),
- goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration),
- comingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
- if (Math.abs(ownEnds - ownStarts) < SCHEDULE_MIN_DURATION) {
- ownEnds += SCHEDULE_MIN_DURATION;
- }
- if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
- end += SCHEDULE_MIN_DURATION;
- }
- ownStarts -= ownGoingDuration;
- ownEnds += ownComingDuration;
- start -= goingDuration;
- end += comingDuration;
- if ((start > ownStarts && start < ownEnds) ||
- (end > ownStarts && end < ownEnds) ||
- (start <= ownStarts && end >= ownEnds)) {
- return true;
- }
- return false;
- };
- module.exports = ScheduleViewModel;
- /***/ }),
- /***/ "./src/js/theme/standard.js":
- /*!**********************************!*\
- !*** ./src/js/theme/standard.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview The standard theme
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- /**
- * "common" prefix is for entire calendar. "common" properties can be overriden by "week", "month".
- * "week" prefix is for weekly and daily view.
- * "month" prefix is for monthly view.
- */
- var theme = {
- 'common.border': '1px solid #e5e5e5',
- 'common.backgroundColor': 'white',
- 'common.holiday.color': '#ff4040',
- 'common.saturday.color': '#333',
- 'common.dayname.color': '#333',
- 'common.today.color': '#333',
- // creation guide style
- 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'common.creationGuide.border': '1px solid #515ce6',
- // month header 'dayname'
- 'month.dayname.height': '31px',
- 'month.dayname.borderLeft': 'none',
- 'month.dayname.paddingLeft': '10px',
- 'month.dayname.paddingRight': '0',
- 'month.dayname.backgroundColor': 'inherit',
- 'month.dayname.fontSize': '12px',
- 'month.dayname.fontWeight': 'normal',
- 'month.dayname.textAlign': 'left',
- // month day grid cell 'day'
- 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
- 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
- 'month.weekend.backgroundColor': 'inherit',
- 'month.day.fontSize': '14px',
- // month schedule style
- 'month.schedule.borderRadius': '2px',
- 'month.schedule.height': '24px',
- 'month.schedule.marginTop': '2px',
- 'month.schedule.marginLeft': '8px',
- 'month.schedule.marginRight': '8px',
- // month more view
- 'month.moreView.border': '1px solid #d5d5d5',
- 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
- 'month.moreView.backgroundColor': 'white',
- 'month.moreView.paddingBottom': '17px',
- 'month.moreViewTitle.height': '44px',
- 'month.moreViewTitle.marginBottom': '12px',
- 'month.moreViewTitle.borderBottom': 'none',
- 'month.moreViewTitle.padding': '12px 17px 0 17px',
- 'month.moreViewList.padding': '0 17px',
- // week header 'dayname'
- 'week.dayname.height': '42px',
- 'week.dayname.borderTop': '1px solid #e5e5e5',
- 'week.dayname.borderBottom': '1px solid #e5e5e5',
- 'week.dayname.borderLeft': 'none',
- 'week.dayname.paddingLeft': '0',
- 'week.dayname.backgroundColor': 'inherit',
- 'week.dayname.textAlign': 'left',
- 'week.today.color': 'inherit',
- 'week.pastDay.color': '#bbb',
- // week vertical panel 'vpanel'
- 'week.vpanelSplitter.border': '1px solid #e5e5e5',
- 'week.vpanelSplitter.height': '3px',
- // week daygrid 'daygrid'
- 'week.daygrid.borderRight': '1px solid #e5e5e5',
- 'week.daygrid.backgroundColor': 'inherit',
- 'week.daygridLeft.width': '72px',
- 'week.daygridLeft.backgroundColor': 'inherit',
- 'week.daygridLeft.paddingRight': '8px',
- 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
- 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'week.weekend.backgroundColor': 'inherit',
- // week timegrid 'timegrid'
- 'week.timegridLeft.width': '72px',
- 'week.timegridLeft.backgroundColor': 'inherit',
- 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
- 'week.timegridLeft.fontSize': '11px',
- 'week.timegridOneHour.height': '52px',
- 'week.timegridHalfHour.height': '26px',
- 'week.timegridHalfHour.borderBottom': 'none',
- 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
- 'week.timegrid.paddingRight': '8px',
- 'week.timegrid.borderRight': '1px solid #e5e5e5',
- 'week.timegridSchedule.borderRadius': '2px',
- 'week.timegridSchedule.paddingLeft': '2px',
- 'week.currentTime.color': '#515ce6',
- 'week.currentTime.fontSize': '11px',
- 'week.currentTime.fontWeight': 'normal',
- 'week.currentTimeLinePast.border': '1px dashed #515ce6',
- 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
- 'week.currentTimeLineToday.border': '1px solid #515ce6',
- 'week.currentTimeLineFuture.border': 'none',
- // week creation guide style
- 'week.creationGuide.color': '#515ce6',
- 'week.creationGuide.fontSize': '11px',
- 'week.creationGuide.fontWeight': 'bold',
- // week daygrid schedule style
- 'week.dayGridSchedule.borderRadius': '2px',
- 'week.dayGridSchedule.height': '24px',
- 'week.dayGridSchedule.marginTop': '2px',
- 'week.dayGridSchedule.marginLeft': '8px',
- 'week.dayGridSchedule.marginRight': '8px'
- };
- module.exports = theme;
- /***/ }),
- /***/ "./src/js/theme/theme.js":
- /*!*******************************!*\
- !*** ./src/js/theme/theme.js ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview The all configuration of a theme
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var themeStandard = __webpack_require__(/*! ./standard */ "./src/js/theme/standard.js");
- var themeConfig = __webpack_require__(/*! ./themeConfig */ "./src/js/theme/themeConfig.js");
- var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
- /**
- * Theme manager
- * @param {object} customTheme - custom theme
- */
- function Theme(customTheme) {
- var theme = customTheme || themeStandard;
- /**
- * @type {util.HashMap}
- */
- this._map = new util.HashMap();
- this.setStyles(theme);
- }
- /**
- * Get a style with key
- * @param {string} key - key for getting a style
- * @returns {string|undefined} style
- */
- Theme.prototype.getStyle = function(key) {
- return this._map.get(key);
- };
- /**
- * Set a style
- * @param {string} key - key for setting a style
- * @param {string} style - style value
- * @returns {boolean} true if the give key is valid or false
- */
- Theme.prototype.setStyle = function(key, style) {
- var styles = {};
- styles[key] = style;
- return this.setStyles(styles).length === 0;
- };
- /**
- * Set styles
- * @param {object} styles - multiple styles map
- * @returns {Array.<string>} error keys
- */
- Theme.prototype.setStyles = function(styles) {
- var errors = [];
- util.forEach(styles, function(style, key) {
- if (util.isUndefined(themeConfig[key])) {
- errors.push(key);
- } else {
- this._map.set(key, style);
- common.set(this, key, style);
- }
- }, this);
- // apply missing styles which have to be default
- util.forEach(themeConfig, function(style, key) {
- if (!this.getStyle(key)) {
- this._map.set(key, style);
- common.set(this, key, style);
- }
- }, this);
- return errors;
- };
- /**
- * Delete all styles
- */
- Theme.prototype.clear = function() {
- var keys = this._map.keys();
- var categories = {};
- util.forEach(keys, function(key) {
- var category = key.split('.')[0];
- if (!categories[category]) {
- categories[category] = category;
- }
- });
- util.forEach(categories, function(child) {
- delete this[child];
- }, this);
- this._map.removeAll();
- };
- module.exports = Theme;
- /***/ }),
- /***/ "./src/js/theme/themeConfig.js":
- /*!*************************************!*\
- !*** ./src/js/theme/themeConfig.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview The all configuration of a theme
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- /**
- * Full configuration for theme.
- * "common" prefix is for entire calendar. "common" properties can be overriden by "week", "month".
- * "week" prefix is for weekly and daily view.
- * "month" prefix is for monthly view.
- * @typedef {object} themeConfig
- * @example
- // default keys and styles
- var themeConfig = {
- 'common.border': '1px solid #e5e5e5',
- 'common.backgroundColor': 'white',
- 'common.holiday.color': '#ff4040',
- 'common.saturday.color': '#333',
- 'common.dayname.color': '#333',
- 'common.today.color': '#333',
- // creation guide style
- 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'common.creationGuide.border': '1px solid #515ce6',
- // month header 'dayname'
- 'month.dayname.height': '31px',
- 'month.dayname.borderLeft': '1px solid #e5e5e5',
- 'month.dayname.paddingLeft': '10px',
- 'month.dayname.paddingRight': '10px',
- 'month.dayname.backgroundColor': 'inherit',
- 'month.dayname.fontSize': '12px',
- 'month.dayname.fontWeight': 'normal',
- 'month.dayname.textAlign': 'left',
- // month day grid cell 'day'
- 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
- 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
- 'month.weekend.backgroundColor': 'inherit',
- 'month.day.fontSize': '14px',
- // month schedule style
- 'month.schedule.borderRadius': '2px',
- 'month.schedule.height': '24px',
- 'month.schedule.marginTop': '2px',
- 'month.schedule.marginLeft': '8px',
- 'month.schedule.marginRight': '8px',
- // month more view
- 'month.moreView.border': '1px solid #d5d5d5',
- 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
- 'month.moreView.backgroundColor': 'white',
- 'month.moreView.paddingBottom': '17px',
- 'month.moreViewTitle.height': '44px',
- 'month.moreViewTitle.marginBottom': '12px',
- 'month.moreViewTitle.backgroundColor': 'inherit',
- 'month.moreViewTitle.borderBottom': 'none',
- 'month.moreViewTitle.padding': '12px 17px 0 17px',
- 'month.moreViewList.padding': '0 17px',
- // week header 'dayname'
- 'week.dayname.height': '42px',
- 'week.dayname.borderTop': '1px solid #e5e5e5',
- 'week.dayname.borderBottom': '1px solid #e5e5e5',
- 'week.dayname.borderLeft': 'inherit',
- 'week.dayname.paddingLeft': '0',
- 'week.dayname.backgroundColor': 'inherit',
- 'week.dayname.textAlign': 'left',
- 'week.today.color': '#333',
- 'week.pastDay.color': '#bbb',
- // week vertical panel 'vpanel'
- 'week.vpanelSplitter.border': '1px solid #e5e5e5',
- 'week.vpanelSplitter.height': '3px',
- // week daygrid 'daygrid'
- 'week.daygrid.borderRight': '1px solid #e5e5e5',
- 'week.daygrid.backgroundColor': 'inherit',
- 'week.daygridLeft.width': '72px',
- 'week.daygridLeft.backgroundColor': 'inherit',
- 'week.daygridLeft.paddingRight': '8px',
- 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
- 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'week.weekend.backgroundColor': 'inherit',
- // week timegrid 'timegrid'
- 'week.timegridLeft.width': '72px',
- 'week.timegridLeft.backgroundColor': 'inherit',
- 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
- 'week.timegridLeft.fontSize': '11px',
- 'week.timegridLeftTimezoneLabel.height': '40px',
- 'week.timegridLeftAdditionalTimezone.backgroundColor': 'white',
- 'week.timegridOneHour.height': '52px',
- 'week.timegridHalfHour.height': '26px',
- 'week.timegridHalfHour.borderBottom': 'none',
- 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
- 'week.timegrid.paddingRight': '8px',
- 'week.timegrid.borderRight': '1px solid #e5e5e5',
- 'week.timegridSchedule.borderRadius': '2px',
- 'week.timegridSchedule.paddingLeft': '2px',
- 'week.currentTime.color': '#515ce6',
- 'week.currentTime.fontSize': '11px',
- 'week.currentTime.fontWeight': 'normal',
- 'week.pastTime.color': '#bbb',
- 'week.pastTime.fontWeight': 'normal',
- 'week.futureTime.color': '#333',
- 'week.futureTime.fontWeight': 'normal',
- 'week.currentTimeLinePast.border': '1px dashed #515ce6',
- 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
- 'week.currentTimeLineToday.border': '1px solid #515ce6',
- 'week.currentTimeLineFuture.border': 'none',
- // week creation guide style
- 'week.creationGuide.color': '#515ce6',
- 'week.creationGuide.fontSize': '11px',
- 'week.creationGuide.fontWeight': 'bold',
- // week daygrid schedule style
- 'week.dayGridSchedule.borderRadius': '2px',
- 'week.dayGridSchedule.height': '24px',
- 'week.dayGridSchedule.marginTop': '2px',
- 'week.dayGridSchedule.marginLeft': '8px',
- 'week.dayGridSchedule.marginRight': '8px'
- };
- */
- var themeConfig = {
- 'common.border': '1px solid #e5e5e5',
- 'common.backgroundColor': 'white',
- 'common.holiday.color': '#ff4040',
- 'common.saturday.color': '#333',
- 'common.dayname.color': '#333',
- 'common.today.color': '#333',
- // creation guide style
- 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'common.creationGuide.border': '1px solid #515ce6',
- // month header 'dayname'
- 'month.dayname.height': '31px',
- 'month.dayname.borderLeft': '1px solid #e5e5e5',
- 'month.dayname.paddingLeft': '10px',
- 'month.dayname.paddingRight': '10px',
- 'month.dayname.backgroundColor': 'inherit',
- 'month.dayname.fontSize': '12px',
- 'month.dayname.fontWeight': 'normal',
- 'month.dayname.textAlign': 'left',
- // month day grid cell 'day'
- 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
- 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
- 'month.weekend.backgroundColor': 'inherit',
- 'month.day.fontSize': '14px',
- // month schedule style
- 'month.schedule.borderRadius': '2px',
- 'month.schedule.height': '24px',
- 'month.schedule.marginTop': '2px',
- 'month.schedule.marginLeft': '8px',
- 'month.schedule.marginRight': '8px',
- // month more view
- 'month.moreView.border': '1px solid #d5d5d5',
- 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
- 'month.moreView.backgroundColor': 'white',
- 'month.moreView.paddingBottom': '17px',
- 'month.moreViewTitle.height': '44px',
- 'month.moreViewTitle.marginBottom': '12px',
- 'month.moreViewTitle.backgroundColor': 'inherit',
- 'month.moreViewTitle.borderBottom': 'none',
- 'month.moreViewTitle.padding': '12px 17px 0 17px',
- 'month.moreViewList.padding': '0 17px',
- // week header 'dayname'
- 'week.dayname.height': '42px',
- 'week.dayname.borderTop': '1px solid #e5e5e5',
- 'week.dayname.borderBottom': '1px solid #e5e5e5',
- 'week.dayname.borderLeft': 'inherit',
- 'week.dayname.paddingLeft': '0',
- 'week.dayname.backgroundColor': 'inherit',
- 'week.dayname.textAlign': 'left',
- 'week.today.color': '#333',
- 'week.pastDay.color': '#bbb',
- // week vertical panel 'vpanel'
- 'week.vpanelSplitter.border': '1px solid #e5e5e5',
- 'week.vpanelSplitter.height': '3px',
- // week daygrid 'daygrid'
- 'week.daygrid.borderRight': '1px solid #e5e5e5',
- 'week.daygrid.backgroundColor': 'inherit',
- 'week.daygridLeft.width': '72px',
- 'week.daygridLeft.backgroundColor': 'inherit',
- 'week.daygridLeft.paddingRight': '8px',
- 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
- 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
- 'week.weekend.backgroundColor': 'inherit',
- // week timegrid 'timegrid'
- 'week.timegridLeft.width': '72px',
- 'week.timegridLeft.backgroundColor': 'inherit',
- 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
- 'week.timegridLeft.fontSize': '11px',
- 'week.timegridLeftTimezoneLabel.height': '40px',
- 'week.timegridLeftAdditionalTimezone.backgroundColor': 'white',
- 'week.timegridOneHour.height': '52px',
- 'week.timegridHalfHour.height': '26px',
- 'week.timegridHalfHour.borderBottom': 'none',
- 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
- 'week.timegrid.paddingRight': '8px',
- 'week.timegrid.borderRight': '1px solid #e5e5e5',
- 'week.timegridSchedule.borderRadius': '2px',
- 'week.timegridSchedule.paddingLeft': '2px',
- 'week.currentTime.color': '#515ce6',
- 'week.currentTime.fontSize': '11px',
- 'week.currentTime.fontWeight': 'normal',
- 'week.pastTime.color': '#bbb',
- 'week.pastTime.fontWeight': 'normal',
- 'week.futureTime.color': '#333',
- 'week.futureTime.fontWeight': 'normal',
- 'week.currentTimeLinePast.border': '1px dashed #515ce6',
- 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
- 'week.currentTimeLineToday.border': '1px solid #515ce6',
- 'week.currentTimeLineFuture.border': 'none',
- // week creation guide style
- 'week.creationGuide.color': '#515ce6',
- 'week.creationGuide.fontSize': '11px',
- 'week.creationGuide.fontWeight': 'bold',
- // week daygrid schedule style
- 'week.dayGridSchedule.borderRadius': '2px',
- 'week.dayGridSchedule.height': '24px',
- 'week.dayGridSchedule.marginTop': '2px',
- 'week.dayGridSchedule.marginLeft': '8px',
- 'week.dayGridSchedule.marginRight': '8px'
- };
- module.exports = themeConfig;
- /***/ }),
- /***/ "./src/js/view/layout.js":
- /*!*******************************!*\
- !*** ./src/js/view/layout.js ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Layout view. wrap all view containers at outside.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
- var Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
- var View = __webpack_require__(/*! ./view */ "./src/js/view/view.js");
- /**
- * Layout view for toggle each child view. It will controlled via navigation UI.
- * @constructor
- * @extends {View}
- * @param {HTMLElement} container Container element to use layout view.
- * @param {Theme} theme - theme instance
- */
- function Layout(container, theme) {
- container = domutil.appendHTMLElement('div', container, config.classname('layout'));
- /**
- * @type {HTMLElement}
- */
- this.container = container;
- /*eslint-disable*/
- /**
- * @type {Collection} Child view collection.
- */
- this.children = new Collection(function(childView) {
- return childView.viewName;
- });
- /* eslint-enable*/
- /**
- * @type {Theme}
- */
- this.theme = theme;
- this.applyTheme();
- }
- util.inherit(Layout, View);
- /**
- * Clear child views.
- */
- Layout.prototype.clear = function() {
- this.children.each(function(childView) {
- childView.destroy();
- });
- this.children.clear();
- this.container.innerHTML = '';
- };
- /**
- * Remove child view.
- * @override
- * @param {(string|View)} viewName - name of view or instance.
- */
- Layout.prototype.removeChild = function(viewName) {
- this.children.remove(viewName);
- };
- /**
- * Toggle child views.
- * @param {string} viewName - Name of view.
- */
- Layout.prototype.toggleChildView = function(viewName) {
- var container,
- prefix = ['add', 'remove'],
- flag;
- this.children.each(function(childView) {
- container = childView.container;
- flag = Number(childView.viewName === viewName);
- domutil[prefix[flag] + 'Class'](container, config.classname('hidden'));
- });
- };
- Layout.prototype.applyTheme = function() {
- var style = this.container.style;
- var theme = this.theme.common;
- // background color
- style.backgroundColor = theme.backgroundColor;
- };
- module.exports = Layout;
- /***/ }),
- /***/ "./src/js/view/month/month.js":
- /*!************************************!*\
- !*** ./src/js/view/month/month.js ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
- tmpl = __webpack_require__(/*! ../template/month/month.hbs */ "./src/js/view/template/month/month.hbs"),
- View = __webpack_require__(/*! ../view */ "./src/js/view/view.js"),
- VLayout = __webpack_require__(/*! ../..//common/vlayout */ "./src/js/common/vlayout.js"),
- WeekdayInMonth = __webpack_require__(/*! ./weekdayInMonth */ "./src/js/view/month/weekdayInMonth.js");
- var mmin = Math.min;
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - options
- * @param {function} [options.scheduleFilter] - schedule filter
- * @param {number} [options.startDayOfWeek=0] - start day of week
- * @param {string} [options.renderMonth='2015-12'] - render month
- * @param {string[]} [options.daynames] - daynames to use upside of month view
- * @param {HTMLElement} container - container element
- * @param {Base.Month} controller - controller instance
- */
- function Month(options, container, controller) {
- var theme = controller ? controller.theme : null;
- var monthOption;
- options = options || {};
- monthOption = options ? options.month : {};
- View.call(this, container);
- /**
- * @type {Base.Month}
- */
- this.controller = controller;
- /**
- * @type {VLayout}
- */
- this.vLayout = new VLayout({
- panels: [
- {height: parseInt(controller.theme.month.dayname.height, 10) || 42},
- {autoHeight: true}
- ]
- }, container, theme);
- /**
- * @type {string}
- */
- this.options = util.extend({
- scheduleFilter: function(schedule) {
- return Boolean(schedule.isVisible);
- },
- startDayOfWeek: 0,
- renderMonth: '2018-01',
- daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- narrowWeekend: false,
- visibleWeeksCount: null,
- isAlways6Week: true,
- isReadOnly: options.isReadOnly,
- grid: {
- header: {
- height: 34
- },
- footer: {
- height: 3
- }
- }
- }, monthOption);
- this.options.grid.header = util.extend({
- height: 34
- }, util.pick(monthOption, 'grid', 'header'));
- this.options.grid.footer = util.extend({
- height: 3
- }, util.pick(monthOption, 'grid', 'footer'));
- /**
- * horizontal grid information
- * @type {Object}
- */
- this.grids = datetime.getGridLeftAndWidth(
- this.options.daynames.length,
- this.options.narrowWeekend,
- this.options.startDayOfWeek);
- }
- util.inherit(Month, View);
- /**
- * Name of view. for managing subview at layout view
- * @type {string}
- */
- Month.prototype.viewName = 'month';
- /**
- * Get calendar array by supplied date
- * @param {string} renderMonth - month to render YYYY-MM, weeks2/3 to render YYYY-MM-DD
- * @returns {array.<Date[]>} calendar array
- */
- Month.prototype._getMonthCalendar = function(renderMonth) {
- var date = new TZDate(renderMonth);
- var startDayOfWeek = this.options.startDayOfWeek || 0;
- var visibleWeeksCount = mmin(this.options.visibleWeeksCount || 0, 6);
- var workweek = this.options.workweek || false;
- var datetimeOptions, calendar;
- if (this.options.visibleWeeksCount) {
- datetimeOptions = {
- startDayOfWeek: startDayOfWeek,
- isAlways6Week: false,
- visibleWeeksCount: visibleWeeksCount,
- workweek: workweek
- };
- } else {
- datetimeOptions = {
- startDayOfWeek: startDayOfWeek,
- isAlways6Week: this.options.isAlways6Week,
- workweek: workweek
- };
- }
- calendar = datetime.arr2dCalendar(date, datetimeOptions);
- return calendar;
- };
- /**
- * Create children view (week) and add children
- * @param {HTMLElement} container - container element to render weeks
- * @param {array.<Date[]>} calendar - calendar array from datetime#arr2dCalendar
- * @param {Theme} theme - theme instance
- */
- Month.prototype._renderChildren = function(container, calendar, theme) {
- var self = this;
- var weekCount = calendar.length;
- var heightPercent = 100 / weekCount;
- var opt = this.options;
- var renderMonth = opt.renderMonth;
- var narrowWeekend = opt.narrowWeekend;
- var startDayOfWeek = opt.startDayOfWeek;
- var visibleWeeksCount = opt.visibleWeeksCount;
- var visibleScheduleCount = opt.visibleScheduleCount;
- var gridOption = opt.grid;
- var isReadOnly = opt.isReadOnly;
- container.innerHTML = '';
- this.children.clear();
- util.forEach(calendar, function(weekArr) {
- var start = new TZDate(weekArr[0]),
- end = new TZDate(weekArr[weekArr.length - 1]),
- weekdayViewContainer,
- weekdayView;
- weekdayViewContainer = domutil.appendHTMLElement(
- 'div', container, config.classname('month-week-item'));
- weekdayView = new WeekdayInMonth({
- renderMonth: renderMonth,
- heightPercent: heightPercent,
- renderStartDate: start,
- renderEndDate: end,
- narrowWeekend: narrowWeekend,
- startDayOfWeek: startDayOfWeek,
- visibleWeeksCount: visibleWeeksCount,
- visibleScheduleCount: visibleScheduleCount,
- grid: gridOption,
- scheduleHeight: parseInt(theme.month.schedule.height, 10),
- scheduleGutter: parseInt(theme.month.schedule.marginTop, 10),
- isReadOnly: isReadOnly
- }, weekdayViewContainer);
- self.addChild(weekdayView);
- });
- };
- /**
- * Render month view
- * @override
- */
- Month.prototype.render = function() {
- var self = this,
- opt = this.options,
- vLayout = this.vLayout,
- controller = this.controller,
- daynames = opt.daynames,
- workweek = opt.workweek,
- calendar = this._getMonthCalendar(opt.renderMonth),
- scheduleFilter = opt.scheduleFilter,
- theme = controller ? controller.theme : null,
- styles = this._getStyles(theme),
- grids,
- daynameViewModel,
- baseViewModel;
- grids = this.grids = datetime.getGridLeftAndWidth(
- opt.daynames.length,
- opt.narrowWeekend,
- opt.startDayOfWeek
- );
- daynameViewModel = util.map(
- util.range(opt.startDayOfWeek, 7).concat(util.range(7)).slice(0, 7),
- function(day, index) {
- return {
- day: day,
- label: daynames[day],
- width: grids[index] ? grids[index].width : 0,
- left: grids[index] ? grids[index].left : 0,
- color: this._getDayNameColor(theme, day)
- };
- },
- this
- );
- if (workweek) {
- grids = this.grids = datetime.getGridLeftAndWidth(5, opt.narrowWeekend, opt.startDayOfWeek, workweek);
- daynameViewModel = util.filter(daynameViewModel, function(daynameModel) {
- return !datetime.isWeekend(daynameModel.day);
- });
- util.forEach(daynameViewModel, function(daynameModel, index) {
- daynameModel.width = grids[index] ? grids[index].width : 0;
- daynameModel.left = grids[index] ? grids[index].left : 0;
- });
- }
- baseViewModel = {
- daynames: daynameViewModel,
- styles: styles
- };
- vLayout.panels[0].container.innerHTML = tmpl(baseViewModel);
- this._renderChildren(vLayout.panels[1].container, calendar, theme);
- baseViewModel.panelHeight = vLayout.panels[1].getHeight();
- this.children.each(function(childView) {
- var start = datetime.start(childView.options.renderStartDate);
- var end = datetime.start(childView.options.renderEndDate);
- var eventsInDateRange = controller.findByDateRange(
- datetime.start(start),
- datetime.end(end),
- scheduleFilter
- );
- var dateRange = datetime.range(
- datetime.start(start),
- datetime.end(end),
- datetime.MILLISECONDS_PER_DAY);
- var viewModel = {
- eventsInDateRange: eventsInDateRange,
- range: dateRange.slice(0, grids.length),
- grids: grids,
- panelHeight: baseViewModel.panelHeight,
- theme: theme
- };
- childView.render(viewModel);
- self._invokeAfterRenderSchedule(eventsInDateRange);
- });
- };
- /**
- * Fire 'afterRenderSchedule' event
- * @param {Array} matrices - schedule matrices from view model
- * @fires Month#afterRenderSchedule
- */
- Month.prototype._invokeAfterRenderSchedule = function(matrices) {
- var self = this;
- util.forEachArray(matrices, function(matrix) {
- util.forEachArray(matrix, function(column) {
- util.forEachArray(column, function(scheduleViewModel) {
- if (scheduleViewModel && !scheduleViewModel.hidden) {
- /**
- * @event Month#afterRenderSchedule
- */
- self.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
- }
- });
- });
- });
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- Month.prototype._getStyles = function(theme) {
- var styles = {};
- var dayname;
- if (theme) {
- dayname = theme.month.dayname;
- styles.borderTop = dayname.borderTop || theme.common.border;
- styles.borderLeft = dayname.borderLeft || theme.common.border;
- styles.height = dayname.height;
- styles.paddingLeft = dayname.paddingLeft;
- styles.paddingRight = dayname.paddingRight;
- styles.fontSize = dayname.fontSize;
- styles.backgroundColor = dayname.backgroundColor;
- styles.fontWeight = dayname.fontWeight;
- styles.textAlign = dayname.textAlign;
- }
- return styles;
- };
- /**
- * Get a day name color
- * @param {Theme} theme - theme instance
- * @param {number} day - day number
- * @returns {string} style - color style
- */
- Month.prototype._getDayNameColor = function(theme, day) {
- var color = '';
- if (theme) {
- if (day === 0) {
- color = theme.common.holiday.color;
- } else if (day === 6) {
- color = theme.common.saturday.color;
- } else {
- color = theme.common.dayname.color;
- }
- }
- return color;
- };
- module.exports = Month;
- /***/ }),
- /***/ "./src/js/view/month/more.js":
- /*!***********************************!*\
- !*** ./src/js/view/month/more.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Floating layer for displaying schedule in specific date
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var OUT_PADDING = 5;
- var VIEW_MIN_WIDTH = 280;
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
- FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js"),
- common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
- tmpl = __webpack_require__(/*! ../template/month/more.hbs */ "./src/js/view/template/month/more.hbs");
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - options
- * @param {object} [options.moreLayerSize] - more layer size
- * @param {object} [options.moreLayerSize.width=null] - css width value(px, auto).
- * The default value 'null' is to fit a grid cell.
- * @param {object} [options.moreLayerSize.height=null] - css height value(px, auto).
- * The default value 'null' is to fit a grid cell.
- * @param {HTMLElement} container = container element
- * @param {Theme} theme - theme instance
- */
- function More(options, container, theme) {
- View.call(this, container);
- /**
- * @type {FloatingLayer}
- */
- this.layer = new FloatingLayer(null, container);
- /**
- * cached view model
- * @type {object}
- */
- this._viewModel = null;
- /**
- * @type {object}
- */
- this.options = util.extend({
- moreLayerSize: {
- width: null,
- height: null
- },
- scheduleHeight: parseInt(theme.month.schedule.height, 10) || 18,
- scheduleGutter: parseInt(theme.month.schedule.marginTop, 10) || 2,
- scheduleBulletTop: (parseInt(theme.month.schedule.height, 10) || 18) / 3,
- borderRadius: theme.month.schedule.borderRadius
- }, options);
- /**
- * @type {Theme}
- */
- this.theme = theme;
- domevent.on(container, 'click', this._onClick, this);
- }
- util.inherit(More, View);
- /**
- * Click event handler for close button
- * @param {MouseEvent} clickEvent - mouse event object
- */
- More.prototype._onClick = function(clickEvent) {
- var target = domevent.getEventTarget(clickEvent);
- var className = config.classname('month-more-close');
- if (!domutil.hasClass(target, className) && !domutil.closest(target, '.' + className)) {
- return;
- }
- this.hide();
- };
- /**
- * Mousedown event handler for hiding more layer when user mousedown outside of
- * layer
- * @param {MouseEvent} mouseDownEvent - mouse event object
- */
- More.prototype._onMouseDown = function(mouseDownEvent) {
- var target = domevent.getEventTarget(mouseDownEvent),
- moreLayer = domutil.closest(target, config.classname('.month-more'));
- if (moreLayer) {
- return;
- }
- this.hide();
- };
- /**
- * Get new position for more layer by +n element itself
- * @param {HTMLElement} target - parent grid-line element of +n element
- * @param {HTMLElement} weekItem - weekItem container element
- * @returns {number[]} new position of more layer
- */
- More.prototype._getRenderPosition = function(target, weekItem) {
- var pos = domevent.getMousePosition({
- clientX: domutil.getPosition(target)[0],
- clientY: domutil.getPosition(weekItem)[1]
- }, this.container);
- var containerSize = domutil.getSize(this.container);
- var left = pos[0] - OUT_PADDING;
- var top = pos[1] - OUT_PADDING;
- left = common.ratio(containerSize[0], 100, left);
- top = common.ratio(containerSize[1], 100, top);
- return [left, top];
- };
- /**
- * @override
- */
- More.prototype.destroy = function() {
- this.layer.destroy();
- this.layer = null;
- domevent.off(this.container, 'click', this._onClick, this);
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- View.prototype.destroy.call(this);
- };
- /**
- * @override
- * @param {object} viewModel - view model from factory/monthView
- */
- More.prototype.render = function(viewModel) {
- var target = domutil.closest(viewModel.target, config.classname('.weekday-grid-line'));
- var weekItem = domutil.closest(target, config.classname('.month-week-item'));
- var layer = this.layer;
- var self = this;
- var pos = this._getRenderPosition(target, weekItem);
- var minHeight = domutil.getSize(weekItem)[1] + (OUT_PADDING * 2);
- var width = target.offsetWidth + (OUT_PADDING * 2);
- var opt = this.options;
- var optMoreLayerSize = opt.moreLayerSize;
- var styles = this._getStyles(this.theme);
- var maxVisibleSchedulesInLayer = 10;
- var height = '';
- var containerSize = domutil.getSize(this.container);
- var calWidth = 0;
- var calHeight = 0;
- var isOverWidth = false;
- var isOverHeight = false;
- var leftPos = pos[0];
- var topPos = pos[1];
- this._viewModel = util.extend(viewModel, {
- scheduleGutter: opt.scheduleGutter,
- scheduleHeight: opt.scheduleHeight,
- scheduleBulletTop: opt.scheduleBulletTop,
- borderRadius: opt.borderRadius,
- styles: styles
- });
- width = Math.max(width, VIEW_MIN_WIDTH);
- height = parseInt(styles.titleHeight, 10);
- height += parseInt(styles.titleMarginBottom, 10);
- if (viewModel.schedules.length <= maxVisibleSchedulesInLayer) {
- height += (opt.scheduleGutter + opt.scheduleHeight) * viewModel.schedules.length;
- } else {
- height += (opt.scheduleGutter + opt.scheduleHeight) * maxVisibleSchedulesInLayer;
- }
- height += parseInt(styles.paddingBottom, 10);
- height += OUT_PADDING; // for border
- if (optMoreLayerSize.width) {
- width = optMoreLayerSize.width;
- }
- if (optMoreLayerSize.height) {
- height = optMoreLayerSize.height;
- }
- if (isNaN(height) || height < minHeight) {
- height = minHeight;
- }
- layer.setContent(tmpl(viewModel));
- calWidth = leftPos * containerSize[0] / 100;
- calHeight = topPos * containerSize[1] / 100;
- isOverWidth = calWidth + width >= containerSize[0];
- isOverHeight = calHeight + height >= containerSize[1];
- leftPos = leftPos + '%';
- topPos = topPos + '%';
- if (isOverWidth && isOverHeight) {
- layer.setLTRB({
- right: 0,
- bottom: 0
- });
- } else if (!isOverWidth && isOverHeight) {
- layer.setLTRB({
- left: leftPos,
- bottom: 0
- });
- } else if (isOverWidth && !isOverHeight) {
- layer.setLTRB({
- right: 0,
- top: topPos
- });
- } else {
- layer.setPosition(leftPos, topPos);
- }
- layer.setSize(width, height);
- layer.show();
- util.debounce(function() {
- domevent.on(document.body, 'mousedown', self._onMouseDown, self);
- })();
- };
- /**
- * Hide layer
- */
- More.prototype.hide = function() {
- this.layer.hide();
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- };
- /**
- * refresh layer
- */
- More.prototype.refresh = function() {
- if (this._viewModel) {
- this.layer.setContent(tmpl(this._viewModel));
- }
- };
- /**
- * Return more layer root element
- * @returns {HTMLElement} root element
- */
- More.prototype.getMoreViewElement = function() {
- return domutil.find(config.classname('.month-more'), this.layer.container);
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- More.prototype._getStyles = function(theme) {
- var styles = {};
- var listHeight = '';
- if (theme) {
- styles.border = theme.month.moreView.border || theme.common.border;
- styles.boxShadow = theme.month.moreView.boxShadow;
- styles.backgroundColor = theme.month.moreView.backgroundColor || theme.common.backgroundColor;
- styles.paddingBottom = theme.month.moreView.paddingBottom;
- styles.titleHeight = theme.month.moreViewTitle.height;
- styles.titleMarginBottom = theme.month.moreViewTitle.marginBottom;
- styles.titleBackgroundColor = theme.month.moreViewTitle.backgroundColor;
- styles.titleBorderBottom = theme.month.moreViewTitle.borderBottom;
- styles.titlePadding = theme.month.moreViewTitle.padding;
- styles.listPadding = theme.month.moreViewList.padding;
- listHeight = 'calc(100%';
- if (parseInt(styles.titleHeight, 10)) {
- listHeight += ' - ' + styles.titleHeight;
- }
- if (parseInt(styles.titleMarginBottom, 10)) {
- listHeight += ' - ' + styles.titleMarginBottom;
- }
- listHeight += ')';
- styles.listHeight = listHeight;
- }
- return styles;
- };
- module.exports = More;
- /***/ }),
- /***/ "./src/js/view/month/weekdayInMonth.js":
- /*!*********************************************!*\
- !*** ./src/js/view/month/weekdayInMonth.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Monthday in month view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- common = __webpack_require__(/*! ../../common/common.js */ "./src/js/common/common.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
- Weekday = __webpack_require__(/*! ../weekday */ "./src/js/view/weekday.js"),
- baseTmpl = __webpack_require__(/*! ../template/month/weekdayInMonth.hbs */ "./src/js/view/template/month/weekdayInMonth.hbs"),
- scheduleTmpl = __webpack_require__(/*! ../template/month/weekdayInMonthSchedule.hbs */ "./src/js/view/template/month/weekdayInMonthSchedule.hbs");
- var mfloor = Math.floor,
- mmin = Math.min;
- /**
- * @constructor
- * @extends {Weekday}
- * @param {object} options - options for WeekdayInWeek view
- * @param {number} [options.heightPercent] - height percent of view
- * @param {number} [options.containerButtonGutter=8] - free space at bottom to
- * make create easy.
- * @param {number} [options.scheduleHeight=18] - height of each schedule block.
- * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
- * @param {HTMLDIVElement} container - DOM element to use container for this
- * view.
- */
- function WeekdayInMonth(options, container) {
- Weekday.call(this, options, container);
- container.style.height = options.heightPercent + '%';
- }
- util.inherit(WeekdayInMonth, Weekday);
- /**
- * Get schedule container element's bound properly by override
- *
- * View#getViewBound.
- * @override
- */
- WeekdayInMonth.prototype.getViewBound = function() {
- var bound = View.prototype.getViewBound.call(this);
- return bound;
- };
- /**
- * Get limit index of schedule block in current view
- * @param {number} panelHeight - panel's height for pre-calculation
- * @returns {number} limit index
- */
- WeekdayInMonth.prototype._getRenderLimitIndex = function(panelHeight) {
- var opt = this.options;
- var containerHeight = panelHeight || this.getViewBound().height;
- var gridHeaderHeight = util.pick(opt, 'grid', 'header', 'height') || 0;
- var gridFooterHeight = util.pick(opt, 'grid', 'footer', 'height') || 0;
- var visibleScheduleCount = opt.visibleScheduleCount || 0;
- var count;
- containerHeight -= (gridHeaderHeight + gridFooterHeight);
- count = mfloor(containerHeight / (opt.scheduleHeight + opt.scheduleGutter));
- if (!visibleScheduleCount) {
- visibleScheduleCount = count;
- }
- return mmin(count, visibleScheduleCount); // subtraction for '+n' label block
- };
- /**
- * @override
- * @param {object} viewModel - schedules view models
- */
- WeekdayInMonth.prototype.getBaseViewModel = function(viewModel) {
- var opt = this.options,
- gridHeaderHeight = util.pick(opt, 'grid', 'header', 'height') || 0,
- gridFooterHeight = util.pick(opt, 'grid', 'footer', 'height') || 0,
- renderLimitIdx = this._getRenderLimitIndex() + 1,
- exceedDate = this.getExceedDate(renderLimitIdx, viewModel.eventsInDateRange, viewModel.range),
- styles = this._getStyles(viewModel.theme);
- var baseViewModel;
- viewModel = util.extend({
- exceedDate: exceedDate
- }, viewModel);
- baseViewModel = Weekday.prototype.getBaseViewModel.call(this, viewModel);
- baseViewModel = util.extend({
- matrices: viewModel.eventsInDateRange,
- gridHeaderHeight: gridHeaderHeight,
- gridFooterHeight: gridFooterHeight,
- renderLimitIdx: renderLimitIdx,
- isReadOnly: opt.isReadOnly,
- styles: styles
- }, baseViewModel);
- return baseViewModel;
- };
- /**
- * @override
- * @param {object} viewModel - schedules view models
- */
- WeekdayInMonth.prototype.render = function(viewModel) {
- var container = this.container,
- baseViewModel = this.getBaseViewModel(viewModel),
- scheduleContainer;
- if (!this.options.visibleWeeksCount) {
- setIsOtherMonthFlag(baseViewModel.dates, this.options.renderMonth, viewModel.theme);
- }
- container.innerHTML = baseTmpl(baseViewModel);
- scheduleContainer = domutil.find(
- config.classname('.weekday-schedules'),
- container
- );
- if (!scheduleContainer) {
- return;
- }
- scheduleContainer.innerHTML = scheduleTmpl(baseViewModel);
- common.setAutoEllipsis(
- config.classname('.weekday-schedule-title'),
- container,
- true
- );
- };
- WeekdayInMonth.prototype._beforeDestroy = function() {
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- WeekdayInMonth.prototype._getStyles = function(theme) {
- var styles = {};
- if (theme) {
- styles.borderTop = theme.common.border;
- styles.borderLeft = theme.common.border;
- styles.fontSize = theme.month.day.fontSize;
- styles.borderRadius = theme.month.schedule.borderRadius;
- styles.marginLeft = theme.month.schedule.marginLeft;
- styles.marginRight = theme.month.schedule.marginRight;
- styles.scheduleBulletTop = this.options.scheduleHeight / 3;
- }
- return styles;
- };
- /**
- * 현재 달이 아닌 날짜에 대해 isOtherMonth = true 플래그를 추가한다.
- * @param {Array} dates - 날짜정보 배열
- * @param {TZDate} renderMonth - 현재 렌더링중인 월 (YYYYMM)
- * @param {Theme} theme - theme instance
- */
- function setIsOtherMonthFlag(dates, renderMonth, theme) {
- var month = renderMonth.getMonth() + 1;
- util.forEach(dates, function(dateObj) {
- var isOtherMonth = dateObj.month !== month;
- dateObj.isOtherMonth = isOtherMonth;
- if (isOtherMonth) {
- dateObj.color = Weekday.prototype._getDayNameColor(theme, dateObj.day, dateObj.isToday, isOtherMonth);
- }
- });
- }
- module.exports = WeekdayInMonth;
- /***/ }),
- /***/ "./src/js/view/popup/scheduleCreationPopup.js":
- /*!****************************************************!*\
- !*** ./src/js/view/popup/scheduleCreationPopup.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Floating layer for writing new schedules
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js");
- var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var DatePicker = __webpack_require__(/*! tui-date-picker */ "tui-date-picker");
- var timezone = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var tmpl = __webpack_require__(/*! ../template/popup/scheduleCreationPopup.hbs */ "./src/js/view/template/popup/scheduleCreationPopup.hbs");
- var TZDate = timezone.Date;
- var MAX_WEEK_OF_MONTH = 6;
- /**
- * @constructor
- * @extends {View}
- * @param {HTMLElement} container - container element
- * @param {Array.<Calendar>} calendars - calendar list used to create new schedule
- * @param {boolean} usageStatistics - GA tracking options in Calendar
- */
- function ScheduleCreationPopup(container, calendars, usageStatistics) {
- View.call(this, container);
- /**
- * @type {FloatingLayer}
- */
- this.layer = new FloatingLayer(null, container);
- /**
- * cached view model
- * @type {object}
- */
- this._viewModel = null;
- this._selectedCal = null;
- this._schedule = null;
- this.calendars = calendars;
- this._focusedDropdown = null;
- this._usageStatistics = usageStatistics;
- this._onClickListeners = [
- this._selectDropdownMenuItem.bind(this),
- this._toggleDropdownMenuView.bind(this),
- this._closeDropdownMenuView.bind(this, null),
- this._closePopup.bind(this),
- this._toggleIsAllday.bind(this),
- this._toggleIsPrivate.bind(this),
- this._onClickSaveSchedule.bind(this)
- ];
- domevent.on(container, 'click', this._onClick, this);
- }
- util.inherit(ScheduleCreationPopup, View);
- /**
- * Mousedown event handler for hiding popup layer when user mousedown outside of
- * layer
- * @param {MouseEvent} mouseDownEvent - mouse event object
- */
- ScheduleCreationPopup.prototype._onMouseDown = function(mouseDownEvent) {
- var target = domevent.getEventTarget(mouseDownEvent),
- popupLayer = domutil.closest(target, config.classname('.floating-layer'));
- if (popupLayer) {
- return;
- }
- this.hide();
- };
- /**
- * @override
- */
- ScheduleCreationPopup.prototype.destroy = function() {
- this.layer.destroy();
- this.layer = null;
- domevent.off(this.container, 'click', this._onClick, this);
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- View.prototype.destroy.call(this);
- };
- /**
- * @override
- * Click event handler for close button
- * @param {MouseEvent} clickEvent - mouse event object
- */
- ScheduleCreationPopup.prototype._onClick = function(clickEvent) {
- var target = domevent.getEventTarget(clickEvent);
- util.forEach(this._onClickListeners, function(listener) {
- return !listener(target);
- });
- };
- /**
- * Test click event target is close button, and return layer is closed(hidden)
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether popup layer is closed or not
- */
- ScheduleCreationPopup.prototype._closePopup = function(target) {
- var className = config.classname('popup-close');
- if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
- this.hide();
- return true;
- }
- return false;
- };
- /**
- * Toggle dropdown menu view, when user clicks dropdown button
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether user clicked dropdown button or not
- */
- ScheduleCreationPopup.prototype._toggleDropdownMenuView = function(target) {
- var className = config.classname('dropdown-button');
- var dropdownBtn = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
- if (!dropdownBtn) {
- return false;
- }
- if (domutil.hasClass(dropdownBtn.parentNode, config.classname('open'))) {
- this._closeDropdownMenuView(dropdownBtn.parentNode);
- } else {
- this._openDropdownMenuView(dropdownBtn.parentNode);
- }
- return true;
- };
- /**
- * Close drop down menu
- * @param {HTMLElement} dropdown - dropdown element that has a opened dropdown menu
- */
- ScheduleCreationPopup.prototype._closeDropdownMenuView = function(dropdown) {
- dropdown = dropdown || this._focusedDropdown;
- if (dropdown) {
- domutil.removeClass(dropdown, config.classname('open'));
- this._focusedDropdown = null;
- }
- };
- /**
- * Open drop down menu
- * @param {HTMLElement} dropdown - dropdown element that has a closed dropdown menu
- */
- ScheduleCreationPopup.prototype._openDropdownMenuView = function(dropdown) {
- domutil.addClass(dropdown, config.classname('open'));
- this._focusedDropdown = dropdown;
- };
- /**
- * If click dropdown menu item, close dropdown menu
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether
- */
- ScheduleCreationPopup.prototype._selectDropdownMenuItem = function(target) {
- var itemClassName = config.classname('dropdown-menu-item');
- var iconClassName = config.classname('icon');
- var contentClassName = config.classname('content');
- var selectedItem = domutil.hasClass(target, itemClassName) ? target : domutil.closest(target, '.' + itemClassName);
- var bgColor, title, dropdown, dropdownBtn;
- if (!selectedItem) {
- return false;
- }
- bgColor = domutil.find('.' + iconClassName, selectedItem).style.backgroundColor || 'transparent';
- title = domutil.find('.' + contentClassName, selectedItem).innerHTML;
- dropdown = domutil.closest(selectedItem, config.classname('.dropdown'));
- dropdownBtn = domutil.find(config.classname('.dropdown-button'), dropdown);
- domutil.find('.' + contentClassName, dropdownBtn).innerText = title;
- if (domutil.hasClass(dropdown, config.classname('section-calendar'))) {
- domutil.find('.' + iconClassName, dropdownBtn).style.backgroundColor = bgColor;
- this._selectedCal = common.find(this.calendars, function(cal) {
- return String(cal.id) === domutil.getData(selectedItem, 'calendarId');
- });
- }
- domutil.removeClass(dropdown, config.classname('open'));
- return true;
- };
- /**
- * Toggle allday checkbox state
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether event target is allday section or not
- */
- ScheduleCreationPopup.prototype._toggleIsAllday = function(target) {
- var className = config.classname('section-allday');
- var alldaySection = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
- var checkbox;
- if (alldaySection) {
- checkbox = domutil.find(config.classname('.checkbox-square'), alldaySection);
- checkbox.checked = !checkbox.checked;
- return true;
- }
- return false;
- };
- /**
- * Toggle private button
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether event target is private section or not
- */
- ScheduleCreationPopup.prototype._toggleIsPrivate = function(target) {
- var className = config.classname('section-private');
- var privateSection = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
- if (privateSection) {
- if (domutil.hasClass(privateSection, config.classname('public'))) {
- domutil.removeClass(privateSection, config.classname('public'));
- } else {
- domutil.addClass(privateSection, config.classname('public'));
- }
- return true;
- }
- return false;
- };
- /**
- * Save new schedule if user clicked save button
- * @emits ScheduleCreationPopup#saveSchedule
- * @param {HTMLElement} target click event target
- * @returns {boolean} whether save button is clicked or not
- */
- // eslint-disable-next-line complexity
- ScheduleCreationPopup.prototype._onClickSaveSchedule = function(target) {
- var className = config.classname('popup-save');
- var cssPrefix = config.cssPrefix;
- var title;
- var startDate;
- var endDate;
- var rangeDate;
- var form;
- var isAllDay;
- if (!domutil.hasClass(target, className) && !domutil.closest(target, '.' + className)) {
- return false;
- }
- title = domutil.get(cssPrefix + 'schedule-title');
- startDate = new TZDate(this.rangePicker.getStartDate());
- endDate = new TZDate(this.rangePicker.getEndDate());
- if (!this._validateForm(title, startDate, endDate)) {
- if (!title.value) {
- title.focus();
- }
- return false;
- }
- isAllDay = !!domutil.get(cssPrefix + 'schedule-allday').checked;
- rangeDate = this._getRangeDate(startDate, endDate, isAllDay);
- form = {
- calendarId: this._selectedCal ? this._selectedCal.id : null,
- title: title,
- location: domutil.get(cssPrefix + 'schedule-location'),
- start: rangeDate.start,
- end: rangeDate.end,
- isAllDay: isAllDay,
- state: domutil.get(cssPrefix + 'schedule-state').innerText,
- isPrivate: !domutil.hasClass(domutil.get(cssPrefix + 'schedule-private'), config.classname('public'))
- };
- if (this._isEditMode) {
- this._onClickUpdateSchedule(form);
- } else {
- this._onClickCreateSchedule(form);
- }
- this.hide();
- return true;
- };
- /**
- * @override
- * @param {object} viewModel - view model from factory/monthView
- */
- ScheduleCreationPopup.prototype.render = function(viewModel) {
- var calendars = this.calendars;
- var layer = this.layer;
- var self = this;
- var boxElement, guideElements;
- viewModel.zIndex = this.layer.zIndex + 5;
- viewModel.calendars = calendars;
- if (calendars.length) {
- viewModel.selectedCal = this._selectedCal = calendars[0];
- }
- this._isEditMode = viewModel.schedule && viewModel.schedule.id;
- if (this._isEditMode) {
- boxElement = viewModel.target;
- viewModel = this._makeEditModeData(viewModel);
- } else {
- this.guide = viewModel.guide;
- guideElements = this._getGuideElements(this.guide);
- boxElement = guideElements.length ? guideElements[0] : null;
- }
- layer.setContent(tmpl(viewModel));
- this._createDatepicker(viewModel.start, viewModel.end, viewModel.isAllDay);
- layer.show();
- if (boxElement) {
- this._setPopupPositionAndArrowDirection(boxElement.getBoundingClientRect());
- }
- util.debounce(function() {
- domevent.on(document.body, 'mousedown', self._onMouseDown, self);
- })();
- };
- /**
- * Make view model for edit mode
- * @param {object} viewModel - original view model from 'beforeCreateEditPopup'
- * @returns {object} - edit mode view model
- */
- ScheduleCreationPopup.prototype._makeEditModeData = function(viewModel) {
- var schedule = viewModel.schedule;
- var title, isPrivate, location, startDate, endDate, isAllDay, state;
- var raw = schedule.raw || {};
- var calendars = this.calendars;
- var id = schedule.id;
- title = schedule.title;
- isPrivate = raw['class'] === 'private';
- location = schedule.location;
- startDate = schedule.start;
- endDate = schedule.end;
- isAllDay = schedule.isAllDay;
- state = schedule.state;
- viewModel.selectedCal = this._selectedCal = common.find(this.calendars, function(cal) {
- return cal.id === viewModel.schedule.calendarId;
- });
- this._schedule = schedule;
- return {
- id: id,
- selectedCal: this._selectedCal,
- calendars: calendars,
- title: title,
- isPrivate: isPrivate,
- location: location,
- isAllDay: isAllDay,
- state: state,
- start: startDate,
- end: endDate,
- raw: {
- class: isPrivate ? 'private' : 'public'
- },
- zIndex: this.layer.zIndex + 5,
- isEditMode: this._isEditMode
- };
- };
- /**
- * Set popup position and arrow direction to apear near guide element
- * @param {MonthCreationGuide|TimeCreationGuide|DayGridCreationGuide} guideBound - creation guide element
- */
- ScheduleCreationPopup.prototype._setPopupPositionAndArrowDirection = function(guideBound) {
- var layer = domutil.find(config.classname('.popup'), this.layer.container);
- var layerSize = {
- width: layer.offsetWidth,
- height: layer.offsetHeight
- };
- var containerBound = this.container.getBoundingClientRect();
- var pos = this._calcRenderingData(layerSize, containerBound, guideBound);
- this.layer.setPosition(pos.x, pos.y);
- this._setArrowDirection(pos.arrow);
- };
- /**
- * Get guide elements from creation guide object
- * It is used to calculate rendering position of popup
- * It will be disappeared when hiding popup
- * @param {MonthCreationGuide|TimeCreationGuide|AlldayCreationGuide} guide - creation guide
- * @returns {Array.<HTMLElement>} creation guide element
- */
- ScheduleCreationPopup.prototype._getGuideElements = function(guide) {
- var guideElements = [];
- var i = 0;
- if (guide.guideElement) {
- guideElements.push(guide.guideElement);
- } else if (guide.guideElements) {
- for (; i < MAX_WEEK_OF_MONTH; i += 1) {
- if (guide.guideElements[i]) {
- guideElements.push(guide.guideElements[i]);
- }
- }
- }
- return guideElements;
- };
- /**
- * Get guide element's bound data which only includes top, right, bottom, left
- * @param {Array.<HTMLElement>} guideElements - creation guide elements
- * @returns {Object} - popup bound data
- */
- ScheduleCreationPopup.prototype._getBoundOfFirstRowGuideElement = function(guideElements) {
- var bound;
- if (!guideElements.length) {
- return null;
- }
- bound = guideElements[0].getBoundingClientRect();
- return {
- top: bound.top,
- left: bound.left,
- bottom: bound.bottom,
- right: bound.right
- };
- };
- /**
- * Get calculate rendering positions of y and arrow direction by guide block elements
- * @param {number} guideBoundTop - guide block's top
- * @param {number} guideBoundBottom - guide block's bottom
- * @param {number} layerHeight - popup layer's height
- * @param {number} containerTop - container's top
- * @param {number} containerBottom - container's bottom
- * @returns {YAndArrowDirection} y and arrowDirection
- */
- ScheduleCreationPopup.prototype._getYAndArrowDirection = function(
- guideBoundTop,
- guideBoundBottom,
- layerHeight,
- containerTop,
- containerBottom
- ) {
- var arrowDirection = 'arrow-bottom';
- var MARGIN = 3;
- var y = guideBoundTop - layerHeight;
- if (y < containerTop) {
- y = guideBoundBottom - containerTop + MARGIN;
- arrowDirection = 'arrow-top';
- } else {
- y = y - containerTop - MARGIN;
- }
- if (y + layerHeight > containerBottom) {
- y = containerBottom - layerHeight - containerTop - MARGIN;
- }
- /**
- * @typedef {Object} YAndArrowDirection
- * @property {number} y - top position of popup layer
- * @property {string} [arrowDirection] - direction of popup arrow
- */
- return {
- y: y,
- arrowDirection: arrowDirection
- };
- };
- /**
- * Get calculate rendering x position and arrow left by guide block elements
- * @param {number} guideBoundLeft - guide block's left
- * @param {number} guideBoundRight - guide block's right
- * @param {number} layerWidth - popup layer's width
- * @param {number} containerLeft - container's left
- * @param {number} containerRight - container's right
- * @returns {XAndArrowLeft} x and arrowLeft
- */
- ScheduleCreationPopup.prototype._getXAndArrowLeft = function(
- guideBoundLeft,
- guideBoundRight,
- layerWidth,
- containerLeft,
- containerRight
- ) {
- var guideHorizontalCenter = (guideBoundLeft + guideBoundRight) / 2;
- var x = guideHorizontalCenter - (layerWidth / 2);
- var ARROW_WIDTH_HALF = 8;
- var arrowLeft;
- if (x + layerWidth > containerRight) {
- x = guideBoundRight - layerWidth + ARROW_WIDTH_HALF;
- arrowLeft = guideHorizontalCenter - x;
- } else {
- x += ARROW_WIDTH_HALF;
- }
- if (x < containerLeft) {
- x = 0;
- arrowLeft = guideHorizontalCenter - containerLeft - ARROW_WIDTH_HALF;
- } else {
- x = x - containerLeft - ARROW_WIDTH_HALF;
- }
- /**
- * @typedef {Object} XAndArrowLeft
- * @property {number} x - left position of popup layer
- * @property {numbe3er} arrowLeft - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
- */
- return {
- x: x,
- arrowLeft: arrowLeft
- };
- };
- /**
- * Calculate rendering position usering guide elements
- * @param {{width: {number}, height: {number}}} layerSize - popup layer's width and height
- * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} containerBound - width and height of the upper layer, that acts as a border of popup
- * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} guideBound - guide element bound data
- * @returns {PopupRenderingData} rendering position of popup and popup arrow
- */
- ScheduleCreationPopup.prototype._calcRenderingData = function(layerSize, containerBound, guideBound) {
- var yPosInfo = this._getYAndArrowDirection(
- guideBound.top,
- guideBound.bottom,
- layerSize.height,
- containerBound.top,
- containerBound.bottom
- );
- var xPosInfo = this._getXAndArrowLeft(
- guideBound.left,
- guideBound.right,
- layerSize.width,
- containerBound.left,
- containerBound.right
- );
- /**
- * @typedef {Object} PopupRenderingData
- * @property {number} x - left position
- * @property {number} y - top position
- * @property {string} arrow.direction - direction of popup arrow
- * @property {number} [arrow.position] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
- */
- return {
- x: xPosInfo.x,
- y: yPosInfo.y,
- arrow: {
- direction: yPosInfo.arrowDirection,
- position: xPosInfo.arrowLeft
- }
- };
- };
- /**
- * Set arrow's direction and position
- * @param {Object} arrow rendering data for popup arrow
- */
- ScheduleCreationPopup.prototype._setArrowDirection = function(arrow) {
- var direction = arrow.direction || 'arrow-bottom';
- var arrowEl = domutil.get(config.classname('popup-arrow'));
- var borderElement = domutil.find(config.classname('.popup-arrow-border', arrowEl));
- if (direction !== config.classname('arrow-bottom')) {
- domutil.removeClass(arrowEl, config.classname('arrow-bottom'));
- domutil.addClass(arrowEl, config.classname(direction));
- }
- if (arrow.position) {
- borderElement.style.left = arrow.position + 'px';
- }
- };
- /**
- * Create date range picker using start date and end date
- * @param {TZDate} start - start date
- * @param {TZDate} end - end date
- * @param {boolean} isAllDay - isAllDay
- */
- ScheduleCreationPopup.prototype._createDatepicker = function(start, end, isAllDay) {
- var cssPrefix = config.cssPrefix;
- this.rangePicker = DatePicker.createRangePicker({
- startpicker: {
- date: new TZDate(start).toDate(),
- input: '#' + cssPrefix + 'schedule-start-date',
- container: '#' + cssPrefix + 'startpicker-container'
- },
- endpicker: {
- date: new TZDate(end).toDate(),
- input: '#' + cssPrefix + 'schedule-end-date',
- container: '#' + cssPrefix + 'endpicker-container'
- },
- format: isAllDay ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm',
- timepicker: isAllDay ? null : {
- showMeridiem: false,
- usageStatistics: this._usageStatistics
- },
- usageStatistics: this._usageStatistics
- });
- };
- /**
- * Hide layer
- */
- ScheduleCreationPopup.prototype.hide = function() {
- this.layer.hide();
- if (this.guide) {
- this.guide.clearGuideElement();
- this.guide = null;
- }
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- };
- /**
- * refresh layer
- */
- ScheduleCreationPopup.prototype.refresh = function() {
- if (this._viewModel) {
- this.layer.setContent(this.tmpl(this._viewModel));
- }
- };
- /**
- * Set calendar list
- * @param {Array.<Calendar>} calendars - calendar list
- */
- ScheduleCreationPopup.prototype.setCalendars = function(calendars) {
- this.calendars = calendars || [];
- };
- /**
- * Validate the form
- * @param {string} title title of then entered schedule
- * @param {TZDate} startDate start date time from range picker
- * @param {TZDate} endDate end date time from range picker
- * @returns {boolean} Returns false if the form is not valid for submission.
- */
- ScheduleCreationPopup.prototype._validateForm = function(title, startDate, endDate) {
- if (!title.value) {
- return false;
- }
- if (!startDate && !endDate) {
- return false;
- }
- if (datetime.compare(startDate, endDate) === 1) {
- return false;
- }
- return true;
- };
- /**
- * Get range date from range picker
- * @param {TZDate} startDate start date time from range picker
- * @param {TZDate} endDate end date time from range picker
- * @param {boolean} isAllDay whether it is an all-day schedule
- * @returns {RangeDate} Returns the start and end time data that is the range date
- */
- ScheduleCreationPopup.prototype._getRangeDate = function(startDate, endDate, isAllDay) {
- var start = isAllDay ? datetime.start(startDate) : startDate;
- var end = isAllDay ? datetime.renderEnd(startDate, endDate) : endDate;
- /**
- * @typedef {object} RangeDate
- * @property {TZDate} start start time
- * @property {TZDate} end end time
- */
- return {
- start: new TZDate(start),
- end: new TZDate(end)
- };
- };
- /**
- * Request schedule model creation to controller by custom schedules.
- * @fires {ScheduleCreationPopup#beforeUpdateSchedule}
- * @param {{
- calendarId: {string},
- title: {string},
- location: {string},
- start: {TZDate},
- end: {TZDate},
- isAllDay: {boolean},
- state: {string},
- isPrivate: {boolean}
- }} form schedule input form data
- */
- ScheduleCreationPopup.prototype._onClickUpdateSchedule = function(form) {
- var changes = common.getScheduleChanges(
- this._schedule,
- ['calendarId', 'title', 'location', 'start', 'end', 'isAllDay', 'state'],
- {
- calendarId: form.calendarId,
- title: form.title.value,
- location: form.location.value,
- start: form.start,
- end: form.end,
- isAllDay: form.isAllDay,
- state: form.state
- }
- );
- /**
- * @event ScheduleCreationPopup#beforeUpdateSchedule
- * @type {object}
- * @property {Schedule} schedule - schedule object to be updated
- */
- this.fire('beforeUpdateSchedule', {
- schedule: util.extend({
- raw: {
- class: form.isPrivate ? 'private' : 'public'
- }
- }, this._schedule),
- changes: changes,
- start: form.start,
- end: form.end,
- calendar: this._selectedCal,
- triggerEventName: 'click'
- });
- };
- /**
- * Request the controller to update the schedule model according to the custom schedule.
- * @fires {ScheduleCreationPopup#beforeCreateSchedule}
- * @param {{
- calendarId: {string},
- title: {string},
- location: {string},
- start: {TZDate},
- end: {TZDate},
- isAllDay: {boolean},
- state: {string}
- }} form schedule input form data
- */
- ScheduleCreationPopup.prototype._onClickCreateSchedule = function(form) {
- /**
- * @event ScheduleCreationPopup#beforeCreateSchedule
- * @type {object}
- * @property {Schedule} schedule - new schedule instance to be added
- */
- this.fire('beforeCreateSchedule', {
- calendarId: form.calendarId,
- title: form.title.value,
- location: form.location.value,
- raw: {
- class: form.isPrivate ? 'private' : 'public'
- },
- start: form.start,
- end: form.end,
- isAllDay: form.isAllDay,
- state: form.state
- });
- };
- module.exports = ScheduleCreationPopup;
- /***/ }),
- /***/ "./src/js/view/popup/scheduleDetailPopup.js":
- /*!**************************************************!*\
- !*** ./src/js/view/popup/scheduleDetailPopup.js ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint-disable vars-on-top */
- /**
- * @fileoverview Floating layer for showing detail schedule
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js");
- var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var tmpl = __webpack_require__(/*! ../template/popup/scheduleDetailPopup.hbs */ "./src/js/view/template/popup/scheduleDetailPopup.hbs");
- var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
- var TZDate = tz.Date;
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- /**
- * @constructor
- * @extends {View}
- * @param {HTMLElement} container - container element
- */
- function ScheduleDetailPopup(container) {
- View.call(this, container);
- /**
- * @type {FloatingLayer}
- */
- this.layer = new FloatingLayer(null, container);
- /**
- * cached view model
- * @type {object}
- */
- this._viewModel = null;
- this._schedule = null;
- this._calendar = null;
- domevent.on(container, 'click', this._onClick, this);
- }
- util.inherit(ScheduleDetailPopup, View);
- /**
- * Mousedown event handler for hiding popup layer when user mousedown outside of
- * layer
- * @param {MouseEvent} mouseDownEvent - mouse event object
- */
- ScheduleDetailPopup.prototype._onMouseDown = function(mouseDownEvent) {
- var target = domevent.getEventTarget(mouseDownEvent),
- popupLayer = domutil.closest(target, config.classname('.floating-layer'));
- if (popupLayer) {
- return;
- }
- this.hide();
- };
- /**
- * @override
- */
- ScheduleDetailPopup.prototype.destroy = function() {
- this.layer.destroy();
- this.layer = null;
- domevent.off(this.container, 'click', this._onClick, this);
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- View.prototype.destroy.call(this);
- };
- /**
- * @override
- * Click event handler for close button
- * @param {MouseEvent} clickEvent - mouse event object
- */
- ScheduleDetailPopup.prototype._onClick = function(clickEvent) {
- var target = domevent.getEventTarget(clickEvent);
- this._onClickEditSchedule(target);
- this._onClickDeleteSchedule(target);
- };
- /**
- * @fires ScheduleDetailPopup#clickEditSchedule
- * @param {HTMLElement} target - event target
- */
- ScheduleDetailPopup.prototype._onClickEditSchedule = function(target) {
- var className = config.classname('popup-edit');
- if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
- this.fire('beforeUpdateSchedule', {
- schedule: this._schedule,
- triggerEventName: 'click',
- target: this._scheduleEl
- });
- this.hide();
- }
- };
- /**
- * @fires ScheduleDetailPopup#clickEditSchedule
- * @param {HTMLElement} target - event target
- */
- ScheduleDetailPopup.prototype._onClickDeleteSchedule = function(target) {
- var className = config.classname('popup-delete');
- if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
- this.fire('beforeDeleteSchedule', {
- schedule: this._schedule
- });
- this.hide();
- }
- };
- /**
- * @override
- * @param {object} viewModel - view model from factory/monthView
- */
- ScheduleDetailPopup.prototype.render = function(viewModel) {
- var layer = this.layer;
- var self = this;
- layer.setContent(tmpl({
- schedule: this._getScheduleModel(viewModel.schedule),
- calendar: viewModel.calendar
- }));
- layer.show();
- this._setPopupPositionAndArrowDirection(viewModel.event);
- this._schedule = viewModel.schedule;
- this._calendar = viewModel.calendar;
- util.debounce(function() {
- domevent.on(document.body, 'mousedown', self._onMouseDown, self);
- })();
- };
- // eslint-disable-next-line complexity
- ScheduleDetailPopup.prototype._getScheduleModel = function(scheduleViewModel) {
- var viewModel = util.extend({}, scheduleViewModel);
- var dayStart = datetime.start(scheduleViewModel.start);
- var startDayOffset = dayStart.toDate().getTimezoneOffset();
- var nativeOffsetMs = tz.getNativeOffsetMs();
- var hasPrimaryTimezoneCustomSetting = tz.hasPrimaryTimezoneCustomSetting();
- var startOffset = viewModel.start.toDate().getTimezoneOffset();
- var endOffset = viewModel.end.toDate().getTimezoneOffset();
- var primaryTimezoneCode = tz.getPrimaryTimezoneName();
- var primaryOffset = tz.getPrimaryOffset();
- var startTimezoneOffset = tz.getOffsetByTimezoneName(
- primaryTimezoneCode,
- viewModel.start.getTime()
- );
- var endTimezoneOffset = tz.getOffsetByTimezoneName(
- primaryTimezoneCode,
- viewModel.end.getTime()
- );
- var MIN_TO_MS = 60 * 1000;
- var offsetDiffMs = 0;
- var start, end;
- if (
- hasPrimaryTimezoneCustomSetting &&
- tz.isNativeOsUsingDSTTimezone() &&
- nativeOffsetMs !== startDayOffset
- ) {
- // When using a custom time zone, the native time zone offset is fixed and rendered.
- // So, The fixed and rendered time should be recalculated as the original time zone offset.
- // The current system OS local time is not affected by summer/standard time and the schedule should always be displayed in the same location.
- offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
- start = new TZDate(viewModel.start);
- start.addMilliseconds(offsetDiffMs);
- viewModel.start = start;
- offsetDiffMs = (endOffset * MIN_TO_MS) - nativeOffsetMs;
- end = new TZDate(viewModel.end);
- end.addMilliseconds(offsetDiffMs);
- viewModel.end = end;
- }
- if (
- hasPrimaryTimezoneCustomSetting &&
- tz.isPrimaryUsingDSTTimezone() &&
- (primaryOffset !== startTimezoneOffset || primaryOffset !== endTimezoneOffset)
- ) {
- // The custom time zone is a time zone where two offsets including DST are applied.
- // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
- // It should be recalculated with the original time zone offset.
- offsetDiffMs = (primaryOffset - startTimezoneOffset) * MIN_TO_MS;
- start = new TZDate(viewModel.start);
- start.addMilliseconds(offsetDiffMs);
- viewModel.start = start;
- offsetDiffMs = (primaryOffset - endTimezoneOffset) * MIN_TO_MS;
- end = new TZDate(viewModel.end);
- end.addMilliseconds(offsetDiffMs);
- viewModel.end = end;
- }
- return viewModel;
- };
- /**
- * Set popup position and arrow direction to apear near guide element
- * @param {Event} event - creation guide element
- */
- ScheduleDetailPopup.prototype._setPopupPositionAndArrowDirection = function(event) {
- var layer = domutil.find(config.classname('.popup'), this.layer.container);
- var layerSize = {
- width: layer.offsetWidth,
- height: layer.offsetHeight
- };
- var containerBound = this.container.getBoundingClientRect();
- var scheduleEl = domevent.getEventTarget(event);
- var blockEl = domutil.closest(scheduleEl, config.classname('.time-date-schedule-block'))
- || domutil.closest(scheduleEl, config.classname('.weekday-schedule'))
- || scheduleEl;
- var scheduleBound = blockEl.getBoundingClientRect();
- var pos;
- this._scheduleEl = blockEl;
- pos = this._calcRenderingData(layerSize, containerBound, scheduleBound);
- this.layer.setPosition(pos.x, pos.y);
- this._setArrowDirection(pos.arrow);
- };
- /**
- * Get calculate rendering positions of y and arrow top by schedule block elements
- * @param {number} scheduleBoundTop - schedule block's top
- * @param {number} scheduleBoundBottom - schedule block's bottom
- * @param {number} layerHeight - popup layer's height
- * @param {number} containerTop - container's top
- * @param {number} containerBottom - container's bottom
- * @returns {YAndArrowTop} y and arrowTop
- */
- ScheduleDetailPopup.prototype._getYAndArrowTop = function(
- scheduleBoundTop,
- scheduleBoundBottom,
- layerHeight,
- containerTop,
- containerBottom
- ) {
- var ARROW_WIDTH_HALF = 8;
- var scheduleVerticalCenter, y, arrowTop;
- scheduleBoundTop = scheduleBoundTop < 0 ? 0 : scheduleBoundTop;
- scheduleVerticalCenter = (scheduleBoundTop + scheduleBoundBottom) / 2;
- y = scheduleVerticalCenter - (layerHeight / 2);
- if (y < containerTop) {
- y = 0;
- arrowTop = scheduleVerticalCenter - containerTop - ARROW_WIDTH_HALF;
- } else if (y + layerHeight > containerBottom) {
- y = Math.max(containerBottom - layerHeight - containerTop, 0);
- arrowTop = scheduleVerticalCenter - y - containerTop - ARROW_WIDTH_HALF;
- } else {
- y -= containerTop;
- }
- if (arrowTop < 0 || arrowTop > layerHeight) {
- arrowTop = null;
- }
- /**
- * @typedef {Object} YAndArrowTop
- * @property {number} y - top position of popup layer
- * @property {number} [arrowTop] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
- */
- return {
- y: y,
- arrowTop: arrowTop
- };
- };
- /**
- * Get calculate rendering x position and arrow direction by schedule block elements
- * @param {number} scheduleBoundLeft - schedule block's left
- * @param {number} scheduleBoundRight - schedule block's right
- * @param {number} layerWidth - popup layer's width
- * @param {number} containerLeft - container's left
- * @param {number} containerRight - container's right
- * @returns {XAndArrowDirection} x and arrowDirection
- */
- ScheduleDetailPopup.prototype._getXAndArrowDirection = function(
- scheduleBoundLeft,
- scheduleBoundRight,
- layerWidth,
- containerLeft,
- containerRight
- ) {
- var arrowDirection = 'arrow-left';
- var x = scheduleBoundRight;
- var MARGIN = 4;
- if (x + layerWidth > containerRight) {
- arrowDirection = 'arrow-right';
- x = scheduleBoundLeft - layerWidth - MARGIN;
- } else {
- x += MARGIN;
- }
- if (x < containerLeft) {
- x = 0;
- } else {
- x -= containerLeft;
- }
- /**
- * @typedef {Object} XAndArrowDirection
- * @property {number} x - left position of popup layer
- * @property {string} arrowDirection - direction of popup arrow
- */
- return {
- x: x,
- arrowDirection: arrowDirection
- };
- };
- /**
- * Calculate rendering position usering guide elements
- * @param {{width: {number}, height: {number}}} layerSize - popup layer's width and height
- * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} containerBound - width and height of the upper layer, that acts as a border of popup
- * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} scheduleBound - guide element bound data
- * @returns {PopupRenderingData} rendering position of popup and popup arrow
- */
- ScheduleDetailPopup.prototype._calcRenderingData = function(layerSize, containerBound, scheduleBound) {
- var yPosInfo = this._getYAndArrowTop(
- scheduleBound.top,
- scheduleBound.bottom,
- layerSize.height,
- containerBound.top,
- containerBound.bottom
- );
- var xPosInfo = this._getXAndArrowDirection(
- scheduleBound.left,
- scheduleBound.right,
- layerSize.width,
- containerBound.left,
- containerBound.right
- );
- /**
- * @typedef {Object} PopupRenderingData
- * @property {number} x - left position
- * @property {number} y - top position
- * @property {string} arrow.direction - direction of popup arrow
- * @property {number} [arrow.position] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
- */
- return {
- x: xPosInfo.x,
- y: yPosInfo.y,
- arrow: {
- direction: xPosInfo.arrowDirection,
- position: yPosInfo.arrowTop
- }
- };
- };
- /**
- * Set arrow's direction and position
- * @param {Object} arrow rendering data for popup arrow
- */
- ScheduleDetailPopup.prototype._setArrowDirection = function(arrow) {
- var direction = arrow.direction || 'arrow-left';
- var arrowEl = domutil.find(config.classname('.popup-arrow'), this.layer.container);
- var borderElement = domutil.find(config.classname('.popup-arrow-border'), arrowEl);
- if (direction !== config.classname('arrow-left')) {
- domutil.removeClass(arrowEl, config.classname('arrow-left'));
- domutil.addClass(arrowEl, config.classname(direction));
- }
- if (arrow.position) {
- borderElement.style.top = arrow.position + 'px';
- }
- };
- /**
- * Hide layer
- */
- ScheduleDetailPopup.prototype.hide = function() {
- this.layer.hide();
- if (this.guide) {
- this.guide.clearGuideElement();
- this.guide = null;
- }
- domevent.off(document.body, 'mousedown', this._onMouseDown, this);
- };
- /**
- * refresh layer
- */
- ScheduleDetailPopup.prototype.refresh = function() {
- if (this._viewModel) {
- this.layer.setContent(this.tmpl(this._viewModel));
- }
- };
- module.exports = ScheduleDetailPopup;
- /***/ }),
- /***/ "./src/js/view/template/helper.js":
- /*!****************************************!*\
- !*** ./src/js/view/template/helper.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint complexity: 0 */
- /**
- * @fileoverview Helpers for handlebar templates.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Handlebars = __webpack_require__(/*! handlebars-template-loader/runtime */ "./node_modules/handlebars-template-loader/runtime/index.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var mmax = Math.max;
- var SIXTY_MINUTES = 60;
- var helpers = {
- /**
- * Stamp supplied object
- *
- * Commonly use for rendering object's unique ID to rendered view
- * @param {object} obj - object to stamp
- * @returns {number} stamp value
- */
- 'stamp': function(obj) {
- return util.stamp(obj);
- },
- /**
- * Whether supplied object are equal?
- * @param {*} a - a
- * @param {*} b - b
- * @returns {boolean} result of operation
- */
- 'equal': function(a, b) {
- return a === b;
- },
- /**
- * OR
- * @param {*} a - a
- * @param {*} b - b
- * @returns {boolean} or
- */
- 'or': function(a, b) {
- return a || b;
- },
- /**
- * AND
- * @param {*} a - a
- * @param {*} b - b
- * @returns {boolean} or
- */
- 'and': function(a, b) {
- return a && b;
- },
- /**
- * Compare object or apply logical operation by customizable oper parameter
- * @param {*} a - a
- * @param {string} oper - operator ex) '==', '<'
- * @param {*} b - b
- * @param {Handlebars} options - handlebar options
- * @returns {boolean} result of operation
- */
- 'fi': function(a, oper, b, options) {
- switch (oper) {
- case '==':
- return (a == b) ? options.fn(this) : options.inverse(this); // eslint-disable-line
- case '===':
- return (a === b) ? options.fn(this) : options.inverse(this);
- case '!==':
- return (a !== b) ? options.fn(this) : options.inverse(this);
- case '<':
- return (a < b) ? options.fn(this) : options.inverse(this);
- case '||':
- return (a || b) ? options.fn(this) : options.inverse(this);
- default:
- throw new Error('Not match operation');
- }
- },
- /**
- * Get hhmm formatted time str
- * @param {Date} date - date object
- * @returns {string} formatted value
- */
- 'hhmm': function(date) {
- return datetime.format(date, 'HH:mm');
- },
- /**
- * Get `width` stylesheet string
- * @param {number} width - width percentage
- * @returns {string} css style part
- */
- 'common-width': function(width) {
- return getElSize(width, '%', 'width');
- },
- /**
- * Get element left based on narrowWeekend
- * @param {object} viewModel - view model
- * @param {Array} grids - dates information
- * @returns {number} element left
- */
- 'grid-left': function(viewModel, grids) {
- return getElLeft(viewModel, grids);
- },
- /**
- * Get element width based on narrowWeekend
- * @param {object} viewModel - view model
- * @param {Array} grids - dates information
- * @returns {number} element width
- */
- 'grid-width': function(viewModel, grids) {
- return getElWidth(viewModel, grids);
- },
- /**
- * Use in time.hbs
- * @param {ScheduleViewModel} viewModel viewModel
- * @returns {string} element size css class
- */
- 'time-scheduleBlock': function(viewModel) {
- var top = getElSize(viewModel.top, 'px', 'top'),
- left = getElSize(viewModel.left, '%', 'left'),
- width = getElSize(viewModel.width, '%', 'width'),
- height = getElSize(viewModel.height, 'px', 'height');
- return [top, left, width, height].join(';');
- },
- 'month-scheduleBlock': function(viewModel, grids, blockHeight, paddingTop) {
- var top = getElSize(((viewModel.top - 1) * blockHeight) + paddingTop, 'px', 'top');
- var left = getElSize(grids[viewModel.left] ? grids[viewModel.left].left : 0, '%', 'left');
- var width = getElSize(getElWidth(viewModel, grids), '%', 'width');
- var height = getElSize(viewModel.height, 'px', 'height');
- return [top, left, width, height].join(';');
- },
- 'holiday': function(day) {
- var cssClass = '';
- if (day === 0) {
- cssClass = config.classname('holiday-sun');
- }
- if (day === 6) {
- cssClass = config.classname('holiday-sat');
- }
- return cssClass;
- },
- /**
- * Add supplied two parameter
- * @param {*} a - a
- * @param {*} b - b
- * @returns {number} result of operation
- */
- 'add': function(a, b) {
- return a + b;
- },
- /**
- * Multiply supplied two parameter
- * @param {*} a - a
- * @param {*} b - b
- * @returns {number} result of operation
- */
- 'multiply': function(a, b) {
- return a * b;
- },
- /**
- * Divide supplied two parameter
- * @param {*} a - a
- * @param {*} b - b
- * @returns {number} result of operation
- */
- 'divide': function(a, b) {
- return a / b;
- },
- /**
- * Subtract supplied two parameter
- * @param {*} a - a
- * @param {*} b - b
- * @returns {number} result of operation
- */
- 'subtract': function(a, b) {
- return a - b;
- },
- 'getRight': function(a, b) {
- return mmax(0, 100 - (a + b));
- },
- /**
- * Get css prefix in global configuration
- * @returns {string} css prefix
- */
- 'CSS_PREFIX': function() {
- return config.cssPrefix;
- },
- 'reverse': function(array) {
- return array.slice().reverse();
- },
- /**********
- * Default schedule template
- **********/
- 'milestone-tmpl': function(model) {
- var icon = config.classname('icon');
- var iconName = config.classname('ic-milestone');
- return '<span class="' + icon + ' ' + iconName + '"></span><span style="background-color: ' + model.bgColor + '">' + common.stripTags(model.title) + '</span>';
- },
- 'milestoneTitle-tmpl': function() {
- var className = config.classname('left-content');
- return '<span class="' + className + '">Milestone</span>';
- },
- 'task-tmpl': function(model) {
- return '#' + model.title;
- },
- 'taskTitle-tmpl': function() {
- var className = config.classname('left-content');
- return '<span class="' + className + '">Task</span>';
- },
- 'alldayTitle-tmpl': function() {
- var className = config.classname('left-content');
- return '<span class="' + className + '">All Day</span>';
- },
- 'allday-tmpl': function(model) {
- return common.stripTags(model.title);
- },
- 'time-tmpl': function(model) {
- return common.stripTags(model.title);
- },
- 'goingDuration-tmpl': function(model) {
- var goingDuration = model.goingDuration;
- var hour = parseInt(goingDuration / SIXTY_MINUTES, 10);
- var minutes = goingDuration % SIXTY_MINUTES;
- return 'GoingTime ' + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
- },
- 'comingDuration-tmpl': function(model) {
- var goingDuration = model.goingDuration;
- var hour = parseInt(goingDuration / SIXTY_MINUTES, 10);
- var minutes = goingDuration % SIXTY_MINUTES;
- return 'ComingTime ' + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
- },
- 'monthMoreTitleDate-tmpl': function(date, dayname) {
- var classDay = config.classname('month-more-title-day');
- var classDayLabel = config.classname('month-more-title-day-label');
- var day = util.pick(date.split('.'), 2);
- return '<span class="' + classDay + '">' + day + '</span> <span class="' + classDayLabel + '">' + dayname + '</span>';
- },
- 'monthMoreClose-tmpl': function() {
- return '';
- },
- 'monthGridHeader-tmpl': function(model) {
- var date = parseInt(model.date.split('-')[2], 10);
- var classNames = [];
- classNames.push(config.classname('weekday-grid-date'));
- if (model.isToday) {
- classNames.push(config.classname('weekday-grid-date-decorator'));
- }
- return '<span class="' + classNames.join(' ') + '">' + date + '</span>';
- },
- 'monthGridHeaderExceed-tmpl': function(hiddenSchedules) {
- var className = config.classname('weekday-grid-more-schedules');
- return '<span class="' + className + '">' + hiddenSchedules + ' more</span>';
- },
- 'monthGridFooter-tmpl': function() {
- return '';
- },
- /* eslint no-unused-vars: 0 */
- 'monthGridFooterExceed-tmpl': function(hiddenSchedules) {
- return '';
- },
- 'monthDayname-tmpl': function(model) {
- return model.label;
- },
- 'weekDayname-tmpl': function(model) {
- var classDate = config.classname('dayname-date');
- var className = config.classname('dayname-name');
- return '<span class="' + classDate + '">' + model.date + '</span> <span class="' + className + '">' + model.dayName + '</span>';
- },
- 'weekGridFooterExceed-tmpl': function(hiddenSchedules) {
- return '+' + hiddenSchedules;
- },
- 'dayGridTitle-tmpl': function(viewName) {
- var tmpl = Handlebars.helpers[viewName + 'Title-tmpl'];
- if (tmpl) {
- return tmpl(viewName);
- }
- return viewName;
- },
- 'schedule-tmpl': function(model) {
- var tmpl = Handlebars.helpers[model.category + '-tmpl'];
- if (tmpl) {
- return tmpl(model);
- }
- return '';
- },
- 'collapseBtnTitle-tmpl': function() {
- var iconName = config.classname('icon');
- var closeIconName = config.classname('ic-arrow-solid-top');
- return '<span class="' + iconName + ' ' + closeIconName + '"></span>';
- },
- 'timezoneDisplayLabel-tmpl': function(timezoneOffset, displayLabel) {
- var gmt, hour, minutes;
- if (util.isUndefined(displayLabel)) {
- gmt = timezoneOffset < 0 ? '-' : '+';
- hour = Math.abs(parseInt(timezoneOffset / SIXTY_MINUTES, 10));
- minutes = Math.abs(timezoneOffset % SIXTY_MINUTES);
- displayLabel = gmt + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
- }
- return displayLabel;
- },
- 'timegridDisplayPrimayTime-tmpl': function(time) {
- /* TODO: 삭제 필요 (will be deprecated) */
- return Handlebars.helpers['timegridDisplayPrimaryTime-tmpl'](time);
- },
- 'timegridDisplayPrimaryTime-tmpl': function(time) {
- var hour = time.hour;
- var meridiem = hour >= 12 ? 'pm' : 'am';
- if (hour > 12) {
- hour = hour - 12;
- }
- return hour + ' ' + meridiem;
- },
- 'timegridDisplayTime-tmpl': function(time) {
- return datetime.leadingZero(time.hour, 2) + ':' + datetime.leadingZero(time.minutes, 2);
- },
- 'timegridCurrentTime-tmpl': function(timezone) {
- var templates = [];
- if (timezone.dateDifference) {
- templates.push('[' + timezone.dateDifferenceSign + timezone.dateDifference + ']<br>');
- }
- templates.push(datetime.format(timezone.hourmarker, 'HH:mm'));
- return templates.join('');
- },
- 'popupIsAllDay-tmpl': function() {
- return 'All day';
- },
- 'popupStateFree-tmpl': function() {
- return 'Free';
- },
- 'popupStateBusy-tmpl': function() {
- return 'Busy';
- },
- 'titlePlaceholder-tmpl': function() {
- return 'Subject';
- },
- 'locationPlaceholder-tmpl': function() {
- return 'Location';
- },
- 'startDatePlaceholder-tmpl': function() {
- return 'Start date';
- },
- 'endDatePlaceholder-tmpl': function() {
- return 'End date';
- },
- 'popupSave-tmpl': function() {
- return 'Save';
- },
- 'popupUpdate-tmpl': function() {
- return 'Update';
- },
- 'popupDetailDate-tmpl': function(isAllDay, start, end) {
- var isSameDate = datetime.isSameDate(start, end);
- var endFormat = (isSameDate ? '' : 'YYYY.MM.DD ') + 'hh:mm tt';
- if (isAllDay) {
- return datetime.format(start, 'YYYY.MM.DD') + (isSameDate ? '' : ' - ' + datetime.format(end, 'YYYY.MM.DD'));
- }
- return (datetime.format(start, 'YYYY.MM.DD hh:mm tt') + ' - ' + datetime.format(end, endFormat));
- },
- 'popupDetailLocation-tmpl': function(schedule) {
- return schedule.location;
- },
- 'popupDetailUser-tmpl': function(schedule) {
- return (schedule.attendees || []).join(', ');
- },
- 'popupDetailState-tmpl': function(schedule) {
- return schedule.state || 'Busy';
- },
- 'popupDetailRepeat-tmpl': function(schedule) {
- return schedule.recurrenceRule;
- },
- 'popupDetailBody-tmpl': function(schedule) {
- return schedule.body;
- },
- 'popupEdit-tmpl': function() {
- return 'Edit';
- },
- 'popupDelete-tmpl': function() {
- return 'Delete';
- }
- };
- /**
- * Get CSS syntax for element size
- * @param {number} value - size value to apply element
- * @param {string} postfix - postfix string ex) px, em, %
- * @param {string} prefix - property name ex) width, height
- * @returns {string} CSS syntax
- */
- function getElSize(value, postfix, prefix) {
- prefix = prefix || '';
- if (util.isNumber(value)) {
- return prefix + ':' + value + postfix;
- }
- return prefix + ':auto';
- }
- /**
- * Get element left based on narrowWeekend
- * @param {object} viewModel - view model
- * @param {Array} grids - dates information
- * @returns {number} element left
- */
- function getElLeft(viewModel, grids) {
- return grids[viewModel.left] ? grids[viewModel.left].left : 0;
- }
- /**
- * Get element width based on narrowWeekend
- * @param {object} viewModel - view model
- * @param {Array} grids - dates information
- * @returns {number} element width
- */
- function getElWidth(viewModel, grids) {
- var width = 0;
- var i = 0;
- var length = grids.length;
- var left;
- for (; i < viewModel.width; i += 1) {
- left = (viewModel.left + i) % length;
- left += parseInt((viewModel.left + i) / length, 10);
- if (left < length) {
- width += grids[left] ? grids[left].width : 0;
- }
- }
- return width;
- }
- Handlebars.registerHelper(helpers);
- /***/ }),
- /***/ "./src/js/view/template/month/month.hbs":
- /*!**********************************************!*\
- !*** ./src/js/view/template/month/month.hbs ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":30}}}) : helper)))
- + "month-dayname-item\"\n style=\"position: absolute;\n width: "
- + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":32}}}) : helper)))
- + "%;\n left: "
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":30}}}) : helper)))
- + "%;\n padding-left: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
- + ";\n padding-right: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingRight")), depth0))
- + ";\n line-height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"height")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":16},"end":{"line":13,"column":27}}})) != null ? stack1 : "")
- + " \">\n <span class=\""
- + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":15,"column":21},"end":{"line":15,"column":36}}}))
- + "\" style=\"color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":15,"column":52},"end":{"line":15,"column":61}}}) : helper)))
- + ";\">\n "
- + ((stack1 = (lookupProperty(helpers,"monthDayname-tmpl")||(depth0 && lookupProperty(depth0,"monthDayname-tmpl"))||alias2).call(alias1,depth0,{"name":"monthDayname-tmpl","hash":{},"data":data,"loc":{"start":{"line":16,"column":12},"end":{"line":16,"column":40}}})) != null ? stack1 : "")
- + "\n </span>\n </div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-right: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
- + ";\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, alias3=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "month-dayname\"\n style=\"border-top: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderTop") : stack1), depth0))
- + "; height: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"height") : stack1), depth0))
- + "; font-size: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"fontSize") : stack1), depth0))
- + "; background-color: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
- + "; text-align: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"textAlign") : stack1), depth0))
- + "; font-weight: "
- + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"fontWeight") : stack1), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"daynames") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":0},"end":{"line":19,"column":9}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/month/more.hbs":
- /*!*********************************************!*\
- !*** ./src/js/view/template/month/more.hbs ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),"||",(depth0 != null ? lookupProperty(depth0,"hasMultiDates") : depth0),{"name":"fi","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":65,"column":15}}})) != null ? stack1 : "");
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div data-id=\""
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":41}}}))
- + "\"\n data-schedule-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\"\n class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":23},"end":{"line":12,"column":37}}}) : helper)))
- + "month-more-schedule "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":57},"end":{"line":12,"column":71}}}) : helper)))
- + "month-more-allday "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":89},"end":{"line":12,"column":103}}}) : helper)))
- + "weekday-schedule-title\"\n style=\"height: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; margin-top: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleGutter")), depth0))
- + "px; border-radius: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data,"loc":{"start":{"line":14,"column":20},"end":{"line":18,"column":27}}})) != null ? stack1 : "")
- + " "
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n "
- + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":20},"end":{"line":20,"column":43}}})) != null ? stack1 : "")
- + "\n </div>\n";
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-left:3px solid "
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-left:3px solid "
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"7":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"category") : stack1),"===","time",{"name":"fi","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(17, data, 0),"data":data,"loc":{"start":{"line":23,"column":12},"end":{"line":64,"column":19}}})) != null ? stack1 : "");
- },"8":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div data-id=\""
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":45}}}))
- + "\"\n data-schedule-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\"\n class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":27},"end":{"line":26,"column":41}}}) : helper)))
- + "month-more-schedule "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":61},"end":{"line":26,"column":75}}}) : helper)))
- + "weekday-schedule "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":92},"end":{"line":26,"column":106}}}) : helper)))
- + "weekday-schedule-time\"\n style=\"height: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; margin-top: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleGutter")), depth0))
- + "px;"
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":33},"end":{"line":28,"column":47}}}) : helper)))
- + "weekday-schedule-bullet\"\n style=\"top: "
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBulletTop")), depth0))
- + "px;\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.program(11, data, 0),"data":data,"loc":{"start":{"line":30,"column":28},"end":{"line":34,"column":35}}})) != null ? stack1 : "")
- + "\"></span>\n <span class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":33},"end":{"line":35,"column":47}}}) : helper)))
- + "weekday-schedule-title\"\n style=\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":36,"column":31},"end":{"line":41,"column":35}}})) != null ? stack1 : "")
- + "\"\n data-title=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":42,"column":53},"end":{"line":42,"column":74}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"9":function(container,depth0,helpers,partials,data) {
- return " background: #ffffff\n";
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " background:"
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + "\n ";
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n color: #ffffff;\n background-color: "
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "\n";
- },"15":function(container,depth0,helpers,partials,data) {
- return " color:#333;\n ";
- },"17":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div data-id=\""
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":45,"column":30},"end":{"line":45,"column":45}}}))
- + "\"\n data-schedule-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\"\n class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":27},"end":{"line":47,"column":41}}}) : helper)))
- + "month-more-schedule "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":61},"end":{"line":47,"column":75}}}) : helper)))
- + "weekday-schedule "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":47,"column":92},"end":{"line":47,"column":161}}})) != null ? stack1 : "")
- + "\"\n style=\"height:"
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height:"
- + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; border-radius: "
- + alias3(alias4(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":49,"column":20},"end":{"line":51,"column":31}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":52,"column":20},"end":{"line":54,"column":31}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(26, data, 0),"data":data,"loc":{"start":{"line":55,"column":20},"end":{"line":59,"column":27}}})) != null ? stack1 : "")
- + " "
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":61,"column":33},"end":{"line":61,"column":47}}}) : helper)))
- + "weekday-schedule-title\"\n data-title=\""
- + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":62,"column":65},"end":{"line":62,"column":90}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"18":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":115},"end":{"line":47,"column":129}}}) : helper)))
- + "weekday-schedule-focused ";
- },"20":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-left: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
- + ";\n";
- },"22":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-right: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
- + ";\n";
- },"24":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"26":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "month-more\" style=\"padding-bottom: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"paddingBottom") : stack1), depth0))
- + "; border: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"border") : stack1), depth0))
- + "; box-shadow: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"boxShadow") : stack1), depth0))
- + "; background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
- + ";\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
- + "month-more-title\"\n style=\"height: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleHeight") : stack1), depth0))
- + "; margin-bottom: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleMarginBottom") : stack1), depth0))
- + "; background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleBackgroundColor") : stack1), depth0))
- + "; border-bottom: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleBorderBottom") : stack1), depth0))
- + "; padding: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titlePadding") : stack1), depth0))
- + ";\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":35}}}) : helper)))
- + "month-more-title-date\">"
- + ((stack1 = (lookupProperty(helpers,"monthMoreTitleDate-tmpl")||(depth0 && lookupProperty(depth0,"monthMoreTitleDate-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"date") : depth0),(depth0 != null ? lookupProperty(depth0,"dayname") : depth0),{"name":"monthMoreTitleDate-tmpl","hash":{},"data":data,"loc":{"start":{"line":4,"column":58},"end":{"line":4,"column":100}}})) != null ? stack1 : "")
- + "</span>\n <button type=\"button\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":37},"end":{"line":5,"column":51}}}) : helper)))
- + "month-more-close\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"monthMoreClose-tmpl") || (depth0 != null ? lookupProperty(depth0,"monthMoreClose-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"monthMoreClose-tmpl","hash":{},"data":data,"loc":{"start":{"line":5,"column":69},"end":{"line":5,"column":94}}}) : helper))) != null ? stack1 : "")
- + "</button>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
- + "month-more-list\" style=\"padding: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"listPadding") : stack1), depth0))
- + "; height: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"listHeight") : stack1), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"schedules") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":8},"end":{"line":66,"column":17}}})) != null ? stack1 : "")
- + " </div>\n</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/month/weekdayInMonth.hbs":
- /*!*******************************************************!*\
- !*** ./src/js/view/template/month/weekdayInMonth.hbs ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
- + "weekday-grid-line "
- + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":7,"column":48},"end":{"line":7,"column":63}}}))
- + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"date") : depth0),"!==",1,{"name":"fi","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":63},"end":{"line":7,"column":119}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isToday") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":119},"end":{"line":7,"column":161}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isOtherMonth") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":161},"end":{"line":7,"column":213}}})) != null ? stack1 : "")
- + "\"\n style=\"width:"
- + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":30}}}) : helper)))
- + "%; left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":8,"column":38},"end":{"line":8,"column":46}}}) : helper)))
- + "%; background-color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":8,"column":67},"end":{"line":8,"column":86}}}) : helper)))
- + "; font-size: "
- + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"fontSize")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":11,"column":19}}})) != null ? stack1 : "")
- + " \">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":20},"end":{"line":13,"column":34}}}) : helper)))
- + "weekday-grid-header\">\n <span style=\"color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":41}}}) : helper)))
- + ";\">"
- + ((stack1 = (lookupProperty(helpers,"monthGridHeader-tmpl")||(depth0 && lookupProperty(depth0,"monthGridHeader-tmpl"))||alias2).call(alias1,depth0,{"name":"monthGridHeader-tmpl","hash":{},"data":data,"loc":{"start":{"line":14,"column":44},"end":{"line":14,"column":75}}})) != null ? stack1 : "")
- + "</span>\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":12},"end":{"line":17,"column":19}}})) != null ? stack1 : "")
- + " </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":20},"end":{"line":19,"column":34}}}) : helper)))
- + "weekday-grid-footer\">\n <span style=\"color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":20,"column":32},"end":{"line":20,"column":41}}}) : helper)))
- + ";\">"
- + ((stack1 = (lookupProperty(helpers,"monthGridFooter-tmpl")||(depth0 && lookupProperty(depth0,"monthGridFooter-tmpl"))||alias2).call(alias1,depth0,{"name":"monthGridFooter-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":44},"end":{"line":20,"column":75}}})) != null ? stack1 : "")
- + "</span>\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":21,"column":12},"end":{"line":23,"column":19}}})) != null ? stack1 : "")
- + " </div>\n </div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":84},"end":{"line":7,"column":98}}}) : helper)))
- + "near-month-day";
- },"4":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":135},"end":{"line":7,"column":149}}}) : helper)))
- + "today";
- },"6":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":182},"end":{"line":7,"column":196}}}) : helper)))
- + "extra-date";
- },"8":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-right:"
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
- + ";\n";
- },"10":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":29},"end":{"line":16,"column":43}}}) : helper)))
- + "weekday-exceed-in-month\" data-ymd=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"ymd") || (depth0 != null ? lookupProperty(depth0,"ymd") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"ymd","hash":{},"data":data,"loc":{"start":{"line":16,"column":78},"end":{"line":16,"column":85}}}) : helper)))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"monthGridHeaderExceed-tmpl")||(depth0 && lookupProperty(depth0,"monthGridHeaderExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"monthGridHeaderExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":16,"column":87},"end":{"line":16,"column":135}}})) != null ? stack1 : "")
- + "</span>\n";
- },"12":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":29},"end":{"line":22,"column":43}}}) : helper)))
- + "weekday-exceed-in-month\" data-ymd=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"ymd") || (depth0 != null ? lookupProperty(depth0,"ymd") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"ymd","hash":{},"data":data,"loc":{"start":{"line":22,"column":78},"end":{"line":22,"column":85}}}) : helper)))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"monthGridFooterExceed-tmpl")||(depth0 && lookupProperty(depth0,"monthGridFooterExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"monthGridFooterExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":22,"column":87},"end":{"line":22,"column":135}}})) != null ? stack1 : "")
- + "</span>\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "weekday-border\"\n style=\"\n border-top: "
- + alias4(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderTop") : stack1), depth0))
- + ";\n\"></div>\n<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":26}}}) : helper)))
- + "weekday-grid\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"dates") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":0},"end":{"line":26,"column":11}}})) != null ? stack1 : "")
- + "</div>\n<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":12},"end":{"line":28,"column":26}}}) : helper)))
- + "weekday-schedules\"></div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/month/weekdayInMonthSchedule.hbs":
- /*!***************************************************************!*\
- !*** ./src/js/view/template/month/weekdayInMonthSchedule.hbs ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":80,"column":11}}})) != null ? stack1 : "");
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n"
- + ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":0},"end":{"line":79,"column":11}}})) != null ? stack1 : "");
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n"
- + ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":0},"end":{"line":78,"column":9}}})) != null ? stack1 : "");
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n"
- + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"top") : depth0),"<",((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"renderLimitIdx")),{"name":"fi","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":4},"end":{"line":77,"column":13}}})) != null ? stack1 : "");
- },"5":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div data-id=\""
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":33}}}))
- + "\"\n class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
- + "weekday-schedule-block\n "
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":30}}}) : helper)))
- + "weekday-schedule-block-"
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":8,"column":53},"end":{"line":8,"column":68}}}))
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":71}}})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":73}}})) != null ? stack1 : "")
- + "\"\n style=\""
- + alias3((lookupProperty(helpers,"month-scheduleBlock")||(depth0 && lookupProperty(depth0,"month-scheduleBlock"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockHeight")),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"gridHeaderHeight")),{"name":"month-scheduleBlock","hash":{},"data":data,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":105}}}))
- + ";\n margin-top:"
- + alias3(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockGutter")), depth0))
- + "px\">\n"
- + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),"||",(depth0 != null ? lookupProperty(depth0,"hasMultiDates") : depth0),{"name":"fi","hash":{},"fn":container.program(10, data, 0),"inverse":container.program(23, data, 0),"data":data,"loc":{"start":{"line":13,"column":8},"end":{"line":75,"column":15}}})) != null ? stack1 : "")
- + " </div>\n";
- },"6":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":31},"end":{"line":9,"column":45}}}) : helper)))
- + "weekday-exceed-left";
- },"8":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":32},"end":{"line":10,"column":46}}}) : helper)))
- + "weekday-exceed-right";
- },"10":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div data-schedule-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\" class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":92},"end":{"line":14,"column":106}}}) : helper)))
- + "weekday-schedule "
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":123},"end":{"line":14,"column":192}}})) != null ? stack1 : "")
- + "\"\n style=\"height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; border-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":16},"end":{"line":18,"column":27}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":19,"column":16},"end":{"line":21,"column":27}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.program(19, data, 0),"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":26,"column":23}}})) != null ? stack1 : "")
- + " "
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":25},"end":{"line":28,"column":39}}}) : helper)))
- + "weekday-schedule-title\"\n data-title=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":29,"column":47},"end":{"line":29,"column":70}}})) != null ? stack1 : "")
- + "</span>\n "
- + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias4).call(alias3,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":30,"column":22},"end":{"line":30,"column":60}}}),{"name":"unless","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":194}}})) != null ? stack1 : "")
- + "\n </div>\n";
- },"11":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":146},"end":{"line":14,"column":160}}}) : helper)))
- + "weekday-schedule-focused ";
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-left: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
- + ";\n";
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-right: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
- + ";\n";
- },"17":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"19":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"21":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<span class=\""
- + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":75},"end":{"line":30,"column":89}}}) : helper)))
- + "weekday-resize-handle handle-y\" style=\"line-height: "
- + alias1(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px;\"> </span>";
- },"23":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"category") : stack1),"===","time",{"name":"fi","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(33, data, 0),"data":data,"loc":{"start":{"line":33,"column":12},"end":{"line":74,"column":19}}})) != null ? stack1 : "");
- },"24":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div data-schedule-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\" class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":100},"end":{"line":34,"column":114}}}) : helper)))
- + "weekday-schedule "
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":131},"end":{"line":34,"column":145}}}) : helper)))
- + "weekday-schedule-time\"\n style=\"height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; "
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":47}}}) : helper)))
- + "weekday-schedule-bullet\"\n style=\"top: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"scheduleBulletTop")), depth0))
- + "px;\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(25, data, 0),"inverse":container.program(27, data, 0),"data":data,"loc":{"start":{"line":38,"column":28},"end":{"line":42,"column":35}}})) != null ? stack1 : "")
- + " \"\n ></span>\n <span class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":33},"end":{"line":45,"column":47}}}) : helper)))
- + "weekday-schedule-title\"\n style=\"\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.program(31, data, 0),"data":data,"loc":{"start":{"line":47,"column":28},"end":{"line":52,"column":35}}})) != null ? stack1 : "")
- + " \"\n data-title=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":54,"column":53},"end":{"line":54,"column":74}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"25":function(container,depth0,helpers,partials,data) {
- return " background: #ffffff\n";
- },"27":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " background:"
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + "\n";
- },"29":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff;\n background-color: "
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "\n";
- },"31":function(container,depth0,helpers,partials,data) {
- return " color:#333;\n";
- },"33":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div data-schedule-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\" class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":57,"column":100},"end":{"line":57,"column":114}}}) : helper)))
- + "weekday-schedule "
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":57,"column":131},"end":{"line":57,"column":200}}})) != null ? stack1 : "")
- + "\"\n style=\"height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height:"
- + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; border-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(34, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":59,"column":20},"end":{"line":61,"column":31}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(36, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":62,"column":20},"end":{"line":64,"column":31}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(38, data, 0),"inverse":container.program(40, data, 0),"data":data,"loc":{"start":{"line":65,"column":20},"end":{"line":69,"column":27}}})) != null ? stack1 : "")
- + " "
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":33},"end":{"line":71,"column":47}}}) : helper)))
- + "weekday-schedule-title\"\n data-title=\""
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":72,"column":65},"end":{"line":72,"column":90}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"34":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-left: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
- + ";\n";
- },"36":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " margin-right: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
- + ";\n";
- },"38":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"40":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":81,"column":11}}})) != null ? stack1 : "");
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/popup/scheduleCreationPopup.hbs":
- /*!**************************************************************!*\
- !*** ./src/js/view/template/popup/scheduleCreationPopup.hbs ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":150},"end":{"line":3,"column":164}}}) : helper)))
- + "hide";
- },"3":function(container,depth0,helpers,partials,data) {
- var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <li class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":31},"end":{"line":11,"column":45}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":64},"end":{"line":11,"column":78}}}) : helper)))
- + "dropdown-menu-item\" data-calendar-id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"id") || (depth0 != null ? lookupProperty(depth0,"id") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data,"loc":{"start":{"line":11,"column":116},"end":{"line":11,"column":122}}}) : helper)))
- + "\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":37},"end":{"line":12,"column":51}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":56},"end":{"line":12,"column":70}}}) : helper)))
- + "calendar-dot\" style=\"background-color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"bgColor") || (depth0 != null ? lookupProperty(depth0,"bgColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"bgColor","hash":{},"data":data,"loc":{"start":{"line":12,"column":109},"end":{"line":12,"column":120}}}) : helper)))
- + "\"></span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":37},"end":{"line":13,"column":51}}}) : helper)))
- + "content\">"
- + alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":13,"column":60},"end":{"line":13,"column":68}}}) : helper)))
- + "</span>\n </li>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":135},"end":{"line":23,"column":149}}}) : helper)))
- + "public";
- },"7":function(container,depth0,helpers,partials,data) {
- return " checked";
- },"9":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"state") || (depth0 != null ? lookupProperty(depth0,"state") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"state","hash":{},"data":data,"loc":{"start":{"line":54,"column":99},"end":{"line":54,"column":108}}}) : helper)));
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateBusy-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateBusy-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupStateBusy-tmpl","hash":{},"data":data,"loc":{"start":{"line":54,"column":116},"end":{"line":54,"column":141}}}) : helper))) != null ? stack1 : "");
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupUpdate-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupUpdate-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupUpdate-tmpl","hash":{},"data":data,"loc":{"start":{"line":69,"column":163},"end":{"line":69,"column":185}}}) : helper))) != null ? stack1 : "");
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupSave-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupSave-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupSave-tmpl","hash":{},"data":data,"loc":{"start":{"line":69,"column":193},"end":{"line":69,"column":213}}}) : helper))) != null ? stack1 : "");
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "popup\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
- + "popup-container\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":34}}}) : helper)))
- + "popup-section "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":48},"end":{"line":3,"column":62}}}) : helper)))
- + "dropdown "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":71},"end":{"line":3,"column":85}}}) : helper)))
- + "close "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":91},"end":{"line":3,"column":105}}}) : helper)))
- + "section-calendar"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"calendars") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":121},"end":{"line":3,"column":179}}})) != null ? stack1 : "")
- + "\">\n <button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":41}}}) : helper)))
- + "button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":48},"end":{"line":4,"column":62}}}) : helper)))
- + "dropdown-button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":78},"end":{"line":4,"column":92}}}) : helper)))
- + "popup-section-item\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":48},"end":{"line":5,"column":62}}}) : helper)))
- + "calendar-dot\" style=\"background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"selectedCal") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "\"></span>\n <span id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":40}}}) : helper)))
- + "schedule-calendar\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":66},"end":{"line":6,"column":80}}}) : helper)))
- + "content\">"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"selectedCal") : depth0)) != null ? lookupProperty(stack1,"name") : stack1), depth0))
- + "</span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":48},"end":{"line":7,"column":62}}}) : helper)))
- + "dropdown-arrow\"></span>\n </button>\n <ul class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":23},"end":{"line":9,"column":37}}}) : helper)))
- + "dropdown-menu\" style=\"z-index: "
- + alias4(((helper = (helper = lookupProperty(helpers,"zIndex") || (depth0 != null ? lookupProperty(depth0,"zIndex") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"zIndex","hash":{},"data":data,"loc":{"start":{"line":9,"column":68},"end":{"line":9,"column":78}}}) : helper)))
- + "\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"calendars") : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":15,"column":25}}})) != null ? stack1 : "")
- + " </ul>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":20},"end":{"line":18,"column":34}}}) : helper)))
- + "popup-section\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":24},"end":{"line":19,"column":38}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":57},"end":{"line":19,"column":71}}}) : helper)))
- + "section-title\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":25},"end":{"line":20,"column":39}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":44},"end":{"line":20,"column":58}}}) : helper)))
- + "ic-title\"></span>\n <input id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":27},"end":{"line":21,"column":41}}}) : helper)))
- + "schedule-title\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":64},"end":{"line":21,"column":78}}}) : helper)))
- + "content\" placeholder=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"titlePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"titlePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"titlePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":21,"column":100},"end":{"line":21,"column":125}}}) : helper)))
- + "\" value=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"title") || (depth0 != null ? lookupProperty(depth0,"title") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data,"loc":{"start":{"line":21,"column":134},"end":{"line":21,"column":143}}}) : helper)))
- + "\">\n </div>\n <button id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":24},"end":{"line":23,"column":38}}}) : helper)))
- + "schedule-private\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":63},"end":{"line":23,"column":77}}}) : helper)))
- + "button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":84},"end":{"line":23,"column":98}}}) : helper)))
- + "section-private"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrivate") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":23,"column":113},"end":{"line":23,"column":166}}})) != null ? stack1 : "")
- + "\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":39}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":44},"end":{"line":24,"column":58}}}) : helper)))
- + "ic-private\"></span>\n </button>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":27,"column":20},"end":{"line":27,"column":34}}}) : helper)))
- + "popup-section\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":38}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":57},"end":{"line":28,"column":71}}}) : helper)))
- + "section-location\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":25},"end":{"line":29,"column":39}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":44},"end":{"line":29,"column":58}}}) : helper)))
- + "ic-location\"></span>\n <input id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":27},"end":{"line":30,"column":41}}}) : helper)))
- + "schedule-location\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":67},"end":{"line":30,"column":81}}}) : helper)))
- + "content\" placeholder=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"locationPlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"locationPlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"locationPlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":30,"column":103},"end":{"line":30,"column":131}}}) : helper)))
- + "\" value=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"location") || (depth0 != null ? lookupProperty(depth0,"location") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"location","hash":{},"data":data,"loc":{"start":{"line":30,"column":140},"end":{"line":30,"column":152}}}) : helper)))
- + "\">\n </div>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":33,"column":20},"end":{"line":33,"column":34}}}) : helper)))
- + "popup-section\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":24},"end":{"line":34,"column":38}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":57},"end":{"line":34,"column":71}}}) : helper)))
- + "section-start-date\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":29},"end":{"line":35,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":48},"end":{"line":35,"column":62}}}) : helper)))
- + "ic-date\"></span>\n <input id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":27},"end":{"line":36,"column":41}}}) : helper)))
- + "schedule-start-date\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":69},"end":{"line":36,"column":83}}}) : helper)))
- + "content\" placeholder=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"startDatePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"startDatePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"startDatePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":36,"column":105},"end":{"line":36,"column":134}}}) : helper)))
- + "\">\n <div id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":37,"column":25},"end":{"line":37,"column":39}}}) : helper)))
- + "startpicker-container\" style=\"margin-left: -1px; position: relative\"></div>\n </div>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":39,"column":25},"end":{"line":39,"column":39}}}) : helper)))
- + "section-date-dash\">-</span>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":40,"column":24},"end":{"line":40,"column":38}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":40,"column":57},"end":{"line":40,"column":71}}}) : helper)))
- + "section-end-date\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":41,"column":29},"end":{"line":41,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":62}}}) : helper)))
- + "ic-date\"></span>\n <input id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":27},"end":{"line":42,"column":41}}}) : helper)))
- + "schedule-end-date\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":67},"end":{"line":42,"column":81}}}) : helper)))
- + "content\" placeholder=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"endDatePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"endDatePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"endDatePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":42,"column":103},"end":{"line":42,"column":130}}}) : helper)))
- + "\">\n <div id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":43,"column":25},"end":{"line":43,"column":39}}}) : helper)))
- + "endpicker-container\" style=\"margin-left: -1px; position: relative\"></div>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":24},"end":{"line":45,"column":38}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":57},"end":{"line":45,"column":71}}}) : helper)))
- + "section-allday\">\n <input id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":46,"column":27},"end":{"line":46,"column":41}}}) : helper)))
- + "schedule-allday\" type=\"checkbox\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":46,"column":81},"end":{"line":46,"column":95}}}) : helper)))
- + "checkbox-square\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAllDay") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":46,"column":111},"end":{"line":46,"column":142}}})) != null ? stack1 : "")
- + ">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":29},"end":{"line":47,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":48},"end":{"line":47,"column":62}}}) : helper)))
- + "ic-checkbox\"></span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":29},"end":{"line":48,"column":43}}}) : helper)))
- + "content\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupIsAllDay-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupIsAllDay-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupIsAllDay-tmpl","hash":{},"data":data,"loc":{"start":{"line":48,"column":52},"end":{"line":48,"column":76}}}) : helper))) != null ? stack1 : "")
- + "</span>\n </div>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":20},"end":{"line":51,"column":34}}}) : helper)))
- + "popup-section "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":48},"end":{"line":51,"column":62}}}) : helper)))
- + "dropdown "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":71},"end":{"line":51,"column":85}}}) : helper)))
- + "close "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":91},"end":{"line":51,"column":105}}}) : helper)))
- + "section-state\">\n <button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":27},"end":{"line":52,"column":41}}}) : helper)))
- + "button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":48},"end":{"line":52,"column":62}}}) : helper)))
- + "dropdown-button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":78},"end":{"line":52,"column":92}}}) : helper)))
- + "popup-section-item\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":53,"column":29},"end":{"line":53,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":53,"column":48},"end":{"line":53,"column":62}}}) : helper)))
- + "ic-state\"></span>\n <span id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":54,"column":26},"end":{"line":54,"column":40}}}) : helper)))
- + "schedule-state\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":54,"column":63},"end":{"line":54,"column":77}}}) : helper)))
- + "content\">"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"state") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.program(11, data, 0),"data":data,"loc":{"start":{"line":54,"column":86},"end":{"line":54,"column":148}}})) != null ? stack1 : "")
- + "</span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":55,"column":29},"end":{"line":55,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":55,"column":48},"end":{"line":55,"column":62}}}) : helper)))
- + "dropdown-arrow\"></span>\n </button>\n <ul class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":57,"column":23},"end":{"line":57,"column":37}}}) : helper)))
- + "dropdown-menu\" style=\"z-index: "
- + alias4(((helper = (helper = lookupProperty(helpers,"zIndex") || (depth0 != null ? lookupProperty(depth0,"zIndex") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"zIndex","hash":{},"data":data,"loc":{"start":{"line":57,"column":68},"end":{"line":57,"column":78}}}) : helper)))
- + "\">\n <li class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":58,"column":27},"end":{"line":58,"column":41}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":58,"column":60},"end":{"line":58,"column":74}}}) : helper)))
- + "dropdown-menu-item\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":59,"column":29},"end":{"line":59,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":59,"column":48},"end":{"line":59,"column":62}}}) : helper)))
- + "none\"></span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":60,"column":29},"end":{"line":60,"column":43}}}) : helper)))
- + "content\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateBusy-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateBusy-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupStateBusy-tmpl","hash":{},"data":data,"loc":{"start":{"line":60,"column":52},"end":{"line":60,"column":77}}}) : helper))) != null ? stack1 : "")
- + "</span>\n </li>\n <li class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":62,"column":27},"end":{"line":62,"column":41}}}) : helper)))
- + "popup-section-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":62,"column":60},"end":{"line":62,"column":74}}}) : helper)))
- + "dropdown-menu-item\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":63,"column":29},"end":{"line":63,"column":43}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":63,"column":48},"end":{"line":63,"column":62}}}) : helper)))
- + "none\"></span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":64,"column":29},"end":{"line":64,"column":43}}}) : helper)))
- + "content\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateFree-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateFree-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupStateFree-tmpl","hash":{},"data":data,"loc":{"start":{"line":64,"column":52},"end":{"line":64,"column":77}}}) : helper))) != null ? stack1 : "")
- + "</span>\n </li>\n </ul>\n </div>\n <button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":23},"end":{"line":68,"column":37}}}) : helper)))
- + "button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":44},"end":{"line":68,"column":58}}}) : helper)))
- + "popup-close\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":84},"end":{"line":68,"column":98}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":103},"end":{"line":68,"column":117}}}) : helper)))
- + "ic-close\"></span></button>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":20},"end":{"line":69,"column":34}}}) : helper)))
- + "section-button-save\"><button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":70},"end":{"line":69,"column":84}}}) : helper)))
- + "button "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":91},"end":{"line":69,"column":105}}}) : helper)))
- + "confirm "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":113},"end":{"line":69,"column":127}}}) : helper)))
- + "popup-save\"><span>"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isEditMode") : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":69,"column":145},"end":{"line":69,"column":220}}})) != null ? stack1 : "")
- + "</span></button></div>\n </div>\n <div id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":13},"end":{"line":71,"column":27}}}) : helper)))
- + "popup-arrow\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":47},"end":{"line":71,"column":61}}}) : helper)))
- + "popup-arrow "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":73},"end":{"line":71,"column":87}}}) : helper)))
- + "arrow-bottom\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":72,"column":20},"end":{"line":72,"column":34}}}) : helper)))
- + "popup-arrow-border\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":73,"column":24},"end":{"line":73,"column":38}}}) : helper)))
- + "popup-arrow-fill\"></div>\n </div>\n </div>\n</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/popup/scheduleDetailPopup.hbs":
- /*!************************************************************!*\
- !*** ./src/js/view/template/popup/scheduleDetailPopup.hbs ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":45},"end":{"line":11,"column":59}}}) : helper)))
- + "popup-detail-item\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":91},"end":{"line":11,"column":105}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":110},"end":{"line":11,"column":124}}}) : helper)))
- + "ic-location-b\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":159},"end":{"line":11,"column":173}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailLocation-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailLocation-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailLocation-tmpl","hash":{},"data":data,"loc":{"start":{"line":11,"column":182},"end":{"line":11,"column":221}}})) != null ? stack1 : "")
- + "</span></div>";
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":51},"end":{"line":12,"column":65}}}) : helper)))
- + "popup-detail-item\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":97},"end":{"line":12,"column":111}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":116},"end":{"line":12,"column":130}}}) : helper)))
- + "ic-repeat-b\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":163},"end":{"line":12,"column":177}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailRepeat-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailRepeat-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailRepeat-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":186},"end":{"line":12,"column":223}}})) != null ? stack1 : "")
- + "</span></div>";
- },"5":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":46},"end":{"line":13,"column":60}}}) : helper)))
- + "popup-detail-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":78},"end":{"line":13,"column":92}}}) : helper)))
- + "popup-detail-item-indent\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":131},"end":{"line":13,"column":145}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":150},"end":{"line":13,"column":164}}}) : helper)))
- + "ic-user-b\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":195},"end":{"line":13,"column":209}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailUser-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailUser-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailUser-tmpl","hash":{},"data":data,"loc":{"start":{"line":13,"column":218},"end":{"line":13,"column":253}}})) != null ? stack1 : "")
- + "</span></div>";
- },"7":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":42},"end":{"line":14,"column":56}}}) : helper)))
- + "popup-detail-item\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":88},"end":{"line":14,"column":102}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":107},"end":{"line":14,"column":121}}}) : helper)))
- + "ic-state-b\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":153},"end":{"line":14,"column":167}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailState-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailState-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailState-tmpl","hash":{},"data":data,"loc":{"start":{"line":14,"column":176},"end":{"line":14,"column":212}}})) != null ? stack1 : "")
- + "</span></div>";
- },"9":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":20},"end":{"line":16,"column":34}}}) : helper)))
- + "popup-detail-item\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":66},"end":{"line":16,"column":80}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":85},"end":{"line":16,"column":99}}}) : helper)))
- + "calendar-dot\" style=\"background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":180},"end":{"line":16,"column":194}}}) : helper)))
- + "content\">"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"calendar") : depth0)) != null ? lookupProperty(stack1,"name") : stack1), depth0))
- + "</span></div>\n";
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":41},"end":{"line":18,"column":55}}}) : helper)))
- + "popup-detail-item "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":73},"end":{"line":18,"column":87}}}) : helper)))
- + "popup-detail-item-separate\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":128},"end":{"line":18,"column":142}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailBody-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailBody-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailBody-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":151},"end":{"line":18,"column":186}}})) != null ? stack1 : "")
- + "</span></div>";
- },"13":function(container,depth0,helpers,partials,data) {
- return "";
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":22,"column":30}}}) : helper)))
- + "section-button\">\n <button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":21},"end":{"line":23,"column":35}}}) : helper)))
- + "popup-edit\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":60},"end":{"line":23,"column":74}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":79},"end":{"line":23,"column":93}}}) : helper)))
- + "ic-edit\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":122},"end":{"line":23,"column":136}}}) : helper)))
- + "content\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupEdit-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupEdit-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupEdit-tmpl","hash":{},"data":data,"loc":{"start":{"line":23,"column":145},"end":{"line":23,"column":165}}}) : helper))) != null ? stack1 : "")
- + "</span></button>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":18},"end":{"line":24,"column":32}}}) : helper)))
- + "popup-vertical-line\"></div>\n <button class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":21},"end":{"line":25,"column":35}}}) : helper)))
- + "popup-delete\"><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":62},"end":{"line":25,"column":76}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":81},"end":{"line":25,"column":95}}}) : helper)))
- + "ic-delete\"></span><span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":126},"end":{"line":25,"column":140}}}) : helper)))
- + "content\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupDelete-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupDelete-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupDelete-tmpl","hash":{},"data":data,"loc":{"start":{"line":25,"column":149},"end":{"line":25,"column":171}}}) : helper))) != null ? stack1 : "")
- + "</span></button>\n </div>\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "popup "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}}) : helper)))
- + "popup-detail\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":28}}}) : helper)))
- + "popup-container\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":30}}}) : helper)))
- + "popup-section "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":44},"end":{"line":3,"column":58}}}) : helper)))
- + "section-header\">\n <div>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":35}}}) : helper)))
- + "schedule-private "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":52},"end":{"line":5,"column":66}}}) : helper)))
- + "icon "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":71},"end":{"line":5,"column":85}}}) : helper)))
- + "ic-private\"></span>\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":35}}}) : helper)))
- + "schedule-title\">"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "</span>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":32}}}) : helper)))
- + "popup-detail-date "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":50},"end":{"line":8,"column":64}}}) : helper)))
- + "content\">"
- + ((stack1 = (lookupProperty(helpers,"popupDetailDate-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailDate-tmpl"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"start") : stack1),((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"end") : stack1),{"name":"popupDetailDate-tmpl","hash":{},"data":data,"loc":{"start":{"line":8,"column":73},"end":{"line":8,"column":145}}})) != null ? stack1 : "")
- + "</div>\n </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":30}}}) : helper)))
- + "section-detail\">\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"location") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":241}}})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"recurrenceRule") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":243}}})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"attendees") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":8},"end":{"line":13,"column":273}}})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"state") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":232}}})) != null ? stack1 : "")
- + "\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"calendar") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":8},"end":{"line":17,"column":15}}})) != null ? stack1 : "")
- + " "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"body") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":8},"end":{"line":18,"column":206}}})) != null ? stack1 : "")
- + "\n </div>\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":20,"column":4},"end":{"line":27,"column":11}}})) != null ? stack1 : "")
- + " </div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":14},"end":{"line":29,"column":28}}}) : helper)))
- + "popup-top-line\" style=\"background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "\"></div>\n <div id=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":11},"end":{"line":30,"column":25}}}) : helper)))
- + "popup-arrow\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":45},"end":{"line":30,"column":59}}}) : helper)))
- + "popup-arrow "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":71},"end":{"line":30,"column":85}}}) : helper)))
- + "arrow-left\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":31,"column":30}}}) : helper)))
- + "popup-arrow-border\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":32,"column":20},"end":{"line":32,"column":34}}}) : helper)))
- + "popup-arrow-fill\"></div>\n </div>\n </div>\n</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/dayGrid.hbs":
- /*!***********************************************!*\
- !*** ./src/js/view/template/week/dayGrid.hbs ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":38}}}) : helper)))
- + "weekday-grid-line\"\n style=\"left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":9,"column":28},"end":{"line":9,"column":36}}}) : helper)))
- + "%; width:"
- + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":9,"column":45},"end":{"line":9,"column":54}}}) : helper)))
- + "%; background-color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":9,"column":75},"end":{"line":9,"column":94}}}) : helper)))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":20},"end":{"line":12,"column":31}}})) != null ? stack1 : "")
- + " \"></div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-right: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRight")), depth0))
- + ";\n";
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"days") : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":8},"end":{"line":27,"column":19}}})) != null ? stack1 : "");
- },"5":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"collapsed")),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.program(9, data, 0),"data":data,"loc":{"start":{"line":18,"column":12},"end":{"line":26,"column":19}}})) != null ? stack1 : "");
- },"6":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":19,"column":16},"end":{"line":21,"column":23}}})) != null ? stack1 : "");
- },"7":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":47}}}) : helper)))
- + "weekday-exceed-in-week\" style=\"z-index: 1; right:"
- + alias4((lookupProperty(helpers,"getRight")||(depth0 && lookupProperty(depth0,"getRight"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"getRight","hash":{},"data":data,"loc":{"start":{"line":20,"column":96},"end":{"line":20,"column":119}}}))
- + "%;\" data-index=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"key") || (data && lookupProperty(data,"key"))) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":20,"column":135},"end":{"line":20,"column":143}}}) : helper)))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"weekGridFooterExceed-tmpl")||(depth0 && lookupProperty(depth0,"weekGridFooterExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"weekGridFooterExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":145},"end":{"line":20,"column":192}}})) != null ? stack1 : "")
- + "</span>\n";
- },"9":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(data && lookupProperty(data,"key")),"===",((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"collapseBtnIndex")),{"name":"fi","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":23,"column":16},"end":{"line":25,"column":23}}})) != null ? stack1 : "");
- },"10":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":33},"end":{"line":24,"column":47}}}) : helper)))
- + "weekday-collapse-btn\" style=\"z-index: 1; right:"
- + alias4((lookupProperty(helpers,"getRight")||(depth0 && lookupProperty(depth0,"getRight"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"getRight","hash":{},"data":data,"loc":{"start":{"line":24,"column":94},"end":{"line":24,"column":117}}}))
- + "%;\">"
- + ((stack1 = ((helper = (helper = lookupProperty(helpers,"collapseBtnTitle-tmpl") || (depth0 != null ? lookupProperty(depth0,"collapseBtnTitle-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"collapseBtnTitle-tmpl","hash":{},"data":data,"loc":{"start":{"line":24,"column":121},"end":{"line":24,"column":148}}}) : helper))) != null ? stack1 : "")
- + "</span>\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + alias4(((helper = (helper = lookupProperty(helpers,"viewName") || (depth0 != null ? lookupProperty(depth0,"viewName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"viewName","hash":{},"data":data,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}}}) : helper)))
- + "-left "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":58}}}) : helper)))
- + "left\" style=\"border-right: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftBorderRight") : stack1), depth0))
- + "; width: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftWidth") : stack1), depth0))
- + "; background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftBackgroundColor") : stack1), depth0))
- + "; padding-right: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftPaddingRight") : stack1), depth0))
- + ";\">\n "
- + ((stack1 = (lookupProperty(helpers,"dayGridTitle-tmpl")||(depth0 && lookupProperty(depth0,"dayGridTitle-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"viewName") : depth0),{"name":"dayGridTitle-tmpl","hash":{},"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":36}}})) != null ? stack1 : "")
- + "\n</div>\n<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":26}}}) : helper)))
- + alias4(((helper = (helper = lookupProperty(helpers,"viewName") || (depth0 != null ? lookupProperty(depth0,"viewName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"viewName","hash":{},"data":data,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":38}}}) : helper)))
- + "-right "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":45},"end":{"line":4,"column":59}}}) : helper)))
- + "right\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":30}}}) : helper)))
- + "container\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":34}}}) : helper)))
- + "weekday-grid\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"days") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":8},"end":{"line":14,"column":19}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showExpandableButton")),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":8},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
- + " </div>\n </div>\n</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/dayGridSchedule.hbs":
- /*!*******************************************************!*\
- !*** ./src/js/view/template/week/dayGridSchedule.hbs ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":4},"end":{"line":27,"column":15}}})) != null ? stack1 : "");
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n "
- + ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":4},"end":{"line":26,"column":15}}})) != null ? stack1 : "");
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":4},"end":{"line":25,"column":13}}})) != null ? stack1 : "");
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4="function", alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "\n <div data-id=\""
- + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":33}}}))
- + "\"\n class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":29}}}) : helper)))
- + "weekday-schedule-block\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":71}}})) != null ? stack1 : "")
- + "\n "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":73}}})) != null ? stack1 : "")
- + "\"\n style=\"top:"
- + alias3((lookupProperty(helpers,"multiply")||(depth0 && lookupProperty(depth0,"multiply"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"top") : depth0),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockHeight")),{"name":"multiply","hash":{},"data":data,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":61}}}))
- + "px;\n left:"
- + alias3((lookupProperty(helpers,"grid-left")||(depth0 && lookupProperty(depth0,"grid-left"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),{"name":"grid-left","hash":{},"data":data,"loc":{"start":{"line":11,"column":21},"end":{"line":11,"column":51}}}))
- + "%;\n width:"
- + alias3((lookupProperty(helpers,"grid-width")||(depth0 && lookupProperty(depth0,"grid-width"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),{"name":"grid-width","hash":{},"data":data,"loc":{"start":{"line":12,"column":22},"end":{"line":12,"column":53}}}))
- + "%\">\n <div data-schedule-id=\""
- + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\" class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":92},"end":{"line":13,"column":106}}}) : helper)))
- + "weekday-schedule "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":123},"end":{"line":13,"column":192}}})) != null ? stack1 : "")
- + "\"\n style=\"height:"
- + alias3(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; line-height:"
- + alias3(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px; border-radius: "
- + alias3(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.program(13, data, 0),"data":data,"loc":{"start":{"line":15,"column":16},"end":{"line":19,"column":23}}})) != null ? stack1 : "")
- + " "
- + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\">\n <span class=\""
- + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":25},"end":{"line":21,"column":39}}}) : helper)))
- + "weekday-schedule-title\" title=\""
- + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":21,"column":87},"end":{"line":21,"column":112}}})) != null ? stack1 : "")
- + "</span>\n "
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":22,"column":22},"end":{"line":22,"column":60}}}),{"name":"unless","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":22,"column":12},"end":{"line":22,"column":193}}})) != null ? stack1 : "")
- + "\n </div>\n </div>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":31},"end":{"line":8,"column":45}}}) : helper)))
- + "weekday-exceed-left";
- },"7":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":32},"end":{"line":9,"column":46}}}) : helper)))
- + "weekday-exceed-right";
- },"9":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":146},"end":{"line":13,"column":160}}}) : helper)))
- + "weekday-schedule-focused ";
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<span class=\""
- + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":75},"end":{"line":22,"column":89}}}) : helper)))
- + "weekday-resize-handle handle-y\" style=\"line-height:"
- + alias1(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
- + "px;\"> </span>";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "weekday-schedules "
- + alias4(((helper = (helper = lookupProperty(helpers,"collapsed") || (depth0 != null ? lookupProperty(depth0,"collapsed") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"collapsed","hash":{},"data":data,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":57}}}) : helper)))
- + "\"style=\"top:"
- + alias4(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleContainerTop")), depth0))
- + "px;\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/daynames.hbs":
- /*!************************************************!*\
- !*** ./src/js/view/template/week/daynames.hbs ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":26}}}) : helper)))
- + "dayname "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isToday") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":75}}})) != null ? stack1 : "")
- + " "
- + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":3,"column":76},"end":{"line":3,"column":91}}}))
- + "\"\n data-date=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"renderDate") || (depth0 != null ? lookupProperty(depth0,"renderDate") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"renderDate","hash":{},"data":data,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":30}}}) : helper)))
- + "\"\n style=\""
- + alias4((lookupProperty(helpers,"common-width")||(depth0 && lookupProperty(depth0,"common-width"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"common-width","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":34}}}))
- + ";left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":48}}}) : helper)))
- + "%; line-height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"height")), depth0))
- + "; border-left: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
- + "; padding-left: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
- + ";\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":17},"end":{"line":6,"column":31}}}) : helper)))
- + "dayname-date-area\" style=\"color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":6,"column":64},"end":{"line":6,"column":73}}}) : helper)))
- + ";\">\n "
- + ((stack1 = (lookupProperty(helpers,"weekDayname-tmpl")||(depth0 && lookupProperty(depth0,"weekDayname-tmpl"))||alias2).call(alias1,depth0,{"name":"weekDayname-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":35}}})) != null ? stack1 : "")
- + "\n </span>\n</div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":49},"end":{"line":3,"column":63}}}) : helper)))
- + "today";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "dayname-leftmargin\" style=\"margin-left: "
- + alias2(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"dayNames") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":10,"column":9}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/time.hbs":
- /*!********************************************!*\
- !*** ./src/js/view/template/week/time.hbs ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":4},"end":{"line":60,"column":13}}})) != null ? stack1 : "");
- },"2":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":59,"column":17}}})) != null ? stack1 : "");
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":8},"end":{"line":58,"column":17}}})) != null ? stack1 : "");
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":34}}}) : helper)))
- + "time-date-schedule-block "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isPending") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":59},"end":{"line":6,"column":136}}})) != null ? stack1 : "")
- + "\" data-id=\""
- + alias4((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":147},"end":{"line":6,"column":162}}}))
- + "\"\n style=\""
- + alias4((lookupProperty(helpers,"time-scheduleBlock")||(depth0 && lookupProperty(depth0,"time-scheduleBlock"))||alias2).call(alias1,depth0,{"name":"time-scheduleBlock","hash":{},"data":data,"loc":{"start":{"line":7,"column":19},"end":{"line":7,"column":46}}}))
- + ";\n"
- + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),"!==",0,{"name":"fi","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":16},"end":{"line":10,"column":23}}})) != null ? stack1 : "")
- + " \">\n <div data-schedule-id=\""
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
- + "\" data-calendar-id=\""
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
- + "\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":96},"end":{"line":12,"column":110}}}) : helper)))
- + "time-schedule "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":12,"column":124},"end":{"line":12,"column":190}}})) != null ? stack1 : "")
- + "\"\n style=\"\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":16},"end":{"line":17,"column":27}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedStart") : depth0),{"name":"unless","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":16},"end":{"line":21,"column":27}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.program(17, data, 0),"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":26,"column":23}}})) != null ? stack1 : "")
- + " "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
- + "\"\n >\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasGoingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":29,"column":12},"end":{"line":37,"column":19}}})) != null ? stack1 : "")
- + " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":28},"end":{"line":38,"column":42}}}) : helper)))
- + "time-schedule-content "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":64},"end":{"line":38,"column":78}}}) : helper)))
- + "time-schedule-content-time\" style=\"height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"modelDurationHeight") || (depth0 != null ? lookupProperty(depth0,"modelDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"modelDurationHeight","hash":{},"data":data,"loc":{"start":{"line":38,"column":121},"end":{"line":38,"column":144}}}) : helper)))
- + "px;\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(22, data, 0),"data":data,"loc":{"start":{"line":39,"column":16},"end":{"line":43,"column":23}}})) != null ? stack1 : "")
- + " "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":44,"column":16},"end":{"line":44,"column":96}}})) != null ? stack1 : "")
- + "\">\n "
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":45,"column":20},"end":{"line":45,"column":41}}})) != null ? stack1 : "")
- + "\n </div>\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":47,"column":12},"end":{"line":54,"column":19}}})) != null ? stack1 : "")
- + " </div>\n "
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":56,"column":37},"end":{"line":56,"column":75}}}),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":56,"column":22},"end":{"line":56,"column":76}}}),{"name":"unless","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":56,"column":12},"end":{"line":56,"column":207}}})) != null ? stack1 : "")
- + "\n </div>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":83},"end":{"line":6,"column":97}}}) : helper)))
- + "time-date-schedule-block-pending";
- },"7":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " padding-left: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
- + ";\n";
- },"9":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":147},"end":{"line":12,"column":161}}}) : helper)))
- + "time-schedule-focused ";
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-bottom-left-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n border-bottom-right-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n";
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-top-left-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n border-top-right-radius: "
- + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
- + ";\n";
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color: #ffffff; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"17":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; background-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
- + "; border-color:"
- + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"19":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":28},"end":{"line":30,"column":42}}}) : helper)))
- + "time-schedule-content "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":64},"end":{"line":30,"column":78}}}) : helper)))
- + "time-schedule-content-travel-time\" style=\"height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"goingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"goingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"goingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":30,"column":128},"end":{"line":30,"column":151}}}) : helper)))
- + "px;\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(22, data, 0),"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":35,"column":23}}})) != null ? stack1 : "")
- + " border-bottom: 1px dashed "
- + alias4(((helper = (helper = lookupProperty(helpers,"travelBorderColor") || (depth0 != null ? lookupProperty(depth0,"travelBorderColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"travelBorderColor","hash":{},"data":data,"loc":{"start":{"line":36,"column":42},"end":{"line":36,"column":63}}}) : helper)))
- + ";\">"
- + ((stack1 = (lookupProperty(helpers,"goingDuration-tmpl")||(depth0 && lookupProperty(depth0,"goingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"goingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":36,"column":66},"end":{"line":36,"column":96}}})) != null ? stack1 : "")
- + "</div>\n";
- },"20":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-color:"
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + ";\n";
- },"22":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-color:"
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n";
- },"24":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "border-bottom: 1px dashed "
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"travelBorderColor") || (depth0 != null ? lookupProperty(depth0,"travelBorderColor") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"travelBorderColor","hash":{},"data":data,"loc":{"start":{"line":44,"column":67},"end":{"line":44,"column":88}}}) : helper)))
- + ";";
- },"26":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":28},"end":{"line":48,"column":42}}}) : helper)))
- + "time-schedule-content "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":64},"end":{"line":48,"column":78}}}) : helper)))
- + "time-schedule-content-travel-time\" style=\"height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"comingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"comingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"comingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":48,"column":128},"end":{"line":48,"column":152}}}) : helper)))
- + "px;\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(27, data, 0),"data":data,"loc":{"start":{"line":49,"column":16},"end":{"line":53,"column":23}}})) != null ? stack1 : "")
- + ";\">"
- + ((stack1 = (lookupProperty(helpers,"comingDuration-tmpl")||(depth0 && lookupProperty(depth0,"comingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"comingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":53,"column":26},"end":{"line":53,"column":57}}})) != null ? stack1 : "")
- + "</div>\n";
- },"27":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-color:"
- + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\n ";
- },"29":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":56,"column":90},"end":{"line":56,"column":104}}}) : helper)))
- + "time-resize-handle handle-x\" style=\"margin-left: "
- + alias1(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
- + ";\"> </div>";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "time-date-schedule-block-wrap\" style=\"margin-right: "
- + alias2(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginRight") : stack1), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":61,"column":9}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/timeGrid.hbs":
- /*!************************************************!*\
- !*** ./src/js/view/template/week/timeGrid.hbs ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":34}}}) : helper)))
- + "timegrid-timezone\" data-timezone-index=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"index") || (data && lookupProperty(data,"index"))) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data,"loc":{"start":{"line":3,"column":74},"end":{"line":3,"column":84}}}) : helper)))
- + "\" style=\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":93},"end":{"line":3,"column":127}}})) != null ? stack1 : "")
- + "position: absolute; top: 0; width: "
- + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":3,"column":162},"end":{"line":3,"column":171}}}) : helper)))
- + "%; left: "
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":3,"column":180},"end":{"line":3,"column":188}}}) : helper)))
- + "%; border-right: "
- + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftBorderRight")), depth0))
- + "; background-color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":3,"column":257},"end":{"line":3,"column":276}}}) : helper)))
- + ";\" >\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrimary") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(10, data, 0),"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":26,"column":15}}})) != null ? stack1 : "")
- + " </div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- return "display:none;";
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timeSlots") : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":9,"column":23}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showHourMarker")),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":14,"column":19}}})) != null ? stack1 : "");
- },"5":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":28},"end":{"line":6,"column":42}}}) : helper)))
- + "timegrid-hour\" style=\"height: "
- + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
- + "; color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":6,"column":111},"end":{"line":6,"column":120}}}) : helper)))
- + "; font-weight: "
- + alias4(((helper = (helper = lookupProperty(helpers,"fontWeight") || (depth0 != null ? lookupProperty(depth0,"fontWeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fontWeight","hash":{},"data":data,"loc":{"start":{"line":6,"column":135},"end":{"line":6,"column":149}}}) : helper)))
- + ";\">\n <span style=\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":33},"end":{"line":7,"column":66}}})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"timegridDisplayPrimayTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridDisplayPrimayTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridDisplayPrimayTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":68},"end":{"line":7,"column":109}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"6":function(container,depth0,helpers,partials,data) {
- return "display:none";
- },"8":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":28},"end":{"line":11,"column":42}}}) : helper)))
- + "timegrid-hourmarker\" style=\"top:"
- + alias4(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"hourmarkerTop")), depth0))
- + "%; margin-top: calc(6px - "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
- + "); height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
- + ";\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":32},"end":{"line":12,"column":46}}}) : helper)))
- + "timegrid-hourmarker-time\" style=\"color: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeColor")), depth0))
- + "; font-size: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontSize")), depth0))
- + "; font-weight: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontWeight")), depth0))
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":223},"end":{"line":12,"column":258}}})) != null ? stack1 : "")
- + "</div>\n </div>\n";
- },"10":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timeSlots") : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":12},"end":{"line":20,"column":23}}})) != null ? stack1 : "")
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showHourMarker")),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":21,"column":12},"end":{"line":25,"column":19}}})) != null ? stack1 : "");
- },"11":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":17,"column":28},"end":{"line":17,"column":42}}}) : helper)))
- + "timegrid-hour\" style=\"height: "
- + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
- + "; color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":17,"column":111},"end":{"line":17,"column":120}}}) : helper)))
- + "; font-weight: "
- + alias4(((helper = (helper = lookupProperty(helpers,"fontWeight") || (depth0 != null ? lookupProperty(depth0,"fontWeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fontWeight","hash":{},"data":data,"loc":{"start":{"line":17,"column":135},"end":{"line":17,"column":149}}}) : helper)))
- + ";\">\n <span style=\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":33},"end":{"line":18,"column":66}}})) != null ? stack1 : "")
- + "\">"
- + ((stack1 = (lookupProperty(helpers,"timegridDisplayTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridDisplayTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridDisplayTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":68},"end":{"line":18,"column":103}}})) != null ? stack1 : "")
- + "</span>\n </div>\n";
- },"13":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":28},"end":{"line":22,"column":42}}}) : helper)))
- + "timegrid-hourmarker\" style=\"top:"
- + alias4(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"hourmarkerTop")), depth0))
- + "%; margin-top: calc(6px - "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
- + "); height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
- + ";\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":32},"end":{"line":23,"column":46}}}) : helper)))
- + "timegrid-hourmarker-time\" style=\"color: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeColor")), depth0))
- + "; font-size: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontSize")), depth0))
- + ";\">"
- + ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":23,"column":171},"end":{"line":23,"column":206}}})) != null ? stack1 : "")
- + "</div>\n </div>\n";
- },"15":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":33,"column":20},"end":{"line":33,"column":34}}}) : helper)))
- + "timegrid-gridline\" style=\"height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
- + ";\n"
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":34,"column":12},"end":{"line":36,"column":23}}})) != null ? stack1 : "")
- + " \">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":24},"end":{"line":38,"column":38}}}) : helper)))
- + "timegrid-gridline-half\" style=\"height: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
- + "; border-bottom: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourBorderBottom")), depth0))
- + ";\"></div>\n </div>\n";
- },"16":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " border-bottom: "
- + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderBottom")), depth0))
- + ";\n";
- },"18":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":16},"end":{"line":47,"column":30}}}) : helper)))
- + "timegrid-hourmarker\" style=\"top:"
- + alias4(((helper = (helper = lookupProperty(helpers,"hourmarkerTop") || (depth0 != null ? lookupProperty(depth0,"hourmarkerTop") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"hourmarkerTop","hash":{},"data":data,"loc":{"start":{"line":47,"column":62},"end":{"line":47,"column":79}}}) : helper)))
- + "%\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":20},"end":{"line":48,"column":34}}}) : helper)))
- + "timegrid-hourmarker-line-left\" style=\"width:"
- + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":48,"column":78},"end":{"line":48,"column":97}}}) : helper)))
- + "%; border-top: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeLeftBorderTop") : stack1), depth0))
- + ";\"></div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":49,"column":20},"end":{"line":49,"column":34}}}) : helper)))
- + "timegrid-todaymarker\" style=\"left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":49,"column":68},"end":{"line":49,"column":87}}}) : helper)))
- + "%; background-color: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeBulletBackgroundColor") : stack1), depth0))
- + "; \">today</div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":50,"column":20},"end":{"line":50,"column":34}}}) : helper)))
- + "timegrid-hourmarker-line-today\" style=\"left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":50,"column":78},"end":{"line":50,"column":97}}}) : helper)))
- + "%; width: "
- + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerWidth") || (depth0 != null ? lookupProperty(depth0,"todaymarkerWidth") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerWidth","hash":{},"data":data,"loc":{"start":{"line":50,"column":107},"end":{"line":50,"column":127}}}) : helper)))
- + "%; border-top: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeTodayBorderTop") : stack1), depth0))
- + ";\"></div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":20},"end":{"line":51,"column":34}}}) : helper)))
- + "timegrid-hourmarker-line-right\" style=\"left:"
- + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerRight") || (depth0 != null ? lookupProperty(depth0,"todaymarkerRight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerRight","hash":{},"data":data,"loc":{"start":{"line":51,"column":78},"end":{"line":51,"column":98}}}) : helper)))
- + "%; border-top: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeRightBorderTop") : stack1), depth0))
- + ";\"></div>\n </div>\n";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "timegrid-left\" style=\"width: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftWidth") : stack1), depth0))
- + "; font-size: "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftFontSize") : stack1), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timezones") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
- + "</div>\n<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":26}}}) : helper)))
- + "timegrid-right\" style=\"margin-left: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftWidth")), depth0))
- + ";\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":31,"column":30}}}) : helper)))
- + "timegrid-h-grid\">\n"
- + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"hoursLabels") : depth0),{"name":"each","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":32,"column":8},"end":{"line":40,"column":19}}})) != null ? stack1 : "")
- + "</div>\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":16},"end":{"line":42,"column":30}}}) : helper)))
- + "timegrid-schedules\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":43,"column":20},"end":{"line":43,"column":34}}}) : helper)))
- + "timegrid-schedules-container\"></div>\n </div>\n\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"showHourMarker") : depth0),{"name":"if","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":46,"column":4},"end":{"line":53,"column":11}}})) != null ? stack1 : "")
- + "</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/timeGridCurrentTime.hbs":
- /*!***********************************************************!*\
- !*** ./src/js/view/template/week/timeGridCurrentTime.hbs ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}})) != null ? stack1 : "")
- + "\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/timeMoveGuide.hbs":
- /*!*****************************************************!*\
- !*** ./src/js/view/template/week/timeMoveGuide.hbs ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":38}}}) : helper)))
- + "time-schedule-content "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":60},"end":{"line":4,"column":74}}}) : helper)))
- + "time-schedule-content-travel-time\" style=\"border-color:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + "; border-bottom: 1px dashed "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"goingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"goingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"goingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":4,"column":203},"end":{"line":4,"column":226}}}) : helper)))
- + "%;\">"
- + ((stack1 = (lookupProperty(helpers,"goingDuration-tmpl")||(depth0 && lookupProperty(depth0,"goingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"goingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":4,"column":230},"end":{"line":4,"column":260}}})) != null ? stack1 : "")
- + "</div>\n";
- },"3":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":38}}}) : helper)))
- + "time-schedule-content "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":60},"end":{"line":10,"column":74}}}) : helper)))
- + "time-schedule-content-travel-time\" style=\"border-color:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + "; border-top: 1px dashed "
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
- + "; height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"comingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"comingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"comingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":10,"column":200},"end":{"line":10,"column":224}}}) : helper)))
- + "%;\">"
- + ((stack1 = (lookupProperty(helpers,"comingDuration-tmpl")||(depth0 && lookupProperty(depth0,"comingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"comingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":10,"column":228},"end":{"line":10,"column":259}}})) != null ? stack1 : "")
- + "</div>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":38},"end":{"line":13,"column":52}}}) : helper)))
- + "time-resize-handle handle-x\"> </div>";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
- + "time-date-schedule-block\" data-id=\""
- + alias4((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":76}}}))
- + "\" style=\"width: 100%; height: 100%;\">\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
- + "time-schedule "
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":58}}}) : helper)))
- + "time-date-schedule-block-focused\" style=\"color: #ffffff; background-color:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"dragBgColor") : stack1), depth0))
- + ";\">\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasGoingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":15}}})) != null ? stack1 : "")
- + " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":38}}}) : helper)))
- + "time-schedule-content\" style=\"height: "
- + alias4(((helper = (helper = lookupProperty(helpers,"modelDurationHeight") || (depth0 != null ? lookupProperty(depth0,"modelDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"modelDurationHeight","hash":{},"data":data,"loc":{"start":{"line":6,"column":76},"end":{"line":6,"column":99}}}) : helper)))
- + "%; border-color:"
- + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
- + ";\">\n "
- + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":37}}})) != null ? stack1 : "")
- + "\n </div>\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":11,"column":15}}})) != null ? stack1 : "")
- + " </div>\n "
- + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":104}}})) != null ? stack1 : "")
- + "\n <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":30}}}) : helper)))
- + "time-date-schedule-block-cover\"></div>\n</div>\n";
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/template/week/timezoneSticky.hbs":
- /*!******************************************************!*\
- !*** ./src/js/view/template/week/timezoneSticky.hbs ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
- module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return "<div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":26}}}) : helper)))
- + "timegrid-timezone-label-container\" style=\""
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":68},"end":{"line":2,"column":102}}})) != null ? stack1 : "")
- + "background-color: "
- + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":2,"column":120},"end":{"line":2,"column":139}}}) : helper)))
- + "; height: 100%; width: "
- + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":2,"column":162},"end":{"line":2,"column":171}}}) : helper)))
- + "%; left: "
- + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":2,"column":180},"end":{"line":2,"column":188}}}) : helper)))
- + "%; font-size: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftFontSize")), depth0))
- + "; border-right: "
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftBorderRight")), depth0))
- + ";\">\n <div title=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"tooltip") || (depth0 != null ? lookupProperty(depth0,"tooltip") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":27}}}) : helper)))
- + "\" class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":36},"end":{"line":3,"column":50}}}) : helper)))
- + "timegrid-timezone-label-cell\" data-timezone=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"displayLabel") || (depth0 != null ? lookupProperty(depth0,"displayLabel") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayLabel","hash":{},"data":data,"loc":{"start":{"line":3,"column":95},"end":{"line":3,"column":111}}}) : helper)))
- + "\" style=\"height: 100%; width: 100%;\">\n"
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,(lookupProperty(helpers,"and")||(depth0 && lookupProperty(depth0,"and"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrimary") : depth0),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showTimezoneCollapseButton")),{"name":"and","hash":{},"data":data,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":62}}}),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":10,"column":15}}})) != null ? stack1 : "")
- + " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":20},"end":{"line":11,"column":34}}}) : helper)))
- + "timegrid-timezone-label\">"
- + ((stack1 = (lookupProperty(helpers,"timezoneDisplayLabel-tmpl")||(depth0 && lookupProperty(depth0,"timezoneDisplayLabel-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"timezoneOffset") : depth0),(depth0 != null ? lookupProperty(depth0,"displayLabel") : depth0),{"name":"timezoneDisplayLabel-tmpl","hash":{},"data":data,"loc":{"start":{"line":11,"column":59},"end":{"line":11,"column":118}}})) != null ? stack1 : "")
- + "</div>\n </div>\n</div>\n";
- },"2":function(container,depth0,helpers,partials,data) {
- return "display:none;";
- },"4":function(container,depth0,helpers,partials,data) {
- var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return " <div class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":38}}}) : helper)))
- + "timegrid-timezone-close-btn\" style=\"border: 1px solid #ddd; top:2px; bottom: 2px; width: 10px; border-left: none;\">\n <span style=\"color: #777; height: calc("
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"displayTimezoneLabelHeight")), depth0))
- + " - 6px); line-height: calc("
- + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"displayTimezoneLabelHeight")), depth0))
- + " - 6px);\">\n <span class=\""
- + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":33},"end":{"line":7,"column":47}}}) : helper)))
- + "icon "
- + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"timezonesCollapsed")),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":7,"column":52},"end":{"line":7,"column":154}}})) != null ? stack1 : "")
- + "\"></span>\n </span>\n </div>\n";
- },"5":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":84},"end":{"line":7,"column":98}}}) : helper)))
- + "ic-arrow-right";
- },"7":function(container,depth0,helpers,partials,data) {
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":120},"end":{"line":7,"column":134}}}) : helper)))
- + "ic-arrow-left";
- },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
- var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
- return parent[propertyName];
- }
- return undefined
- };
- return ((stack1 = lookupProperty(helpers,"each").call(alias1,(lookupProperty(helpers,"reverse")||(depth0 && lookupProperty(depth0,"reverse"))||container.hooks.helperMissing).call(alias1,(depth0 != null ? lookupProperty(depth0,"timezones") : depth0),{"name":"reverse","hash":{},"data":data,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}}),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":11}}})) != null ? stack1 : "");
- },"useData":true});
- /***/ }),
- /***/ "./src/js/view/view.js":
- /*!*****************************!*\
- !*** ./src/js/view/view.js ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview The base class of views.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
- var Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
- /**
- * Base class of views.
- *
- * All views create own container element inside supplied container element.
- * @constructor
- * @param {HTMLElement} container Default container element for view.
- * you can use this element for this.container syntax.
- */
- function View(container) {
- var id = util.stamp(this);
- if (util.isUndefined(container)) {
- container = domutil.appendHTMLElement('div');
- }
- domutil.addClass(container, this.cssprefix(id));
- /**
- * unique id
- * @type {number}
- */
- this.id = id;
- /**
- * base element of view.
- * @type {HTMLDIVElement}
- */
- this.container = container;
- /*eslint-disable*/
- /**
- * child views.
- * @type {Collection}
- */
- this.children = new Collection(function(view) {
- return util.stamp(view);
- });
- /* eslint-enable*/
- /**
- * parent view instance.
- * @type {View}
- */
- this.parent = null;
- /**
- * state of view
- */
- this.state = {};
- }
- /**
- * CSS classname prefix
- * @type {string}
- */
- View.prototype.cssPrefix = 'tui-view-';
- /**
- * Add child views.
- * @param {View} view The view instance to add.
- * @param {function} [fn] Function for invoke before add. parent view class is supplied first arguments.
- */
- View.prototype.addChild = function(view, fn) {
- if (fn) {
- fn.call(view, this);
- }
- // add parent view
- view.parent = this;
- this.children.add(view);
- };
- /**
- * Remove added child view.
- * @param {(number|View)} id View id or instance itself to remove.
- * @param {function} [fn] Function for invoke before remove. parent view class is supplied first arguments.
- */
- View.prototype.removeChild = function(id, fn) {
- var view = util.isNumber(id) ? this.children.items[id] : id;
- id = util.stamp(view);
- if (fn) {
- fn.call(view, this);
- }
- this.children.remove(id);
- };
- /**
- * Render view recursively.
- */
- View.prototype.render = function() {
- this.children.each(function(childView) {
- childView.render();
- });
- };
- /**
- * Invoke function recursively.
- * @param {function} fn - function to invoke child view recursively
- * @param {boolean} [skipThis=false] - set true then skip invoke with this(root) view.
- */
- View.prototype.recursive = function(fn, skipThis) {
- if (!util.isFunction(fn)) {
- return;
- }
- if (!skipThis) {
- fn(this);
- }
- this.children.each(function(childView) {
- childView.recursive(fn);
- });
- };
- /**
- * Resize view recursively to parent.
- */
- View.prototype.resize = function() {
- var args = Array.prototype.slice.call(arguments),
- parent = this.parent;
- while (parent) {
- if (util.isFunction(parent._onResize)) {
- parent._onResize.apply(parent, args);
- }
- parent = parent.parent;
- }
- };
- /**
- * Invoking method before destroying.
- */
- View.prototype._beforeDestroy = function() {};
- /**
- * Clear properties
- */
- View.prototype._destroy = function() {
- this._beforeDestroy();
- this.children.clear();
- this.container.innerHTML = '';
- this.id = this.parent = this.children = this.container = null;
- };
- /*eslint-disable*/
- /**
- * Destroy child view recursively.
- */
- View.prototype.destroy = function(isChildView) {
- this.children.each(function(childView) {
- childView.destroy(true);
- childView._destroy();
- });
- if (isChildView) {
- return;
- }
- this._destroy();
- };
- /* eslint-enable*/
- /**
- * Calculate view's container element bound.
- * @returns {object} The bound of container element.
- */
- View.prototype.getViewBound = function() {
- var container = this.container,
- position = domutil.getPosition(container),
- size = domutil.getSize(container);
- return {
- x: position[0],
- y: position[1],
- width: size[0],
- height: size[1]
- };
- };
- /**
- * Return view default CSS prefix
- * @param {string} [className] - if supplied then return prefix added class name
- * @returns {string} CSS prefix value
- */
- View.prototype.cssprefix = function(className) {
- return this.cssPrefix + (className || '');
- };
- /**
- * set state
- * @param {object} state - state
- */
- View.prototype.setState = function(state) {
- util.extend(this.state, state);
- };
- util.CustomEvents.mixin(View);
- module.exports = View;
- /***/ }),
- /***/ "./src/js/view/week/dayGrid.js":
- /*!*************************************!*\
- !*** ./src/js/view/week/dayGrid.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview DayGrid in weekly view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
- common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
- datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
- domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
- TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
- View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
- DayGridSchedule = __webpack_require__(/*! ./dayGridSchedule */ "./src/js/view/week/dayGridSchedule.js"),
- baseTmpl = __webpack_require__(/*! ../template/week/dayGrid.hbs */ "./src/js/view/template/week/dayGrid.hbs"),
- reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var mmax = Math.max,
- mmin = Math.min;
- /**
- * @constructor
- * @extends {Weekday}
- * @param {string} name - view name
- * @param {object} options - options for DayGridSchedule view
- * @param {number} [options.heightPercent] - height percent of view
- * @param {number} [options.containerButtonGutter=8] - free space at bottom to
- * make create easy.
- * @param {number} [options.scheduleHeight=18] - height of each schedule block.
- * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
- * @param {HTMLDIVElement} container - DOM element to use container for this
- * view.
- * @param {Theme} theme - theme instance
- */
- function DayGrid(name, options, container, theme) {
- container = domutil.appendHTMLElement(
- 'div',
- container,
- config.classname('daygrid-layout')
- );
- View.call(this, container);
- name = name || 'daygrid';
- this.options = util.extend({
- viewName: name,
- daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- renderStartDate: '',
- renderEndDate: '',
- containerBottomGutter: 18,
- scheduleHeight: parseInt(theme.week.dayGridSchedule.height, 10),
- scheduleGutter: parseInt(theme.week.dayGridSchedule.marginTop, 10),
- scheduleContainerTop: 1,
- timezones: options.timezones,
- isReadOnly: options.isReadOnly,
- getViewModelFunc: function(viewModel) {
- return viewModel.schedulesInDateRange[name];
- },
- setViewModelFunc: function(viewModel, matrices) {
- viewModel.schedulesInDateRange[name] = matrices;
- }
- }, options.week);
- this.handler = {};
- this.vPanel = null;
- this.state.collapsed = true;
- }
- util.inherit(DayGrid, View);
- /**
- * @override
- * @param {object} viewModel - schedules view models
- */
- DayGrid.prototype.getBaseViewModel = function(viewModel) {
- var opt = this.options,
- daynames = opt.daynames,
- range = viewModel.range,
- grids = viewModel.grids,
- matrices = opt.getViewModelFunc(viewModel),
- exceedDate = {},
- panel = getPanel(opt.panels, opt.viewName),
- panelHeight = this.getViewBound().height,
- collapsed = this.state.collapsed,
- heightForcedSet = this.vPanel ? this.vPanel.getHeightForcedSet() : false,
- timezonesCollapsed = viewModel.state.timezonesCollapsed,
- styles = this._getStyles(viewModel.theme, timezonesCollapsed);
- var baseViewModel, visibleScheduleCount;
- var now = new TZDate().toLocalTime();
- if (panel.showExpandableButton) {
- if (!heightForcedSet) {
- if (collapsed) {
- panelHeight = mmax(panelHeight, panel.maxHeight);
- } else {
- panelHeight = mmin(panelHeight, panel.maxExpandableHeight);
- }
- }
- visibleScheduleCount = Math.floor(panelHeight / (opt.scheduleHeight + opt.scheduleGutter));
- if (collapsed) {
- exceedDate = this.parent.controller.getExceedDate(visibleScheduleCount,
- matrices,
- viewModel.range
- );
- matrices = this.parent.controller.excludeExceedSchedules(matrices, visibleScheduleCount);
- opt.setViewModelFunc(viewModel, matrices);
- }
- }
- baseViewModel = {
- viewName: opt.viewName,
- range: range,
- grids: grids,
- days: util.map(viewModel.range, function(d, index) {
- var day = d.getDay();
- var ymd = datetime.format(d, 'YYYYMMDD');
- var isToday = datetime.isSameDate(now, d);
- return {
- day: day,
- dayName: daynames[day],
- isToday: isToday,
- date: d.getDate(),
- renderDate: datetime.format(d, 'YYYY-MM-DD'),
- hiddenSchedules: exceedDate[ymd] || 0,
- width: grids[index] ? grids[index].width : 0,
- left: grids[index] ? grids[index].left : 0,
- backgroundColor: viewModel.range.length > 1 ?
- getWeekBackgroundColor(day, isToday, styles) : styles.backgroundColor
- };
- }),
- exceedDate: exceedDate,
- showExpandableButton: panel.showExpandableButton,
- collapsed: collapsed,
- collapseBtnIndex: this.state.clickedExpandBtnIndex,
- styles: styles
- };
- return baseViewModel;
- };
- /**
- * @override
- * @param {object} viewModel - schedules view models
- */
- DayGrid.prototype.render = function(viewModel) {
- var opt = this.options,
- container = this.container,
- baseViewModel = this.getBaseViewModel(viewModel),
- scheduleContainerTop = this.options.scheduleContainerTop;
- var dayGridSchedule;
- container.innerHTML = baseTmpl(baseViewModel);
- this.children.clear();
- dayGridSchedule = new DayGridSchedule(
- opt,
- domutil.find(config.classname('.container'), container)
- );
- this.addChild(dayGridSchedule);
- dayGridSchedule.on('afterRender', function(weekdayViewModel) {
- baseViewModel.height = weekdayViewModel.minHeight + scheduleContainerTop;
- });
- this.children.each(function(childView) {
- childView.render(viewModel);
- }, this);
- this.fire('afterRender', baseViewModel);
- };
- DayGrid.prototype._beforeDestroy = function() {
- };
- DayGrid.prototype.addHandler = function(type, handler, vPanel) {
- var self = this;
- this.handler[type] = handler;
- this.vPanel = vPanel;
- if (type === 'click') {
- handler.on('expand', function() {
- self.setState({
- collapsed: false
- });
- }, this);
- handler.on('collapse', function() {
- self.setState({
- collapsed: true
- });
- }, this);
- }
- };
- DayGrid.prototype._expand = function() {
- reqAnimFrame.requestAnimFrame(function() {
- var vPanel = this.vPanel;
- var opt = this.options;
- var panel = getPanel(opt.panels, opt.viewName);
- vPanel.setMaxHeight(panel.maxExpandableHeight);
- vPanel.setHeightForcedSet(false);
- vPanel.setHeight(null, panel.maxExpandableHeight);
- if (this.parent) {
- this.parent.render();
- }
- }, this);
- };
- DayGrid.prototype._collapse = function() {
- reqAnimFrame.requestAnimFrame(function() {
- var vPanel = this.vPanel;
- var opt = this.options;
- var panel = getPanel(opt.panels, opt.viewName);
- vPanel.setMaxHeight(panel.maxHeight);
- vPanel.setHeightForcedSet(false);
- vPanel.setHeight(null, panel.minHeight);
- if (this.parent) {
- this.parent.render();
- }
- }, this);
- };
- /**
- * set state
- * @param {object} state - state
- */
- DayGrid.prototype.setState = function(state) {
- var collapsed = this.state.collapsed;
- View.prototype.setState.call(this, state);
- if (this.state.collapsed === collapsed) {
- return;
- }
- if (this.state.collapsed) {
- this._collapse();
- } else {
- this._expand();
- }
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
- * @returns {object} styles - styles object
- */
- DayGrid.prototype._getStyles = function(theme, timezonesCollapsed) {
- var styles = {};
- var timezonesLength = this.options.timezones.length;
- var collapsed = timezonesCollapsed;
- var numberAndUnit;
- if (theme) {
- styles.borderRight = theme.week.daygrid.borderRight || theme.common.border;
- styles.todayBackgroundColor = theme.week.today.backgroundColor;
- styles.weekendBackgroundColor = theme.week.weekend.backgroundColor;
- styles.backgroundColor = theme.week.daygrid.backgroundColor;
- styles.leftWidth = theme.week.daygridLeft.width;
- styles.leftBackgroundColor = theme.week.daygridLeft.backgroundColor;
- styles.leftPaddingRight = theme.week.daygridLeft.paddingRight;
- styles.leftBorderRight = theme.week.daygridLeft.borderRight;
- if (!collapsed && timezonesLength > 1) {
- numberAndUnit = common.parseUnit(styles.leftWidth);
- styles.leftWidth = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
- }
- }
- return styles;
- };
- /**
- * Get a background color based on day.
- * @param {number} day - day number
- * @param {boolean} isToday - today flag
- * @param {object} styles - style object
- * @returns {string} backgroundColor
- */
- function getWeekBackgroundColor(day, isToday, styles) {
- var backgroundColor = '';
- if (day === 0 || day === 6) {
- backgroundColor = styles.weekendBackgroundColor;
- } else if (isToday) {
- backgroundColor = styles.todayBackgroundColor;
- } else {
- backgroundColor = styles.backgroundColor;
- }
- return backgroundColor;
- }
- /**
- * get a panel infomation
- * @param {Array.<object[]>} panels - panel infomations
- * @param {string} name - panel name
- * @returns {object} panel information
- */
- function getPanel(panels, name) {
- var found;
- util.forEach(panels, function(panel) {
- if (panel.name === name) {
- found = panel;
- }
- });
- return found;
- }
- module.exports = DayGrid;
- /***/ }),
- /***/ "./src/js/view/week/dayGridSchedule.js":
- /*!*********************************************!*\
- !*** ./src/js/view/week/dayGridSchedule.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Weekday view for week
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var Weekday = __webpack_require__(/*! ../weekday */ "./src/js/view/weekday.js"),
- tmpl = __webpack_require__(/*! ../template/week/dayGridSchedule.hbs */ "./src/js/view/template/week/dayGridSchedule.hbs");
- var mmax = Math.max;
- /**
- * @constructor
- * @extends {Weekday}
- * @param {object} options - options for DayGridSchedule view
- * @param {number} [options.containerButtonGutter=8] - free space at bottom to
- * make create easy.
- * @param {number} [options.scheduleHeight=18] - height of each schedule block.
- * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
- * @param {HTMLDIVElement} container - DOM element to use container for this
- * view.
- */
- function DayGridSchedule(options, container) {
- Weekday.call(this, options, container);
- this.collapsed = true;
- }
- util.inherit(DayGridSchedule, Weekday);
- /**
- * Render Weekday view
- * @override
- */
- DayGridSchedule.prototype.render = function(viewModel) {
- var container = this.container;
- var baseViewModel;
- baseViewModel = this.getBaseViewModel(viewModel);
- container.innerHTML = tmpl(baseViewModel);
- this.fire('afterRender', baseViewModel);
- };
- /**
- * returns maximum schedule count in day
- * @param {array} matrices - The matrices for schedule placing.
- * @returns {number} maximum schedule count in day
- */
- DayGridSchedule.prototype._getMaxScheduleInDay = function(matrices) {
- return mmax.apply(
- null,
- util.map(matrices, function(matrix) {
- return Math.max.apply(null, util.map(matrix, function(row) {
- return row.length;
- }));
- })
- );
- };
- /**
- * returns minimum height for container.
- * @param {number} maxScheduleInDay - max schedule blocks in one day
- * @returns {number}
- */
- DayGridSchedule.prototype._getMinHeight = function(maxScheduleInDay) {
- var opt = this.options;
- var contentHeight = (maxScheduleInDay * opt.scheduleHeight)
- + ((maxScheduleInDay - 1) * opt.scheduleGutter);
- // if (this.collapsed && this.aboutMe.maxHeight >= contentHeight + opt.containerBottomGutter) {
- // contentHeight += opt.containerBottomGutter;
- // }
- return contentHeight;
- };
- /**
- * @override
- * @param {object} viewModel - schedules view models
- */
- DayGridSchedule.prototype.getBaseViewModel = function(viewModel) {
- var opt = this.options;
- var matrices = opt.getViewModelFunc(viewModel);
- var maxScheduleInDay = this._getMaxScheduleInDay(matrices);
- var baseViewModel;
- var styles = this._getStyles(viewModel.theme);
- baseViewModel = Weekday.prototype.getBaseViewModel.call(this, viewModel);
- baseViewModel = util.extend({
- minHeight: this._getMinHeight(maxScheduleInDay),
- matrices: matrices,
- scheduleContainerTop: this.options.scheduleContainerTop,
- maxScheduleInDay: maxScheduleInDay,
- isReadOnly: opt.isReadOnly,
- styles: styles
- }, baseViewModel);
- return baseViewModel;
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- DayGridSchedule.prototype._getStyles = function(theme) {
- var styles = {};
- if (theme) {
- styles.borderRadius = theme.week.dayGridSchedule.borderRadius;
- }
- return styles;
- };
- module.exports = DayGridSchedule;
- /***/ }),
- /***/ "./src/js/view/week/dayname.js":
- /*!*************************************!*\
- !*** ./src/js/view/week/dayname.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview View for rendering daynames
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
- var daynameTmpl = __webpack_require__(/*! ../template/week/daynames.hbs */ "./src/js/view/template/week/daynames.hbs");
- /**
- * @constructor
- * @param {object} options - options for dayname view
- * @param {HTMLElement} container Container element to use.
- * @param {Theme} theme - theme instance
- * @extends {View}
- */
- function DayName(options, container, theme) {
- container = domutil.appendHTMLElement(
- 'div',
- container,
- config.classname('dayname-container')
- );
- this.options = util.extend({
- daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
- timezones: options.timezones
- }, options.week);
- /**
- * @type {Theme}
- */
- this.theme = theme;
- View.call(this, container);
- this.applyTheme();
- }
- util.inherit(DayName, View);
- /**
- * Get default viewmodels.
- * @param {Date} start The date of start render
- * @param {Date} end The end of end render
- * @param {object} grids grid data(width, left, day)
- * @returns {array} viewmodel.
- */
- DayName.prototype._getBaseViewModel = function(start, end, grids) {
- var daynames = this.options.daynames,
- theme = this.theme,
- now = new TZDate().toLocalTime(),
- viewModel;
- viewModel = util.map(datetime.range(
- datetime.start(start),
- datetime.end(end),
- datetime.MILLISECONDS_PER_DAY
- ), function(d, i) {
- var day = d.getDay();
- var isToday = datetime.isSameDate(d, now);
- var isPastDay = d < now && !isToday;
- return {
- day: day,
- dayName: daynames[day],
- isToday: isToday,
- date: d.getDate(),
- left: grids[i] ? grids[i].left : 0,
- width: grids[i] ? grids[i].width : 0,
- renderDate: datetime.format(d, 'YYYY-MM-DD'),
- color: this._getDayNameColor(theme, day, isToday, isPastDay)
- };
- }, this);
- return viewModel;
- };
- /**
- * @override
- * @param {object} viewModel View model from parent (WeekView)
- */
- DayName.prototype.render = function(viewModel) {
- var dayNames = this._getBaseViewModel(
- viewModel.renderStartDate,
- viewModel.renderEndDate,
- viewModel.grids
- );
- var timezonesCollapsed = viewModel.state.timezonesCollapsed;
- var styles = this._getStyles(this.theme, timezonesCollapsed);
- var baseViewModel = util.extend({}, {
- dayNames: dayNames,
- styles: styles
- });
- this.container.innerHTML = daynameTmpl(baseViewModel);
- };
- /**
- * Get a day name color
- * @param {Theme} theme - theme instance
- * @param {number} day - day number
- * @param {boolean} isToday - today flag
- * @param {boolean} isPastDay - is past day flag
- * @returns {string} style - color style
- */
- DayName.prototype._getDayNameColor = function(theme, day, isToday, isPastDay) {
- var color = '';
- if (theme) {
- if (day === 0) {
- color = theme.common.holiday.color;
- } else if (isPastDay) {
- color = theme.week.pastDay.color || theme.common.dayname.color;
- } else if (day === 6) {
- color = theme.common.saturday.color;
- } else if (isToday) {
- color = theme.week.today.color || theme.common.today.color;
- } else {
- color = theme.common.dayname.color;
- }
- }
- return color;
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
- * @returns {object} styles - styles object
- */
- DayName.prototype._getStyles = function(theme, timezonesCollapsed) {
- var styles = {};
- var timezonesLength = this.options.timezones.length;
- var collapsed = timezonesCollapsed;
- var numberAndUnit;
- if (theme) {
- styles.borderTop = theme.week.dayname.borderTop || theme.common.border;
- styles.borderBottom = theme.week.dayname.borderBottom || theme.common.border;
- styles.borderLeft = theme.week.dayname.borderLeft || theme.common.border;
- styles.paddingLeft = theme.week.dayname.paddingLeft;
- styles.backgroundColor = theme.week.dayname.backgroundColor;
- styles.height = theme.week.dayname.height;
- styles.textAlign = theme.week.dayname.textAlign;
- styles.marginLeft = theme.week.daygridLeft.width;
- if (!collapsed && timezonesLength > 1) {
- numberAndUnit = common.parseUnit(styles.marginLeft);
- styles.marginLeft = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
- }
- }
- return styles;
- };
- DayName.prototype.applyTheme = function() {
- var styles = this._getStyles(this.theme);
- var style = this.container.style;
- style.borderTop = styles.borderTop;
- style.borderBottom = styles.borderBottom;
- style.height = styles.height;
- style.backgroundColor = styles.backgroundColor;
- style.textAlign = styles.textAlign;
- return style;
- };
- module.exports = DayName;
- /***/ }),
- /***/ "./src/js/view/week/time.js":
- /*!**********************************!*\
- !*** ./src/js/view/week/time.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview View of time.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
- var timeTmpl = __webpack_require__(/*! ../template/week/time.hbs */ "./src/js/view/template/week/time.hbs");
- var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
- var forEachArr = util.forEachArray;
- var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
- /**
- * calculate offset start of schedule
- * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
- * @param {object} options - options for calculating schedule element's bound.
- * @returns {object} - left and width
- */
- function getOffsetStart(viewModel, options) {
- var goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
- var startDayOffset = options.todayStart.toDate().getTimezoneOffset();
- var nativeOffsetMs = tz.getNativeOffsetMs();
- var startOffset = viewModel.valueOf().start.toDate().getTimezoneOffset();
- var primaryOffset = tz.getPrimaryOffset();
- var timezoneOffset = tz.getOffsetByTimezoneName(
- tz.getPrimaryTimezoneName(),
- viewModel.valueOf().start.getTime()
- );
- var MIN_TO_MS = 60 * 1000;
- var offsetDiffMs = 0;
- var offsetStart = viewModel.valueOf().start - goingDuration - options.todayStart;
- if (tz.hasPrimaryTimezoneCustomSetting()) {
- if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startDayOffset) {
- // When using a custom time zone, the native time zone offset is fixed and rendered.
- // So, The fixed and rendered time should be recalculated as the original time zone offset.
- // The current system OS local time is not affected by summer/standard time and the schedule should always be displayed in the same location.
- offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
- offsetStart += offsetDiffMs;
- }
- if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
- // The custom time zone is a time zone where two offsets including DST are applied.
- // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
- // It should be recalculated with the original time zone offset.
- offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
- offsetStart += offsetDiffMs;
- }
- }
- return offsetStart;
- }
- /**
- * @constructor
- * @extends {View}
- * @param {object} options Options
- * @param {number} options.index Date index in week view.
- * @param {number} options.width Date element width (percent)
- * @param {string} options.ymd YYYMMDD string for this view
- * @param {boolean} options.isToday when set true then assign today design class to container.
- * @param {number} options.hourStart Can limit of render hour start.
- * @param {number} options.hourEnd Can limit of render hour end.
- * @param {HTMLElement} container Element to use container for this view.
- * @param {Theme} theme - theme instance
- */
- function Time(options, container, theme) {
- View.call(this, container);
- this.options = util.extend(
- {
- index: 0,
- width: 0,
- ymd: '',
- isToday: false,
- pending: false,
- hourStart: 0,
- hourEnd: 24,
- defaultMarginBottom: 2,
- minHeight: 18.5,
- isReadOnly: false
- },
- options
- );
- this.timeTmpl = timeTmpl;
- /**
- * @type {Theme}
- */
- this.theme = theme;
- container.style.width = options.width + '%';
- container.style.left = options.left + '%';
- if (this.options.isToday) {
- domutil.addClass(this.container, config.classname('today'));
- }
- this.applyTheme();
- }
- util.inherit(Time, View);
- /**
- * Convert YYYYMMDD formatted string date to Date.
- * @param {string} str formatted string.
- * @returns {Date} start of date.
- */
- Time.prototype._parseDateGroup = function(str) {
- var y = parseInt(str.substr(0, 4), 10),
- m = parseInt(str.substr(4, 2), 10),
- d = parseInt(str.substr(6, 2), 10);
- var date = datetime.start();
- date.setFullYear(y, m - 1, d);
- return datetime.start(date);
- };
- /**
- * calculate left and width
- * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
- * @param {object} options - options for calculating schedule element's bound.
- * @returns {object} - left and width
- */
- Time.prototype._getScheduleViewBoundX = function(viewModel, options) {
- var width = options.baseWidth * (viewModel.extraSpace + 1);
- // set width auto when has no collisions.
- if (!viewModel.hasCollide) {
- width = null;
- }
- return {
- left: options.baseLeft[options.columnIndex],
- width: width
- };
- };
- /**
- * calculate top, height, croppedStart and croppedEnd
- * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
- * @param {object} options - options for calculating schedule element's bound.
- * @returns {object} - left and width
- */
- Time.prototype._getScheduleViewBoundY = function(viewModel, options) {
- var baseMS = options.baseMS;
- var baseHeight = options.baseHeight;
- var croppedStart = false;
- var croppedEnd = false;
- var goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
- var comingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
- var modelDuration = viewModel.duration();
- var top, height, duration;
- var goingDurationHeight, modelDurationHeight, comingDurationHeight;
- var offsetStart = getOffsetStart(viewModel, options);
- // containerHeight : milliseconds in day = x : schedule's milliseconds
- top = (baseHeight * offsetStart) / baseMS;
- modelDuration = modelDuration > SCHEDULE_MIN_DURATION ? modelDuration : SCHEDULE_MIN_DURATION;
- duration = modelDuration + goingDuration + comingDuration;
- height = (baseHeight * duration) / baseMS;
- goingDurationHeight = (baseHeight * goingDuration) / baseMS; // common.ratio(duration, goingDuration, 100);
- modelDurationHeight = (baseHeight * modelDuration) / baseMS; // common.ratio(duration, modelDuration, 100);
- comingDurationHeight = (baseHeight * comingDuration) / baseMS; // common.ratio(duration, comingDuration, 100);
- if (offsetStart < 0) {
- top = 0;
- height += (baseHeight * offsetStart) / baseMS;
- croppedStart = true;
- }
- if (height + top > baseHeight) {
- height = baseHeight - top;
- croppedEnd = true;
- }
- return {
- top: top,
- height: Math.max(height, this.options.minHeight) - this.options.defaultMarginBottom,
- modelDurationHeight: modelDurationHeight,
- goingDurationHeight: goingDurationHeight,
- comingDurationHeight: comingDurationHeight,
- hasGoingDuration: goingDuration > 0,
- hasComingDuration: comingDuration > 0,
- croppedStart: croppedStart,
- croppedEnd: croppedEnd
- };
- };
- /**
- * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
- * @param {object} options - options for calculating schedule element's bound.
- * @param {Date} options.todayStart - date object represent schedule date's start (00:00:00)
- * @param {number} options.baseMS - the number of milliseconds to render schedule blocks.
- * @param {number} options.baseHeight - pixel value related with baseMS options.
- * @param {number[]} options.baseLeft - left position percents for each columns.
- * @param {number} options.baseWidth - the unit of schedule blocks width percent.
- * @param {number} options.columnIndex - the number index of schedule blocks.
- * it represent rendering index from left sides in view.
- * @returns {object} bound object for supplied view model.
- */
- Time.prototype.getScheduleViewBound = function(viewModel, options) {
- var boundX = this._getScheduleViewBoundX(viewModel, options);
- var boundY = this._getScheduleViewBoundY(viewModel, options);
- var schedule = viewModel.model;
- var isReadOnly = util.pick(schedule, 'isReadOnly') || false;
- var travelBorderColor = schedule.isFocused ? '#ffffff' : schedule.borderColor;
- if (travelBorderColor === schedule.bgColor) {
- travelBorderColor = null; // follow text color
- }
- return util.extend(
- {
- isReadOnly: isReadOnly,
- travelBorderColor: travelBorderColor
- },
- boundX,
- boundY
- );
- };
- /**
- * Set viewmodels for rendering.
- * @param {string} ymd The date of schedules. YYYYMMDD format.
- * @param {array} matrices The matrices for schedule placing.
- * @param {number} containerHeight - container's height
- */
- Time.prototype._getBaseViewModel = function(ymd, matrices, containerHeight) {
- var self = this,
- options = this.options,
- hourStart = options.hourStart,
- hourEnd = options.hourEnd,
- isReadOnly = options.isReadOnly,
- todayStart,
- baseMS;
- /**
- * Calculate each schedule element bounds relative with rendered hour milliseconds and
- * wrap each schedule model to viewmodels.
- */
- containerHeight = containerHeight || this.getViewBound().height;
- todayStart = this._parseDateGroup(ymd);
- todayStart.setHours(hourStart);
- baseMS = datetime.millisecondsFrom('hour', hourEnd - hourStart);
- forEachArr(matrices, function(matrix) {
- var maxRowLength, widthPercent, leftPercents, i;
- maxRowLength = Math.max.apply(
- null,
- util.map(matrix, function(row) {
- return row.length;
- })
- );
- widthPercent = 100 / maxRowLength;
- leftPercents = [];
- for (i = 0; i < maxRowLength; i += 1) {
- leftPercents[i] = widthPercent * i;
- }
- forEachArr(matrix, function(row) {
- forEachArr(row, function(viewModel, col) {
- var viewBound;
- if (!viewModel) {
- return;
- }
- viewBound = self.getScheduleViewBound(viewModel, {
- todayStart: todayStart,
- baseMS: baseMS,
- baseLeft: leftPercents,
- baseWidth: widthPercent,
- baseHeight: containerHeight,
- columnIndex: col,
- isReadOnly: isReadOnly
- });
- util.extend(viewModel, viewBound);
- });
- });
- });
- };
- /**
- * @returns {Date} - Date of this view.
- */
- Time.prototype.getDate = function() {
- return this._parseDateGroup(this.options.ymd);
- };
- /**
- * @override
- * @param {string} ymd The date of schedules. YYYYMMDD format
- * @param {array} matrices Matrices for placing schedules
- * @param {number} containerHeight - container's height
- */
- Time.prototype.render = function(ymd, matrices, containerHeight) {
- this._getBaseViewModel(ymd, matrices, containerHeight);
- this.container.innerHTML = this.timeTmpl({
- matrices: matrices,
- styles: this._getStyles(this.theme),
- isReadOnly: this.options.isReadOnly
- });
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @returns {object} styles - styles object
- */
- Time.prototype._getStyles = function(theme) {
- var styles = {};
- var options = this.options;
- if (theme) {
- styles.borderRight = theme.week.timegrid.borderRight || theme.common.border;
- styles.marginRight = theme.week.timegrid.paddingRight;
- styles.borderRadius = theme.week.timegridSchedule.borderRadius;
- styles.paddingLeft = theme.week.timegridSchedule.paddingLeft;
- styles.backgroundColor = options.isToday ? theme.week.today.backgroundColor : 'inherit';
- }
- return styles;
- };
- Time.prototype.applyTheme = function() {
- var style = this.container.style;
- var styles = this._getStyles(this.theme);
- style.borderRight = styles.borderRight;
- style.backgroundColor = styles.backgroundColor;
- };
- module.exports = Time;
- /***/ }),
- /***/ "./src/js/view/week/timeGrid.js":
- /*!**************************************!*\
- !*** ./src/js/view/week/timeGrid.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview View for rendered schedules by times.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
- var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
- var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
- var Time = __webpack_require__(/*! ./time */ "./src/js/view/week/time.js");
- var AutoScroll = __webpack_require__(/*! ../../common/autoScroll */ "./src/js/common/autoScroll.js");
- var mainTmpl = __webpack_require__(/*! ../template/week/timeGrid.hbs */ "./src/js/view/template/week/timeGrid.hbs");
- var timezoneStickyTmpl = __webpack_require__(/*! ../template/week/timezoneSticky.hbs */ "./src/js/view/template/week/timezoneSticky.hbs");
- var timegridCurrentTimeTmpl = __webpack_require__(/*! ../template/week/timeGridCurrentTime.hbs */ "./src/js/view/template/week/timeGridCurrentTime.hbs");
- var TZDate = tz.Date;
- var HOURMARKER_REFRESH_INTERVAL = 1000 * 60;
- var SIXTY_SECONDS = 60;
- var SIXTY_MINUTES = 60;
- /**
- * Returns a list of time labels from start to end.
- * For hidden labels near the current time, set to hidden: true.
- * @param {object} opt - TimeGrid.options
- * @param {boolean} hasHourMarker - Whether the current time is displayed
- * @param {number} timezoneOffset - timezone offset
- * @param {object} styles - styles
- * @returns {Array.<Object>}
- */
- function getHoursLabels(opt, hasHourMarker, timezoneOffset, styles) {
- var hourStart = opt.hourStart;
- var hourEnd = opt.hourEnd;
- var renderEndDate = new TZDate(opt.renderEndDate);
- var shiftByOffset = parseInt(timezoneOffset / SIXTY_MINUTES, 10);
- var shiftMinutes = Math.abs(timezoneOffset % SIXTY_MINUTES);
- var now = new TZDate().toLocalTime();
- var nowMinutes = now.getMinutes();
- var hoursRange = util.range(0, 24);
- var nowAroundHours = null;
- var nowHours, nowHoursIndex;
- var isNegativeZero = 1 / -Infinity === shiftByOffset;
- if ((shiftByOffset < 0 || isNegativeZero) && shiftMinutes > 0) {
- shiftByOffset -= 1;
- }
- // shift the array and take elements between start and end
- common.shiftArray(hoursRange, shiftByOffset);
- common.takeArray(hoursRange, hourStart, hourEnd);
- nowHours = common.shiftHours(now.getHours(), shiftByOffset) % 24;
- nowHoursIndex = util.inArray(nowHours, hoursRange);
- if (hasHourMarker) {
- if (nowMinutes < 20) {
- nowAroundHours = nowHours;
- } else if (nowMinutes > 40) {
- nowAroundHours = nowHours + 1;
- }
- if (util.isNumber(nowAroundHours)) {
- nowAroundHours %= 24;
- }
- }
- return util.map(hoursRange, function(hour, index) {
- var color;
- var fontWeight;
- var isPast =
- (hasHourMarker && index <= nowHoursIndex) ||
- (renderEndDate < now && !datetime.isSameDate(renderEndDate, now));
- if (isPast) {
- // past
- color = styles.pastTimeColor;
- fontWeight = styles.pastTimeFontWeight;
- } else {
- // future
- color = styles.futureTimeColor;
- fontWeight = styles.futureTimeFontWeight;
- }
- return {
- hour: hour,
- minutes: shiftMinutes,
- hidden: nowAroundHours === hour || index === 0,
- color: color || '',
- fontWeight: fontWeight || ''
- };
- });
- }
- /**
- * Returns timezone offset from timezone object
- * @param {object} timezoneObj - timezone object in options.timzones
- * @param {number} timestamp - timestamp
- * @returns {number} timezoneOffset - timezone offset
- */
- function getOffsetByTimezoneOption(timezoneObj, timestamp) {
- var primaryOffset = tz.getPrimaryOffset();
- if (util.isString(timezoneObj.timezoneName)) {
- return -tz.getOffsetByTimezoneName(timezoneObj.timezoneName, timestamp);
- }
- // @deprecated timezoneOffset property will be deprecated
- if (util.isNumber(timezoneObj.timezoneOffset) && timezoneObj.timezoneOffset !== primaryOffset) {
- return timezoneObj.timezoneOffset;
- }
- return -primaryOffset;
- }
- /**
- * @constructor
- * @extends {View}
- * @param {string} name - view name
- * @param {object} options The object for view customization.
- * @param {string} options.renderStartDate - render start date. YYYY-MM-DD
- * @param {string} options.renderEndDate - render end date. YYYY-MM-DD
- * @param {number} [options.hourStart=0] You can change view's start hours.
- * @param {number} [options.hourEnd=0] You can change view's end hours.
- * @param {HTMLElement} panelElement panel element.
- */
- function TimeGrid(name, options, panelElement) {
- var container = domutil.appendHTMLElement(
- 'div',
- panelElement,
- config.classname('timegrid-container')
- );
- var stickyContainer = domutil.appendHTMLElement(
- 'div',
- panelElement,
- config.classname('timegrid-sticky-container')
- );
- panelElement.style.position = 'relative'; // for stickyContainer
- name = name || 'time';
- View.call(this, container);
- if (!util.browser.safari) {
- /**
- * @type {AutoScroll}
- */
- this._autoScroll = new AutoScroll(container);
- }
- this.stickyContainer = stickyContainer;
- /**
- * Time view options.
- * @type {object}
- */
- this.options = util.extend(
- {
- viewName: name,
- renderStartDate: '',
- renderEndDate: '',
- hourStart: 0,
- hourEnd: 24,
- timezones: options.timezones,
- isReadOnly: options.isReadOnly,
- showTimezoneCollapseButton: false
- },
- options.week
- );
- if (this.options.timezones.length < 1) {
- this.options.timezones = [
- {
- timezoneOffset: tz.getPrimaryOffset()
- }
- ];
- }
- /**
- * Interval id for hourmarker animation.
- * @type {number}
- */
- this.intervalID = 0;
- /**
- * timer id for hourmarker initial state
- * @type {number}
- */
- this.timerID = 0;
- /**
- * requestAnimationFrame unique ID
- * @type {number}
- */
- this.rAnimationFrameID = 0;
- /**
- * @type {boolean}
- */
- this._scrolled = false;
- /**
- * cache parent's view model
- * @type {object}
- */
- this._cacheParentViewModel = null;
- /**
- * cache hoursLabels view model to render again TimeGrid
- * @type {object}
- */
- this._cacheHoursLabels = null;
- this.attachEvent();
- }
- util.inherit(TimeGrid, View);
- /**********
- * Prototype props
- **********/
- /**
- * @type {string}
- */
- TimeGrid.prototype.viewName = 'timegrid';
- /**
- * Destroy view.
- * @override
- */
- TimeGrid.prototype._beforeDestroy = function() {
- clearInterval(this.intervalID);
- clearTimeout(this.timerID);
- reqAnimFrame.cancelAnimFrame(this.rAnimationFrameID);
- if (this._autoScroll) {
- this._autoScroll.destroy();
- }
- domevent.off(this.stickyContainer, 'click', this._onClickStickyContainer, this);
- this._autoScroll = this.hourmarkers = this.intervalID
- = this.timerID = this.rAnimationFrameID = this._cacheParentViewModel = this.stickyContainer = null;
- };
- /**
- * @param {Date} [time] - date object to convert pixel in grids.
- * use **Date.now()** when not supplied.
- * @returns {number} The pixel value represent current time in grids.
- */
- TimeGrid.prototype._getTopPercentByTime = function(time) {
- var opt = this.options,
- raw = datetime.raw(time || new TZDate()),
- hourLength = util.range(opt.hourStart, opt.hourEnd).length,
- maxMilliseconds = hourLength * datetime.MILLISECONDS_PER_HOUR,
- hmsMilliseconds =
- datetime.millisecondsFrom('hour', raw.h) +
- datetime.millisecondsFrom('minutes', raw.m) +
- datetime.millisecondsFrom('seconds', raw.s) +
- raw.ms,
- topPercent;
- topPercent = common.ratio(maxMilliseconds, 100, hmsMilliseconds);
- topPercent -= common.ratio(
- maxMilliseconds,
- 100,
- datetime.millisecondsFrom('hour', opt.hourStart)
- );
- return common.limit(topPercent, [0], [100]);
- };
- /**
- * Get Hourmarker viewmodel.
- * @param {TZDate} now - now
- * @param {object} grids grid information(width, left, day)
- * @param {Array.<TZDate>} range render range
- * @returns {object} ViewModel of hourmarker.
- */
- TimeGrid.prototype._getHourmarkerViewModel = function(now, grids, range) {
- var todaymarkerLeft = -1;
- var todaymarkerWidth = -1;
- var hourmarkerTimzones = [];
- var opt = this.options;
- var primaryOffset = tz.getPrimaryOffset();
- var timezones = opt.timezones;
- var viewModel;
- util.forEach(range, function(date, index) {
- if (datetime.isSameDate(now, date)) {
- todaymarkerLeft = grids[index] ? grids[index].left : 0;
- todaymarkerWidth = grids[index] ? grids[index].width : 0;
- }
- });
- util.forEach(timezones, function(timezone) {
- var hourmarker = new TZDate(now);
- var timezoneOffset = getOffsetByTimezoneOption(timezone, hourmarker.getTime());
- var timezoneDifference = timezoneOffset + primaryOffset;
- var dateDifference;
- hourmarker.setMinutes(hourmarker.getMinutes() + timezoneDifference);
- dateDifference = datetime.getDateDifference(hourmarker, now);
- hourmarkerTimzones.push({
- hourmarker: hourmarker,
- dateDifferenceSign: dateDifference < 0 ? '-' : '+',
- dateDifference: Math.abs(dateDifference)
- });
- });
- viewModel = {
- currentHours: now.getHours(),
- hourmarkerTop: this._getTopPercentByTime(now),
- hourmarkerTimzones: hourmarkerTimzones,
- todaymarkerLeft: todaymarkerLeft,
- todaymarkerWidth: todaymarkerWidth,
- todaymarkerRight: todaymarkerLeft + todaymarkerWidth
- };
- return viewModel;
- };
- /**
- * Get timezone view model
- * @param {number} currentHours - current hour
- * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
- * @param {object} styles - styles
- * @returns {object} ViewModel
- */
- TimeGrid.prototype._getTimezoneViewModel = function(currentHours, timezonesCollapsed, styles) {
- var opt = this.options;
- var primaryOffset = tz.getPrimaryOffset();
- var timezones = opt.timezones;
- var timezonesLength = timezones.length;
- var timezoneViewModel = [];
- var collapsed = timezonesCollapsed;
- var width = collapsed ? 100 : 100 / timezonesLength;
- var now = new TZDate().toLocalTime();
- var backgroundColor = styles.displayTimezoneLabelBackgroundColor;
- // eslint-disable-next-line complexity
- util.forEach(timezones, function(timezone, index) {
- var hourmarker = new TZDate(now);
- var timezoneOffset = getOffsetByTimezoneOption(timezone, hourmarker.getTime());
- var timezoneDifference = timezoneOffset + primaryOffset;
- var timeSlots = getHoursLabels(opt, currentHours >= 0, timezoneDifference, styles);
- var dateDifference;
- hourmarker.setMinutes(hourmarker.getMinutes() + timezoneDifference);
- dateDifference = datetime.getDateDifference(hourmarker, now);
- if (index > 0) {
- backgroundColor = styles.additionalTimezoneBackgroundColor;
- }
- timezoneViewModel.push({
- timeSlots: timeSlots,
- displayLabel: timezone.displayLabel,
- timezoneOffset: timezone.timezoneOffset,
- tooltip: timezone.tooltip || '',
- width: width,
- left: collapsed ? 0 : (timezones.length - index - 1) * width,
- isPrimary: index === 0,
- backgroundColor: backgroundColor || '',
- hidden: index !== 0 && collapsed,
- hourmarker: hourmarker,
- dateDifferenceSign: dateDifference < 0 ? '-' : '+',
- dateDifference: Math.abs(dateDifference)
- });
- });
- return timezoneViewModel;
- };
- /**
- * Get base viewModel.
- * @param {object} viewModel - view model
- * @returns {object} ViewModel
- */
- TimeGrid.prototype._getBaseViewModel = function(viewModel) {
- var grids = viewModel.grids;
- var range = viewModel.range;
- var opt = this.options;
- var baseViewModel = this._getHourmarkerViewModel(new TZDate().toLocalTime(), grids, range);
- var timezonesCollapsed = util.pick(viewModel, 'state', 'timezonesCollapsed');
- var styles = this._getStyles(viewModel.theme, timezonesCollapsed);
- return util.extend(baseViewModel, {
- timezones: this._getTimezoneViewModel(
- baseViewModel.todaymarkerLeft,
- timezonesCollapsed,
- styles
- ),
- hoursLabels: getHoursLabels(opt, baseViewModel.todaymarkerLeft >= 0, 0, styles),
- styles: styles,
- showTimezoneCollapseButton: util.pick(opt, 'showTimezoneCollapseButton'),
- timezonesCollapsed: timezonesCollapsed
- });
- };
- /**
- * Reconcilation child views and render.
- * @param {object} viewModels Viewmodel
- * @param {object} grids grid information(width, left, day)
- * @param {HTMLElement} container Container element for each time view.
- * @param {Theme} theme - theme instance
- */
- TimeGrid.prototype._renderChildren = function(viewModels, grids, container, theme) {
- var self = this,
- options = this.options,
- childOption,
- child,
- isToday,
- containerHeight,
- today = datetime.format(new TZDate().toLocalTime(), 'YYYYMMDD'),
- i = 0;
- // clear contents
- container.innerHTML = '';
- this.children.clear();
- containerHeight = domutil.getSize(container.parentElement)[1];
- // reconcilation of child views
- util.forEach(viewModels, function(schedules, ymd) {
- isToday = ymd === today;
- childOption = {
- index: i,
- left: grids[i] ? grids[i].left : 0,
- width: grids[i] ? grids[i].width : 0,
- ymd: ymd,
- isToday: isToday,
- isPending: options.isPending,
- isFocused: options.isFocused,
- isReadOnly: options.isReadOnly,
- hourStart: options.hourStart,
- hourEnd: options.hourEnd
- };
- child = new Time(
- childOption,
- domutil.appendHTMLElement('div', container, config.classname('time-date')),
- theme
- );
- child.render(ymd, schedules, containerHeight);
- self.addChild(child);
- i += 1;
- });
- };
- /**
- * @override
- * @param {object} viewModel ViewModel list from Week view.
- */
- TimeGrid.prototype.render = function(viewModel) {
- var opt = this.options,
- timeViewModel = viewModel.schedulesInDateRange[opt.viewName],
- container = this.container,
- grids = viewModel.grids,
- baseViewModel = this._getBaseViewModel(viewModel),
- scheduleLen = util.keys(timeViewModel).length;
- this._cacheParentViewModel = viewModel;
- this._cacheHoursLabels = baseViewModel.hoursLabels;
- if (!scheduleLen) {
- return;
- }
- baseViewModel.showHourMarker = baseViewModel.todaymarkerLeft >= 0;
- container.innerHTML = mainTmpl(baseViewModel);
- /**********
- * Render sticky container for timezone display label
- **********/
- this.renderStickyContainer(baseViewModel);
- /**********
- * Render children
- **********/
- this._renderChildren(
- timeViewModel,
- grids,
- domutil.find(config.classname('.timegrid-schedules-container'), container),
- viewModel.theme
- );
- this._hourLabels = domutil.find('ul', container);
- /**********
- * Render hourmarker
- **********/
- this.hourmarkers = domutil.find(config.classname('.timegrid-hourmarker'), container, true);
- if (!this._scrolled) {
- this._scrolled = true;
- this.scrollToNow();
- }
- };
- TimeGrid.prototype.renderStickyContainer = function(baseViewModel) {
- var stickyContainer = this.stickyContainer;
- stickyContainer.innerHTML = timezoneStickyTmpl(baseViewModel);
- stickyContainer.style.display = baseViewModel.timezones.length > 1 ? 'block' : 'none';
- stickyContainer.style.width = baseViewModel.styles.leftWidth;
- stickyContainer.style.height = baseViewModel.styles.displayTimezoneLabelHeight;
- stickyContainer.style.borderBottom = baseViewModel.styles.leftBorderRight;
- };
- /**
- * Refresh hourmarker element.
- */
- TimeGrid.prototype.refreshHourmarker = function() {
- var hourmarkers = this.hourmarkers;
- var viewModel = this._cacheParentViewModel;
- var hoursLabels = this._cacheHoursLabels;
- var rAnimationFrameID = this.rAnimationFrameID;
- var baseViewModel;
- if (!hourmarkers || !viewModel || rAnimationFrameID) {
- return;
- }
- baseViewModel = this._getBaseViewModel(viewModel);
- this.rAnimationFrameID = reqAnimFrame.requestAnimFrame(function() {
- var needsRender = false;
- util.forEach(hoursLabels, function(hoursLabel, index) {
- if (hoursLabel.hidden !== baseViewModel.hoursLabels[index].hidden) {
- needsRender = true;
- return false;
- }
- return true;
- });
- if (needsRender) {
- this.render(viewModel);
- } else {
- util.forEach(hourmarkers, function(hourmarker) {
- var todaymarker = domutil.find(
- config.classname('.timegrid-todaymarker'),
- hourmarker
- );
- var hourmarkerContainer = domutil.find(
- config.classname('.timegrid-hourmarker-time'),
- hourmarker
- );
- var timezone = domutil.closest(hourmarker, config.classname('.timegrid-timezone'));
- var timezoneIndex = timezone ? domutil.getData(timezone, 'timezoneIndex') : 0;
- hourmarker.style.top = baseViewModel.hourmarkerTop + '%';
- if (todaymarker) {
- todaymarker.style.display =
- baseViewModel.todaymarkerLeft >= 0 ? 'block' : 'none';
- }
- if (hourmarkerContainer) {
- hourmarkerContainer.innerHTML = timegridCurrentTimeTmpl(
- baseViewModel.hourmarkerTimzones[timezoneIndex]
- );
- }
- });
- }
- this.rAnimationFrameID = null;
- }, this);
- };
- /**
- * Attach events
- */
- TimeGrid.prototype.attachEvent = function() {
- clearInterval(this.intervalID);
- clearTimeout(this.timerID);
- this.intervalID = this.timerID = this.rAnimationFrameID = null;
- this.timerID = setTimeout(
- this.onTick.bind(this),
- (SIXTY_SECONDS - new TZDate().getSeconds()) * 1000
- );
- domevent.on(this.stickyContainer, 'click', this._onClickStickyContainer, this);
- };
- /**
- * Scroll time grid to current hourmarker.
- */
- TimeGrid.prototype.scrollToNow = function() {
- var container = this.container;
- var offsetTop, viewBound, scrollTop, scrollAmount, scrollBy, scrollFn;
- if (!this.hourmarkers || !this.hourmarkers.length) {
- return;
- }
- offsetTop = this.hourmarkers[0].offsetTop;
- viewBound = this.getViewBound();
- scrollTop = offsetTop;
- scrollAmount = viewBound.height / 4;
- scrollBy = 10;
- scrollFn = function() {
- if (scrollTop > offsetTop - scrollAmount) {
- scrollTop -= scrollBy;
- container.scrollTop = scrollTop;
- reqAnimFrame.requestAnimFrame(scrollFn);
- } else {
- container.scrollTop = offsetTop - scrollAmount;
- }
- };
- reqAnimFrame.requestAnimFrame(scrollFn);
- };
- /**********
- * Schedule handlers
- **********/
- /**
- * Interval tick handler
- */
- TimeGrid.prototype.onTick = function() {
- if (this.timerID) {
- clearTimeout(this.timerID);
- this.timerID = null;
- }
- if (!this.intervalID) {
- this.intervalID = setInterval(this.onTick.bind(this), HOURMARKER_REFRESH_INTERVAL);
- }
- this.refreshHourmarker();
- };
- /**
- * Get the styles from theme
- * @param {Theme} theme - theme instance
- * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
- * @returns {object} styles - styles object
- */
- // eslint-disable-next-line complexity
- TimeGrid.prototype._getStyles = function(theme, timezonesCollapsed) {
- var styles = {};
- var timezonesLength = this.options.timezones.length;
- var collapsed = timezonesCollapsed;
- var numberAndUnit;
- if (theme) {
- styles.borderBottom = theme.week.timegridHorizontalLine.borderBottom || theme.common.border;
- styles.halfHourBorderBottom =
- theme.week.timegridHalfHour.borderBottom || theme.common.border;
- styles.todayBackgroundColor = theme.week.today.backgroundColor;
- styles.weekendBackgroundColor = theme.week.weekend.backgroundColor;
- styles.backgroundColor = theme.week.daygrid.backgroundColor;
- styles.leftWidth = theme.week.timegridLeft.width;
- styles.leftBackgroundColor = theme.week.timegridLeft.backgroundColor;
- styles.leftBorderRight = theme.week.timegridLeft.borderRight || theme.common.border;
- styles.leftFontSize = theme.week.timegridLeft.fontSize;
- styles.timezoneWidth = theme.week.timegridLeft.width;
- styles.additionalTimezoneBackgroundColor =
- theme.week.timegridLeftAdditionalTimezone.backgroundColor || styles.leftBackgroundColor;
- styles.displayTimezoneLabelHeight = theme.week.timegridLeftTimezoneLabel.height;
- styles.displayTimezoneLabelBackgroundColor =
- theme.week.timegridLeft.backgroundColor === 'inherit'
- ? 'white'
- : theme.week.timegridLeft.backgroundColor;
- styles.oneHourHeight = theme.week.timegridOneHour.height;
- styles.halfHourHeight = theme.week.timegridHalfHour.height;
- styles.quaterHourHeight = (parseInt(styles.halfHourHeight, 10) / 2) + 'px';
- styles.currentTimeColor = theme.week.currentTime.color;
- styles.currentTimeFontSize = theme.week.currentTime.fontSize;
- styles.currentTimeFontWeight = theme.week.currentTime.fontWeight;
- styles.pastTimeColor = theme.week.pastTime.color;
- styles.pastTimeFontWeight = theme.week.pastTime.fontWeight;
- styles.futureTimeColor = theme.week.futureTime.color;
- styles.futureTimeFontWeight = theme.week.futureTime.fontWeight;
- styles.currentTimeLeftBorderTop = theme.week.currentTimeLinePast.border;
- styles.currentTimeBulletBackgroundColor = theme.week.currentTimeLineBullet.backgroundColor;
- styles.currentTimeTodayBorderTop = theme.week.currentTimeLineToday.border;
- styles.currentTimeRightBorderTop = theme.week.currentTimeLineFuture.border;
- if (!collapsed && timezonesLength > 1) {
- numberAndUnit = common.parseUnit(styles.leftWidth);
- styles.leftWidth = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
- }
- }
- return styles;
- };
- /**
- * @param {MouseEvent} event - mouse event object
- */
- TimeGrid.prototype._onClickStickyContainer = function(event) {
- var target = domevent.getEventTarget(event);
- var closeBtn = domutil.closest(target, config.classname('.timegrid-timezone-close-btn'));
- if (!closeBtn) {
- return;
- }
- this.fire('clickTimezonesCollapsedBtn');
- };
- module.exports = TimeGrid;
- /***/ }),
- /***/ "./src/js/view/week/week.js":
- /*!**********************************!*\
- !*** ./src/js/view/week/week.js ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview View of days UI.
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
- var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
- var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
- var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
- var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
- /**
- * @constructor
- * @param {Base.Week} controller The controller mixin part.
- * @param {object} options View options
- * @param {string} [options.renderStartDate] Start date of render.
- * if not supplied then use -3d from today. YYYY-MM-DD format.
- * @param {string} [options.renderEndDate] End date of render.
- * if not supplied then use +3d from today. YYYY-MM-DD format.
- * @param {string} [options.cssPrefix] - CSS classname prefix
- * @param {HTMLElement} container The element to use container for this view.
- * @param {object} panels - schedule panels like 'milestone', 'task', 'allday', 'time'
- * @param {string} viewName - 'week', 'day'
- * @extends {View}
- */
- function Week(controller, options, container, panels, viewName) {
- var range;
- container = domutil.appendHTMLElement('div', container);
- View.call(this, container);
- domutil.addClass(container, config.classname('week-container'));
- range = this._getRenderDateRange(new TZDate());
- /**
- * @type {object} Options for view.
- */
- this.options = util.extend({
- scheduleFilter: [function(schedule) {
- return Boolean(schedule.isVisible);
- }],
- renderStartDate: datetime.format(range.start, 'YYYY-MM-DD'),
- renderEndDate: datetime.format(range.end, 'YYYY-MM-DD'),
- narrowWeekend: false,
- startDayOfWeek: 0,
- workweek: false,
- showTimezoneCollapseButton: false,
- timezonesCollapsed: false,
- hourStart: 0,
- hourEnd: 24
- }, options);
- /**
- * Week controller mixin.
- * @type {Base.Week}
- */
- this.controller = controller;
- /**
- * Schedule Panels
- * @type {Array.<object>}
- */
- this.panels = panels;
- /**
- * Week view states
- * @type {object}
- */
- this.state = {
- timezonesCollapsed: this.options.timezonesCollapsed
- };
- if (viewName === 'day') {
- _disableDayOptions(this.options);
- }
- }
- util.inherit(Week, View);
- /**********
- * Override props
- **********/
- /**
- * Render each child view with schedules in ranges.
- * @fires Week#afterRender
- * @override
- */
- Week.prototype.render = function() {
- var self = this,
- options = this.options,
- scheduleFilter = options.scheduleFilter,
- narrowWeekend = options.narrowWeekend,
- startDayOfWeek = options.startDayOfWeek,
- workweek = options.workweek,
- theme = this.controller.theme || {},
- state = this.state;
- var renderStartDate, renderEndDate, schedulesInDateRange, viewModel, grids, range;
- renderStartDate = new TZDate(options.renderStartDate);
- renderEndDate = new TZDate(options.renderEndDate);
- range = datetime.range(
- datetime.start(renderStartDate),
- datetime.end(renderEndDate),
- datetime.MILLISECONDS_PER_DAY
- );
- if (options.workweek && datetime.compare(renderStartDate, renderEndDate)) {
- range = util.filter(range, function(date) {
- return !datetime.isWeekend(date.getDay());
- });
- renderStartDate = range[0];
- renderEndDate = range[range.length - 1];
- }
- schedulesInDateRange = this.controller.findByDateRange(
- datetime.start(renderStartDate),
- datetime.end(renderEndDate),
- this.panels,
- scheduleFilter,
- this.options
- );
- grids = datetime.getGridLeftAndWidth(
- range.length,
- narrowWeekend,
- startDayOfWeek,
- workweek
- );
- viewModel = {
- schedulesInDateRange: schedulesInDateRange,
- renderStartDate: renderStartDate,
- renderEndDate: renderEndDate,
- grids: grids,
- range: range,
- theme: theme,
- state: state
- };
- this.children.each(function(childView) {
- var matrices;
- var viewName = util.pick(childView.options, 'viewName');
- childView.render(viewModel);
- if (viewName) {
- matrices = viewModel.schedulesInDateRange[viewName]; // DayGrid limits schedule count by visibleScheduleCount after rendering it.
- if (util.isArray(matrices)) {
- self._invokeAfterRenderSchedule(matrices);
- } else {
- util.forEach(matrices, function(matricesOfDay) {
- self._invokeAfterRenderSchedule(matricesOfDay);
- });
- }
- }
- });
- /**
- * @event Week#afterRender
- */
- this.fire('afterRender');
- };
- /**
- * Fire 'afterRenderSchedule' event
- * @param {Array} matrices - schedule matrices from view model
- * @fires Week#afterRenderSchedule
- */
- Week.prototype._invokeAfterRenderSchedule = function(matrices) {
- var self = this;
- util.forEachArray(matrices, function(matrix) {
- util.forEachArray(matrix, function(column) {
- util.forEachArray(column, function(scheduleViewModel) {
- if (scheduleViewModel) {
- /**
- * @event Week#afterRenderSchedule
- */
- self.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
- }
- });
- });
- });
- };
- /**********
- * Prototype props
- **********/
- Week.prototype.viewName = 'week';
- /**
- * Calculate default render date range from supplied date.
- * @param {Date} baseDate base date.
- * @returns {object} date range.
- */
- Week.prototype._getRenderDateRange = function(baseDate) {
- var base = datetime.start(baseDate),
- start = new TZDate(Number(base)),
- end = new TZDate(Number(base));
- start.setDate(start.getDate() - 3);
- end.setDate(end.getDate() + 3);
- return {
- start: start,
- end: end
- };
- };
- /**
- * disable options for day view
- * @param {WeekOptions} options - week options to disable
- */
- function _disableDayOptions(options) {
- options.workweek = false;
- }
- util.CustomEvents.mixin(Week);
- module.exports = Week;
- /***/ }),
- /***/ "./src/js/view/weekday.js":
- /*!********************************!*\
- !*** ./src/js/view/weekday.js ***!
- \********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * @fileoverview Weekday view
- * @author NHN FE Development Lab <dl_javascript@nhn.com>
- */
- var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
- var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
- domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
- datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js"),
- TZDate = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js").Date,
- View = __webpack_require__(/*! ./view */ "./src/js/view/view.js");
- /**
- * @constructor
- * @extends {View}
- * @param {object} options - view options.
- * @param {number} [options.containerButtonGutter=8] - free space at bottom to
- * make create easy.
- * @param {number} [options.scheduleHeight=18] - height of each schedule block.
- * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
- * @param {HTMLDIVElement} container - DOM element to use container for this
- * view.
- */
- function Weekday(options, container) {
- container = domutil.appendHTMLElement(
- 'div',
- container,
- config.classname('weekday')
- );
- /**
- * @type {object}
- */
- this.options = util.extend({
- containerBottomGutter: 8,
- scheduleHeight: 18,
- scheduleGutter: 2,
- narrowWeekend: false,
- startDayOfWeek: 0,
- workweek: false
- }, options);
- /*
- * cache parent's view model
- * @type {object}
- */
- this._cacheParentViewModel = null;
- View.call(this, container);
- }
- util.inherit(Weekday, View);
- /**
- * Get render date range
- * @returns {Date[]} rendered date range
- */
- Weekday.prototype.getRenderDateRange = function() {
- return this._cacheParentViewModel.range;
- };
- /**
- * Get render date grids information
- * @returns {Date[]} rendered date grids information
- */
- Weekday.prototype.getRenderDateGrids = function() {
- return this._cacheParentViewModel.grids;
- };
- /**
- * Get default view model.
- * @param {object} viewModel parent's view model
- * @returns {object} viewModel to rendering.
- */
- Weekday.prototype.getBaseViewModel = function(viewModel) {
- var opt = this.options;
- var range = viewModel.range;
- var gridWidth = (100 / range.length);
- var grids = viewModel.grids;
- var exceedDate = viewModel.exceedDate || {};
- var theme = viewModel.theme;
- var now = new TZDate().toLocalTime();
- this._cacheParentViewModel = viewModel;
- return {
- width: gridWidth,
- scheduleHeight: opt.scheduleHeight,
- scheduleBlockHeight: (opt.scheduleHeight + opt.scheduleGutter),
- scheduleBlockGutter: opt.scheduleGutter,
- dates: util.map(range, function(date, index) {
- var day = date.getDay();
- var ymd = datetime.format(new TZDate(date), 'YYYYMMDD');
- var isToday = datetime.isSameDate(now, date);
- return {
- date: datetime.format(date, 'YYYY-MM-DD'),
- month: date.getMonth() + 1,
- day: day,
- isToday: isToday,
- ymd: ymd,
- hiddenSchedules: exceedDate[ymd] || 0,
- width: grids[index] ? grids[index].width : 0,
- left: grids[index] ? grids[index].left : 0,
- color: this._getDayNameColor(theme, day, isToday),
- backgroundColor: this._getDayBackgroundColor(theme, day)
- };
- }, this)
- };
- };
- /* eslint max-nested-callbacks: 0 */
- /**
- * Make exceed date information
- * @param {number} maxCount - exceed schedule count
- * @param {Array} eventsInDateRange - matrix of ScheduleViewModel
- * @param {Array.<TZDate>} range - date range of one week
- * @returns {object} exceedDate
- */
- Weekday.prototype.getExceedDate = function(maxCount, eventsInDateRange, range) {
- var exceedDate = this._initExceedDate(range);
- util.forEach(eventsInDateRange, function(matrix) {
- util.forEach(matrix, function(column) {
- util.forEach(column, function(viewModel) {
- var period;
- if (!viewModel || viewModel.top < maxCount) {
- return;
- }
- // check that this schedule block is not visible after rendered.
- viewModel.hidden = true;
- period = datetime.range(
- viewModel.getStarts(),
- viewModel.getEnds(),
- datetime.MILLISECONDS_PER_DAY
- );
- util.forEach(period, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD');
- exceedDate[ymd] += 1;
- });
- });
- });
- });
- return exceedDate;
- };
- /**
- * Initiate exceed date information
- * @param {Array.<TZDate>} range - date range of one week
- * @returns {Object} - initiated exceed date
- */
- Weekday.prototype._initExceedDate = function(range) {
- var exceedDate = {};
- util.forEach(range, function(date) {
- var ymd = datetime.format(date, 'YYYYMMDD');
- exceedDate[ymd] = 0;
- });
- return exceedDate;
- };
- /**
- * Get a day name color
- * @param {Theme} theme - theme instance
- * @param {number} day - day number
- * @param {boolean} isToday - today flag
- * @param {boolean} isOtherMonth - not this month flag
- * @returns {string} style - color style
- */
- Weekday.prototype._getDayNameColor = function(theme, day, isToday, isOtherMonth) {
- var color = '';
- if (theme) {
- if (day === 0) {
- color = isOtherMonth ? theme.month.holidayExceptThisMonth.color : theme.common.holiday.color;
- } else if (day === 6) {
- color = isOtherMonth ? theme.month.dayExceptThisMonth.color : theme.common.saturday.color;
- } else if (isToday) {
- color = theme.common.today.color;
- } else {
- color = isOtherMonth ? theme.month.dayExceptThisMonth.color : theme.common.dayname.color;
- }
- }
- return color;
- };
- /**
- * Get a day background color
- * @param {Theme} theme - theme instance
- * @param {number} day - day number
- * @returns {string} style - color style
- */
- Weekday.prototype._getDayBackgroundColor = function(theme, day) {
- var color = '';
- if (theme) {
- if (day === 0 || day === 6) {
- color = theme.month.weekend.backgroundColor;
- } else {
- color = 'inherit';
- }
- }
- return color;
- };
- module.exports = Weekday;
- /***/ }),
- /***/ "tui-code-snippet":
- /*!******************************************************************************************************************************!*\
- !*** external {"commonjs":"tui-code-snippet","commonjs2":"tui-code-snippet","amd":"tui-code-snippet","root":["tui","util"]} ***!
- \******************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__;
- /***/ }),
- /***/ "tui-date-picker":
- /*!*********************************************************************************************************************************!*\
- !*** external {"commonjs":"tui-date-picker","commonjs2":"tui-date-picker","amd":"tui-date-picker","root":["tui","DatePicker"]} ***!
- \*********************************************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- module.exports = __WEBPACK_EXTERNAL_MODULE_tui_date_picker__;
- /***/ })
- /******/ });
- });
- //# sourceMappingURL=tui-calendar.js.map
|