ng2-pagination
Advanced tools
Comparing version 0.0.1-beta.2 to 0.0.1-beta.3
@@ -0,1 +1,7 @@ | ||
# 0.0.1-beta.3 (2016-03-24) | ||
* Fixed PaginationControlsCmp.outOfBoundCorrection() to prevent it returning `0` when the collection is empty ([f7f9bd9](https://github.com/michaelbromley/ng2-pagination/commit/f7f9bd98544a29cfad02d4a368ac32327d62c6c5)). | ||
* Added System.register bundle build (`dist/ng2-pagination-bundle.js`) | ||
# 0.0.1-beta.2 (2016-02-29) | ||
@@ -2,0 +8,0 @@ |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var paginate_pipe_1 = require('./paginate-pipe'); | ||
@@ -2,0 +3,0 @@ exports.PaginatePipe = paginate_pipe_1.PaginatePipe; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -109,3 +110,2 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
state.end === end; | ||
state.end === end; | ||
}; | ||
@@ -120,3 +120,3 @@ PaginatePipe = __decorate([ | ||
return PaginatePipe; | ||
})(); | ||
}()); | ||
exports.PaginatePipe = PaginatePipe; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
@@ -109,3 +110,3 @@ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
var totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage); | ||
if (totalPages < instance.currentPage) { | ||
if (totalPages < instance.currentPage && 0 < totalPages) { | ||
return totalPages; | ||
@@ -211,3 +212,3 @@ } | ||
return PaginationControlsCmp; | ||
})(); | ||
}()); | ||
exports.PaginationControlsCmp = PaginationControlsCmp; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var core_1 = require('angular2/core'); | ||
@@ -105,3 +106,3 @@ var PaginationService = (function () { | ||
return PaginationService; | ||
})(); | ||
}()); | ||
exports.PaginationService = PaginationService; |
@@ -5,3 +5,4 @@ /** | ||
*/ | ||
"use strict"; | ||
exports.DEFAULT_TEMPLATE = "\n <div #template>\n <ng-content></ng-content>\n </div>\n <ul class=\"pagination\" role=\"navigation\" aria-label=\"Pagination\" *ngIf=\"!hasTemplate\">\n\n <li class=\"pagination-previous\" [class.disabled]=\"isFirstPage()\" *ngIf=\"directionLinks\">\n <a *ngIf=\"1 < getCurrent()\" (click)=\"previous()\" aria-label=\"Next page\">\n Previous <span class=\"show-for-sr\">page</span>\n </a>\n <span *ngIf=\"isFirstPage()\">Previous <span class=\"show-for-sr\">page</span></span>\n </li>\n\n <li [class.current]=\"getCurrent() === page.value\" *ngFor=\"#page of pages\">\n <a (click)=\"setCurrent(page.value)\" *ngIf=\"getCurrent() !== page.value\">\n <span class=\"show-for-sr\">Page</span>\n <span>{{ page.label }}</span>\n </a>\n <div *ngIf=\"getCurrent() === page.value\">\n <span class=\"show-for-sr\">You're on page</span>\n <span>{{ page.label }}</span>\n </div>\n </li>\n\n <li class=\"pagination-next\" [class.disabled]=\"isLastPage()\" *ngIf=\"directionLinks\">\n <a *ngIf=\"!isLastPage()\" (click)=\"next()\" aria-label=\"Next page\">\n Next <span class=\"show-for-sr\">page</span>\n </a>\n <span *ngIf=\"isLastPage()\">Next <span class=\"show-for-sr\">page</span></span>\n </li>\n\n </ul>\n "; | ||
exports.DEFAULT_STYLES = "\n.pagination {\n margin-left: 0;\n margin-bottom: 1rem; }\n .pagination::before, .pagination::after {\n content: ' ';\n display: table; }\n .pagination::after {\n clear: both; }\n .pagination li {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n font-size: 0.875rem;\n margin-right: 0.0625rem;\n border-radius: 0;\n display: none; }\n .pagination li:last-child, .pagination li:first-child {\n display: inline-block; }\n @media screen and (min-width: 40em) {\n .pagination li {\n display: inline-block; } }\n .pagination a,\n .pagination button {\n color: #0a0a0a;\n display: block;\n padding: 0.1875rem 0.625rem;\n border-radius: 0; }\n .pagination a:hover,\n .pagination button:hover {\n background: #e6e6e6; }\n .pagination .current {\n padding: 0.1875rem 0.625rem;\n background: #2199e8;\n color: #fefefe;\n cursor: default; }\n .pagination .disabled {\n padding: 0.1875rem 0.625rem;\n color: #cacaca;\n cursor: default; }\n .pagination .disabled:hover {\n background: transparent; }\n .pagination .ellipsis::after {\n content: '\u2026';\n padding: 0.1875rem 0.625rem;\n color: #0a0a0a; }\n\n.pagination-previous a::before,\n.pagination-previous.disabled::before {\n content: '\u00AB';\n display: inline-block;\n margin-right: 0.5rem; }\n\n.pagination-next a::after,\n.pagination-next.disabled::after {\n content: '\u00BB';\n display: inline-block;\n margin-left: 0.5rem; }\n\n.pagination .show-for-sr {\n position: absolute !important;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0); }"; |
{ | ||
"name": "ng2-pagination", | ||
"version": "0.0.1-beta.2", | ||
"version": "0.0.1-beta.3", | ||
"description": "Pagination for Angular2", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "node node_modules/typescript/bin/tsc", | ||
"build:system": "node node_modules/typescript/bin/tsc -p tsconfig.system.json", | ||
"build:cjs": "node node_modules/typescript/bin/tsc", | ||
"build": "npm run build:cjs && npm run build:system", | ||
"test": "karma start karma.conf.js", | ||
@@ -32,6 +34,6 @@ "demo:watch": "webpack --progress --colors --watch", | ||
"devDependencies": { | ||
"angular2": "^2.0.0-beta.6", | ||
"angular2": "^2.0.0-beta.12", | ||
"bulma": "^0.0.14", | ||
"es6-promise": "^3.0.2", | ||
"es6-shim": "^0.33.13", | ||
"es6-shim": "^0.35.0", | ||
"highlight.js": "^9.1.0", | ||
@@ -45,10 +47,10 @@ "html-loader": "^0.4.3", | ||
"reflect-metadata": "^0.1.2", | ||
"rxjs": "^5.0.0-beta.0", | ||
"rxjs": "5.0.0-beta.2", | ||
"sass-loader": "^3.1.2", | ||
"ts-loader": "^0.7.2", | ||
"typescript": "^1.7.3", | ||
"typescript": "^1.8.0", | ||
"webpack": "^1.12.9", | ||
"zone.js": "0.5.14" | ||
"zone.js": "0.6.6" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -11,5 +11,7 @@ # Angular2 Pagination | ||
Play with it on Plunker here: http://plnkr.co/edit/JVQMPvV8z2brCIzdG3N4?p=preview | ||
## Quick Start | ||
Requirements: TypeScript 1.6+ (for TS builds), tested with Angular 2.0.0-beta.6+ | ||
Requirements: TypeScript 1.6+ (for TS builds), tested with Angular 2.0.0-beta.12+ | ||
@@ -20,4 +22,12 @@ ``` | ||
**Note** that currently this module only supports commonjs. | ||
### CommonJS | ||
ng2-pagination ships as un-bundled CommonJS modules (located in the `dist` folder), which can be imported with | ||
`require('ng2-pagination');`, or `import` for those environments that support this method (e.g. TypeScript 1.6+). | ||
### System.register | ||
ng2-pagination also ships with a bundle in the system format (`dist/ng2-pagination-bundle.js`), suitable for use with the [es6-module-loader](https://github.com/ModuleLoader/es6-module-loader) | ||
and related loaders such as SystemJS. See the [demo Plunker](http://plnkr.co/edit/JVQMPvV8z2brCIzdG3N4?p=preview) for an example of this. | ||
## Simple Example | ||
@@ -34,3 +44,3 @@ | ||
<li *ngFor="#item of collection | paginate: { itemsPerPage: 10, currentPage: p }"> ... </li> | ||
<ul> | ||
</ul> | ||
@@ -37,0 +47,0 @@ <pagination-controls (pageChange)="p = $event"></pagination-controls> |
65493
16
1156
203