import{u as q,Q as U}from"./use-meta-C8KjZCta.js";import{z as Q,G as j,H as N}from"./QItemLabel-DcDpebHx.js";import{a as y,r as n,l as C,w as _,Z as g,_ as v,a1 as o,a2 as u,a4 as w,a3 as x,a8 as p,am as S,ac as A,aj as I,a0 as b,o as M,a6 as R}from"./index-CJh31sX4.js";import{Q as T,a as z,b as F}from"./QTable-surzgb0S.js";import{get as H}from"./axios-C8XO8gCN.js";import{u as K}from"./vue-i18n.runtime-BVjpgzfn.js";const D={class:"q-pa-md"},E={key:0},G={key:1},L={__name:"UserList",setup(V){const{t}=K(),r=Q(),f=y(()=>[{name:"username",required:!0,label:t("username"),align:"left",field:"username",sortable:!0},{name:"email",align:"center",label:t("email"),field:"email",sortable:!0},{name:"date_joined",label:t("date_joined"),field:"date_joined",sortable:!0},{name:"last_login",label:t("last_login"),field:"last_login",sortable:!0},{name:"updated_time",label:t("updated_time"),field:"updated_time",sortable:!0},{name:"action",label:t("action"),align:"right"}]),c=n([]),m=n(""),s=n({sortBy:"username",descending:!1,page:1,rowsPerPage:1,rowsNumber:1}),h=y(()=>Math.ceil(c.value.length/s.value.rowsPerPage)),P=n(r.screen.height*.73+"px"),B=n(r.screen.width*.825+"px"),k=n(r.dark.isActive?"#121212":"#ffffff");function d(l){H("core/user/").then(e=>{c.value=e.results}).catch(e=>(console.error(e),Promise.reject(e))),console.log(l),s.value=l.pagination}function $(l){console.log("pageChange",l)}return C(()=>{d({pagination:s.value})}),_(()=>r.dark.isActive,l=>{k.value=l?"#121212":"#ffffff"}),_(()=>s.value,l=>{console.log(l)}),(l,e)=>(g(),v("div",D,[o(F,{class:I(b(r).dark.isActive?"my-sticky-header-last-column-table-dark":"my-sticky-header-last-column-table"),flat:"",bordered:"",rows:c.value,columns:f.value,"row-key":"name",pagination:s.value,separator:"cell","no-data-label":b(t)("nodata"),"rows-per-page-label":b(t)("per_page"),"rows-per-page-options":[1,10,30,50,200,0],"table-style":{height:P.value,width:B.value},"card-style":{backgroundColor:k.value},onRequest:d},{top:u(a=>[o(w,{color:"primary",label:"refresh",icon:"refresh",onClick:e[0]||(e[0]=i=>d())}),x(" "+p(h.value)+" ",1),o(j),o(N,{borderless:"",dense:"",debounce:"300",color:"primary",modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=i=>m.value=i),onInput:e[2]||(e[2]=i=>d()),onKeyup:e[3]||(e[3]=S(i=>d(),["enter"]))},{append:u(()=>[o(A,{name:"search"})]),_:1},8,["modelValue"]),o(w,{flat:"",round:"",dense:"",icon:a.inFullscreen?"fullscreen_exit":"fullscreen",onClick:a.toggleFullscreen},null,8,["icon","onClick"])]),"body-cell":u(a=>[o(T,{props:a},{default:u(()=>[a.col.name==="action"?(g(),v("div",E,p(a.value),1)):(g(),v("div",G,p(a.value),1))]),_:2},1032,["props"])]),pagination:u(a=>[x(p(a)+" ",1),o(z,{modelValue:a.pagination.page,"onUpdate:modelValue":[i=>a.pagination.page=i,i=>$(a)],max:a.pagesNumber,input:"","input-class":"text-orange-10"},null,8,["modelValue","onUpdate:modelValue","max"])]),_:1},8,["class","rows","columns","pagination","no-data-label","rows-per-page-label","table-style","card-style"])]))}},ee={__name:"UserReader",setup(V){const t=Q(),r=n(!1),f=n(""),c=n(""),m=n("");return q(()=>({title:f.value,meta:{description:{name:"description",content:c.value},keywords:{name:"keywords",content:m.value}}})),C(()=>{}),M(()=>{}),_(()=>t.dark.isActive,s=>{r.value=s}),(s,h)=>(g(),R(U,{class:"flex flex-top"},{default:u(()=>[o(L)]),_:1}))}};export{ee as default};
