2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[193],{7749:function(e,t,s){s.r(t),s.d(t,{default:function(){return A}});s(6699);var a=s(6252),r=s(2262),l=s(3577),o=s(3324),n=s(7402);const c={class:"chart-menu"},i={class:"chart-arrow"},u={class:"time-frames custom-checkboxes-group"},d={class:"time-frames-checkboxes custom-checkboxes"},p=["id","name","checked","onInput"],m={class:"chart-arrow"};var v=(0,a.aZ)({name:"StatsMenu",emits:["arrowClick","timeFrameUpdate"],setup(e,{emit:t}){let s=(0,r.iH)("month");const o=["week","month","year"];function n(e){s.value=e,t("timeFrameUpdate",e)}return(e,v)=>((0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",i,[(0,a._)("i",{class:"fa fa-chevron-left","aria-hidden":"true",onClick:v[0]||(v[0]=e=>t("arrowClick",!0))})]),(0,a._)("div",u,[(0,a._)("div",d,[((0,a.wg)(),(0,a.iD)(a.HY,null,(0,a.Ko)(o,(t=>(0,a._)("div",{class:"time-frame custom-checkbox",key:t},[(0,a._)("label",null,[(0,a._)("input",{type:"radio",id:t,name:t,checked:(0,r.SU)(s)===t,onInput:e=>n(t)},null,40,p),(0,a._)("span",null,(0,l.zw)(e.$t(`statistics.TIME_FRAMES.${t}`)),1)])]))),64))])]),(0,a._)("div",m,[(0,a._)("i",{class:"fa fa-chevron-right","aria-hidden":"true",onClick:v[1]||(v[1]=e=>t("arrowClick",!1))})])]))}}),k=s(3744);const S=(0,k.Z)(v,[["__scopeId","data-v-af15954c"]]);var w=S,f=s(631);const _={class:"sports-menu"},h=["id","name","checked","onInput"],U={class:"sport-label"};var b=(0,a.aZ)({name:"StatsSportsMenu",props:{userSports:null,selectedSportIds:{default:()=>[]}},emits:["selectedSportIdsUpdate"],setup(e,{emit:t}){const s=e,{t:n}=(0,o.QT)(),c=(0,a.f3)("sportColors"),{selectedSportIds:i}=(0,r.BK)(s),u=(0,a.Fl)((()=>(0,f.xH)(s.userSports,n)));function d(e){t("selectedSportIdsUpdate",e)}return(e,t)=>{const s=(0,a.up)("SportImage");return(0,a.wg)(),(0,a.iD)("div",_,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,r.SU)(u),(e=>((0,a.wg)(),(0,a.iD)("label",{type:"checkbox",key:e.id,style:(0,l.j5)({color:e.color?e.color:(0,r.SU)(c)[e.label]})},[(0,a._)("input",{type:"checkbox",id:e.id,name:e.label,checked:(0,r.SU)(i).includes(e.id),onInput:t=>d(e.id)},null,40,h),(0,a.Wm)(s,{"sport-label":e.label,color:e.color},null,8,["sport-label","color"]),(0,a._)("span",U,(0,l.zw)(e.translatedLabel),1)],4)))),128))])}}});const I=b;var g=I,T=s(9318);const y={key:0,id:"user-statistics"};var C=(0,a.aZ)({name:"index",props:{sports:null,user:null},setup(e){const t=e,{t:s}=(0,o.QT)(),{sports:l,user:c}=(0,r.BK)(t);let i=(0,r.iH)("month");const u=(0,r.iH)(v(i.value)),d=(0,a.Fl)((()=>(0,f.xH)(t.sports,s))),p=(0,r.iH)(S(t.sports));function m(e){i.value=e,u.value=v(i.value)}function v(e){return(0,T.aZ)(new Date,e,t.user.weekm)}function k(e){u.value=(0,T.FN)(u.value,e,t.user.weekm)}function S(e){return e.map((e=>e.id))}function _(e){p.value.includes(e)?p.value=p.value.filter((t=>t!==e)):p.value.push(e)}return(0,a.YP)((()=>t.sports),(e=>{p.value=S(e)})),(e,t)=>(0,r.SU)(d)?((0,a.wg)(),(0,a.iD)("div",y,[(0,a.Wm)(w,{onTimeFrameUpdate:m,onArrowClick:k}),(0,a.Wm)(n.Z,{sports:(0,r.SU)(l),user:(0,r.SU)(c),chartParams:u.value,"displayed-sport-ids":p.value,fullStats:!0},null,8,["sports","user","chartParams","displayed-sport-ids"]),(0,a.Wm)(g,{"selected-sport-ids":p.value,"user-sports":(0,r.SU)(l),onSelectedSportIdsUpdate:_},null,8,["selected-sport-ids","user-sports"])])):(0,a.kq)("",!0)}});const F=(0,k.Z)(C,[["__scopeId","data-v-7d54529b"]]);var Z=F,x=s(5630),D=s(8602),H=s(9917);const E={id:"statistics",class:"view"},R={key:0,class:"container"};var W=(0,a.aZ)({name:"StatisticsView",setup(e){const t=(0,H.o)(),s=(0,a.Fl)((()=>t.getters[D.YN.GETTERS.AUTH_USER_PROFILE])),o=(0,a.Fl)((()=>t.getters[D.O8.GETTERS.SPORTS].filter((e=>s.value.sports_list.includes(e.id)))));return(e,t)=>{const n=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",E,[(0,r.SU)(s).username?((0,a.wg)(),(0,a.iD)("div",R,[(0,a.Wm)(n,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,l.zw)(e.$t("statistics.STATISTICS")),1)])),content:(0,a.w5)((()=>[(0,a.Wm)(Z,{class:(0,l.C_)({"stats-disabled":0===(0,r.SU)(s).nb_workouts}),user:(0,r.SU)(s),sports:(0,r.SU)(o)},null,8,["class","user","sports"])])),_:1}),0===(0,r.SU)(s).nb_workouts?((0,a.wg)(),(0,a.j4)(x.Z,{key:0})):(0,a.kq)("",!0)])):(0,a.kq)("",!0)])}}});const P=(0,k.Z)(W,[["__scopeId","data-v-2e341d4e"]]);var A=P}}]);
|
|
//# sourceMappingURL=statistics.7aabfecc.js.map
|