{
  "tag": "ed-pagination",
  "kind": "component",
  "summary": "Pagination allows users to navigate through pages of content and optionally change the page size.",
  "status": "experimental",
  "since": "1.0",
  "docs": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/pagination/",
  "usage": "https://test-apps.eurodata.de/a/eurodata-ui/docs/components/pagination/usage/",
  "playwright": "getByTestId('…')",
  "dependencies": [
    "ed-icon",
    "ed-number-input",
    "ed-option",
    "ed-select"
  ],
  "use": [
    "Moving through a long list or table that has been split across multiple pages",
    "Choosing how many rows a list shows per page, such as 25 or 100, to find a balance between paging and scrolling",
    "Seeing the position in a long result, such as items 51 to 75 of 430, and jumping to a page"
  ],
  "notFor": [
    {
      "when": "A continuously growing feed where position does not matter, such as an activity stream or social timeline",
      "instead": "infinite scroll or a load-more control"
    },
    {
      "when": "A short list that already fits on one screen",
      "instead": "show all items, with no pagination"
    }
  ],
  "rules": [
    {
      "id": "pagination/total-and-position",
      "rule": "Never paginate a dataset without exposing the total and the current position, and never leave users unsure whether more data exists beyond the current page. Showing how many entries exist and which portion is currently visible is mandatory, not optional.",
      "why": "In accounting and payroll, a user who cannot tell that the view is only a slice of the data may act on an incomplete set — with legal and financial consequences.",
      "check": "error"
    },
    {
      "id": "pagination/true-total",
      "rule": "Supply the true total item count, not the current slice's size. The one exception is a server that cannot count its data: pass a negative `total-items` then, and say beside the pager that more exists — \"1–20 of more than 20\", as [Data Grid](https://test-apps.eurodata.de/a/eurodata-ui/docs/components/data-grid) does.",
      "why": "The built-in indicator can only show how much data exists and where the user is if you feed it the full count. With a negative count the pager drops its total-pages indicator and keeps stepping forward; the user still sees that the view is a slice.",
      "check": "warning"
    },
    {
      "id": "pagination/over-infinite-scroll",
      "rule": "Prefer pagination over infinite scroll for task-driven data; infinite scroll suits only goal-less browsing feeds.",
      "why": "Users need their position, the total, and a way back to a record."
    },
    {
      "id": "pagination/entry-counter",
      "rule": "Pair it with a visible entry counter above the table, so users can see data volume and filter state at a glance.",
      "check": "warning"
    },
    {
      "id": "pagination/page-size-choice",
      "rule": "Let users choose how many items appear per page. The built-in page-size selector is on by default; hide it only when one fixed size genuinely serves everyone.",
      "check": "warning"
    },
    {
      "id": "pagination/page-sizes",
      "rule": "Choose a default page size high enough to reduce paging but low enough to keep the page responsive, and never offer page sizes so large that they reintroduce the slow, endless scrolling pagination is meant to prevent.",
      "check": "warning"
    },
    {
      "id": "pagination/consistent-location",
      "rule": "Keep the controls in a consistent, predictable location relative to the data."
    },
    {
      "id": "pagination/with-sort-filter-search",
      "rule": "Pair pagination with sorting, filtering, and search, and never rely on paging as the only way to reach a specific record.",
      "why": "Paging alone is not a way to find a specific record in a large set.",
      "check": "warning"
    }
  ],
  "api": {
    "attributes": [
      {
        "name": "total-items",
        "property": "totalItems",
        "type": "number",
        "default": "0",
        "description": "The total number of items being paginated. Below zero while unknown: the pages then go on without a last one."
      },
      {
        "name": "page",
        "property": "page",
        "type": "number",
        "default": "1",
        "description": "The current page (1-indexed). A page set past the last, or below the first, or that is no whole\nnumber, is brought back within the pages silently."
      },
      {
        "name": "page-size",
        "property": "pageSize",
        "type": "number",
        "default": "50",
        "description": "The number of items per page."
      },
      {
        "name": "page-size-options",
        "property": "pageSizeOptions",
        "type": "number[]",
        "default": "[...defaultPageSizeOptions]",
        "description": "The available page size options for the dropdown."
      },
      {
        "name": "hide-page-size",
        "property": "hidePageSize",
        "type": "boolean",
        "default": "false",
        "description": "Hides the page-size selector section."
      },
      {
        "name": "disabled",
        "property": "disabled",
        "type": "boolean",
        "default": "false",
        "description": "Disables the entire pagination component."
      },
      {
        "name": "dir",
        "property": "dir",
        "type": "string"
      },
      {
        "name": "lang",
        "property": "lang",
        "type": "string"
      }
    ],
    "properties": [
      {
        "name": "totalPages",
        "type": "number",
        "description": "The total number of pages, derived from totalItems and pageSize; -1 while the total is unknown."
      }
    ],
    "methods": [
      {
        "name": "setPageSize",
        "parameters": [
          {
            "name": "size",
            "type": "number | string"
          }
        ],
        "description": "Sets the page size, keeping the first currently visible item in view — which generally means the\npage changes as well.\n\nBoth land in one `ed-page-size-change`, rather than that event plus a separate\n`ed-page-change`: two events for one user action made a consumer that loads on each of them\nfetch twice, the first time for a page it was never on."
      },
      {
        "name": "setPage",
        "parameters": [
          {
            "name": "page",
            "type": "number | string"
          }
        ],
        "description": "Sets the current page"
      }
    ],
    "events": [
      {
        "name": "ed-page-change",
        "react": "onEdPageChange",
        "type": "{ page: number }",
        "description": "Emitted when the user moves to another page. A page brought back within the pages because `page`, `total-items` or `page-size` was set from outside is not reported."
      },
      {
        "name": "ed-page-size-change",
        "react": "onEdPageSizeChange",
        "type": "{ pageSize: number, page: number }",
        "description": "Emitted when the page size changes. Carries the resulting page as well, because a resize keeps the first visible item in view and therefore usually moves the page — one event per user action, so loading on it fetches once."
      }
    ],
    "slots": [],
    "cssProperties": [],
    "parts": [
      {
        "name": "base",
        "description": "The component's base wrapper."
      },
      {
        "name": "page-size-section",
        "description": "The page-size selector section."
      },
      {
        "name": "page-size-section-select",
        "description": "The internal ed-select."
      },
      {
        "name": "page-nav-section",
        "description": "The page navigation section."
      },
      {
        "name": "total-pages",
        "description": "The \"from X\" text. Absent while the total is unknown."
      }
    ],
    "states": []
  },
  "import": "import '@eurodata/eurodata-ui/dist/components/pagination/pagination.js';",
  "react": {
    "component": "EdPagination",
    "import": "import EdPagination from '@eurodata/eurodata-ui/dist/react/pagination/index.js';"
  }
}
