Skip to content

Commit

Permalink
feat(pagination): address changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leotheluck authored and dpellier committed Feb 2, 2024
1 parent 512c11d commit bab3bdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
const ODS_PAGINATION_PER_PAGE_MIN = 10;
const ODS_PAGINATION_PER_PAGE_MAX = 300;
const ODS_PAGINATION_PER_PAGE_OPTIONS = Object.freeze([ODS_PAGINATION_PER_PAGE_MIN, 25, 50, 100, ODS_PAGINATION_PER_PAGE_MAX]);
type ODS_PAGINATION_PER_PAGE = typeof ODS_PAGINATION_PER_PAGE_OPTIONS[number];

export enum ODS_PAGINATION_PER_PAGE {
MIN = ODS_PAGINATION_PER_PAGE_MIN,
OPTION_25 = 25,
OPTION_50 = 50,
OPTION_100 = 100,
MAX = ODS_PAGINATION_PER_PAGE_MAX
}

export {
ODS_PAGINATION_PER_PAGE_MAX,
ODS_PAGINATION_PER_PAGE_MIN,
ODS_PAGINATION_PER_PAGE_OPTIONS,
};

export type {
ODS_PAGINATION_PER_PAGE,
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class OsdsPagination implements OdsPaginationAttribute, OdsPaginationEven
@Prop({ reflect: true }) labelTooltipPrevious: string = DEFAULT_ATTRIBUTE.labelTooltipPrevious;
@Prop({ reflect: true }) labelTooltipNext: string = DEFAULT_ATTRIBUTE.labelTooltipNext;

@State() itemPerPage = this.defaultItemsPerPage ? this.defaultItemsPerPage : ODS_PAGINATION_PER_PAGE_MIN;
@State() itemPerPage = this.defaultItemsPerPage || ODS_PAGINATION_PER_PAGE_MIN;
@State() pageList: OdsPaginationPageList = [];

@Event() odsPaginationChanged!: EventEmitter<OdsPaginationChangedEventDetail>;
Expand Down

0 comments on commit bab3bdd

Please sign in to comment.