import{u as P,Q as B}from"./use-meta-DOYUf45L.js";import{u as x}from"./use-quasar-rqy1CZtR.js";import{a as f,r as n,o as C,w as _,a5 as d,a6 as b,a9 as o,aa as i,ac as w,ay as $,ak as q,ag as g,ab as S,at as A,a8 as v,e as T,ae as F}from"./index-DICPTgNa.js";import{a as N}from"./rtl-Cq6Y33Hr.js";import{Q as R,a as U,b as M}from"./QTable-CCY7eiso.js";import{u as z}from"./vue-i18n.runtime-BTnF4KD_.js";import"./QItemLabel-DKKcZbkY.js";const D={class:"q-pa-md"},E={key:0},H={key:1},K={__name:"TableList",setup(Q){const{t:s}=z(),l=x(),p=f(()=>[{name:"desc",required:!0,label:s("title"),align:"left",field:e=>e.name,format:e=>`${e}`,sortable:!0},{name:"calories",align:"center",label:"Calories",field:"calories",sortable:!0},{name:"fat",label:"Fat (g)",field:"fat",sortable:!0},{name:"carbs",label:"Carbs (g)",field:"carbs"},{name:"protein",label:"Protein (g)",field:"protein"},{name:"sodium",label:"Sodium (mg)",field:"sodium"},{name:"calcium",label:"Calcium (%)",field:"calcium",sortable:!0,sort:(e,t)=>parseInt(e,10)-parseInt(t,10)},{name:"iron",label:"Iron (%)",field:"iron",sortable:!0,sort:(e,t)=>parseInt(e,10)-parseInt(t,10)},{name:"action",label:s("action"),align:"right"}]),u=f(()=>[{name:"Frozen Yogurt",calories:159,fat:6,carbs:24,protein:4,sodium:87,calcium:"14%",iron:"1%"},{name:"Ice cream sandwich",calories:237,fat:9,carbs:37,protein:4.3,sodium:129,calcium:"8%",iron:"1%"},{name:"Eclair",calories:262,fat:16,carbs:23,protein:6,sodium:337,calcium:"6%",iron:"7%"},{name:"Cupcake",calories:305,fat:3.7,carbs:67,protein:4.3,sodium:413,calcium:"3%",iron:"8%"},{name:"Gingerbread",calories:356,fat:16,carbs:49,protein:3.9,sodium:327,calcium:"7%",iron:"16%"},{name:"Jelly bean",calories:375,fat:0,carbs:94,protein:0,sodium:50,calcium:"0%",iron:"0%"},{name:"Lollipop",calories:392,fat:.2,carbs:98,protein:0,sodium:38,calcium:"0%",iron:"2%"},{name:"Honeycomb",calories:408,fat:3.2,carbs:87,protein:6.5,sodium:562,calcium:"0%",iron:"45%"},{name:"Donut",calories:452,fat:25,carbs:51,protein:4.9,sodium:326,calcium:"2%",iron:"22%"},{name:"KitKat",calories:518,fat:26,carbs:65,protein:7,sodium:54,calcium:"12%",iron:"6%"}]),r=n({sortBy:"desc",descending:!1,page:1,rowsPerPage:1}),c=f(()=>Math.ceil(u.value.length/r.value.rowsPerPage)),k=n(l.screen.height*.73+"px"),I=n(l.screen.width*.825+"px"),y=n(l.dark.isActive?"#121212":"#ffffff");function h(e){r.value=e.pagination}function V(e){console.log(e)}return C(()=>{h({pagination:r.value})}),_(()=>l.dark.isActive,e=>{y.value=e?"#121212":"#ffffff"}),_(r,(e,t)=>{console.log(`myRef的值从${t}变为${e}`)}),(e,t)=>(d(),b("div",D,[o(M,{class:A(v(l).dark.isActive?"my-sticky-header-last-column-table-dark":"my-sticky-header-last-column-table"),flat:"",bordered:"",rows:u.value,columns:p.value,"row-key":"name",pagination:r.value,separator:"cell","no-data-label":v(s)("nodata"),"rows-per-page-label":v(s)("per_page"),"rows-per-page-options":[1,10,30,50,200,0],"table-style":{height:k.value,width:I.value},"card-style":{backgroundColor:y.value},onRequest:h},{top:i(a=>[o(w,{color:"primary",label:"Add row"}),o(N),o($,{borderless:"",dense:"",debounce:"300",color:"primary",modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=m=>c.value=m)},{append:i(()=>[o(q,{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":i(a=>[o(R,{props:a},{default:i(()=>[a.col.name==="action"?(d(),b("div",E,g(a.value),1)):(d(),b("div",H,g(a.value),1))]),_:2},1032,["props"])]),pagination:i(a=>[S(g(a)+" ",1),o(U,{modelValue:a.pagination.page,"onUpdate:modelValue":[m=>a.pagination.page=m,m=>V(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"])]))}},X={__name:"TableReader",setup(Q){const s=x(),l=n(!1),p=n(""),u=n(""),r=n("");return P(()=>({title:p.value,meta:{description:{name:"description",content:u.value},keywords:{name:"keywords",content:r.value}}})),C(()=>{}),T(()=>{}),_(()=>s.dark.isActive,c=>{l.value=c}),(c,k)=>(d(),F(B,{class:"flex flex-top"},{default:i(()=>[o(K)]),_:1}))}};export{X as default};
