@xcpcio/board-app 0.29.0 → 0.30.0

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.
Files changed (30) hide show
  1. package/dist/assets/Board-1cb5a052.js +3 -0
  2. package/dist/assets/Board-3c31679a.css +1 -0
  3. package/dist/assets/{DataSourceInput.vue_vue_type_script_setup_true_lang-d16f2a12.js → DataSourceInput.vue_vue_type_script_setup_true_lang-c6907218.js} +1 -1
  4. package/dist/assets/{TheInput.vue_vue_type_script_setup_true_lang-1dafe5cb.js → TheInput.vue_vue_type_script_setup_true_lang-bd490116.js} +1 -1
  5. package/dist/assets/{_...all_-d54370e4.js → _...all_-b2ba251c.js} +1 -1
  6. package/dist/assets/{_name_-c7264d89.js → _name_-abd07bc1.js} +1 -1
  7. package/dist/assets/{about-55b7ba92.js → about-64b5108b.js} +1 -1
  8. package/dist/assets/{board-88a98e6a.js → board-85ce205a.js} +1 -1
  9. package/dist/assets/{board-layout-e4e0bae6.js → board-layout-1eaf73df.js} +1 -1
  10. package/dist/assets/{headless-3466779c.js → headless-e800ef5b.js} +1 -1
  11. package/dist/assets/{home-37e85146.js → home-2a74cabc.js} +1 -1
  12. package/dist/assets/{index-a0a089d2.css → index-184e36da.css} +1 -1
  13. package/dist/assets/{index-f1d19db1.js → index-6578287f.js} +4 -4
  14. package/dist/assets/{index-bc173751.js → index-78001918.js} +1 -1
  15. package/dist/assets/{index-layout-c91f7cfd.js → index-layout-a0249ba4.js} +1 -1
  16. package/dist/assets/{test-133c6df2.js → test-c0da21d8.js} +1 -1
  17. package/dist/assets/{useQueryBoardData-c0567554.js → useQueryBoardData-3b8a91d5.js} +1 -1
  18. package/dist/assets/{user-6ae7ff90.js → user-69e7d90e.js} +1 -1
  19. package/dist/assets/{virtual_pwa-register-7ea4486e.js → virtual_pwa-register-7796129c.js} +1 -1
  20. package/dist/index.html +3 -3
  21. package/dist/sw.js +1 -1
  22. package/package.json +3 -3
  23. package/src/components/board/Board.vue +6 -0
  24. package/src/components/board/ProblemInfoModal.vue +6 -0
  25. package/src/components/board/SubmissionsTable.vue +260 -58
  26. package/src/components/board/TeamInfoModal.vue +23 -7
  27. package/src/components/flowbite/Tooltip.vue +1 -1
  28. package/src/styles/submission-status-filter.css +123 -0
  29. package/dist/assets/Board-2cad79eb.css +0 -1
  30. package/dist/assets/Board-9442407d.js +0 -3
@@ -1 +1 @@
1
- import{g as C,h as w,i as u,u as V,o,c as n,j as t,n as E,d as s,k as S,t as p,l as g,m as F,p as R,B as I,q as A,w as O,s as q,v as M,x as Q,y as X,F as N,z as G,A as H,R as J,b as $,a as K,C as j}from"./index-f1d19db1.js";import{u as P}from"./useQueryBoardData-c0567554.js";import{g as W,_ as Y}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-d16f2a12.js";import"./TheInput.vue_vue_type_script_setup_true_lang-1dafe5cb.js";const Z={flex:"","flex-1":"","flex-col":"","justify-center":"","items-start":""},ee={class:"resolver-team-name",truncate:"","overflow-hidden":""},te=s("div",{flex:"","flex-row":"","text-sm":"","items-start":"","gap-x-2":""},null,-1),oe={"w-32":"",flex:"","flex-shrink-0":"","flex-row":"","justify-start":"","items-center":""},ne=C({__name:"BalloonBlock",props:{index:null,balloon:null},setup(f){const a=f,_=w(()=>a.index),r=w(()=>a.balloon),c=u(null),i=V(c);function x(e){return[e.location,e.organization,e.name].filter(d=>d).join(" - ")}function v(e){return typeof e=="string"?e:F&&(e!=null&&e.dark)?e.dark:e.light}return(e,b)=>{var d,l,h,k;return o(),n("div",{ref_key:"el",ref:c,"h-24":""},[t(i)?(o(),n("div",{key:0,"h-24":"",flex:"","flex-row":"","gap-x-4":"","font-mono":"","text-4xl":"",class:E([t(_)%2===0?"bg-resolver-bg-zero":"bg-resolver-bg-one"])},[s("div",{"w-20":"",flex:"","flex-shrink-0":"","justify-center":"","items-center":"",style:S({backgroundColor:v(((l=(d=t(r).problem)==null?void 0:d.balloonColor)==null?void 0:l.background_color)??"rgba(0, 0, 0, 0.5)")})},[s("div",{style:S({color:v(((k=(h=t(r).problem)==null?void 0:h.balloonColor)==null?void 0:k.color)??"#fff")})},p(t(r).problem.label),5)],4),s("div",Z,[s("div",ee,p(x(t(r).team)),1),te]),s("div",oe,p(t(r).submission.timestampToMinute),1)],2)):g("",!0)],512)}}}),se={class:"bg-[#323443]","text-gray-200":""},ae={key:0},le={flex:"","flex-col":"","justify-center":"","items-center":"","w-screen":"","h-screen":"","text-xl":"",italic:""},re={key:0},ce={key:1},ie={flex:"","flex-col":"","justify-between":""},ue=C({__name:"Balloon",props:{dataSourceUrl:null},setup(f){const a=f,_=R(I),{t:r}=A(),c=u(!1),i=u({}),x=u([]),v=u([]),e=u({}),b=u(new Date);function d(){const m=new J(i.value,x.value,v.value);m.buildBalloons(),e.value=m}const{data:l,isError:h,error:k}=P(a.dataSourceUrl,b);O(l,async()=>{var m,B,y;l.value===null||l.value===void 0||(i.value=q((m=l.value)==null?void 0:m.contest),_.value=`${i.value.name} | ${I}`,x.value=M((B=l.value)==null?void 0:B.teams),v.value=Q((y=l.value)==null?void 0:y.submissions),d(),c.value=!0)});const U=w(()=>e.value.balloons),z=setInterval(()=>{b.value=new Date},1e3);return X(()=>{clearInterval(z)}),(m,B)=>{const y=ne;return o(),n("div",se,[t(c)?(o(),n("div",ce,[s("div",ie,[(o(!0),n(N,null,G(t(U),(D,L)=>(o(),H(y,{key:D.key,index:L,balloon:D},null,8,["index","balloon"]))),128))])])):(o(),n("div",ae,[s("div",le,[s("div",null,p(t(r)("common.loading"))+"... ",1),t(h)?(o(),n("div",re,p(t(k)),1)):g("",!0)])]))])}}}),_e={key:0},de={"mt-20":""},me={key:1},fe=C({__name:"CustomBalloon",setup(f){const a=W();return(_,r)=>{const c=Y,i=ue;return o(),n(N,null,[t(a).length===0?(o(),n("div",_e,[s("div",de,[$(c)])])):g("",!0),t(a).length>0?(o(),n("div",me,[$(i,{"data-source-url":t(a)},null,8,["data-source-url"])])):g("",!0)],64)}}}),T={};function ve(f,a){const _=fe;return o(),n("div",null,[$(_)])}typeof j=="function"&&j(T);const ke=K(T,[["render",ve]]);export{ke as default};
1
+ import{g as C,h as w,i as u,u as V,o,c as n,j as t,n as E,d as s,k as S,t as p,l as g,m as F,p as R,B as I,q as A,w as O,s as q,v as M,x as Q,y as X,F as N,z as G,A as H,R as J,b as $,a as K,C as j}from"./index-6578287f.js";import{u as P}from"./useQueryBoardData-3b8a91d5.js";import{g as W,_ as Y}from"./DataSourceInput.vue_vue_type_script_setup_true_lang-c6907218.js";import"./TheInput.vue_vue_type_script_setup_true_lang-bd490116.js";const Z={flex:"","flex-1":"","flex-col":"","justify-center":"","items-start":""},ee={class:"resolver-team-name",truncate:"","overflow-hidden":""},te=s("div",{flex:"","flex-row":"","text-sm":"","items-start":"","gap-x-2":""},null,-1),oe={"w-32":"",flex:"","flex-shrink-0":"","flex-row":"","justify-start":"","items-center":""},ne=C({__name:"BalloonBlock",props:{index:null,balloon:null},setup(f){const a=f,_=w(()=>a.index),r=w(()=>a.balloon),c=u(null),i=V(c);function x(e){return[e.location,e.organization,e.name].filter(d=>d).join(" - ")}function v(e){return typeof e=="string"?e:F&&(e!=null&&e.dark)?e.dark:e.light}return(e,b)=>{var d,l,h,k;return o(),n("div",{ref_key:"el",ref:c,"h-24":""},[t(i)?(o(),n("div",{key:0,"h-24":"",flex:"","flex-row":"","gap-x-4":"","font-mono":"","text-4xl":"",class:E([t(_)%2===0?"bg-resolver-bg-zero":"bg-resolver-bg-one"])},[s("div",{"w-20":"",flex:"","flex-shrink-0":"","justify-center":"","items-center":"",style:S({backgroundColor:v(((l=(d=t(r).problem)==null?void 0:d.balloonColor)==null?void 0:l.background_color)??"rgba(0, 0, 0, 0.5)")})},[s("div",{style:S({color:v(((k=(h=t(r).problem)==null?void 0:h.balloonColor)==null?void 0:k.color)??"#fff")})},p(t(r).problem.label),5)],4),s("div",Z,[s("div",ee,p(x(t(r).team)),1),te]),s("div",oe,p(t(r).submission.timestampToMinute),1)],2)):g("",!0)],512)}}}),se={class:"bg-[#323443]","text-gray-200":""},ae={key:0},le={flex:"","flex-col":"","justify-center":"","items-center":"","w-screen":"","h-screen":"","text-xl":"",italic:""},re={key:0},ce={key:1},ie={flex:"","flex-col":"","justify-between":""},ue=C({__name:"Balloon",props:{dataSourceUrl:null},setup(f){const a=f,_=R(I),{t:r}=A(),c=u(!1),i=u({}),x=u([]),v=u([]),e=u({}),b=u(new Date);function d(){const m=new J(i.value,x.value,v.value);m.buildBalloons(),e.value=m}const{data:l,isError:h,error:k}=P(a.dataSourceUrl,b);O(l,async()=>{var m,B,y;l.value===null||l.value===void 0||(i.value=q((m=l.value)==null?void 0:m.contest),_.value=`${i.value.name} | ${I}`,x.value=M((B=l.value)==null?void 0:B.teams),v.value=Q((y=l.value)==null?void 0:y.submissions),d(),c.value=!0)});const U=w(()=>e.value.balloons),z=setInterval(()=>{b.value=new Date},1e3);return X(()=>{clearInterval(z)}),(m,B)=>{const y=ne;return o(),n("div",se,[t(c)?(o(),n("div",ce,[s("div",ie,[(o(!0),n(N,null,G(t(U),(D,L)=>(o(),H(y,{key:D.key,index:L,balloon:D},null,8,["index","balloon"]))),128))])])):(o(),n("div",ae,[s("div",le,[s("div",null,p(t(r)("common.loading"))+"... ",1),t(h)?(o(),n("div",re,p(t(k)),1)):g("",!0)])]))])}}}),_e={key:0},de={"mt-20":""},me={key:1},fe=C({__name:"CustomBalloon",setup(f){const a=W();return(_,r)=>{const c=Y,i=ue;return o(),n(N,null,[t(a).length===0?(o(),n("div",_e,[s("div",de,[$(c)])])):g("",!0),t(a).length>0?(o(),n("div",me,[$(i,{"data-source-url":t(a)},null,8,["data-source-url"])])):g("",!0)],64)}}}),T={};function ve(f,a){const _=fe;return o(),n("div",null,[$(_)])}typeof j=="function"&&j(T);const ke=K(T,[["render",ve]]);export{ke as default};
@@ -1 +1 @@
1
- import{a as s,r as a,o as c,c as r,b as e,d as _,F as m,e as p,f as l}from"./index-f1d19db1.js";const i={},d={class:"lg:mt-[-52px]","py-2":"","text-gray-700":"","dark:text-gray-200":""};function u(x,f){const o=p,t=a("RouterView"),n=l;return c(),r(m,null,[e(o,{width:"sm:w-[1024px] lg:w-screen"}),_("main",d,[e(t),e(n,{class:"sm:w-[1024px] lg:w-screen"})])],64)}const w=s(i,[["render",u]]);export{w as default};
1
+ import{a as s,r as a,o as c,c as r,b as e,d as _,F as m,e as p,f as l}from"./index-6578287f.js";const i={},d={class:"lg:mt-[-52px]","py-2":"","text-gray-700":"","dark:text-gray-200":""};function u(x,f){const o=p,t=a("RouterView"),n=l;return c(),r(m,null,[e(o,{width:"sm:w-[1024px] lg:w-screen"}),_("main",d,[e(t),e(n,{class:"sm:w-[1024px] lg:w-screen"})])],64)}const w=s(i,[["render",u]]);export{w as default};
@@ -1 +1 @@
1
- import{_ as m}from"./TheInput.vue_vue_type_script_setup_true_lang-1dafe5cb.js";import{g as _,i as p,D as f,q as h,o as b,c as v,d as e,t as n,j as o,b as y,E as x,G as g,C as l}from"./index-f1d19db1.js";import{u as w}from"./user-6ae7ff90.js";const V={flex:"","flex-col":"","justify-center":"","items-center":""},k=e("div",{"text-4xl":""},[e("div",{"i-carbon-campsite":""})],-1),C=e("p",null,[e("a",{rel:"noreferrer",href:"https://github.com/antfu/vitesse",target:"_blank"}," Vitesse ")],-1),I={"text-sm":"","opacity-75":""},B=e("div",{"py-4":""},null,-1),K={"w-48":""},N={class:"hidden",for:"input"},R=["disabled"],U=_({name:"IndexPage",__name:"test",setup(j){const r=w(),t=p(r.savedName),c=f();function a(){t.value&&c.push(`/hi/${encodeURIComponent(t.value)}`)}const{t:s}=h();return(D,i)=>{const d=m;return b(),v("div",V,[k,C,e("p",null,[e("em",I,n(o(s)("intro.desc")),1)]),B,e("div",K,[y(d,{modelValue:o(t),"onUpdate:modelValue":i[0]||(i[0]=u=>x(t)?t.value=u:null),placeholder:o(s)("intro.whats-your-name"),autocomplete:"false",onKeydown:g(a,["enter"])},null,8,["modelValue","placeholder","onKeydown"]),e("label",N,n(o(s)("intro.whats-your-name")),1)]),e("div",null,[e("button",{"m-3":"","text-sm":"",btn:"",disabled:!o(t),onClick:a},n(o(s)("button.go")),9,R)])])}}});typeof l=="function"&&l(U);export{U as default};
1
+ import{_ as m}from"./TheInput.vue_vue_type_script_setup_true_lang-bd490116.js";import{g as _,i as p,D as f,q as h,o as b,c as v,d as e,t as n,j as o,b as y,E as x,G as g,C as l}from"./index-6578287f.js";import{u as w}from"./user-69e7d90e.js";const V={flex:"","flex-col":"","justify-center":"","items-center":""},k=e("div",{"text-4xl":""},[e("div",{"i-carbon-campsite":""})],-1),C=e("p",null,[e("a",{rel:"noreferrer",href:"https://github.com/antfu/vitesse",target:"_blank"}," Vitesse ")],-1),I={"text-sm":"","opacity-75":""},B=e("div",{"py-4":""},null,-1),K={"w-48":""},N={class:"hidden",for:"input"},R=["disabled"],U=_({name:"IndexPage",__name:"test",setup(j){const r=w(),t=p(r.savedName),c=f();function a(){t.value&&c.push(`/hi/${encodeURIComponent(t.value)}`)}const{t:s}=h();return(D,i)=>{const d=m;return b(),v("div",V,[k,C,e("p",null,[e("em",I,n(o(s)("intro.desc")),1)]),B,e("div",K,[y(d,{modelValue:o(t),"onUpdate:modelValue":i[0]||(i[0]=u=>x(t)?t.value=u:null),placeholder:o(s)("intro.whats-your-name"),autocomplete:"false",onKeydown:g(a,["enter"])},null,8,["modelValue","placeholder","onKeydown"]),e("label",N,n(o(s)("intro.whats-your-name")),1)]),e("div",null,[e("button",{"m-3":"","text-sm":"",btn:"",disabled:!o(t),onClick:a},n(o(s)("button.go")),9,R)])])}}});typeof l=="function"&&l(U);export{U as default};
@@ -1 +1 @@
1
- import{ak as M,al as S,am as K,an as U,ao as D,ap as B,aq as W,ar as V,as as A,at as z,au as N,av as $,aw as H,ax as Y,h as P,ay as _,w as b,az as x,aA as G,aB as J,aC as X,aD as Z,j as C,aE as ee,aF as te}from"./index-f1d19db1.js";class se extends M{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),k(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),S(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&j(this.currentQuery,n,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ie(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(K)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),U||this.currentResult.isStale||!D(this.options.staleTime))return;const t=B(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(U||this.options.enabled===!1||!D(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,n=this.options,i=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,l=e!==s,h=l?e.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:o}=e;let{dataUpdatedAt:d,error:R,errorUpdatedAt:m,fetchStatus:v,status:f}=o,w=!1,F=!1,y;if(t._optimisticResults){const p=this.hasListeners(),O=!p&&k(e,t),L=p&&j(e,s,t,n);(O||L)&&(v=V(e.options.networkMode)?"fetching":"paused",d||(f="loading")),t._optimisticResults==="isRestoring"&&(v="idle")}if(t.keepPreviousData&&!o.dataUpdatedAt&&c!=null&&c.isSuccess&&f!=="error")y=c.data,d=c.dataUpdatedAt,f=c.status,w=!0;else if(t.select&&typeof o.data<"u")if(i&&o.data===(u==null?void 0:u.data)&&t.select===this.selectFn)y=this.selectResult;else try{this.selectFn=t.select,y=t.select(o.data),y=A(i==null?void 0:i.data,y,t),this.selectResult=y,this.selectError=null}catch(p){this.selectError=p}else y=o.data;if(typeof t.placeholderData<"u"&&typeof y>"u"&&f==="loading"){let p;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))p=i.data;else if(p=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof p<"u")try{p=t.select(p),this.selectError=null}catch(O){this.selectError=O}typeof p<"u"&&(f="success",y=A(i==null?void 0:i.data,p,t),F=!0)}this.selectError&&(R=this.selectError,y=this.selectResult,m=Date.now(),f="error");const Q=v==="fetching",g=f==="loading",I=f==="error";return{status:f,fetchStatus:v,isLoading:g,isSuccess:f==="success",isError:I,isInitialLoading:g&&Q,data:y,dataUpdatedAt:d,error:R,errorUpdatedAt:m,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>h.dataUpdateCount||o.errorUpdateCount>h.errorUpdateCount,isFetching:Q,isRefetching:Q&&!g,isLoadingError:I&&o.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:F,isPreviousData:w,isRefetchError:I&&o.dataUpdatedAt!==0,isStale:T(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,S(s,t))return;this.currentResult=s;const n={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,a=typeof u=="function"?u():u;if(a==="all"||!a&&!this.trackedProps.size)return!0;const l=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(h=>{const c=h;return this.currentResult[c]!==t[c]&&l.has(c)})};(e==null?void 0:e.listeners)!==!1&&i()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!z(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){N.batch(()=>{if(e.onSuccess){var t,s,n,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(n=(i=this.options).onSettled)==null||n.call(i,this.currentResult.data,null)}else if(e.onError){var u,a,l,h;(u=(a=this.options).onError)==null||u.call(a,this.currentResult.error),(l=(h=this.options).onSettled)==null||l.call(h,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function re(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function k(r,e){return re(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&T(r,e)}return!1}function j(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&T(r,t)}function T(r,e){return r.isStaleByTime(e.staleTime)}function ie(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!S(r.getCurrentResult(),e)}function ne(r=""){var e;if(!((e=$())==null?void 0:e.proxy))throw new Error("vue-query hooks can only be used inside setup() function.");const s=Y(r),n=H(s);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}function ue(r,e,t={},s={}){var n;const i=P(()=>ae(e,t,s)),u=(n=i.value.queryClient)!=null?n:ne(i.value.queryClientKey),a=P(()=>{const d=u.defaultQueryOptions(i.value);return d._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",d}),l=new r(u,a.value),h=_(l.getCurrentResult());let c=()=>{};b(u.isRestoring,d=>{d||(c(),c=l.subscribe(R=>{x(h,R)}))},{immediate:!0}),b(a,()=>{l.setOptions(a.value),x(h,l.getCurrentResult())}),G(()=>{c()});const o=()=>new Promise((d,R)=>{let m=()=>{};const v=()=>{if(a.value.enabled!==!1){const f=l.getOptimisticResult(a.value);f.isStale?(m(),l.fetchOptimistic(a.value).then(d,R)):(m(),d(f))}};v(),m=b(a,v,{deep:!0})});return b(()=>h.error,d=>{if(h.isError&&!h.isFetching&&J(a.value.useErrorBoundary,[d,l.getCurrentQuery()]))throw d}),{...X(Z(h)),suspense:o}}function ae(r,e={},t={}){const s=C(r),n=C(e),i=C(t);let u=s;return ee(s)?typeof n=="function"?u={...i,queryKey:s,queryFn:n}:u={...n,queryKey:s}:u=s,te(u)}function ce(r,e,t){const s=ue(se,r,e,t);return{...s,refetch:s.refetch.value,remove:s.remove.value}}const le=3,q=30*1e3;async function oe(r,e){const t=r.startsWith("/")?r.slice(1):r;let s=`${window.DATA_HOST}${t}`;r.startsWith("http")&&(s=r),s.endsWith("/")&&(s=s.slice(0,-1));const n=await fetch(`${s}/config.json?t=${e??0}`),i=await fetch(`${s}/team.json?t=${e??0}`),u=await fetch(`${s}/run.json?t=${e??0}`),{status:a,statusText:l}=n;if(a>=300||a<200)throw new Error(`fetch data failed. [status=${a}] [statusText=${l}]`);return Promise.all([n.json(),i.json(),u.json()]).then(c=>({contest:c[0],teams:c[1],submissions:c[2]}))}function fe(r,e){return ce({queryKey:[r,e.value.getTime()],queryFn:()=>oe(r,e.value.getTime()),retry:le,staleTime:q,refetchInterval:q})}export{fe as u};
1
+ import{ak as M,al as S,am as K,an as U,ao as D,ap as B,aq as W,ar as V,as as A,at as z,au as N,av as $,aw as H,ax as Y,h as P,ay as _,w as b,az as x,aA as G,aB as J,aC as X,aD as Z,j as C,aE as ee,aF as te}from"./index-6578287f.js";class se extends M{constructor(e,t){super(),this.client=e,this.options=t,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),k(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,t){const s=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),S(s,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();const i=this.hasListeners();i&&j(this.currentQuery,n,this.options,s)&&this.executeFetch(),this.updateResult(t),i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();const u=this.computeRefetchInterval();i&&(this.currentQuery!==n||this.options.enabled!==s.enabled||u!==this.currentRefetchInterval)&&this.updateRefetchInterval(u)}getOptimisticResult(e){const t=this.client.getQueryCache().build(this.client,e),s=this.createResult(t,e);return ie(this,s,e)&&(this.currentResult=s,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),s}getCurrentResult(){return this.currentResult}trackResult(e){const t={};return Object.keys(e).forEach(s=>{Object.defineProperty(t,s,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(s),e[s])})}),t}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...t}={}){return this.fetch({...t,meta:{refetchPage:e}})}fetchOptimistic(e){const t=this.client.defaultQueryOptions(e),s=this.client.getQueryCache().build(this.client,t);return s.isFetchingOptimistic=!0,s.fetch().then(()=>this.createResult(s,t))}fetch(e){var t;return this.executeFetch({...e,cancelRefetch:(t=e.cancelRefetch)!=null?t:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let t=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(K)),t}updateStaleTimeout(){if(this.clearStaleTimeout(),U||this.currentResult.isStale||!D(this.options.staleTime))return;const t=B(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},t)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(U||this.options.enabled===!1||!D(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||W.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,t){const s=this.currentQuery,n=this.options,i=this.currentResult,u=this.currentResultState,a=this.currentResultOptions,l=e!==s,h=l?e.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:o}=e;let{dataUpdatedAt:d,error:R,errorUpdatedAt:m,fetchStatus:v,status:f}=o,w=!1,F=!1,y;if(t._optimisticResults){const p=this.hasListeners(),O=!p&&k(e,t),L=p&&j(e,s,t,n);(O||L)&&(v=V(e.options.networkMode)?"fetching":"paused",d||(f="loading")),t._optimisticResults==="isRestoring"&&(v="idle")}if(t.keepPreviousData&&!o.dataUpdatedAt&&c!=null&&c.isSuccess&&f!=="error")y=c.data,d=c.dataUpdatedAt,f=c.status,w=!0;else if(t.select&&typeof o.data<"u")if(i&&o.data===(u==null?void 0:u.data)&&t.select===this.selectFn)y=this.selectResult;else try{this.selectFn=t.select,y=t.select(o.data),y=A(i==null?void 0:i.data,y,t),this.selectResult=y,this.selectError=null}catch(p){this.selectError=p}else y=o.data;if(typeof t.placeholderData<"u"&&typeof y>"u"&&f==="loading"){let p;if(i!=null&&i.isPlaceholderData&&t.placeholderData===(a==null?void 0:a.placeholderData))p=i.data;else if(p=typeof t.placeholderData=="function"?t.placeholderData():t.placeholderData,t.select&&typeof p<"u")try{p=t.select(p),this.selectError=null}catch(O){this.selectError=O}typeof p<"u"&&(f="success",y=A(i==null?void 0:i.data,p,t),F=!0)}this.selectError&&(R=this.selectError,y=this.selectResult,m=Date.now(),f="error");const Q=v==="fetching",g=f==="loading",I=f==="error";return{status:f,fetchStatus:v,isLoading:g,isSuccess:f==="success",isError:I,isInitialLoading:g&&Q,data:y,dataUpdatedAt:d,error:R,errorUpdatedAt:m,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>h.dataUpdateCount||o.errorUpdateCount>h.errorUpdateCount,isFetching:Q,isRefetching:Q&&!g,isLoadingError:I&&o.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:F,isPreviousData:w,isRefetchError:I&&o.dataUpdatedAt!==0,isStale:T(e,t),refetch:this.refetch,remove:this.remove}}updateResult(e){const t=this.currentResult,s=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,S(s,t))return;this.currentResult=s;const n={cache:!0},i=()=>{if(!t)return!0;const{notifyOnChangeProps:u}=this.options,a=typeof u=="function"?u():u;if(a==="all"||!a&&!this.trackedProps.size)return!0;const l=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&l.add("error"),Object.keys(this.currentResult).some(h=>{const c=h;return this.currentResult[c]!==t[c]&&l.has(c)})};(e==null?void 0:e.listeners)!==!1&&i()&&(n.listeners=!0),this.notify({...n,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const t=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const t={};e.type==="success"?t.onSuccess=!e.manual:e.type==="error"&&!z(e.error)&&(t.onError=!0),this.updateResult(t),this.hasListeners()&&this.updateTimers()}notify(e){N.batch(()=>{if(e.onSuccess){var t,s,n,i;(t=(s=this.options).onSuccess)==null||t.call(s,this.currentResult.data),(n=(i=this.options).onSettled)==null||n.call(i,this.currentResult.data,null)}else if(e.onError){var u,a,l,h;(u=(a=this.options).onError)==null||u.call(a,this.currentResult.error),(l=(h=this.options).onSettled)==null||l.call(h,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function re(r,e){return e.enabled!==!1&&!r.state.dataUpdatedAt&&!(r.state.status==="error"&&e.retryOnMount===!1)}function k(r,e){return re(r,e)||r.state.dataUpdatedAt>0&&E(r,e,e.refetchOnMount)}function E(r,e,t){if(e.enabled!==!1){const s=typeof t=="function"?t(r):t;return s==="always"||s!==!1&&T(r,e)}return!1}function j(r,e,t,s){return t.enabled!==!1&&(r!==e||s.enabled===!1)&&(!t.suspense||r.state.status!=="error")&&T(r,t)}function T(r,e){return r.isStaleByTime(e.staleTime)}function ie(r,e,t){return t.keepPreviousData?!1:t.placeholderData!==void 0?e.isPlaceholderData:!S(r.getCurrentResult(),e)}function ne(r=""){var e;if(!((e=$())==null?void 0:e.proxy))throw new Error("vue-query hooks can only be used inside setup() function.");const s=Y(r),n=H(s);if(!n)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return n}function ue(r,e,t={},s={}){var n;const i=P(()=>ae(e,t,s)),u=(n=i.value.queryClient)!=null?n:ne(i.value.queryClientKey),a=P(()=>{const d=u.defaultQueryOptions(i.value);return d._optimisticResults=u.isRestoring.value?"isRestoring":"optimistic",d}),l=new r(u,a.value),h=_(l.getCurrentResult());let c=()=>{};b(u.isRestoring,d=>{d||(c(),c=l.subscribe(R=>{x(h,R)}))},{immediate:!0}),b(a,()=>{l.setOptions(a.value),x(h,l.getCurrentResult())}),G(()=>{c()});const o=()=>new Promise((d,R)=>{let m=()=>{};const v=()=>{if(a.value.enabled!==!1){const f=l.getOptimisticResult(a.value);f.isStale?(m(),l.fetchOptimistic(a.value).then(d,R)):(m(),d(f))}};v(),m=b(a,v,{deep:!0})});return b(()=>h.error,d=>{if(h.isError&&!h.isFetching&&J(a.value.useErrorBoundary,[d,l.getCurrentQuery()]))throw d}),{...X(Z(h)),suspense:o}}function ae(r,e={},t={}){const s=C(r),n=C(e),i=C(t);let u=s;return ee(s)?typeof n=="function"?u={...i,queryKey:s,queryFn:n}:u={...n,queryKey:s}:u=s,te(u)}function ce(r,e,t){const s=ue(se,r,e,t);return{...s,refetch:s.refetch.value,remove:s.remove.value}}const le=3,q=30*1e3;async function oe(r,e){const t=r.startsWith("/")?r.slice(1):r;let s=`${window.DATA_HOST}${t}`;r.startsWith("http")&&(s=r),s.endsWith("/")&&(s=s.slice(0,-1));const n=await fetch(`${s}/config.json?t=${e??0}`),i=await fetch(`${s}/team.json?t=${e??0}`),u=await fetch(`${s}/run.json?t=${e??0}`),{status:a,statusText:l}=n;if(a>=300||a<200)throw new Error(`fetch data failed. [status=${a}] [statusText=${l}]`);return Promise.all([n.json(),i.json(),u.json()]).then(c=>({contest:c[0],teams:c[1],submissions:c[2]}))}function fe(r,e){return ce({queryKey:[r,e.value.getTime()],queryFn:()=>oe(r,e.value.getTime()),retry:le,staleTime:q,refetchInterval:q})}export{fe as u};
@@ -1 +1 @@
1
- import{aH as m,i as r,h as t}from"./index-f1d19db1.js";const l=m("user",()=>{const e=r(""),s=r(new Set),o=t(()=>Array.from(s.value)),u=t(()=>o.value.filter(a=>a!==e.value));function n(a){e.value&&s.value.add(e.value),e.value=a}return{setNewName:n,otherNames:u,savedName:e}});export{l as u};
1
+ import{aH as m,i as r,h as t}from"./index-6578287f.js";const l=m("user",()=>{const e=r(""),s=r(new Set),o=t(()=>Array.from(s.value)),u=t(()=>o.value.filter(a=>a!==e.value));function n(a){e.value&&s.value.add(e.value),e.value=a}return{setNewName:n,otherNames:u,savedName:e}});export{l as u};
@@ -1 +1 @@
1
- import{_ as u}from"./index-f1d19db1.js";function p(d={}){const{immediate:l=!1,onNeedRefresh:v,onOfflineReady:t,onRegistered:r,onRegisteredSW:o,onRegisterError:s}=d;let i,n;const c=async(a=!0)=>{await n};async function f(){if("serviceWorker"in navigator){const{Workbox:a}=await u(()=>import("./workbox-window.prod.es5-a7b12eab.js"),[],import.meta.url);i=new a("/sw.js",{scope:"/",type:"classic"}),i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||t==null||t()}),i.register({immediate:l}).then(e=>{o?o("/sw.js",e):r==null||r(e)}).catch(e=>{s==null||s(e)})}}return n=f(),c}export{p as registerSW};
1
+ import{_ as u}from"./index-6578287f.js";function p(d={}){const{immediate:l=!1,onNeedRefresh:v,onOfflineReady:t,onRegistered:r,onRegisteredSW:o,onRegisterError:s}=d;let i,n;const c=async(a=!0)=>{await n};async function f(){if("serviceWorker"in navigator){const{Workbox:a}=await u(()=>import("./workbox-window.prod.es5-a7b12eab.js"),[],import.meta.url);i=new a("/sw.js",{scope:"/",type:"classic"}),i.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&window.location.reload()}),i.addEventListener("installed",e=>{e.isUpdate||t==null||t()}),i.register({immediate:l}).then(e=>{o?o("/sw.js",e):r==null||r(e)}).catch(e=>{s==null||s(e)})}}return n=f(),c}export{p as registerSW};
package/dist/index.html CHANGED
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
6
- <link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.29.0/dist/balloon-192x192.png">
7
- <link rel="mask-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.29.0/dist/balloon-512x512.svg" color="#00aba9">
6
+ <link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.30.0/dist/balloon-192x192.png">
7
+ <link rel="mask-icon" href="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.30.0/dist/balloon-512x512.svg" color="#00aba9">
8
8
  <meta name="msapplication-TileColor" content="#00aba9">
9
9
  <script>
10
10
  function normalizePath(path) {
@@ -44,7 +44,7 @@
44
44
  }
45
45
  })();
46
46
  </script>
47
- <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.29.0/dist/assets/index-f1d19db1.js"></script>
47
+ <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@xcpcio/board-app@0.30.0/dist/assets/index-6578287f.js"></script>
48
48
  <link rel="manifest" href="/manifest.webmanifest"><style></style></head>
49
49
  <body class="font-sans">
50
50
  <div id="app"></div>
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,n)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const a=s=>l(s,i),t={module:{uri:i},exports:u,require:a};e[i]=Promise.all(r.map((s=>t[s]||a(s)))).then((s=>(n(...s),u)))}}define(["./workbox-b8d87ee1"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/_...all_-d54370e4.js",revision:null},{url:"assets/_name_-c7264d89.js",revision:null},{url:"assets/about-55b7ba92.js",revision:null},{url:"assets/Board-2cad79eb.css",revision:null},{url:"assets/board-88a98e6a.js",revision:null},{url:"assets/Board-9442407d.js",revision:null},{url:"assets/board-layout-e4e0bae6.js",revision:null},{url:"assets/DataSourceInput.vue_vue_type_script_setup_true_lang-d16f2a12.js",revision:null},{url:"assets/en-644e039f.js",revision:null},{url:"assets/headless-3466779c.js",revision:null},{url:"assets/home-37e85146.js",revision:null},{url:"assets/index-a0a089d2.css",revision:null},{url:"assets/index-bc173751.js",revision:null},{url:"assets/index-f1d19db1.js",revision:null},{url:"assets/index-layout-c91f7cfd.js",revision:null},{url:"assets/test-133c6df2.js",revision:null},{url:"assets/TheInput.vue_vue_type_script_setup_true_lang-1dafe5cb.js",revision:null},{url:"assets/useQueryBoardData-c0567554.js",revision:null},{url:"assets/user-6ae7ff90.js",revision:null},{url:"assets/virtual_pwa-register-7ea4486e.js",revision:null},{url:"assets/workbox-window.prod.es5-a7b12eab.js",revision:null},{url:"assets/zh-CN-44b801f0.js",revision:null},{url:"index.html",revision:"b06a5a5b7720b252ecb2476c728cea7c"},{url:"favicon.svg",revision:"5a744f4ccbb122d4a0575be779ddcd43"},{url:"safari-pinned-tab.svg",revision:"5eaf74d1c43d30e0af743b68a3f48504"},{url:"balloon2-192x192.png",revision:"c857ae6d9dfae118ab4397d4358422bd"},{url:"balloon2-512x512.png",revision:"065594f4f743fe3884793c03d3fe7d9e"},{url:"manifest.webmanifest",revision:"3082e8d8ebc9619c6c1055ff243a02a8"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
1
+ if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,n)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const a=s=>l(s,i),t={module:{uri:i},exports:u,require:a};e[i]=Promise.all(r.map((s=>t[s]||a(s)))).then((s=>(n(...s),u)))}}define(["./workbox-b8d87ee1"],(function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/_...all_-b2ba251c.js",revision:null},{url:"assets/_name_-abd07bc1.js",revision:null},{url:"assets/about-64b5108b.js",revision:null},{url:"assets/Board-1cb5a052.js",revision:null},{url:"assets/Board-3c31679a.css",revision:null},{url:"assets/board-85ce205a.js",revision:null},{url:"assets/board-layout-1eaf73df.js",revision:null},{url:"assets/DataSourceInput.vue_vue_type_script_setup_true_lang-c6907218.js",revision:null},{url:"assets/en-644e039f.js",revision:null},{url:"assets/headless-e800ef5b.js",revision:null},{url:"assets/home-2a74cabc.js",revision:null},{url:"assets/index-184e36da.css",revision:null},{url:"assets/index-6578287f.js",revision:null},{url:"assets/index-78001918.js",revision:null},{url:"assets/index-layout-a0249ba4.js",revision:null},{url:"assets/test-c0da21d8.js",revision:null},{url:"assets/TheInput.vue_vue_type_script_setup_true_lang-bd490116.js",revision:null},{url:"assets/useQueryBoardData-3b8a91d5.js",revision:null},{url:"assets/user-69e7d90e.js",revision:null},{url:"assets/virtual_pwa-register-7796129c.js",revision:null},{url:"assets/workbox-window.prod.es5-a7b12eab.js",revision:null},{url:"assets/zh-CN-44b801f0.js",revision:null},{url:"index.html",revision:"693c9b3d1472ec29a0a06f37e8e6625d"},{url:"favicon.svg",revision:"5a744f4ccbb122d4a0575be779ddcd43"},{url:"safari-pinned-tab.svg",revision:"5eaf74d1c43d30e0af743b68a3f48504"},{url:"balloon2-192x192.png",revision:"c857ae6d9dfae118ab4397d4358422bd"},{url:"balloon2-512x512.png",revision:"065594f4f743fe3884793c03d3fe7d9e"},{url:"manifest.webmanifest",revision:"3082e8d8ebc9619c6c1055ff243a02a8"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xcpcio/board-app",
3
3
  "type": "module",
4
- "version": "0.29.0",
4
+ "version": "0.30.0",
5
5
  "description": "XCPCIO Board App",
6
6
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
7
7
  "license": "MIT",
@@ -53,8 +53,8 @@
53
53
  "vue-router": "^4.2.4",
54
54
  "vue-search-select": "^3.1.2",
55
55
  "vue-toast-notification": "^3",
56
- "@xcpcio/core": "0.29.0",
57
- "@xcpcio/types": "0.29.0"
56
+ "@xcpcio/core": "0.30.0",
57
+ "@xcpcio/types": "0.30.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@antfu/eslint-config": "^0.39.8",
@@ -423,6 +423,12 @@ const widthClass = "sm:w-[1260px] xl:w-screen";
423
423
  w-full
424
424
  :rank="rank"
425
425
  :submissions="rank.getSubmissions()"
426
+ :enable-filter="{
427
+ organization: true,
428
+ team: true,
429
+ language: true,
430
+ status: true,
431
+ }"
426
432
  />
427
433
  </div>
428
434
 
@@ -94,6 +94,12 @@ const types = [TYPE_SUBMISSIONS, TYPE_STATISTICS, TYPE_AWARDS];
94
94
  :submissions="submissions"
95
95
  :page-size="8"
96
96
  :remove-border="true"
97
+ :enable-filter="{
98
+ organization: true,
99
+ team: true,
100
+ language: true,
101
+ status: true,
102
+ }"
97
103
  />
98
104
  </div>
99
105
 
@@ -1,23 +1,210 @@
1
1
  <script setup lang="ts">
2
- import type { Rank, Submissions } from "@xcpcio/core";
2
+ import { MultiSelect } from "vue-search-select";
3
+
4
+ import type { Rank, SelectOptionItem, Submissions } from "@xcpcio/core";
3
5
  import { Submission } from "@xcpcio/core";
6
+ import type { SubmissionStatus } from "@xcpcio/types";
4
7
  import { SubmissionStatusToString } from "@xcpcio/types";
5
8
 
6
9
  import { Pagination } from "~/composables/pagination";
7
10
 
11
+ import "~/styles/submission-status-filter.css";
12
+
13
+ interface FilterOptions {
14
+ orgNames: string[];
15
+ teamIds: string[];
16
+ languages: string[];
17
+ statuses: SubmissionStatus[];
18
+ }
19
+
20
+ interface EnableFilterOptions {
21
+ organization?: boolean,
22
+ team?: boolean,
23
+ language?: boolean,
24
+ status?: boolean,
25
+ }
26
+
8
27
  const props = defineProps<{
9
28
  rank: Rank,
10
29
  submissions: Submissions,
11
30
  pageSize?: number,
12
31
  removeBorder?: boolean,
32
+ enableFilter?: EnableFilterOptions,
13
33
  }>();
14
34
 
15
35
  const rank = computed(() => props.rank);
36
+ const enableFilter = computed(() => props.enableFilter);
37
+ const enableFilterButton = computed(() => {
38
+ if (!enableFilter.value) {
39
+ return false;
40
+ }
41
+
42
+ for (const [_k, v] of Object.entries(enableFilter.value)) {
43
+ if (v === true) {
44
+ return true;
45
+ }
46
+ }
47
+
48
+ return false;
49
+ });
50
+
51
+ const filterOptions = ref<FilterOptions>({
52
+ orgNames: [],
53
+ teamIds: [],
54
+ languages: [],
55
+ statuses: [],
56
+ });
57
+
58
+ const orgOptions = computed(() => {
59
+ const res = rank.value.organizations.map((o) => {
60
+ return {
61
+ value: o,
62
+ text: o,
63
+ };
64
+ });
65
+
66
+ return res;
67
+ });
68
+
69
+ const orgSelectedItems = ref<Array<SelectOptionItem>>([]);
70
+ const orgLastSelectItem = ref({});
71
+
72
+ function orgOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: SelectOptionItem) {
73
+ orgSelectedItems.value = selectedItems;
74
+ orgLastSelectItem.value = lastSelectItem;
75
+ }
76
+
77
+ const teamsOptions = computed(() => {
78
+ const res = rank.value.originTeams.map((t) => {
79
+ return {
80
+ value: t.id,
81
+ text: t.organization ? `${t.name} - ${t.organization}` : t.name,
82
+ };
83
+ });
84
+
85
+ return res;
86
+ });
87
+
88
+ const teamsSelectedItems = ref<Array<SelectOptionItem>>([]);
89
+ const teamsLastSelectItem = ref({});
90
+
91
+ function teamsOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: SelectOptionItem) {
92
+ teamsSelectedItems.value = selectedItems;
93
+ teamsLastSelectItem.value = lastSelectItem;
94
+ }
95
+
96
+ const languageOptions = computed(() => {
97
+ const languages = rank.value.languages;
98
+
99
+ const res = languages.map((l) => {
100
+ return {
101
+ value: l,
102
+ text: l,
103
+ };
104
+ });
105
+
106
+ return res;
107
+ });
108
+
109
+ const languageSelectedItems = ref<Array<SelectOptionItem>>([]);
110
+ const languageLastSelectItem = ref({});
111
+
112
+ function languageOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: SelectOptionItem) {
113
+ languageSelectedItems.value = selectedItems;
114
+ languageLastSelectItem.value = lastSelectItem;
115
+ }
116
+
117
+ const statusOptions = computed(() => {
118
+ const statuses = rank.value.statuses;
119
+
120
+ const res = statuses.map((s) => {
121
+ return {
122
+ value: s,
123
+ text: SubmissionStatusToString[s],
124
+ };
125
+ });
126
+
127
+ return res;
128
+ });
129
+
130
+ const statusSelectedItems = ref<Array<SelectOptionItem>>([]);
131
+ const statusLastSelectItem = ref({});
132
+
133
+ function statusOnSelect(selectedItems: Array<SelectOptionItem>, lastSelectItem: SelectOptionItem) {
134
+ statusSelectedItems.value = selectedItems;
135
+ statusLastSelectItem.value = lastSelectItem;
136
+ }
137
+
138
+ function statusCustomAttr(option: SelectOptionItem) {
139
+ return option.value.toString();
140
+ }
141
+
16
142
  const submissions = computed(() => {
17
- const s = props.submissions;
18
- return s.sort(Submission.compare).reverse();
143
+ const ss = props.submissions;
144
+ return ss.filter((s) => {
145
+ const o = filterOptions.value;
146
+
147
+ if (o.orgNames.length === 0
148
+ && o.teamIds.length === 0
149
+ && o.languages.length === 0
150
+ && o.statuses.length === 0
151
+ ) {
152
+ return true;
153
+ }
154
+
155
+ if (o.teamIds.length > 0) {
156
+ for (const t of o.teamIds) {
157
+ if (t === s.teamId) {
158
+ return true;
159
+ }
160
+ }
161
+ }
162
+
163
+ if (o.orgNames.length > 0) {
164
+ const team = rank.value.teamsMap.get(s.teamId);
165
+ for (const n of o.orgNames) {
166
+ if (n === team?.organization) {
167
+ return true;
168
+ }
169
+ }
170
+ }
171
+
172
+ if (o.languages.length > 0) {
173
+ for (const l of o.languages) {
174
+ if (l === s.language) {
175
+ return true;
176
+ }
177
+ }
178
+ }
179
+
180
+ if (o.statuses.length > 0) {
181
+ for (const sta of o.statuses) {
182
+ if (sta === s.status) {
183
+ return true;
184
+ }
185
+ }
186
+ }
187
+
188
+ return false;
189
+ }).sort(Submission.compare).reverse();
19
190
  });
20
191
 
192
+ function onFilter() {
193
+ const newFilterOptions: FilterOptions = {
194
+ orgNames: [],
195
+ teamIds: [],
196
+ languages: [],
197
+ statuses: [],
198
+ };
199
+
200
+ newFilterOptions.orgNames = orgSelectedItems.value.map(o => o.value);
201
+ newFilterOptions.teamIds = teamsSelectedItems.value.map(t => t.value);
202
+ newFilterOptions.languages = languageSelectedItems.value.map(l => l.value);
203
+ newFilterOptions.statuses = statusSelectedItems.value.map(s => s.value as SubmissionStatus);
204
+
205
+ filterOptions.value = newFilterOptions;
206
+ }
207
+
21
208
  const p = ref(new Pagination());
22
209
 
23
210
  p.value.currentPage = 0;
@@ -69,79 +256,94 @@ function getProblemLabelColorStyle(s: Submission) {
69
256
  <template>
70
257
  <section>
71
258
  <div
72
- class="mx-auto w-full"
259
+ mx-auto w-full
73
260
  px-4
74
261
  >
75
262
  <div
76
- class="relative overflow-hidden bg-white dark:bg-gray-800"
263
+ relative overflow-hidden
264
+ bg-white dark:bg-gray-800
77
265
  :class="{
78
266
  'shadow-md': props.removeBorder !== true,
79
267
  'sm:rounded-sm': props.removeBorder !== true,
80
268
  }"
81
269
  >
82
270
  <div
83
- class="lg:flex-row lg:items-center lg:justify-between space-y-3 lg:space-x-4 lg:space-y-0"
271
+ space-y-3
84
272
  flex flex-col
85
273
  px-4 py-3
274
+ lg:flex-row lg:items-center lg:justify-between
275
+ lg:space-x-4 lg:space-y-0
86
276
  >
87
277
  <div
88
- class="flex flex-shrink-0 flex-col md:flex-row md:items-center lg:justify-end space-y-3 md:space-x-3 md:space-y-0"
278
+ flex flex-shrink-0 flex-col
279
+ md:flex-row md:items-center
280
+ lg:justify-end space-y-3
281
+ md:space-x-3 md:space-y-0
89
282
  >
90
- <button
91
- v-if="notShowing"
92
- type="button"
93
- class="flex items-center justify-center rounded-lg bg-primary-700 px-4 py-2 text-sm font-medium text-white dark:bg-primary-600 hover:bg-primary-800 focus:outline-none focus:ring-4 focus:ring-primary-300 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
283
+ <div
284
+ v-if="rank.contest.organization && enableFilter?.organization"
285
+ w-48
94
286
  >
95
- <svg
96
- class="mr-2 h-3.5 w-3.5"
97
- fill="currentColor"
98
- viewbox="0 0 20 20"
99
- xmlns="http://www.w3.org/2000/svg"
100
- aria-hidden="true"
101
- >
102
- <path
103
- clip-rule="evenodd"
104
- fill-rule="evenodd"
105
- d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
106
- />
107
- </svg>
108
- Add new product
109
- </button>
110
-
111
- <button
112
- v-if="notShowing"
113
- type="button"
114
- class="flex flex-shrink-0 items-center justify-center border border-gray-200 rounded-lg bg-white px-3 py-2 text-sm font-medium text-gray-900 focus:z-10 dark:border-gray-600 dark:bg-gray-800 hover:bg-gray-100 dark:text-gray-400 hover:text-primary-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
287
+ <MultiSelect
288
+ :options="orgOptions"
289
+ :selected-options="orgSelectedItems"
290
+ :placeholder="rank.contest.organization"
291
+ @select="orgOnSelect"
292
+ />
293
+ </div>
294
+
295
+ <div
296
+ v-if="enableFilter?.team"
297
+ w-48
115
298
  >
116
- <svg
117
- class="mr-2 h-4 w-4"
118
- xmlns="http://www.w3.org/2000/svg"
119
- aria-hidden="true"
120
- fill="none"
121
- viewbox="0 0 24 24"
122
- stroke-width="1.5"
123
- stroke="currentColor"
124
- >
125
- <path
126
- stroke-linecap="round"
127
- stroke-linejoin="round"
128
- d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"
129
- />
130
- </svg>
131
- Update stocks 1/250
132
- </button>
133
-
134
- <button
135
- v-if="notShowing"
136
- type="button"
137
- class="flex flex-shrink-0 items-center justify-center border border-gray-200 rounded-lg bg-white px-3 py-2 text-sm font-medium text-gray-900 focus:z-10 dark:border-gray-600 dark:bg-gray-800 hover:bg-gray-100 dark:text-gray-400 hover:text-primary-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
299
+ <MultiSelect
300
+ :options="teamsOptions"
301
+ :selected-options="teamsSelectedItems"
302
+ placeholder="Team"
303
+ @select="teamsOnSelect"
304
+ />
305
+ </div>
306
+
307
+ <div
308
+ v-if="enableFilter?.status"
309
+ w-64
310
+ >
311
+ <MultiSelect
312
+ :options="statusOptions"
313
+ :selected-options="statusSelectedItems"
314
+ placeholder="Status"
315
+ :custom-attr="statusCustomAttr"
316
+ @select="statusOnSelect"
317
+ />
318
+ </div>
319
+
320
+ <div
321
+ v-if="enableFilter?.language && languageOptions.length > 0"
322
+ w-48
138
323
  >
139
- <div
140
- i-pajamas-export
141
- class="mr-2 h-4 w-4"
324
+ <MultiSelect
325
+ :options="languageOptions"
326
+ :selected-options="languageSelectedItems"
327
+ placeholder="Language"
328
+ @select="languageOnSelect"
142
329
  />
143
- Export
144
- </button>
330
+ </div>
331
+
332
+ <div
333
+ v-if="enableFilterButton"
334
+ >
335
+ <button
336
+ type="button"
337
+ class="flex flex-shrink-0 items-center justify-center border border-gray-200 rounded-lg bg-white px-3 py-2 text-sm font-medium text-gray-900 focus:z-10 dark:border-gray-600 dark:bg-gray-800 hover:bg-gray-100 dark:text-gray-400 hover:text-primary-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"
338
+ @click="onFilter"
339
+ >
340
+ <div
341
+ i-material-symbols-search
342
+ mr-1 h-5 w-5
343
+ />
344
+ Filter
345
+ </button>
346
+ </div>
145
347
  </div>
146
348
  </div>
147
349
 
@@ -80,13 +80,29 @@ const types = [TYPE_SUBMISSIONS, TYPE_STATISTICS, TYPE_AWARDS];
80
80
  width-class="h-8 w-8"
81
81
  />
82
82
 
83
- <h3
84
- text-gray-900 dark:text-white
85
- text-2xl
86
- font-sans font-semibold italic
87
- >
88
- {{ headerTitle }}
89
- </h3>
83
+ <Tooltip>
84
+ <h3
85
+ text-gray-900 dark:text-white
86
+ text-2xl
87
+ font-sans font-semibold italic
88
+ >
89
+ {{ headerTitle }}
90
+ </h3>
91
+
92
+ <template #popper>
93
+ <div
94
+ flex flex-col
95
+ justify-start items-start
96
+ >
97
+ <div>
98
+ TeamID: {{ team.id }}
99
+ </div>
100
+ <div>
101
+ ddd: f22
102
+ </div>
103
+ </div>
104
+ </template>
105
+ </Tooltip>
90
106
  </div>
91
107
 
92
108
  <ModalMenu
@@ -42,7 +42,7 @@ onMounted(() => {
42
42
  ref="tooltipTargetEl"
43
43
  role="tooltip"
44
44
  class="tooltip inline-block absolute invisible px-3 py-2 transition-opacity duration-300 shadow-sm opacity-0"
45
- z-9999
45
+ z-99999
46
46
  rounded
47
47
  text-base text-white font-medium
48
48
  bg-gray-900 dark:bg-gray-700