{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "oods-pagination-bar",
  "type": "registry:component",
  "title": "OODS Foundry PaginationBar",
  "description": "Vue adapter for OODS PaginationBar on shadcn-vue / Reka UI. Uses the team Reka pagination controls; page and page-size events preserve the Vue contract.",
  "dependencies": [
    "@oods/components-vue@0.11.2"
  ],
  "registryDependencies": [
    "pagination"
  ],
  "files": [
    {
      "path": "components/oods/pagination-bar.vue",
      "type": "registry:component",
      "content": "<script lang=\"ts\">\nimport { defineComponent, h, ref, useId } from 'vue';\nimport { PaginationBar as Contract } from '@oods/components-vue';\nimport { Pagination, PaginationContent, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis } from '@/components/ui/pagination';\n\n// Reuse the shipped Vue prop defaults and event vocabulary; the rendered parts belong to the team.\nexport default defineComponent({\n  name: 'OodsPaginationBarAdapter',\n  inheritAttrs: false,\n  props: Contract.props,\n  emits: Array.isArray(Contract.emits) ? Contract.emits : Object.keys(Contract.emits ?? {}),\n  setup(props: any, { attrs, emit }: any) {\n    const id = `oods-page-${useId()}`, goto = ref('');\n    return () => {\n      const size = Number.isFinite(props.pageSize) && props.pageSize > 0 ? Math.floor(props.pageSize) : 25;\n      const count = Math.max(0, Math.floor(props.totalPages ?? Math.ceil(props.totalItems / size)));\n      const page = count ? Math.max(1, Math.min(Math.floor(props.page), count)) : 1;\n      const go = (value: number) => { const next = Math.max(1, Math.min(Math.floor(value), count)); if (!count || !Number.isFinite(next) || next === page) return; emit('update:page', next); emit('pageChange', next); emit('change', next); emit('update', next); };\n      return h(Pagination, { ...attrs, 'data-oods-component': undefined, page, itemsPerPage: size, total: count * size, 'onUpdate:page': go, class: ['flex flex-wrap items-center gap-3', attrs.class], 'aria-label': attrs['aria-label'] ?? 'Pagination', 'data-oods-adapter': 'PaginationBar' }, { default: () => [\n        props.showItemRange ? h('span', `${props.totalItems} ${props.totalItems === 1 ? 'record' : 'records'}`) : null,\n        props.showItemRange && props.totalItems > 0 && count > 1 ? h('span', `Showing ${(page - 1) * size + 1}–${Math.min(page * size, props.totalItems)} of ${props.totalItems}`) : null,\n        count > 1 ? h(PaginationContent, {}, { default: ({ items }: any) => [h(PaginationPrevious, { 'aria-label': 'Previous page' }), ...items.map((item: any, index: number) => item.type === 'page' ? h(PaginationItem, { key: index, value: item.value, isActive: item.value === page, 'aria-label': `Page ${item.value}` }, { default: () => item.value }) : h(PaginationEllipsis, { key: index })), h(PaginationNext, { 'aria-label': 'Next page' })] }) : null,\n        count > 1 ? h('span', `Page ${page} of ${count}`) : null,\n        props.showPageSizeSelector ? h('label', ['Items per page', h('select', { value: size, onChange: (event: Event) => emit('pageSizeChange', Number((event.target as HTMLSelectElement).value)) }, props.pageSizeOptions.map((value: number) => h('option', { value }, String(value))))]) : null,\n        props.showGotoPage ? h('form', { onSubmit: (event: Event) => { event.preventDefault(); go(Number(goto.value)); } }, [h('label', { for: id }, 'Go to page'), h('input', { id, type: 'number', min: 1, max: Math.max(1, count), value: goto.value, onInput: (event: Event) => { goto.value = (event.target as HTMLInputElement).value; } }), h('button', { type: 'submit' }, 'Go')]) : null,\n      ] });\n    };\n  },\n});\n</script>\n"
    }
  ]
}
