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

Paginator: PaginatorTemplateOptions interface elements should be optional (TypeScript) #3503

Closed
ewenjo opened this issue Oct 24, 2022 · 1 comment · Fixed by #3505
Closed
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@ewenjo
Copy link
Contributor

ewenjo commented Oct 24, 2022

Describe the bug

TypeScript complains that all PaginatorTemplateOptions elements are required when they can be optional. The paginator template supports a user to define some of the custom elements by falling back to a default when they are not provided. The PaginatorTemplateOptions interface should reflect this by making the elements optional

interface PaginatorTemplateOptions {

Reproducer

No response

PrimeReact version

8.6.1

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

interface PaginatorTemplateOptions {
    layout: string;
    FirstPageLink?: PaginatorFirstPageLinkType;
    PrevPageLink?: PaginatorPrevPageLinkType;
    PageLinks?: PaginatorPageLinksType;
    NextPageLink?: PaginatorNextPageLinkType;
    LastPageLink?: PaginatorLastPageLinkType;
    RowsPerPageDropdown?: PaginatorRowsPerPageDropdownType;
    CurrentPageReport?: PaginatorCurrentPageReportType;
    JumpToPageInput?: PaginatorJumpToPageInputType;
}
@ewenjo ewenjo added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 24, 2022
@melloware melloware added Typescript Issue or pull request is *only* related to TypeScript definition and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 24, 2022
@melloware melloware added this to the 8.6.2 milestone Oct 24, 2022
melloware added a commit that referenced this issue Oct 24, 2022
…onal (#3505)

Co-authored-by: Ulaş Turan <ulasturan@Ulas-MacBook-Pro.local>
Co-authored-by: Melloware <mellowaredev@gmail.com>
@melloware
Copy link
Member

@ewenjo thanks a lot for the report and the PR!

@mertsincan mertsincan added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants