Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table - add paginator #693

Open
3 tasks
daniele-zurico opened this issue Sep 18, 2024 · 0 comments
Open
3 tasks

Table - add paginator #693

daniele-zurico opened this issue Sep 18, 2024 · 0 comments
Milestone

Comments

@daniele-zurico
Copy link
Contributor

daniele-zurico commented Sep 18, 2024

Now that we have available the paginator component will be nice to enhance the table component adding the ability to do pagination if the number of item is big.

the table by default do not have the paginator enabled (false) however if the developer pass an extra attribute paginator then it will be displayed.

Ex:

<Table paginator={ all the props available in the paginator}/>

properties available:

  /**
   * Total pages count
   */
  totalPages: number;
  /**
   * It will set the initial page where the paginator will position at the beginning
   */
  currentPage?: number;
  /**
   * Class name that will apply the style to the current page
   */
  currentPageClassName?: string;
  /**
   * Class name to style the outer container
   */
  paginatorClassName?: string;
  /**
   * Allow to pass a custom component to define the previous button
   */
  previousButton?: JSX.Element | string;
  /**
   * It will allow to style the container of the previous button
   */
  previousButtonClassName?: string;
  /**
   * Allow to pass a custom component to define the next button
   */
  nextButton?: JSX.Element | string;
  /**
   * It will allow to style the container of the next button
   */
  nextButtonClassName?: string;
  /**
   * It will allow to style every single page number
   */
  pageNumbersClassName?: string;
  /**
   * Number of always visible pages before and after the current page.
   * @default 1
   */
  sibilingCount?: number;
  /**
   * Number of always visible pages at the beginning and end.
   * @default 1
   */
  boundaryCount?: number;
  /**
   * Callback function that is triggered when the page changes and returns the updated current page
   */
  onPageChange?: (page: number) => void;

make mandatory only totalPages needed by the paginator component, all the others will be optional.

Enhance:

  • table in the example
  • table in storybook
  • test

Set up:

git checkout release/1.1.0
git pull
git checkout -b 'feature/tableWithPaginator'
@daniele-zurico daniele-zurico added this to the 1.1.0 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant