npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shk-ng-pagination

v1.0.82

Published

Created by Ahmed Shaikoun to help those wanted a quick and powerful pagination with minimum effort to install and use.

Downloads

4

Readme

ShaikounNgPagination Lib

This package library was created by Ahmed Shaikoun to help those wanted a quick and powerful pagination with minimum effort to install and use.

Release Info

This is a beta release!.

Install It

Type this command to install my pagination:
npm i shk-ng-pagination

How To Use It

  1. import ShkNgPaginationModule from 'shk-ng-pagination'.
  2. insert ShkNgPaginationModule into NgModule imports:[] list.
  3. use it in html like that example:
    <shk-ng-pagination [totalCount]="100" [pageNumber]="1" [pageSize]="5" (pageNumberChanged)="onPageNumberChanged($event)" (totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>
  4. to track every change from pagination in your component import PageValue from 'shk-ng-pagination'.
  5. define a handler for event pageNumberChanged like that:
    onPageNumberChanged(value: PageValue<number>): void {
    console.log(JSON.stringify(value));
    }
  6. define a handler for event totalPagesChanged like that:
    onTotalPagesChanged(value: PageValue<number>): void {
    console.log(JSON.stringify(value));
    }
  7. you can control the count of pages that displayed left and right of selected page using property pagesCountRightLeftSelection where the minimum value is 1 and the maximum value is 7, so if you want to make pagination displayes 7 buttons for 7 pages every time you can supply pagesCountRightLeftSelection property with value 3 like this example:
    <shk-ng-pagination [totalCount]="100" [pageNumber]="1" [pageSize]="5" [pagesCountRightLeftSelection]="3"
    (pageNumberChanged)="onPageNumberChanged($event)" (totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>
    and if you want to make pagination displayes 3 buttons for only 3 pages every time you can supply pagesCountRightLeftSelection property with value 1 like this example:
    <shk-ng-pagination [totalCount]="100" [pageNumber]="1" [pageSize]="5" [pagesCountRightLeftSelection]="1"
    (pageNumberChanged)="onPageNumberChanged($event)" (totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>
  8. Starting from release version 1.0.55 this pagination provides you with full control over displaying page up and page down buttons and the range of page up and down, where the default value of page up and down range is 5 and the buttons of page up and page down is displayed by default, you can control the page up and page down buttons and range like this example:
    <shk-ng-pagination [totalCount]="100"
    [pageNumber]="1"
    [pageSize]="5"
    [usePageUp]="true"
    [usePageDown]="true"
    [pageUpDownRange]="5"
    (pageNumberChanged)="onPageNumberChanged($event)"
    (totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>

Style

Starting from version 1.0.6 it has a default theme which is white theme and starting from version 1.0.8 it has provided with two themes 'white' and 'dark' and you can switch between them like this example:
<shk-ng-pagination [totalCount]="100"
[pageNumber]="1"
[pageSize]="5"
[theme]="'dark'"
(pageNumberChanged)="onPageNumberChanged($event)"
(totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>
Or
<shk-ng-pagination [totalCount]="100"
[pageNumber]="1"
[pageSize]="5"
[theme]="'white'"
(pageNumberChanged)="onPageNumberChanged($event)"
(totalPagesChanged)="onTotalPagesChanged($event)"></shk-ng-pagination>

It do not need a bootstrap to style it.

Road Map

This is just a start, and this pagination is still under development to include more features to this tool like displayed pages options and themes and more.

Contact Me

You can contact me for any issue by sending mail to my email address which is:
[email protected]

Further help

To get more help on the Angular CLI use ng help or go check out the [Angular CLI README] (https://github.com/angular/angular-cli/blob/master/README.md).

Keywords

pagination, shaikoun-ng-pagination, shk-ng-pagination.