Skip to content

Commit

Permalink
refactor: remove pagination component
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed May 24, 2021
1 parent 1a6b0b8 commit 3fbce5a
Show file tree
Hide file tree
Showing 22 changed files with 128 additions and 341 deletions.
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</a>
</p>
<h1 align="center">Angular Paginator</h1>
<p align="center">Pagination for Angular application using Bootstrap-4 template</p>
<p align="center">Pagination for Angular applications</p>
<p align="center">
<a href="https://github.com/sibiraj-s/angular-paginator/actions">
<img alt="Build Status" src="https://github.com/sibiraj-s/angular-paginator/workflows/Tests/badge.svg">
Expand Down Expand Up @@ -44,8 +44,6 @@ import { AngularPaginatorModule } from 'angular-paginator';
})
```

Import [bootstrap-4][Bootstrap4] into your application

Then in HTML

```html
Expand Down Expand Up @@ -73,47 +71,20 @@ angularPaginator pipe accepts
Paginator component accepts

```html
<angular-paginator [boundaryLinks]="false"
[directionLinks]="true"
[maxSize]="5"
<angular-paginator [maxSize]="5"
[rotate]="true"
[boundaryLinkNumbers]="false"
[forceEllipses]="false"
size="sm"
id="ANGULAR_PAGINATOR_DEFAULT"
firstText="First"
previousText="Previous"
nextText="Next"
lastText="Last"
screenReaderFirstText="First"
screenReaderPreviousText="Previous"
screenReaderNextText="Next"
screenReaderLastText="Last"
screenReaderPageText="Page"
screenReaderCurrentPageText="You`re on page"
screenReaderPaginationLabel="Pagination"
className="ANGULAR_PAGINATOR_DEFAULT"
[autoHide]="false"
[disabled]="false"
(pageChange)="currentPage = $event">
</angular-paginator>
```

* **id:** Use unique id when multiple paginations are being used on the same page
* **boundaryLinks:** Whether to display First / Last buttons
* **directionLinks:** Whether to display Previous / Next buttons
* **maxSize:** Limit number for pagination size
* **rotate:** Whether to keep the current page in the middle of the visible ones
* **boundaryLinkNumbers:** Whether to always display the first and last page numbers. If max-size is smaller than the number of pages, then the first and last page numbers are still shown with ellipses in-between as necessary. NOTE: max-size refers to the center of the range. This option may add up to 2 more numbers on each side of the displayed range for the end value and what would be an ellipsis but is replaced by a number because it is sequential
* **forceEllipses:** Also displays ellipses when rotate is true and maxSize is smaller than the number of pages
* **size:** Sets the size of pagination when bootstrap 4 is being used. Can accept only two values either `sm` or `lg`. Check Bootstrap 4 docs for more details.
* **className:** Adds custom class to the pagination element
* **firstText:** Text for First button
* **previousText:** Text for Previous button
* **nextText:** Text for Next button
* **lastText:** Text for Last button
* **autoHide:** Hides the pagination component if items length is less than itemsPerPage
* **disabled:** Disables pagination component

### Demo

Expand All @@ -123,4 +94,3 @@ Demo at stackblitz [angular-paginator](https://angular-paginator.stackblitz.io)
[yarn]: https://yarnpkg.com/lang/en/
[github]: https://sibiraj-s.github.io/
[wiki]: https://github.com/sibiraj-s/angular-paginator/wiki/angular-paginator
[Bootstrap4]: https://github.com/twbs/bootstrap
3 changes: 1 addition & 2 deletions projects/angular-paginator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
],
"peerDependencies": {
"@angular/common": ">=12.0.0",
"@angular/core": ">=12.0.0",
"bootstrap": "^5.0.1"
"@angular/core": ">=12.0.0"
},
"dependencies": {
"tslib": "^2.1.0"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

127 changes: 0 additions & 127 deletions projects/angular-paginator/src/lib/angular-paginator.component.ts

This file was deleted.

10 changes: 4 additions & 6 deletions projects/angular-paginator/src/lib/angular-paginator.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AngularPaginatorComponent } from './angular-paginator.component';

import { AngularPaginatorPipe } from './pipes/angular-paginator.pipe';
import { AngularPaginatorDirective } from './directives/angular-paginator.directive';
import { AngularPaginatorService } from './services/angular-paginator.service';

@NgModule({
imports: [
CommonModule
],
imports: [CommonModule],
providers: [AngularPaginatorService],
declarations: [AngularPaginatorComponent, AngularPaginatorPipe, AngularPaginatorDirective],
exports: [AngularPaginatorComponent, AngularPaginatorPipe]
declarations: [AngularPaginatorPipe, AngularPaginatorDirective],
exports: [AngularPaginatorDirective, AngularPaginatorPipe]
})

export class AngularPaginatorModule { }

0 comments on commit 3fbce5a

Please sign in to comment.