import{e as g,o as a,f as l,g as q,q as u,t as P,x as p,v as h,p as v,y as D,F as c,C as F,c as N,E as x,u as T,n as k,I as A,A as I,J as S}from"./iframe-Bl-fVlm8.js";import{l as $}from"./lodash-CdDiHlzQ.js";import{P as E}from"./PzInfoHint-DKG3kEnA.js";import{_ as B}from"./_plugin-vue_export-helper-DlAUqK2U.js";const V="—",w={class:"pz-table-data__title"},W=["innerHTML"],m=g({name:"PzTableData",__name:"PzTableData",props:{column:{},data:{default:void 0},defaultValue:{},isBold:{type:Boolean,default:!1}},setup(e){const o=e,r=N(()=>o.data??{}),s=N(()=>$.get(o.data,o.column.key)||o.defaultValue);return(y,C)=>{var i;return a(),l("td",{class:q(["pz-table-data",{"pz-table-data--bold":e.isBold}])},[u("p",w,[u("span",null,P(e.column.mobileName||e.column.name),1),(i=e.column.infoContent)!=null&&i.length?(a(),p(h(E),{key:0,"info-content":e.column.infoContent},null,8,["info-content"])):v("",!0)]),D(y.$slots,"default",{data:r.value,column:e.column,value:s.value},()=>[e.column.isContentHtml?(a(),l("span",{key:0,innerHTML:String(s.value)},null,8,W)):(a(),l(c,{key:1},[F(P(s.value),1)],64))],!0)],2)}}}),j=B(m,[["__scopeId","data-v-e0a86207"]]);m.__docgenInfo=Object.assign({displayName:m.name??m.__name},{name:"PzTableData",exportName:"default",displayName:"PzTableData",description:"",tags:{},props:[{name:"column",required:!0,type:{name:"PzTableColumn",elements:[{name:"TKey"}]}},{name:"data",required:!1,type:{name:"TRow"},defaultValue:{func:!1,value:"undefined"}},{name:"defaultValue",required:!0,type:{name:"string"}},{name:"isBold",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"false"}}],slots:[{name:"default",scoped:!0,bindings:[{name:"data",title:"binding"},{name:"column",title:"binding"},{name:"value",title:"binding"}]}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Data/PzTable/PzTableData.vue"]});const M={class:"pz-table-head",scope:"col"},f=g({name:"PzTableHead",__name:"PzTableHead",props:{column:{}},setup(e){return(o,r)=>{var s;return a(),l("th",M,[u("span",null,P(e.column.name),1),(s=e.column.infoContent)!=null&&s.length?(a(),p(h(E),{key:0,"info-content":e.column.infoContent,class:"pz-table-head__hint"},null,8,["info-content"])):v("",!0)])}}}),R=B(f,[["__scopeId","data-v-c4688b62"]]);f.__docgenInfo=Object.assign({displayName:f.name??f.__name},{name:"PzTableHead",exportName:"default",displayName:"PzTableHead",description:"",tags:{},props:[{name:"column",required:!0,type:{name:"PzTableColumn"}}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Data/PzTable/PzTableHead.vue"]});const U={class:"pz-table-wrap"},K={class:"pz-table"},O={key:0,class:"pz-table__head"},Y={class:"pz-table__row pz-table__row--head"},Z=100,b=g({name:"PzTable",__name:"PzTable",props:{config:{},data:{},defaultValue:{default:V},visibleHeader:{type:Boolean,default:!0},isBoldFirstColumn:{type:Boolean,default:!0}},setup(e){const o=x(),r=e,s=({colWidth:n})=>({width:r.config.some(({colWidth:t})=>!!t)?`${n}%`:`${Math.floor(Z/r.config.length)}%`}),y=n=>!!o[n],C=n=>n,i=(n,_)=>{const{id:t}=n,z=typeof t=="string"||typeof t=="number";return"id"in n&&z?t:_};return(n,_)=>(a(),l("div",U,[u("table",K,[e.visibleHeader?(a(),l("thead",O,[u("tr",Y,[(a(!0),l(c,null,T(e.config,t=>(a(),p(R,{key:t.id,column:t,style:k(s(t))},null,8,["column","style"]))),128))])])):v("",!0),u("tbody",null,[(a(!0),l(c,null,T(e.data,(t,z)=>(a(),l("tr",{key:i(t,z),class:"pz-table__row"},[(a(!0),l(c,null,T(e.config,(d,H)=>(a(),p(j,{key:d.id,column:d,data:t,"default-value":e.defaultValue??h(V),"is-bold":e.isBoldFirstColumn&&H===0,style:k(s(d))},A({_:2},[y(d.key)?{name:"default",fn:I(L=>[D(n.$slots,C(d.key),S({ref_for:!0},L),void 0,!0)]),key:"0"}:void 0]),1032,["column","data","default-value","is-bold","style"]))),128))]))),128))])])]))}}),ee=B(b,[["__scopeId","data-v-956b5e80"]]);b.__docgenInfo=Object.assign({displayName:b.name??b.__name},{name:"PzTable",exportName:"default",displayName:"PzTable",description:"",tags:{},props:[{name:"config",required:!0,type:{name:"Array",elements:[{name:"PzTableColumn",elements:[{name:"TKey"}]}]}},{name:"data",required:!0,type:{name:"Array",elements:[{name:"TRow"}]}},{name:"defaultValue",required:!1,type:{name:"string"},defaultValue:{func:!1,value:"PZ_TABLE_DEFAULT_EMPTY_VALUE"}},{name:"visibleHeader",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}},{name:"isBoldFirstColumn",required:!1,type:{name:"boolean"},defaultValue:{func:!1,value:"true"}}],slots:[{name:"getSlotName(column.key)",scoped:!0,bindings:[{name:"name",title:"binding"}]}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Data/PzTable/PzTable.vue"]});export{ee as P,V as a,R as b,j as c};
