import{P}from"./PzTable-DBoLxbsv.js";import{P as u}from"./PzText-D5PUnIjq.js";import{e as b,f as v,y as z,v as t,x as T,p as f,o as r}from"./iframe-Bl-fVlm8.js";import{I as y,P as _}from"./PzListNav-DBS8u2z6.js";import{u as h}from"./StaticPagination.composable-CiVqHavQ.js";import"./lodash-CdDiHlzQ.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./PzInfoHint-DKG3kEnA.js";import"./PzIcon-cRuuou9i.js";import"./PzHint-DsiQRpYG.js";import"./floating-vue-C5xzxu-B.js";import"./floating-vue-ByDoVj13.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./preload-helper-C1FmrZbK.js";import"./PzSelect-CwWCI-kq.js";import"./index-pk-yyh3_.js";import"./PzLabel-avnfC9tn.js";import"./PzPagination-Cjg8KFKz.js";const n=b({name:"PzTablePaginationProvider",__name:"PzTablePaginationProvider",props:{perPage:{default:y.FIVE},data:{}},setup(e){const a=e,{perPage:l,pageChanged:d,getItems:m,isPaginationAvailable:g}=h(a);return(c,k)=>(r(),v("div",null,[z(c.$slots,"default",{items:t(m)}),t(g)?(r(),T(t(_),{key:0,total:e.data.length,"per-page":t(l),class:"pz-mt-32",onOnInput:t(d)},null,8,["total","per-page","onOnInput"])):f("",!0)]))}});n.__docgenInfo=Object.assign({displayName:n.name??n.__name},{name:"PzTablePaginationProvider",exportName:"default",displayName:"PzTablePaginationProvider",description:"",tags:{},props:[{name:"perPage",defaultValue:{func:!1,value:"ITEMS_PER_PAGE.FIVE"}}],slots:[{name:"default",scoped:!0,bindings:[{name:"items",title:"binding"}]}],sourceFiles:["/builds/Web-Projects/client-services/prozorro-ui/src/components/Navigation/PzTablePaginationProvider/PzTablePaginationProvider.vue"]});const S=n,x=n,C=P,E=[{id:"name",name:"Назва",key:"name",colWidth:40},{id:"quantity",name:"Кількість",key:"quantity",colWidth:30},{id:"deliveryDate",name:"Дата поставки",key:"deliveryDate",colWidth:30}],I=12,N=10,w=Array.from({length:I},(e,a)=>({id:`item-${a+1}`,name:`Товар №${a+1}`,quantity:`${(a+1)*N} штука`,deliveryDate:"до 30 грудня 2026"})),Y={title:"Components/Navigation/PzTablePaginationProvider",component:x,parameters:{docs:{description:{component:"Generic static-pagination wrapper for tabular data. Slices `data` into pages, exposes the current page array through the default `items` slot prop, and renders `PzListNav` when the data exceeds `perPage`. Here it is typed as `PzTableRow` and feeds a `PzTable`."}}},args:{data:w,perPage:5},argTypes:{data:{control:!1,description:"Full row array; the provider paginates it internally."},perPage:{control:{type:"number",min:1},description:"Rows per page."}}},o={render:e=>({components:{pzTablePaginationProvider:S,pzTable:C,pzText:u},setup(){return{args:e,config:E}},template:`
      <div style="max-width: 720px;">
        <pz-table-pagination-provider :data="args.data" :per-page="args.perPage">
          <template #default="{ items }">
            <pz-table :config="config" :data="items" />
          </template>
        </pz-table-pagination-provider>
      </div>
    `})};var i,p,s;o.parameters={...o.parameters,docs:{...(i=o.parameters)==null?void 0:i.docs,source:{originalSource:`{
  render: (args: PzTablePaginationProviderStoryArgs) => ({
    components: {
      pzTablePaginationProvider: pzTablePaginationProviderStoryComponent,
      pzTable: pzTableStoryComponent,
      pzText: PzText
    },
    setup() {
      return {
        args,
        config
      };
    },
    template: \`
      <div style="max-width: 720px;">
        <pz-table-pagination-provider :data="args.data" :per-page="args.perPage">
          <template #default="{ items }">
            <pz-table :config="config" :data="items" />
          </template>
        </pz-table-pagination-provider>
      </div>
    \`
  })
}`,...(s=(p=o.parameters)==null?void 0:p.docs)==null?void 0:s.source}}};const J=["Playground"];export{o as Playground,J as __namedExportsOrder,Y as default};
