@mjsz-vbr-elements/extended 2.1.0-rc.7 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/extended
3
- * version: v2.1.0-rc.7 - 27/11/2023, 20:04:08
3
+ * version: v2.1.2 - 01/12/2023, 13:05:22
4
4
  * (c) 2023
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
@@ -28,5 +28,5 @@ var MjszVbrElementsExtended=function(it,o,X){"use strict";const Z=t=>({}.VITE_CS
28
28
  `,nn=`.is-dropdown-menu{padding:8px 0;margin:0;min-width:160px;color:#000;list-style:none;background:var(--vbr-widget-popover-bg-color);border-radius:3px;box-shadow:0 5px 30px rgba(black,.3)}.is-dropdown-menu .is-dropdown-item{display:flex;align-items:center;padding:.25rem 1rem;font-family:var(--vbr-widget-font-family);line-height:24px;color:var(--vbr-widget-dropdown-item-color);text-align:inherit;text-decoration:none;white-space:nowrap;background-color:transparent;border:0}.is-dropdown-menu .is-dropdown-item:hover{color:var(--vbr-widget-dropdown-item-hover-color);background-color:var(--vbr-widget-dropdown-item-hover-bg-color)}.is-dropdown-menu .is-dropdown-item svg{margin-right:8px}
29
29
  `,Od=`.is-card{container-name:card-row;container-type:inline-size;background-color:#fff;padding:15px;margin-bottom:20px;box-shadow:0 2px 4px #0000001a,0 2px 2px #0000001a}.is-card>div{border-bottom:1px solid var(--vbr-widget-primary-color-100)}.is-card>div:last-of-type{border:none}.mjsz-vbr-card-item{display:grid;grid-gap:1rem;grid-template-columns:2fr 1fr 2fr;padding:2rem 0;border-bottom:1px solid var(--vbr-widget-primary-color-100)}.mjsz-vbr-card-item svg{display:block}.mjsz-vbr-card-item .is-team-name-short{display:none}@container card-row (max-width: 768px){.mjsz-vbr-card-item .is-team-name-long{display:none}.mjsz-vbr-card-item .is-team-name-short{display:block}}.mjsz-vbr-card-item .is-info{grid-column:1/4;display:flex;justify-content:center;align-items:center;color:var(--vbr-widget-primary-color-500)}.mjsz-vbr-card-item .is-home-team{display:flex;gap:8px;align-items:center;justify-content:flex-end;font-weight:700}.mjsz-vbr-card-item .is-away-team{display:flex;gap:8px;align-items:center;justify-content:flex-start;font-weight:700}.mjsz-vbr-card-item .is-logo-image{width:40px}.mjsz-vbr-card-item .is-game-data{display:flex;flex-direction:column;align-items:center;justify-content:center}.mjsz-vbr-card-item .is-game-data a{display:flex;flex-direction:column;align-items:center;color:var(--vbr-widget-primary-color-900)}.mjsz-vbr-card-item .is-game-data a:hover{color:var(--vbr-widget-primary-color-600)}.mjsz-vbr-card-item .is-game-data.is-live,.mjsz-vbr-card-item .is-game-data.is-live a{color:var(--vbr-widget-live-game-color)}.mjsz-vbr-section-selector{margin:20px 0;border-bottom:1px solid var(--vbr-widget-primary-color-200)}.mjsz-vbr-main-image-wrapper{--overlay-size: 160px;--overlay-radius: 50%;display:grid;grid-template-columns:1fr var(--overlay-size) 1fr;grid-template-rows:1fr 1fr 1fr calc(var(--overlay-size) / 2) calc(var(--overlay-size) / 2);margin-left:var(--vbr-widget-main-image-wrapper-horizontal-margin);margin-right:var(--vbr-widget-main-image-wrapper-horizontal-margin)}.mjsz-vbr-main-image-wrapper:has(img.is-default){min-height:470px}.mjsz-vbr-main-image-wrapper .is-main-image{grid-column:1/4;grid-row:1/5;display:flex;justify-content:center;align-items:center;background-color:var(--vbr-widget-primary-color-50);box-shadow:0 2px 4px #0003}.mjsz-vbr-main-image-wrapper .is-main-image .is-default{filter:grayscale(1);opacity:.3;mix-blend-mode:multiply}.mjsz-vbr-main-image-wrapper .is-main-image img:not(.is-default){width:100%}.mjsz-vbr-main-image-wrapper .is-ovarlay-image{grid-row:4/-1;grid-column:2;justify-self:center;overflow:hidden;border-radius:var(--overlay-radius);z-index:1}.mjsz-vbr-main-image-wrapper .is-ovarlay-image img{width:100%;aspect-ratio:1}
30
30
  `,jd=`.mjsz-vbr-paginator{display:flex;flex-direction:row;list-style-type:none;margin:10px 0;padding:0}.mjsz-vbr-paginator button,.mjsz-vbr-paginator div{display:flex;align-items:center;justify-content:center;padding:6px 12px;text-decoration:none;cursor:pointer;color:var(--vbr-widget-paginator-color);border:1px solid var(--vbr-widget-paginator-border-color);background-color:var(--vbr-widget-paginator-bg-color);margin-left:-1px}.mjsz-vbr-paginator button .icon,.mjsz-vbr-paginator div .icon{width:16px;height:16px;margin:0 -4px}.mjsz-vbr-paginator button:hover:not(.mjsz-vbr-paginator button.is-disabled,.mjsz-vbr-paginator button.is-active),.mjsz-vbr-paginator div:hover:not(.mjsz-vbr-paginator div.is-disabled,.mjsz-vbr-paginator div.is-active){color:var(--vbr-widget-paginator-hover-color);background-color:var(--vbr-widget-paginator-hover-bg-color)}.mjsz-vbr-paginator button:disabled,.mjsz-vbr-paginator button.is-disabled,.mjsz-vbr-paginator div:disabled,.mjsz-vbr-paginator div.is-disabled{color:var(--vbr-widget-paginator-disabled-color);background-color:var(--vbr-widget-paginator-bg-color);pointer-events:none;cursor:default}.mjsz-vbr-paginator button.is-active,.mjsz-vbr-paginator div.is-active{color:var(--vbr-widget-paginator-active-color);background-color:var(--vbr-widget-paginator-active-bg-color);border-color:var(--vbr-widget-paginator-active-bg-color);cursor:default}
31
- `,or=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},Dd=["onClick"],Ad=["onClick"],Cd=["onClick"],$d=["onClick"],Id=["onClick"],an=or({__name:"Championship.ce",props:{locale:{type:String,default:"hu"},apiKey:{type:String,default:""},championshipName:{type:String,default:""},timezoneSelector:{type:Boolean,default:!1},externalGameLink:{type:[String,Function],default:""},limit:{type:Number,default:20}},setup(t){const e=t,r=o.ref(null),n=o.ref(yo()),a=o.computed(()=>vo(new Date,o.unref(n),e.locale)),i=Z("tab-button"),s=Z("section-selector"),l={en:Qe,hu:Xe},c=g=>ic(e.externalGameLink,g),d=g=>sc(e.externalTeamResolver,g);return(g,p)=>(o.openBlock(),o.createElementBlock("div",null,[o.createVNode(o.unref(Me),{locale:e.locale,messages:l},{default:o.withCtx(({t:u})=>[o.createVNode(o.unref(Be),null,{default:o.withCtx(({error:m,hasError:h})=>[h?(o.openBlock(),o.createBlock(o.unref(Ve),{key:0,error:m},null,8,["error"])):o.createCommentVNode("",!0),o.createVNode(wd,{locale:t.locale,timezone:n.value,"championship-name":t.championshipName,limit:t.limit},{default:o.withCtx(({sort:f,page:b,games:y,phases:x,report:z,phaseId:E,columns:N,seasons:C,reports:$,isLoading:V,selectedPanel:D,championships:_,championshipId:I,selectedChampionshipId:Y,onSort:T,changePanel:v,changePhase:w,changeSeason:P,onChangeReport:S,onPaginatorChange:O,changeChampionship:j})=>[o.createVNode(zd,{seasons:C,"championship-id":I,"onUpdate:championshipId":P},null,8,["seasons","championship-id","onUpdate:championshipId"]),o.createElementVNode("div",{class:o.normalizeClass(o.unref(s))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(_,A=>(o.openBlock(),o.createElementBlock("button",{key:A.phaseId,onClick:G=>j(A.sectionId),class:o.normalizeClass([o.unref(i),{"is-active":A.sectionId===Y}])},o.toDisplayString(A.sectionName),11,Dd))),128))],2),o.createVNode(_d,{phases:x,"phase-id":E,reports:$,report:z,"is-reports-visible":D===o.unref(Dt)||D===o.unref(fe),"onUpdate:phaseId":w,"onUpdate:report":S},null,8,["phases","phase-id","reports","report","is-reports-visible","onUpdate:phaseId","onUpdate:report"]),o.createElementVNode("div",{class:o.normalizeClass(o.unref(s))},[o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Ut)}]),onClick:A=>v(o.unref(Ut))},o.toDisplayString(u("selection.schedule")),11,Ad),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Xo)}]),onClick:A=>v(o.unref(Xo))},o.toDisplayString(u("selection.standings")),11,Cd),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Dt)}]),onClick:A=>v(o.unref(Dt))},o.toDisplayString(u("selection.playerStats")),11,$d),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(fe)}]),onClick:A=>v(o.unref(fe))},o.toDisplayString(u("selection.teamStats")),11,Id)],2),o.createVNode(o.unref(Vl),{columns:N,rows:y.rows,sort:f,"is-loading":V,"offset-name":a.value,"external-team-resolver":d,"external-game-resolver":c,"append-to":r.value,"hide-columns":D===o.unref(Ut)?"broadcast":"",onSort:T},null,8,["columns","rows","sort","is-loading","offset-name","append-to","hide-columns","onSort"]),D===o.unref(Dt)?(o.openBlock(),o.createBlock(o.unref(rl),{key:0,page:b,"items-per-page":e.limit,"total-items":y.totalItems,"range-length":5,onChange:O},null,8,["page","items-per-page","total-items","onChange"])):o.createCommentVNode("",!0)]),_:2},1032,["locale","timezone","championship-name","limit"]),o.createElementVNode("div",{ref_key:"tooltipContainer",ref:r},null,512)]),_:2},1024)]),_:1},8,["locale"])]))}},[["styles",[tr,er,rr,en,rn,on,nn,Od,jd]]]),Vd={class:"g-row"},Bd=["value"],Md=["onClick"],Ld={__name:"SeasonSelector",props:{seasons:{type:Array,default:()=>[]},championshipId:{type:Number,default:0},sections:{type:Array,default:()=>[]},sectionId:{type:Number,default:0}},emits:["onChangeSeason","onChangeSection"],setup(t,{emit:e}){const r=t,{t:n}=lt(),a=o.computed({get(){return r.championshipId},set(s){e("onChangeSeason",s)}});function i(s){e("onChangeSection",s)}return(s,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Vd,[o.createElementVNode("div",null,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.season")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.seasons,c=>(o.openBlock(),o.createElementBlock("option",{key:c.championshipId,value:c.championshipId},o.toDisplayString(c.seasonName),9,Bd))),128))]),_:1},8,["modelValue"])])]),o.createElementVNode("div",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sections,c=>(o.openBlock(),o.createElementBlock("button",{key:c.phaseId,onClick:d=>i(c),class:o.normalizeClass([o.unref(Z)("tab-button"),{"is-active":c.sectionId===t.sectionId}])},o.toDisplayString(c.sectionName),11,Md))),128))])],64))}},Rd=(t,e)=>{if(t.length===0)throw new Re(pe.message,pe.options);e.seasons=Fd(t),e.championshipId||(e.championshipId=bt(e.seasons).championshipId)},Gd=(t,e)=>{var r;e.sections=t,e.sectionId=Je(Pt("sectionId"),bt)(t),e.phaseId=((r=qo([0,"phases",0],t))==null?void 0:r.phaseId)??null},Fd=t=>Je(Jo(Wo(Pt("seasonName"))),We(Zo(["championshipId","seasonName"])))(t),Hd={gameName:{label:"table.gameName.short",tooltip:"table.gameName.tooltip",class:"is-text-left is-text-light"},gameDateDate:{label:"table.gameDate.short",tooltip:"table.gameDate.tooltip",class:"is-text-left"},gameDateTime:{label:"table.gameDateTime.short",tooltip:"table.gameDateTime.tooltip",class:"is-text-left"},divisionName:{label:"table.section.short",tooltip:"table.section.tooltip",class:"is-has-image is-text-light"},homeTeamName:{label:"table.organizer.short",tooltip:"table.organizer.tooltip",class:"is-text-left is-w-auto is-text-bold"},location:{label:"table.location.short",tooltip:"table.location.tooltip",class:"is-text-left is-w-auto"},document:{label:"table.document.short",tooltip:"table.document.tooltip",class:"is-text-left"}},Yd=t=>e=>We(r=>({...r,...r.registration&&{registration:`${r.registration}/cid/${t}`}}))(e),Ud={__name:"DataProvider",props:{championshipName:{type:String,default:""},championshipId:{type:Number,default:0},limit:{type:Number,default:20},apiKey:{type:String,default:""},locale:{type:String,default:"hu"},timezone:{type:String,default:""}},setup(t){const e=t,r=o.reactive({seasons:[],championshipId:null,sections:[],sectionId:null,phaseId:null}),{onError:n}=ce(),{isLoading:a,execute:i}=dt({options:{path:"/v2/championship-seasons",apiKey:e.apiKey,params:{championshipName:e.championshipName}},transform:f=>Rd(f,r),onError:n}),{isLoading:s,execute:l}=dt({options:{path:"/v2/championship-sections",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId}))},transform:f=>Gd(f,r),onError:n}),{isLoading:c,state:d,execute:g}=dt({options:{path:"/v2/games-list",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId,phaseId:r.phaseId}))},transform:f=>Yt(Oo,Yd(r.championshipId))(f),onError:n}),p=o.computed(()=>_o(d.value).schedule(e.timezone,e.locale).value());jt([i,l,g]);const u=o.computed(()=>[s.value,a.value,c.value].some(Boolean));function m(f){r.championshipId=f,jt([l,g])}function h(f){r.sectionId=f.sectionId,r.phaseId=qo(["phases",0,"phaseId"],f),g()}return(f,b)=>o.renderSlot(f.$slots,"default",o.normalizeProps(o.guardReactiveProps({rows:p.value,isLoading:u.value,values:o.unref(dd)(["phaseId"],r),listeners:{onChangeSection:h,onChangeSeason:m}})))}},Kd=["href"],Wd=["href"],qd={__name:"ScheduleCupDataTable",props:{columns:{type:Object,default:()=>({})},rows:{type:Array,default:()=>[]},offsetName:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(t){const e=t,r=o.ref(null),{columns:n}=wo(e.columns,null,o.computed(()=>({offsetName:e.offsetName}))),{t:a}=lt();return(i,s)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"tooltipContainer",ref:r},[o.createVNode(o.unref(so),null,{default:o.withCtx(()=>[o.createVNode(o.unref(no),{columns:o.unref(n),rows:t.rows,"is-loading":t.isLoading,"append-to":r.value},{"cell-homeTeamName":o.withCtx(({row:l})=>{var c;return[o.createTextVNode(o.toDisplayString(((c=l.homeTeam)==null?void 0:c.longName)??""),1)]}),"cell-location":o.withCtx(({row:l})=>{var c;return[o.createTextVNode(o.toDisplayString(((c=l.location)==null?void 0:c.locationName)??""),1)]}),"cell-document":o.withCtx(({row:l})=>[l.schedule?(o.openBlock(),o.createElementBlock("a",{key:0,href:l.schedule,target:"_blank"},o.toDisplayString(o.unref(a)("schedule")),9,Kd)):l.registration?(o.openBlock(),o.createElementBlock("a",{key:1,href:l.registration,target:"_blank"},o.toDisplayString(o.unref(a)("registration")),9,Wd)):o.createCommentVNode("",!0)]),_:1},8,["columns","rows","is-loading","append-to"])]),_:1})],512))}},sn=or({__name:"ScheduleCup.ce",props:{locale:{type:String,default:"hu"},apiKey:{type:String,default:""},championshipName:{type:String,default:""},timezoneSelector:{type:Boolean,default:!1}},setup(t){const e=t,r={en:Qe,hu:Xe},n=o.ref(yo()),a=o.computed(()=>vo(new Date,n.value,e.locale));return(i,s)=>(o.openBlock(),o.createBlock(o.unref(Me),{locale:e.locale,messages:r},{default:o.withCtx(()=>[o.createVNode(o.unref(Be),null,{default:o.withCtx(({error:l,hasError:c})=>[c?(o.openBlock(),o.createBlock(o.unref(Ve),{key:0,error:l},null,8,["error"])):o.createCommentVNode("",!0),o.createVNode(Ud,{"championship-name":t.championshipName,locale:t.locale,timezone:n.value},{default:o.withCtx(({rows:d,isLoading:g,values:p,listeners:u})=>[o.createVNode(Ld,o.mergeProps(p,o.toHandlers(u)),null,16),o.createVNode(qd,{columns:o.unref(Hd),rows:d.rows,"is-loading":g,"offset-name":a.value},null,8,["columns","rows","is-loading","offset-name"])]),_:1},8,["championship-name","locale","timezone"])]),_:1})]),_:1},8,["locale"]))}},[["styles",[tr,er,rr,en,rn,on,nn]]]);function Zd(t,e){e.seasonsList=t,e.seasonId=Yt(bt,Pt("id"))(t)}function Jd(t,e){e.championshipList=t,e.championshipId=Yt(bt,Pt("championshipId"))(t)}function Xd(t,e){e.sections=t,e.sectionId=Yt(bt,Pt("sectionId"))(t)}const Qd={__name:"DataProvider",props:{apiKey:{type:String,default:""},locale:{type:String,default:"hu"}},setup(t){const e=t,r=o.reactive({seasonsList:[],seasonId:null,championshipList:[],championshipId:null,sections:[],sectionId:null}),{onError:n}=ce(),{isLoading:a,execute:i}=dt({options:{path:"/v2/all-season-list",apiKey:e.apiKey,params:{}},transform:f=>Zd(f,r),onError:n}),{isLoading:s,execute:l}=dt({options:{path:"/v2/championship-list",apiKey:e.apiKey,params:o.computed(()=>({seasonId:r.seasonId}))},transform:f=>Jd(f,r),onError:n}),{isLoading:c,execute:d}=dt({options:{path:"/v2/championship-sections",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId}))},transform:f=>Xd(f,r),onError:n}),g=o.computed(()=>{var f,b;return((b=(f=r.sections)==null?void 0:f.find(y=>y.sectionId===r.sectionId))==null?void 0:b.phases)??[]});jt([i,l,d]);const p=o.computed(()=>[a.value,s.value,c.value].some(Boolean));function u(f){r.seasonId=f,jt([l,d])}function m(f){r.championshipId=f,d()}function h(f){r.sectionId=f}return(f,b)=>o.renderSlot(f.$slots,"default",o.normalizeProps(o.guardReactiveProps({...r,isLoading:p.value,phaseData:g.value,onChangeSeason:u,onChangeSection:h,onChangeChampionship:m})))}},tp={class:"is-mb-5"},ep=["value"],rp=["value"],op={__name:"Selector",props:{seasonsList:{type:Array,default:()=>[]},seasonId:{type:Number,default:null},championshipList:{type:Array,default:()=>[]},championshipId:{type:Number,default:null}},emits:["update:seasonId","update:championshipId"],setup(t,{emit:e}){const r=t,{t:n}=lt(),{seasonId:a,championshipId:i}=He(r,e);return(s,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",tp,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.seasons")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:o.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>o.isRef(a)?a.value=c:null)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.seasonsList,c=>(o.openBlock(),o.createElementBlock("option",{key:c.id,value:c.id},o.toDisplayString(c.seasonName),9,ep))),128))]),_:1},8,["modelValue"])]),o.createElementVNode("div",null,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.championships")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:o.unref(i),"onUpdate:modelValue":l[1]||(l[1]=c=>o.isRef(i)?i.value=c:null)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.championshipList,c=>(o.openBlock(),o.createElementBlock("option",{key:c.championshipId,value:c.championshipId},o.toDisplayString(c.championshipName),9,rp))),128))]),_:1},8,["modelValue"])])],64))}},np=`.main-layout[data-v-b6ae9b67]{display:flex;flex-wrap:wrap;gap:20px}.main-layout>div[data-v-b6ae9b67]:nth-child(2){flex:1}pre[data-v-b6ae9b67]{padding:10px;white-space:pre-wrap;overflow-x:auto;background-color:var(--vbr-widget-primary-color-50);border-radius:5px}
31
+ `,or=(t,e)=>{const r=t.__vccOpts||t;for(const[n,a]of e)r[n]=a;return r},Dd=["onClick"],Ad=["onClick"],Cd=["onClick"],$d=["onClick"],Id=["onClick"],an=or({__name:"Championship.ce",props:{locale:{type:String,default:"hu"},apiKey:{type:String,default:""},championshipName:{type:String,default:""},timezoneSelector:{type:Boolean,default:!1},externalGameResolver:{type:[String,Function],default:""},limit:{type:Number,default:20}},setup(t){const e=t,r=o.ref(null),n=o.ref(yo()),a=o.computed(()=>vo(new Date,o.unref(n),e.locale)),i=Z("tab-button"),s=Z("section-selector"),l={en:Qe,hu:Xe},c=g=>ic(e.externalGameResolver,g),d=g=>sc(e.externalTeamResolver,g);return(g,p)=>(o.openBlock(),o.createElementBlock("div",null,[o.createVNode(o.unref(Me),{locale:e.locale,messages:l},{default:o.withCtx(({t:u})=>[o.createVNode(o.unref(Be),null,{default:o.withCtx(({error:m,hasError:h})=>[h?(o.openBlock(),o.createBlock(o.unref(Ve),{key:0,error:m},null,8,["error"])):o.createCommentVNode("",!0),o.createVNode(wd,{locale:t.locale,timezone:n.value,"championship-name":t.championshipName,limit:t.limit},{default:o.withCtx(({sort:f,page:b,games:y,phases:x,report:z,phaseId:E,columns:N,seasons:C,reports:$,isLoading:V,selectedPanel:D,championships:_,championshipId:I,selectedChampionshipId:Y,onSort:T,changePanel:v,changePhase:w,changeSeason:P,onChangeReport:S,onPaginatorChange:O,changeChampionship:j})=>[o.createVNode(zd,{seasons:C,"championship-id":I,"onUpdate:championshipId":P},null,8,["seasons","championship-id","onUpdate:championshipId"]),o.createElementVNode("div",{class:o.normalizeClass(o.unref(s))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(_,A=>(o.openBlock(),o.createElementBlock("button",{key:A.phaseId,onClick:G=>j(A.sectionId),class:o.normalizeClass([o.unref(i),{"is-active":A.sectionId===Y}])},o.toDisplayString(A.sectionName),11,Dd))),128))],2),o.createVNode(_d,{phases:x,"phase-id":E,reports:$,report:z,"is-reports-visible":D===o.unref(Dt)||D===o.unref(fe),"onUpdate:phaseId":w,"onUpdate:report":S},null,8,["phases","phase-id","reports","report","is-reports-visible","onUpdate:phaseId","onUpdate:report"]),o.createElementVNode("div",{class:o.normalizeClass(o.unref(s))},[o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Ut)}]),onClick:A=>v(o.unref(Ut))},o.toDisplayString(u("selection.schedule")),11,Ad),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Xo)}]),onClick:A=>v(o.unref(Xo))},o.toDisplayString(u("selection.standings")),11,Cd),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(Dt)}]),onClick:A=>v(o.unref(Dt))},o.toDisplayString(u("selection.playerStats")),11,$d),o.createElementVNode("button",{class:o.normalizeClass([o.unref(i),{"is-active":D===o.unref(fe)}]),onClick:A=>v(o.unref(fe))},o.toDisplayString(u("selection.teamStats")),11,Id)],2),o.createVNode(o.unref(Vl),{columns:N,rows:y.rows,sort:f,"is-loading":V,"offset-name":a.value,"external-team-resolver":d,"external-game-resolver":c,"append-to":r.value,"hide-columns":D===o.unref(Ut)?"broadcast":"",onSort:T},null,8,["columns","rows","sort","is-loading","offset-name","append-to","hide-columns","onSort"]),D===o.unref(Dt)?(o.openBlock(),o.createBlock(o.unref(rl),{key:0,page:b,"items-per-page":e.limit,"total-items":y.totalItems,"range-length":5,onChange:O},null,8,["page","items-per-page","total-items","onChange"])):o.createCommentVNode("",!0)]),_:2},1032,["locale","timezone","championship-name","limit"]),o.createElementVNode("div",{ref_key:"tooltipContainer",ref:r},null,512)]),_:2},1024)]),_:1},8,["locale"])]))}},[["styles",[tr,er,rr,en,rn,on,nn,Od,jd]]]),Vd={class:"g-row"},Bd=["value"],Md=["onClick"],Ld={__name:"SeasonSelector",props:{seasons:{type:Array,default:()=>[]},championshipId:{type:Number,default:0},sections:{type:Array,default:()=>[]},sectionId:{type:Number,default:0}},emits:["onChangeSeason","onChangeSection"],setup(t,{emit:e}){const r=t,{t:n}=lt(),a=o.computed({get(){return r.championshipId},set(s){e("onChangeSeason",s)}});function i(s){e("onChangeSection",s)}return(s,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Vd,[o.createElementVNode("div",null,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.season")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.seasons,c=>(o.openBlock(),o.createElementBlock("option",{key:c.championshipId,value:c.championshipId},o.toDisplayString(c.seasonName),9,Bd))),128))]),_:1},8,["modelValue"])])]),o.createElementVNode("div",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sections,c=>(o.openBlock(),o.createElementBlock("button",{key:c.phaseId,onClick:d=>i(c),class:o.normalizeClass([o.unref(Z)("tab-button"),{"is-active":c.sectionId===t.sectionId}])},o.toDisplayString(c.sectionName),11,Md))),128))])],64))}},Rd=(t,e)=>{if(t.length===0)throw new Re(pe.message,pe.options);e.seasons=Fd(t),e.championshipId||(e.championshipId=bt(e.seasons).championshipId)},Gd=(t,e)=>{var r;e.sections=t,e.sectionId=Je(Pt("sectionId"),bt)(t),e.phaseId=((r=qo([0,"phases",0],t))==null?void 0:r.phaseId)??null},Fd=t=>Je(Jo(Wo(Pt("seasonName"))),We(Zo(["championshipId","seasonName"])))(t),Hd={gameName:{label:"table.gameName.short",tooltip:"table.gameName.tooltip",class:"is-text-left is-text-light"},gameDateDate:{label:"table.gameDate.short",tooltip:"table.gameDate.tooltip",class:"is-text-left"},gameDateTime:{label:"table.gameDateTime.short",tooltip:"table.gameDateTime.tooltip",class:"is-text-left"},divisionName:{label:"table.section.short",tooltip:"table.section.tooltip",class:"is-has-image is-text-light"},homeTeamName:{label:"table.organizer.short",tooltip:"table.organizer.tooltip",class:"is-text-left is-w-auto is-text-bold"},location:{label:"table.location.short",tooltip:"table.location.tooltip",class:"is-text-left is-w-auto"},document:{label:"table.document.short",tooltip:"table.document.tooltip",class:"is-text-left"}},Yd=t=>e=>We(r=>({...r,...r.registration&&{registration:`${r.registration}/cid/${t}`}}))(e),Ud={__name:"DataProvider",props:{championshipName:{type:String,default:""},championshipId:{type:Number,default:0},limit:{type:Number,default:20},apiKey:{type:String,default:""},locale:{type:String,default:"hu"},timezone:{type:String,default:""}},setup(t){const e=t,r=o.reactive({seasons:[],championshipId:null,sections:[],sectionId:null,phaseId:null}),{onError:n}=ce(),{isLoading:a,execute:i}=dt({options:{path:"/v2/championship-seasons",apiKey:e.apiKey,params:{championshipName:e.championshipName}},transform:f=>Rd(f,r),onError:n}),{isLoading:s,execute:l}=dt({options:{path:"/v2/championship-sections",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId}))},transform:f=>Gd(f,r),onError:n}),{isLoading:c,state:d,execute:g}=dt({options:{path:"/v2/games-list",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId,phaseId:r.phaseId}))},transform:f=>Yt(Oo,Yd(r.championshipId))(f),onError:n}),p=o.computed(()=>_o(d.value).schedule(e.timezone,e.locale).value());jt([i,l,g]);const u=o.computed(()=>[s.value,a.value,c.value].some(Boolean));function m(f){r.championshipId=f,jt([l,g])}function h(f){r.sectionId=f.sectionId,r.phaseId=qo(["phases",0,"phaseId"],f),g()}return(f,b)=>o.renderSlot(f.$slots,"default",o.normalizeProps(o.guardReactiveProps({rows:p.value,isLoading:u.value,values:o.unref(dd)(["phaseId"],r),listeners:{onChangeSection:h,onChangeSeason:m}})))}},Kd=["href"],Wd=["href"],qd={__name:"ScheduleCupDataTable",props:{columns:{type:Object,default:()=>({})},rows:{type:Array,default:()=>[]},offsetName:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(t){const e=t,r=o.ref(null),{columns:n}=wo(e.columns,null,o.computed(()=>({offsetName:e.offsetName}))),{t:a}=lt();return(i,s)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"tooltipContainer",ref:r},[o.createVNode(o.unref(so),null,{default:o.withCtx(()=>[o.createVNode(o.unref(no),{columns:o.unref(n),rows:t.rows,"is-loading":t.isLoading,"append-to":r.value},{"cell-homeTeamName":o.withCtx(({row:l})=>{var c;return[o.createTextVNode(o.toDisplayString(((c=l.homeTeam)==null?void 0:c.longName)??""),1)]}),"cell-location":o.withCtx(({row:l})=>{var c;return[o.createTextVNode(o.toDisplayString(((c=l.location)==null?void 0:c.locationName)??""),1)]}),"cell-document":o.withCtx(({row:l})=>[l.schedule?(o.openBlock(),o.createElementBlock("a",{key:0,href:l.schedule,target:"_blank"},o.toDisplayString(o.unref(a)("schedule")),9,Kd)):l.registration?(o.openBlock(),o.createElementBlock("a",{key:1,href:l.registration,target:"_blank"},o.toDisplayString(o.unref(a)("registration")),9,Wd)):o.createCommentVNode("",!0)]),_:1},8,["columns","rows","is-loading","append-to"])]),_:1})],512))}},sn=or({__name:"ScheduleCup.ce",props:{locale:{type:String,default:"hu"},apiKey:{type:String,default:""},championshipName:{type:String,default:""}},setup(t){const e=t,r={en:Qe,hu:Xe},n=o.ref(yo()),a=o.computed(()=>vo(new Date,n.value,e.locale));return(i,s)=>(o.openBlock(),o.createBlock(o.unref(Me),{locale:e.locale,messages:r},{default:o.withCtx(()=>[o.createVNode(o.unref(Be),null,{default:o.withCtx(({error:l,hasError:c})=>[c?(o.openBlock(),o.createBlock(o.unref(Ve),{key:0,error:l},null,8,["error"])):o.createCommentVNode("",!0),o.createVNode(Ud,{"championship-name":t.championshipName,locale:t.locale,timezone:n.value},{default:o.withCtx(({rows:d,isLoading:g,values:p,listeners:u})=>[o.createVNode(Ld,o.mergeProps(p,o.toHandlers(u)),null,16),o.createVNode(qd,{columns:o.unref(Hd),rows:d.rows,"is-loading":g,"offset-name":a.value},null,8,["columns","rows","is-loading","offset-name"])]),_:1},8,["championship-name","locale","timezone"])]),_:1})]),_:1},8,["locale"]))}},[["styles",[tr,er,rr,en,rn,on,nn]]]);function Zd(t,e){e.seasonsList=t,e.seasonId=Yt(bt,Pt("id"))(t)}function Jd(t,e){e.championshipList=t,e.championshipId=Yt(bt,Pt("championshipId"))(t)}function Xd(t,e){e.sections=t,e.sectionId=Yt(bt,Pt("sectionId"))(t)}const Qd={__name:"DataProvider",props:{apiKey:{type:String,default:""},locale:{type:String,default:"hu"}},setup(t){const e=t,r=o.reactive({seasonsList:[],seasonId:null,championshipList:[],championshipId:null,sections:[],sectionId:null}),{onError:n}=ce(),{isLoading:a,execute:i}=dt({options:{path:"/v2/all-season-list",apiKey:e.apiKey,params:{}},transform:f=>Zd(f,r),onError:n}),{isLoading:s,execute:l}=dt({options:{path:"/v2/championship-list",apiKey:e.apiKey,params:o.computed(()=>({seasonId:r.seasonId}))},transform:f=>Jd(f,r),onError:n}),{isLoading:c,execute:d}=dt({options:{path:"/v2/championship-sections",apiKey:e.apiKey,params:o.computed(()=>({championshipId:r.championshipId}))},transform:f=>Xd(f,r),onError:n}),g=o.computed(()=>{var f,b;return((b=(f=r.sections)==null?void 0:f.find(y=>y.sectionId===r.sectionId))==null?void 0:b.phases)??[]});jt([i,l,d]);const p=o.computed(()=>[a.value,s.value,c.value].some(Boolean));function u(f){r.seasonId=f,jt([l,d])}function m(f){r.championshipId=f,d()}function h(f){r.sectionId=f}return(f,b)=>o.renderSlot(f.$slots,"default",o.normalizeProps(o.guardReactiveProps({...r,isLoading:p.value,phaseData:g.value,onChangeSeason:u,onChangeSection:h,onChangeChampionship:m})))}},tp={class:"is-mb-5"},ep=["value"],rp=["value"],op={__name:"Selector",props:{seasonsList:{type:Array,default:()=>[]},seasonId:{type:Number,default:null},championshipList:{type:Array,default:()=>[]},championshipId:{type:Number,default:null}},emits:["update:seasonId","update:championshipId"],setup(t,{emit:e}){const r=t,{t:n}=lt(),{seasonId:a,championshipId:i}=He(r,e);return(s,l)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",tp,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.seasons")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:o.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>o.isRef(a)?a.value=c:null)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.seasonsList,c=>(o.openBlock(),o.createElementBlock("option",{key:c.id,value:c.id},o.toDisplayString(c.seasonName),9,ep))),128))]),_:1},8,["modelValue"])]),o.createElementVNode("div",null,[o.createElementVNode("label",{for:"season",class:o.normalizeClass(o.unref(Z)("label"))},o.toDisplayString(o.unref(n)("selection.championships")),3),o.createVNode(o.unref(Et),{id:"season",modelValue:o.unref(i),"onUpdate:modelValue":l[1]||(l[1]=c=>o.isRef(i)?i.value=c:null)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.championshipList,c=>(o.openBlock(),o.createElementBlock("option",{key:c.championshipId,value:c.championshipId},o.toDisplayString(c.championshipName),9,rp))),128))]),_:1},8,["modelValue"])])],64))}},np=`.main-layout[data-v-b6ae9b67]{display:flex;flex-wrap:wrap;gap:20px}.main-layout>div[data-v-b6ae9b67]:nth-child(2){flex:1}pre[data-v-b6ae9b67]{padding:10px;white-space:pre-wrap;overflow-x:auto;background-color:var(--vbr-widget-primary-color-50);border-radius:5px}
32
32
  `,ap={class:"main-layout"},ip={class:"is-mb-5"},sp={for:"seasonId"},lp=["textContent"],cp={class:"is-mb-5"},dp={for:"championshipName"},pp=["textContent"],up={class:"is-mb-5"},gp={for:"championshipId"},mp=["textContent"],fp={class:"is-mb-5"},hp={for:"sections"},bp=["onClick"],yp={class:"is-mb-5"},vp={for:"phases"},wp=["textContent"],ln=or({__name:"IvrIdentifiers.ce",props:{locale:{type:String,default:"hu"},apiKey:{type:String,default:""}},setup(t){const e=t,r={en:Qe,hu:Xe};return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Me),{locale:e.locale,messages:r},{default:o.withCtx(({t:i})=>[o.createVNode(o.unref(Be),null,{default:o.withCtx(({error:s,hasError:l})=>[l?(o.openBlock(),o.createBlock(o.unref(Ve),{key:0,error:s},null,8,["error"])):o.createCommentVNode("",!0),o.createVNode(Qd,null,{default:o.withCtx(({seasonsList:c,seasonId:d,championshipList:g,championshipId:p,sections:u,sectionId:m,phaseData:h,onChangeSeason:f,onChangeSection:b,onChangeChampionship:y})=>{var x;return[o.createElementVNode("div",ap,[o.createElementVNode("div",null,[o.createVNode(op,{"seasons-list":c,"season-id":d,"championship-list":g,"championship-id":p,"onUpdate:seasonId":f,"onUpdate:championshipId":y},null,8,["seasons-list","season-id","championship-list","championship-id","onUpdate:seasonId","onUpdate:championshipId"])]),o.createElementVNode("div",null,[o.createElementVNode("section",ip,[o.createElementVNode("label",sp,o.toDisplayString(i("selection.seasonId")),1),o.createElementVNode("p",{id:"seasonId",textContent:o.toDisplayString(d)},null,8,lp)]),o.createElementVNode("section",cp,[o.createElementVNode("label",dp,o.toDisplayString(i("selection.championshipName")),1),o.createElementVNode("p",{id:"championshipName",textContent:o.toDisplayString((x=g.find(z=>z.championshipId===p))==null?void 0:x.championshipName)},null,8,pp)]),o.createElementVNode("section",up,[o.createElementVNode("label",gp,o.toDisplayString(i("selection.championshipId")),1),o.createElementVNode("p",{id:"championshipId",textContent:o.toDisplayString(p)},null,8,mp)]),o.createElementVNode("section",fp,[o.createElementVNode("label",hp,o.toDisplayString(i("selection.sections"))+":",1),o.createElementVNode("div",{id:"sections",class:o.normalizeClass([o.unref(Z)("toggle-group")])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u,z=>(o.openBlock(),o.createElementBlock("button",{key:z.sectionId,class:o.normalizeClass({"is-active":z.sectionId===m}),onClick:E=>b(z.sectionId)},o.toDisplayString(z.sectionName),11,bp))),128))],2)]),o.createElementVNode("section",yp,[o.createElementVNode("label",vp,o.toDisplayString(i("selection.phasesDivision"))+":",1),o.createElementVNode("pre",{id:"phases",textContent:o.toDisplayString(h)},null,8,wp)])])])]}),_:2},1024)]),_:2},1024)]),_:1},8,["locale"]))}},[["styles",[tr,er,rr,np]],["__scopeId","data-v-b6ae9b67"]]),cn=o.defineCustomElement(an),dn=o.defineCustomElement(sn),pn=o.defineCustomElement(ln);function un(){customElements.define("mjsz-vbr-championship",cn),customElements.define("mjsz-vbr-schedule-cup",dn),customElements.define("mjsz-vbr-ibr-identifiers",pn)}return it.Championship=an,it.ChampionshipCE=cn,it.IVRIdentifiers=ln,it.IVRIdentifiersCE=pn,it.ScheduleCup=sn,it.ScheduleCupCE=dn,it.default=un,it.register=un,Object.defineProperties(it,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),it}({},Vue,MjszVbrElementsCore);
Binary file
Binary file
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/extended
3
- * version: v2.1.0-rc.7 - 27/11/2023, 20:04:08
3
+ * version: v2.1.2 - 01/12/2023, 13:05:22
4
4
  * (c) 2023
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
@@ -6162,7 +6162,7 @@ const Ju = Zu, Xu = (t, e) => {
6162
6162
  type: Boolean,
6163
6163
  default: !1
6164
6164
  },
6165
- externalGameLink: {
6165
+ externalGameResolver: {
6166
6166
  type: [String, Function],
6167
6167
  default: ""
6168
6168
  },
@@ -6172,7 +6172,7 @@ const Ju = Zu, Xu = (t, e) => {
6172
6172
  }
6173
6173
  },
6174
6174
  setup(t) {
6175
- const e = t, r = Y(null), o = Y(mn()), n = R(() => fn(/* @__PURE__ */ new Date(), f(o), e.locale)), a = ut("tab-button"), i = ut("section-selector"), s = { en: zr, hu: xr }, l = (p) => Hc(e.externalGameLink, p), c = (p) => Bc(e.externalTeamResolver, p);
6175
+ const e = t, r = Y(null), o = Y(mn()), n = R(() => fn(/* @__PURE__ */ new Date(), f(o), e.locale)), a = ut("tab-button"), i = ut("section-selector"), s = { en: zr, hu: xr }, l = (p) => Hc(e.externalGameResolver, p), c = (p) => Bc(e.externalTeamResolver, p);
6176
6176
  return (p, u) => (k(), j("div", null, [
6177
6177
  U(f(pr), {
6178
6178
  locale: e.locale,
@@ -6565,11 +6565,11 @@ const Ju = Zu, Xu = (t, e) => {
6565
6565
  championshipName: {
6566
6566
  type: String,
6567
6567
  default: ""
6568
- },
6569
- timezoneSelector: {
6570
- type: Boolean,
6571
- default: !1
6572
6568
  }
6569
+ // timezoneSelector: {
6570
+ // type: Boolean,
6571
+ // default: false,
6572
+ // },
6573
6573
  },
6574
6574
  setup(t) {
6575
6575
  const e = t, r = { en: zr, hu: xr }, o = Y(mn()), n = R(() => fn(/* @__PURE__ */ new Date(), o.value, e.locale));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@mjsz-vbr-elements/extended",
3
3
  "description": "Data visualization for MJSZ VBR",
4
4
  "private": false,
5
- "version": "2.1.0-rc.7",
5
+ "version": "2.1.2",
6
6
  "author": "Ákos Stegner <akos.stegner@gmail.com>",
7
7
  "homepage": "https://api.icehockey.hu/widgets/docs/v2/",
8
8
  "type": "module",
@@ -20,8 +20,8 @@
20
20
  "@vueuse/core": "^10.1.2",
21
21
  "ramda": "^0.29.0",
22
22
  "vue": "^3.3.4",
23
- "@mjsz-vbr-elements/core": "^2.1.0-rc.7",
24
- "@mjsz-vbr-elements/shared": "^2.1.0-rc.7"
23
+ "@mjsz-vbr-elements/core": "^2.1.2",
24
+ "@mjsz-vbr-elements/shared": "^2.1.2"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@vitejs/plugin-vue": "^4.1.0",
@@ -30,9 +30,13 @@
30
30
  "vite-plugin-compression": "^0.5.1",
31
31
  "vite-plugin-static-copy": "^0.17.0"
32
32
  },
33
+ "release-it": {
34
+ "git": false
35
+ },
33
36
  "scripts": {
34
37
  "dev": "vite",
35
38
  "build": "vite build",
36
- "preview": "vite preview"
39
+ "preview": "vite preview",
40
+ "release": "release-it"
37
41
  }
38
42
  }