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

@voll/pagination-pager

v5.0.1

Published

{{pagination-pager}} - Ember.js Component for Bootstrap 3 pagination & pager components

Downloads

5

Readme

@voll/pagination-pager (fork of pagination-pager)

Ember Component for Bootstrap 3 Pagination & Pager components

<PaginationPager
  @current={{this.page}}
  @count={{10}}
  @change={{fn (mut this.page)}}
/>

Here's a [demo][1], and these are the original Bootstrap Components: [Pagination][2] and [Pager][3].

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v12 or above

Getting Started

First install the addon.

ember install @voll/pagination-pager

Then use it in your app with <PaginationPager /> with the options in the following section.

Available Options

To switch to the pager UI, set the pager attribute to true, see the optional section.

By default the first page is 1, and the last is the value of count, you can change these by setting firstPage and lastPage.

Required

  • @count -- The number of pages in total, required
  • @current -- The current page number, required

Optional

  • @pager -- Switches to the pager component, defaults to false
  • @urlTemplate -- Url template for supporting opening pages in new windows, defaults to '#'. @urlTemplate should be in the form of http://myurl.com/#/posts?page={current}.
  • @hide -- Hide the component for any reason, defaults to false.
  • @autoHide -- Hide the component if count is <= 1, defaults to true.
  • @disabled -- Disable changing the pages, defaults to false.

Pagination Only

  • @paginationNext -- The text to display for pagination next button
  • @paginationPrevious -- The text to display for pagination previous button
  • @paginationSize -- The size of the element, default is '', available options include lg and sm.
  • @countOut -- The number of page links in the begin and end of whole range
  • @countIn -- The number of page links on each side of current page

Pager Only

  • @pagerNext -- The text to display for the pager next button
  • @pagerPrevious -- The text to display for the pager previous button
  • @pagerFirst -- The text to display for the pager first button (no button is shown if not specified)
  • @pagerLast -- The text to display for the pager last button (no button is shown if not specified)
  • @pagerSpread -- Pager buttons spaced out, defaults to false
<PaginationPager @pager={{true}} @count={{this.count}} @current={{this.current}}>
  <!-- This will show up between the two buttons. -->
  Page {{current}} of {{count}}
</PaginationPager>

Actions

  • @change -- Action that returns currentPage and previousPage, e.g.
<PaginationPager
  @count={{this.count}}
  @current={{this.current}}
  @change={{this.changePage}}
/>
// clicking on '2' after '5'
@action
pageChanged(current, previous) {
  console.log(current, previous);
  // => 2, 5
}

Note: If changed is defined, then current isn't updated automatically, it's your job to update it.

Testing

ember test works just fine, plus ember serve and then visit 'http://localhost:4200/pagination-pager/' to see the dummy app.

Building Demo (Github Pages)

Build by checking out the relevant branch, since the test dummy app is actually the demo app.

Run the following command:

See the Contributing guide for details.

ember github-pages:commit --message <message describing demo release>