1import{a as F,m as y,j as u}from"./-W1VOijv.js";import P from"./B8Ry3j3y.js";import W from"./Cb9MYrcP.js";import q from"./Dc6hFrXi.js";import{d as A}from"./BmaaQ1Wp.js";import{bg as s,b3 as V,Q as B,a0 as t,b_ as i,I as a,bs as d,Z as l,aL as h}from"./PW_UF68a.js";import"./Bz2dEcw7.js";import"./CIhhRri8.js";import"./Bs5_TFWz.js";import"./B_aewNsK.js";import"./fgnZjpTr.js";import"./CH7vd0UB.js";import"./206wqFYJ.js";const C={name:"WidgetsIndex",components:{ResetFiltersButton:q,TextFieldFilter:P,SelectFilter:W},mixins:[A],data(){return{headers:[{title:this.$t("fields.name"),align:"start",key:"name"},{title:this.$t("fields.type"),key:"type"},{title:this.$t("fields.location"),key:"location"},{title:this.$t("fields.order"),key:"order"},{title:"",sortable:!1,align:"end",key:"action"}]}},async mounted(){await this.fetchData()},head(){return{title:"Widgeturi"}},computed:{...u("widgets",["widgets","widgetTypes"]),...u("loader",["loading"]),...u("query",["queryParams"]),currentScope(){return"widgets"},formattedWidgetTypes(){return!this.widgetTypes||!Array.isArray(this.widgetTypes)?[]:this.widgetTypes.map(e=>typeof e=="object"&&e!==null?{title:e.text||"",value:e.value||""}:e)}},methods:{...y("resources",["getData","deleteResource"]),...y("query",["resetScopeFilters","setVuetifyPagination"]),async fetchData(){await this.getData(this.currentScope)},handleOptionsUpdate(e){this.setVuetifyPagination({scope:this.currentScope,pagination:e}),this.getData(this.currentScope)},getWidgetText(e){if(!this.widgetTypes||!Array.isArray(this.widgetTypes))return e;const o=this.widgetTypes.find(f=>f.value===e);return o&&o.text||e},getLocationText(e){return e?e==="left"?"Stânga":e==="right"?"Dreapta":e==="footer"?"Footer":e==="page"?"PaginÄ":e:""}}},U={class:"d-flex flex-column flex-grow-1"},$={class:"text-h5 text-md-h4"},j={class:"filter-row"},I={class:"text-end"},L={class:"d-flex no-wrap justify-end"},N={class:"font-weight-bold"},R={class:"font-weight-bold"};function E(e,o,f,O,v,r){const b=s("v-divider"),w=s("v-spacer"),c=s("v-btn"),x=s("v-card-title"),p=s("text-field-filter"),T=s("select-filter"),S=s("reset-filters-button"),g=s("v-icon"),_=s("v-tooltip"),k=s("v-data-table-server"),D=s("v-card-text"),z=s("v-card");return V(),B("div",U,[t(z,{elevation:"5"},{default:i(()=>[t(x,{class:"d-flex align-center"},{default:i(()=>[a("div",$,d(e.$t("menu.widgets")),1),t(b,{class:"mx-2 d-none d-md-inline",vertical:""}),t(w),t(c,{class:"mt-2 mt-md-0 create-button",color:"primary",size:"large",to:"/widgets/create"},{default:i(()=>[l(d(e.$t("buttons.create_widget")),1)]),_:1})]),_:1}),t(D,null,{default:i(()=>[t(k,{options:e.pagination,"onUpdate:options":[o[0]||(o[0]=n=>e.pagination=n),r.handleOptionsUpdate],headers:v.headers,items:e.widgets,"items-length":e.queryParams[r.currentScope]?.pagination?.total||0,"items-per-page-options":[10,15,30,60],loading:e.loading,class:"flex-grow-1 v2-style-table"},{"body.prepend":i(()=>[a("tr",j,[a("td",null,[t(p,{label:e.$t("fields.name"),scope:r.currentScope,class:"filter-field","hide-details":"","scope-key":"name"},null,8,["label","scope"])]),a("td",null,[t(T,{items:r.formattedWidgetTypes,label:e.$t("fields.type"),scope:r.currentScope,class:"filter-field","hide-details":"","scope-key":"type"},null,8,["items","label","scope"])]),a("td",null,[t(p,{label:e.$t("fields.location"),scope:r.currentScope,class:"filter-field","hide-details":"","scope-key":"location"},null,8,["label","scope"])]),a("td",null,[t(p,{label:e.$t("fields.order"),scope:r.currentScope,class:"filter-field","hide-details":"","scope-key":"order"},null,8,["label","scope"])]),a("td",I,[t(S,{scope:r.currentScope,class:"filter-reset-button"},null,8,["scope"])])])]),"item.type":i(({item:n})=>[l(d(r.getWidgetText(n.type)),1)]),"item.location":i(({item:n})=>[l(d(r.getLocationText(n.location)),1)]),"item.action":i(({item:n})=>[a("div",L,[t(_,{location:"bottom"},{activator:i(({props:m})=>[t(c,h({to:`/widgets/edit/${n.id}`,density:"compact",icon:"",size:"medium"},m,{variant:"text",style:{color:"rgba(0, 0, 0, 0.7) !important"}}),{default:i(()=>[t(g,{size:"large"},{default:i(()=>[...o[1]||(o[1]=[l("mdi-square-edit-outline",-1)])]),_:1})]),_:1},16,["to"])]),default:i(()=>[a("span",null,[o[2]||(o[2]=l("EditeazÄ ",-1)),a("i",N,d(n.name),1)])]),_:2},1024),t(_,{location:"bottom"},{activator:i(({props:m})=>[t(c,h({density:"compact",icon:"",size:"medium"},m,{variant:"text",onClick:H=>e.deleteResource({scope:r.currentScope,data:n})}),{default:i(()=>[t(g,{size:"large"},{default:i(()=>[...o[3]||(o[3]=[l("mdi-delete",-1)])]),_:1})]),_:1},16,["onClick"])]),default:i(()=>[a("span",null,[o[4]||(o[4]=l("Èterge ",-1)),a("i",R,d(n.name),1)])]),_:2},1024)])]),_:1},8,["options","headers","items","items-length","loading","onUpdate:options"])]),_:1})]),_:1})])}const ae=F(C,[["render",E],["__scopeId","data-v-1bb42110"]]);export{ae as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.