├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── angular.json ├── package-lock.json ├── package.json ├── projects └── jw-pagination │ ├── README.md │ ├── karma.conf.js │ ├── ng-package.json │ ├── node_modules │ ├── jw-paginate │ │ ├── LICENSE │ │ ├── README.md │ │ ├── lib │ │ │ ├── jw-paginate.d.ts │ │ │ └── jw-paginate.js │ │ ├── package.json │ │ └── tsconfig.json │ └── tslib │ │ ├── CopyrightNotice.txt │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── package.json │ │ ├── tslib.d.ts │ │ ├── tslib.es6.html │ │ ├── tslib.es6.js │ │ ├── tslib.html │ │ └── tslib.js │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── lib │ │ ├── jw-pagination.component.ts │ │ └── jw-pagination.module.ts │ ├── public-api.ts │ └── test.ts │ ├── tsconfig.lib.json │ ├── tsconfig.lib.prod.json │ ├── tsconfig.spec.json │ └── tslint.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Jason Watmore 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jw-angular-pagination 2 | 3 | Angular Pagination Component 4 | 5 | Usage instructions available at https://jasonwatmore.com/post/2018/04/26/npm-jw-angular-pagination-component -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "jw-pagination": { 7 | "projectType": "library", 8 | "root": "projects/jw-pagination", 9 | "sourceRoot": "projects/jw-pagination/src", 10 | "prefix": "lib", 11 | "architect": { 12 | "build": { 13 | "builder": "@angular-devkit/build-ng-packagr:build", 14 | "options": { 15 | "tsConfig": "projects/jw-pagination/tsconfig.lib.json", 16 | "project": "projects/jw-pagination/ng-package.json" 17 | }, 18 | "configurations": { 19 | "production": { 20 | "tsConfig": "projects/jw-pagination/tsconfig.lib.prod.json" 21 | } 22 | } 23 | }, 24 | "test": { 25 | "builder": "@angular-devkit/build-angular:karma", 26 | "options": { 27 | "main": "projects/jw-pagination/src/test.ts", 28 | "tsConfig": "projects/jw-pagination/tsconfig.spec.json", 29 | "karmaConfig": "projects/jw-pagination/karma.conf.js" 30 | } 31 | }, 32 | "lint": { 33 | "builder": "@angular-devkit/build-angular:tslint", 34 | "options": { 35 | "tsConfig": [ 36 | "projects/jw-pagination/tsconfig.lib.json", 37 | "projects/jw-pagination/tsconfig.spec.json" 38 | ], 39 | "exclude": [ 40 | "**/node_modules/**" 41 | ] 42 | } 43 | } 44 | } 45 | }}, 46 | "defaultProject": "jw-pagination" 47 | } 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jw-angular-pagination", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~9.1.1", 15 | "@angular/common": "~9.1.1", 16 | "@angular/compiler": "~9.1.1", 17 | "@angular/core": "~9.1.1", 18 | "@angular/forms": "~9.1.1", 19 | "@angular/platform-browser": "~9.1.1", 20 | "@angular/platform-browser-dynamic": "~9.1.1", 21 | "@angular/router": "~9.1.1", 22 | "rxjs": "~6.5.4", 23 | "tslib": "^1.10.0", 24 | "zone.js": "~0.10.2" 25 | }, 26 | "devDependencies": { 27 | "@angular-devkit/build-angular": "~0.901.8", 28 | "@angular-devkit/build-ng-packagr": "~0.901.8", 29 | "@angular/cli": "~9.1.1", 30 | "@angular/compiler-cli": "~9.1.1", 31 | "@angular/language-service": "~9.1.1", 32 | "@types/node": "^12.11.1", 33 | "@types/jasmine": "~3.5.0", 34 | "@types/jasminewd2": "~2.0.3", 35 | "codelyzer": "^5.1.2", 36 | "jasmine-core": "~3.5.0", 37 | "jasmine-spec-reporter": "~4.2.1", 38 | "karma": "~4.4.1", 39 | "karma-chrome-launcher": "~3.1.0", 40 | "karma-coverage-istanbul-reporter": "~2.1.0", 41 | "karma-jasmine": "~3.0.1", 42 | "karma-jasmine-html-reporter": "^1.4.2", 43 | "ng-packagr": "^9.0.0", 44 | "protractor": "~5.4.3", 45 | "ts-node": "~8.3.0", 46 | "tslint": "~6.1.0", 47 | "typescript": "~3.8.3" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /projects/jw-pagination/README.md: -------------------------------------------------------------------------------- 1 | # jw-angular-pagination 2 | 3 | Angular Pagination Component 4 | 5 | Usage instructions available at https://jasonwatmore.com/post/2018/04/26/npm-jw-angular-pagination-component -------------------------------------------------------------------------------- /projects/jw-pagination/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/jw-pagination'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /projects/jw-pagination/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/jw-pagination", 4 | "whitelistedNonPeerDependencies": [ 5 | "jw-paginate" 6 | ], 7 | "lib": { 8 | "entryFile": "src/public-api.ts", 9 | "umdModuleIds": { 10 | "jw-paginate": "paginate" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Jason Watmore 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/README.md: -------------------------------------------------------------------------------- 1 | # jw-paginate 2 | 3 | Pure Pagination Logic in JavaScript / TypeScript 4 | 5 | For documentation check out http://jasonwatmore.com/post/2018/08/07/javascript-pure-pagination-logic-in-vanilla-js-typescript 6 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/lib/jw-paginate.d.ts: -------------------------------------------------------------------------------- 1 | declare function paginate(totalItems: number, currentPage?: number, pageSize?: number, maxPages?: number): { 2 | totalItems: number; 3 | currentPage: number; 4 | pageSize: number; 5 | totalPages: number; 6 | startPage: number; 7 | endPage: number; 8 | startIndex: number; 9 | endIndex: number; 10 | pages: number[]; 11 | }; 12 | export = paginate; 13 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/lib/jw-paginate.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | function paginate(totalItems, currentPage, pageSize, maxPages) { 3 | if (currentPage === void 0) { currentPage = 1; } 4 | if (pageSize === void 0) { pageSize = 10; } 5 | if (maxPages === void 0) { maxPages = 10; } 6 | // calculate total pages 7 | var totalPages = Math.ceil(totalItems / pageSize); 8 | // ensure current page isn't out of range 9 | if (currentPage < 1) { 10 | currentPage = 1; 11 | } 12 | else if (currentPage > totalPages) { 13 | currentPage = totalPages; 14 | } 15 | var startPage, endPage; 16 | if (totalPages <= maxPages) { 17 | // total pages less than max so show all pages 18 | startPage = 1; 19 | endPage = totalPages; 20 | } 21 | else { 22 | // total pages more than max so calculate start and end pages 23 | var maxPagesBeforeCurrentPage = Math.floor(maxPages / 2); 24 | var maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1; 25 | if (currentPage <= maxPagesBeforeCurrentPage) { 26 | // current page near the start 27 | startPage = 1; 28 | endPage = maxPages; 29 | } 30 | else if (currentPage + maxPagesAfterCurrentPage >= totalPages) { 31 | // current page near the end 32 | startPage = totalPages - maxPages + 1; 33 | endPage = totalPages; 34 | } 35 | else { 36 | // current page somewhere in the middle 37 | startPage = currentPage - maxPagesBeforeCurrentPage; 38 | endPage = currentPage + maxPagesAfterCurrentPage; 39 | } 40 | } 41 | // calculate start and end item indexes 42 | var startIndex = (currentPage - 1) * pageSize; 43 | var endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1); 44 | // create an array of pages to ng-repeat in the pager control 45 | var pages = Array.from(Array((endPage + 1) - startPage).keys()).map(function (i) { return startPage + i; }); 46 | // return object with all pager properties required by the view 47 | return { 48 | totalItems: totalItems, 49 | currentPage: currentPage, 50 | pageSize: pageSize, 51 | totalPages: totalPages, 52 | startPage: startPage, 53 | endPage: endPage, 54 | startIndex: startIndex, 55 | endIndex: endIndex, 56 | pages: pages 57 | }; 58 | } 59 | module.exports = paginate; 60 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "jw-paginate@1.0.4", 5 | "/Users/jwatmore/Projects/personal/jw-angular-pagination/projects/jw-pagination" 6 | ] 7 | ], 8 | "_from": "jw-paginate@1.0.4", 9 | "_id": "jw-paginate@1.0.4", 10 | "_inBundle": false, 11 | "_integrity": "sha512-W0bv782exgCoynUL/egbRpaYwf/r6T6e02H870H5u3hfSgEYrxgz5POwmFF5aApS6iPi6yhZ0VF8IbafNFsntA==", 12 | "_location": "/jw-paginate", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "jw-paginate@1.0.4", 18 | "name": "jw-paginate", 19 | "escapedName": "jw-paginate", 20 | "rawSpec": "1.0.4", 21 | "saveSpec": null, 22 | "fetchSpec": "1.0.4" 23 | }, 24 | "_requiredBy": [ 25 | "/" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/jw-paginate/-/jw-paginate-1.0.4.tgz", 28 | "_spec": "1.0.4", 29 | "_where": "/Users/jwatmore/Projects/personal/jw-angular-pagination/projects/jw-pagination", 30 | "bugs": { 31 | "url": "https://github.com/cornflourblue/jw-paginate/issues" 32 | }, 33 | "description": "Pure Pagination Logic in JavaScript / TypeScript", 34 | "devDependencies": { 35 | "typescript": "^2.8.3" 36 | }, 37 | "homepage": "http://jasonwatmore.com/post/2018/08/07/javascript-pure-pagination-logic-in-vanilla-js-typescript", 38 | "license": "MIT", 39 | "main": "./lib/jw-paginate.js", 40 | "name": "jw-paginate", 41 | "repository": { 42 | "type": "git", 43 | "url": "git+https://github.com/cornflourblue/jw-paginate.git" 44 | }, 45 | "scripts": { 46 | "build": "tsc", 47 | "demo": "node ./demo/index.js" 48 | }, 49 | "types": "./lib/jw-paginate.d.ts", 50 | "version": "1.0.4" 51 | } 52 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/jw-paginate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "lib": [ "es2015", "dom" ], 5 | "outDir": "lib", 6 | "target": "es5" 7 | }, 8 | "files": [ 9 | "src/jw-paginate.ts" 10 | ] 11 | } -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/CopyrightNotice.txt: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13 | PERFORMANCE OF THIS SOFTWARE. 14 | ***************************************************************************** */ 15 | 16 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted. 5 | 6 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 7 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 8 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 9 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 10 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 11 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 12 | PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/README.md: -------------------------------------------------------------------------------- 1 | # tslib 2 | 3 | This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions. 4 | 5 | This library is primarily used by the `--importHelpers` flag in TypeScript. 6 | When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file: 7 | 8 | ```ts 9 | var __assign = (this && this.__assign) || Object.assign || function(t) { 10 | for (var s, i = 1, n = arguments.length; i < n; i++) { 11 | s = arguments[i]; 12 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 13 | t[p] = s[p]; 14 | } 15 | return t; 16 | }; 17 | exports.x = {}; 18 | exports.y = __assign({}, exports.x); 19 | 20 | ``` 21 | 22 | will instead be emitted as something like the following: 23 | 24 | ```ts 25 | var tslib_1 = require("tslib"); 26 | exports.x = {}; 27 | exports.y = tslib_1.__assign({}, exports.x); 28 | ``` 29 | 30 | Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead. 31 | For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`. 32 | 33 | # Installing 34 | 35 | For the latest stable version, run: 36 | 37 | ## npm 38 | 39 | ```sh 40 | # TypeScript 2.3.3 or later 41 | npm install --save tslib 42 | 43 | # TypeScript 2.3.2 or earlier 44 | npm install --save tslib@1.6.1 45 | ``` 46 | 47 | ## yarn 48 | 49 | ```sh 50 | # TypeScript 2.3.3 or later 51 | yarn add tslib 52 | 53 | # TypeScript 2.3.2 or earlier 54 | yarn add tslib@1.6.1 55 | ``` 56 | 57 | ## bower 58 | 59 | ```sh 60 | # TypeScript 2.3.3 or later 61 | bower install tslib 62 | 63 | # TypeScript 2.3.2 or earlier 64 | bower install tslib@1.6.1 65 | ``` 66 | 67 | ## JSPM 68 | 69 | ```sh 70 | # TypeScript 2.3.3 or later 71 | jspm install tslib 72 | 73 | # TypeScript 2.3.2 or earlier 74 | jspm install tslib@1.6.1 75 | ``` 76 | 77 | # Usage 78 | 79 | Set the `importHelpers` compiler option on the command line: 80 | 81 | ``` 82 | tsc --importHelpers file.ts 83 | ``` 84 | 85 | or in your tsconfig.json: 86 | 87 | ```json 88 | { 89 | "compilerOptions": { 90 | "importHelpers": true 91 | } 92 | } 93 | ``` 94 | 95 | #### For bower and JSPM users 96 | 97 | You will need to add a `paths` mapping for `tslib`, e.g. For Bower users: 98 | 99 | ```json 100 | { 101 | "compilerOptions": { 102 | "module": "amd", 103 | "importHelpers": true, 104 | "baseUrl": "./", 105 | "paths": { 106 | "tslib" : ["bower_components/tslib/tslib.d.ts"] 107 | } 108 | } 109 | } 110 | ``` 111 | 112 | For JSPM users: 113 | 114 | ```json 115 | { 116 | "compilerOptions": { 117 | "module": "system", 118 | "importHelpers": true, 119 | "baseUrl": "./", 120 | "paths": { 121 | "tslib" : ["jspm_packages/npm/tslib@1.13.0/tslib.d.ts"] 122 | } 123 | } 124 | } 125 | ``` 126 | 127 | 128 | # Contribute 129 | 130 | There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. 131 | 132 | * [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. 133 | * Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). 134 | * Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). 135 | * Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. 136 | * [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). 137 | 138 | # Documentation 139 | 140 | * [Quick tutorial](http://www.typescriptlang.org/Tutorial) 141 | * [Programming handbook](http://www.typescriptlang.org/Handbook) 142 | * [Homepage](http://www.typescriptlang.org/) 143 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_args": [ 3 | [ 4 | "tslib@1.13.0", 5 | "/Users/jwatmore/Projects/personal/jw-angular-pagination/projects/jw-pagination" 6 | ] 7 | ], 8 | "_from": "tslib@1.13.0", 9 | "_id": "tslib@1.13.0", 10 | "_inBundle": false, 11 | "_integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", 12 | "_location": "/tslib", 13 | "_phantomChildren": {}, 14 | "_requested": { 15 | "type": "version", 16 | "registry": true, 17 | "raw": "tslib@1.13.0", 18 | "name": "tslib", 19 | "escapedName": "tslib", 20 | "rawSpec": "1.13.0", 21 | "saveSpec": null, 22 | "fetchSpec": "1.13.0" 23 | }, 24 | "_requiredBy": [ 25 | "/" 26 | ], 27 | "_resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 28 | "_spec": "1.13.0", 29 | "_where": "/Users/jwatmore/Projects/personal/jw-angular-pagination/projects/jw-pagination", 30 | "author": { 31 | "name": "Microsoft Corp." 32 | }, 33 | "bugs": { 34 | "url": "https://github.com/Microsoft/TypeScript/issues" 35 | }, 36 | "description": "Runtime library for TypeScript helper functions", 37 | "homepage": "https://www.typescriptlang.org/", 38 | "jsnext:main": "tslib.es6.js", 39 | "keywords": [ 40 | "TypeScript", 41 | "Microsoft", 42 | "compiler", 43 | "language", 44 | "javascript", 45 | "tslib", 46 | "runtime" 47 | ], 48 | "license": "0BSD", 49 | "main": "tslib.js", 50 | "module": "tslib.es6.js", 51 | "name": "tslib", 52 | "repository": { 53 | "type": "git", 54 | "url": "git+https://github.com/Microsoft/tslib.git" 55 | }, 56 | "sideEffects": false, 57 | "typings": "tslib.d.ts", 58 | "version": "1.13.0" 59 | } 60 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/tslib.d.ts: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13 | PERFORMANCE OF THIS SOFTWARE. 14 | ***************************************************************************** */ 15 | export declare function __extends(d: Function, b: Function): void; 16 | export declare function __assign(t: any, ...sources: any[]): any; 17 | export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; 18 | export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; 19 | export declare function __param(paramIndex: number, decorator: Function): Function; 20 | export declare function __metadata(metadataKey: any, metadataValue: any): Function; 21 | export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; 22 | export declare function __generator(thisArg: any, body: Function): any; 23 | export declare function __exportStar(m: any, exports: any): void; 24 | export declare function __values(o: any): any; 25 | export declare function __read(o: any, n?: number): any[]; 26 | export declare function __spread(...args: any[][]): any[]; 27 | export declare function __spreadArrays(...args: any[][]): any[]; 28 | export declare function __await(v: any): any; 29 | export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any; 30 | export declare function __asyncDelegator(o: any): any; 31 | export declare function __asyncValues(o: any): any; 32 | export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray; 33 | export declare function __importStar(mod: T): T; 34 | export declare function __importDefault(mod: T): T | { default: T }; 35 | export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; 36 | export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; 37 | export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/tslib.es6.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/tslib.es6.js: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13 | PERFORMANCE OF THIS SOFTWARE. 14 | ***************************************************************************** */ 15 | /* global Reflect, Promise */ 16 | 17 | var extendStatics = function(d, b) { 18 | extendStatics = Object.setPrototypeOf || 19 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 20 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 21 | return extendStatics(d, b); 22 | }; 23 | 24 | export function __extends(d, b) { 25 | extendStatics(d, b); 26 | function __() { this.constructor = d; } 27 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 28 | } 29 | 30 | export var __assign = function() { 31 | __assign = Object.assign || function __assign(t) { 32 | for (var s, i = 1, n = arguments.length; i < n; i++) { 33 | s = arguments[i]; 34 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 35 | } 36 | return t; 37 | } 38 | return __assign.apply(this, arguments); 39 | } 40 | 41 | export function __rest(s, e) { 42 | var t = {}; 43 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 44 | t[p] = s[p]; 45 | if (s != null && typeof Object.getOwnPropertySymbols === "function") 46 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 47 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 48 | t[p[i]] = s[p[i]]; 49 | } 50 | return t; 51 | } 52 | 53 | export function __decorate(decorators, target, key, desc) { 54 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 55 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 56 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 57 | return c > 3 && r && Object.defineProperty(target, key, r), r; 58 | } 59 | 60 | export function __param(paramIndex, decorator) { 61 | return function (target, key) { decorator(target, key, paramIndex); } 62 | } 63 | 64 | export function __metadata(metadataKey, metadataValue) { 65 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 66 | } 67 | 68 | export function __awaiter(thisArg, _arguments, P, generator) { 69 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 70 | return new (P || (P = Promise))(function (resolve, reject) { 71 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 72 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 73 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 74 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 75 | }); 76 | } 77 | 78 | export function __generator(thisArg, body) { 79 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 80 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 81 | function verb(n) { return function (v) { return step([n, v]); }; } 82 | function step(op) { 83 | if (f) throw new TypeError("Generator is already executing."); 84 | while (_) try { 85 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 86 | if (y = 0, t) op = [op[0] & 2, t.value]; 87 | switch (op[0]) { 88 | case 0: case 1: t = op; break; 89 | case 4: _.label++; return { value: op[1], done: false }; 90 | case 5: _.label++; y = op[1]; op = [0]; continue; 91 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 92 | default: 93 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 94 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 95 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 96 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 97 | if (t[2]) _.ops.pop(); 98 | _.trys.pop(); continue; 99 | } 100 | op = body.call(thisArg, _); 101 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 102 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 103 | } 104 | } 105 | 106 | export function __createBinding(o, m, k, k2) { 107 | if (k2 === undefined) k2 = k; 108 | o[k2] = m[k]; 109 | } 110 | 111 | export function __exportStar(m, exports) { 112 | for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; 113 | } 114 | 115 | export function __values(o) { 116 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 117 | if (m) return m.call(o); 118 | if (o && typeof o.length === "number") return { 119 | next: function () { 120 | if (o && i >= o.length) o = void 0; 121 | return { value: o && o[i++], done: !o }; 122 | } 123 | }; 124 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 125 | } 126 | 127 | export function __read(o, n) { 128 | var m = typeof Symbol === "function" && o[Symbol.iterator]; 129 | if (!m) return o; 130 | var i = m.call(o), r, ar = [], e; 131 | try { 132 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 133 | } 134 | catch (error) { e = { error: error }; } 135 | finally { 136 | try { 137 | if (r && !r.done && (m = i["return"])) m.call(i); 138 | } 139 | finally { if (e) throw e.error; } 140 | } 141 | return ar; 142 | } 143 | 144 | export function __spread() { 145 | for (var ar = [], i = 0; i < arguments.length; i++) 146 | ar = ar.concat(__read(arguments[i])); 147 | return ar; 148 | } 149 | 150 | export function __spreadArrays() { 151 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 152 | for (var r = Array(s), k = 0, i = 0; i < il; i++) 153 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 154 | r[k] = a[j]; 155 | return r; 156 | }; 157 | 158 | export function __await(v) { 159 | return this instanceof __await ? (this.v = v, this) : new __await(v); 160 | } 161 | 162 | export function __asyncGenerator(thisArg, _arguments, generator) { 163 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 164 | var g = generator.apply(thisArg, _arguments || []), i, q = []; 165 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 166 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 167 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 168 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 169 | function fulfill(value) { resume("next", value); } 170 | function reject(value) { resume("throw", value); } 171 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 172 | } 173 | 174 | export function __asyncDelegator(o) { 175 | var i, p; 176 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 177 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 178 | } 179 | 180 | export function __asyncValues(o) { 181 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 182 | var m = o[Symbol.asyncIterator], i; 183 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 184 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 185 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 186 | } 187 | 188 | export function __makeTemplateObject(cooked, raw) { 189 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 190 | return cooked; 191 | }; 192 | 193 | export function __importStar(mod) { 194 | if (mod && mod.__esModule) return mod; 195 | var result = {}; 196 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 197 | result.default = mod; 198 | return result; 199 | } 200 | 201 | export function __importDefault(mod) { 202 | return (mod && mod.__esModule) ? mod : { default: mod }; 203 | } 204 | 205 | export function __classPrivateFieldGet(receiver, privateMap) { 206 | if (!privateMap.has(receiver)) { 207 | throw new TypeError("attempted to get private field on non-instance"); 208 | } 209 | return privateMap.get(receiver); 210 | } 211 | 212 | export function __classPrivateFieldSet(receiver, privateMap, value) { 213 | if (!privateMap.has(receiver)) { 214 | throw new TypeError("attempted to set private field on non-instance"); 215 | } 216 | privateMap.set(receiver, value); 217 | return value; 218 | } 219 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/tslib.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/jw-pagination/node_modules/tslib/tslib.js: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13 | PERFORMANCE OF THIS SOFTWARE. 14 | ***************************************************************************** */ 15 | 16 | /* global global, define, System, Reflect, Promise */ 17 | var __extends; 18 | var __assign; 19 | var __rest; 20 | var __decorate; 21 | var __param; 22 | var __metadata; 23 | var __awaiter; 24 | var __generator; 25 | var __exportStar; 26 | var __values; 27 | var __read; 28 | var __spread; 29 | var __spreadArrays; 30 | var __await; 31 | var __asyncGenerator; 32 | var __asyncDelegator; 33 | var __asyncValues; 34 | var __makeTemplateObject; 35 | var __importStar; 36 | var __importDefault; 37 | var __classPrivateFieldGet; 38 | var __classPrivateFieldSet; 39 | var __createBinding; 40 | (function (factory) { 41 | var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; 42 | if (typeof define === "function" && define.amd) { 43 | define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); 44 | } 45 | else if (typeof module === "object" && typeof module.exports === "object") { 46 | factory(createExporter(root, createExporter(module.exports))); 47 | } 48 | else { 49 | factory(createExporter(root)); 50 | } 51 | function createExporter(exports, previous) { 52 | if (exports !== root) { 53 | if (typeof Object.create === "function") { 54 | Object.defineProperty(exports, "__esModule", { value: true }); 55 | } 56 | else { 57 | exports.__esModule = true; 58 | } 59 | } 60 | return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; 61 | } 62 | }) 63 | (function (exporter) { 64 | var extendStatics = Object.setPrototypeOf || 65 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 66 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 67 | 68 | __extends = function (d, b) { 69 | extendStatics(d, b); 70 | function __() { this.constructor = d; } 71 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 72 | }; 73 | 74 | __assign = Object.assign || function (t) { 75 | for (var s, i = 1, n = arguments.length; i < n; i++) { 76 | s = arguments[i]; 77 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 78 | } 79 | return t; 80 | }; 81 | 82 | __rest = function (s, e) { 83 | var t = {}; 84 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 85 | t[p] = s[p]; 86 | if (s != null && typeof Object.getOwnPropertySymbols === "function") 87 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 88 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 89 | t[p[i]] = s[p[i]]; 90 | } 91 | return t; 92 | }; 93 | 94 | __decorate = function (decorators, target, key, desc) { 95 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 96 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 97 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 98 | return c > 3 && r && Object.defineProperty(target, key, r), r; 99 | }; 100 | 101 | __param = function (paramIndex, decorator) { 102 | return function (target, key) { decorator(target, key, paramIndex); } 103 | }; 104 | 105 | __metadata = function (metadataKey, metadataValue) { 106 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 107 | }; 108 | 109 | __awaiter = function (thisArg, _arguments, P, generator) { 110 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 111 | return new (P || (P = Promise))(function (resolve, reject) { 112 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 113 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 114 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 115 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 116 | }); 117 | }; 118 | 119 | __generator = function (thisArg, body) { 120 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 121 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 122 | function verb(n) { return function (v) { return step([n, v]); }; } 123 | function step(op) { 124 | if (f) throw new TypeError("Generator is already executing."); 125 | while (_) try { 126 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 127 | if (y = 0, t) op = [op[0] & 2, t.value]; 128 | switch (op[0]) { 129 | case 0: case 1: t = op; break; 130 | case 4: _.label++; return { value: op[1], done: false }; 131 | case 5: _.label++; y = op[1]; op = [0]; continue; 132 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 133 | default: 134 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 135 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 136 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 137 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 138 | if (t[2]) _.ops.pop(); 139 | _.trys.pop(); continue; 140 | } 141 | op = body.call(thisArg, _); 142 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 143 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 144 | } 145 | }; 146 | 147 | __createBinding = function(o, m, k, k2) { 148 | if (k2 === undefined) k2 = k; 149 | o[k2] = m[k]; 150 | }; 151 | 152 | __exportStar = function (m, exports) { 153 | for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; 154 | }; 155 | 156 | __values = function (o) { 157 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 158 | if (m) return m.call(o); 159 | if (o && typeof o.length === "number") return { 160 | next: function () { 161 | if (o && i >= o.length) o = void 0; 162 | return { value: o && o[i++], done: !o }; 163 | } 164 | }; 165 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 166 | }; 167 | 168 | __read = function (o, n) { 169 | var m = typeof Symbol === "function" && o[Symbol.iterator]; 170 | if (!m) return o; 171 | var i = m.call(o), r, ar = [], e; 172 | try { 173 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 174 | } 175 | catch (error) { e = { error: error }; } 176 | finally { 177 | try { 178 | if (r && !r.done && (m = i["return"])) m.call(i); 179 | } 180 | finally { if (e) throw e.error; } 181 | } 182 | return ar; 183 | }; 184 | 185 | __spread = function () { 186 | for (var ar = [], i = 0; i < arguments.length; i++) 187 | ar = ar.concat(__read(arguments[i])); 188 | return ar; 189 | }; 190 | 191 | __spreadArrays = function () { 192 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 193 | for (var r = Array(s), k = 0, i = 0; i < il; i++) 194 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 195 | r[k] = a[j]; 196 | return r; 197 | }; 198 | 199 | __await = function (v) { 200 | return this instanceof __await ? (this.v = v, this) : new __await(v); 201 | }; 202 | 203 | __asyncGenerator = function (thisArg, _arguments, generator) { 204 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 205 | var g = generator.apply(thisArg, _arguments || []), i, q = []; 206 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 207 | function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 208 | function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 209 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 210 | function fulfill(value) { resume("next", value); } 211 | function reject(value) { resume("throw", value); } 212 | function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 213 | }; 214 | 215 | __asyncDelegator = function (o) { 216 | var i, p; 217 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 218 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 219 | }; 220 | 221 | __asyncValues = function (o) { 222 | if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 223 | var m = o[Symbol.asyncIterator], i; 224 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 225 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 226 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 227 | }; 228 | 229 | __makeTemplateObject = function (cooked, raw) { 230 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 231 | return cooked; 232 | }; 233 | 234 | __importStar = function (mod) { 235 | if (mod && mod.__esModule) return mod; 236 | var result = {}; 237 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 238 | result["default"] = mod; 239 | return result; 240 | }; 241 | 242 | __importDefault = function (mod) { 243 | return (mod && mod.__esModule) ? mod : { "default": mod }; 244 | }; 245 | 246 | __classPrivateFieldGet = function (receiver, privateMap) { 247 | if (!privateMap.has(receiver)) { 248 | throw new TypeError("attempted to get private field on non-instance"); 249 | } 250 | return privateMap.get(receiver); 251 | }; 252 | 253 | __classPrivateFieldSet = function (receiver, privateMap, value) { 254 | if (!privateMap.has(receiver)) { 255 | throw new TypeError("attempted to set private field on non-instance"); 256 | } 257 | privateMap.set(receiver, value); 258 | return value; 259 | }; 260 | 261 | exporter("__extends", __extends); 262 | exporter("__assign", __assign); 263 | exporter("__rest", __rest); 264 | exporter("__decorate", __decorate); 265 | exporter("__param", __param); 266 | exporter("__metadata", __metadata); 267 | exporter("__awaiter", __awaiter); 268 | exporter("__generator", __generator); 269 | exporter("__exportStar", __exportStar); 270 | exporter("__createBinding", __createBinding); 271 | exporter("__values", __values); 272 | exporter("__read", __read); 273 | exporter("__spread", __spread); 274 | exporter("__spreadArrays", __spreadArrays); 275 | exporter("__await", __await); 276 | exporter("__asyncGenerator", __asyncGenerator); 277 | exporter("__asyncDelegator", __asyncDelegator); 278 | exporter("__asyncValues", __asyncValues); 279 | exporter("__makeTemplateObject", __makeTemplateObject); 280 | exporter("__importStar", __importStar); 281 | exporter("__importDefault", __importDefault); 282 | exporter("__classPrivateFieldGet", __classPrivateFieldGet); 283 | exporter("__classPrivateFieldSet", __classPrivateFieldSet); 284 | }); 285 | -------------------------------------------------------------------------------- /projects/jw-pagination/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jw-angular-pagination", 3 | "version": "1.2.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "jw-paginate": { 8 | "version": "1.0.4", 9 | "resolved": "https://registry.npmjs.org/jw-paginate/-/jw-paginate-1.0.4.tgz", 10 | "integrity": "sha512-W0bv782exgCoynUL/egbRpaYwf/r6T6e02H870H5u3hfSgEYrxgz5POwmFF5aApS6iPi6yhZ0VF8IbafNFsntA==" 11 | }, 12 | "tslib": { 13 | "version": "1.13.0", 14 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 15 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /projects/jw-pagination/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jw-angular-pagination", 3 | "version": "1.2.0", 4 | "homepage": "https://jasonwatmore.com/post/2018/04/26/npm-jw-angular-pagination-component", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/cornflourblue/jw-angular-pagination.git" 8 | }, 9 | "peerDependencies": { 10 | "@angular/common": "^9.1.11", 11 | "@angular/core": "^9.1.11" 12 | }, 13 | "dependencies": { 14 | "tslib": "^1.10.0", 15 | "jw-paginate": "^1.0.4" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/jw-pagination/src/lib/jw-pagination.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core'; 2 | 3 | import paginate from 'jw-paginate'; 4 | 5 | @Component({ 6 | selector: 'jw-pagination', 7 | template: `` 24 | }) 25 | 26 | export class JwPaginationComponent implements OnInit, OnChanges { 27 | @Input() items: Array; 28 | @Output() changePage = new EventEmitter(true); 29 | @Input() initialPage = 1; 30 | @Input() pageSize = 10; 31 | @Input() maxPages = 10; 32 | 33 | pager: any = {}; 34 | 35 | ngOnInit() { 36 | // set page if items array isn't empty 37 | if (this.items && this.items.length) { 38 | this.setPage(this.initialPage); 39 | } 40 | } 41 | 42 | ngOnChanges(changes: SimpleChanges) { 43 | // reset page if items array has changed 44 | if (changes.items.currentValue !== changes.items.previousValue) { 45 | this.setPage(this.initialPage); 46 | } 47 | } 48 | 49 | setPage(page: number) { 50 | // get new pager object for specified page 51 | this.pager = paginate(this.items.length, page, this.pageSize, this.maxPages); 52 | 53 | // get new page of items from items array 54 | var pageOfItems = this.items.slice(this.pager.startIndex, this.pager.endIndex + 1); 55 | 56 | // call change page function in parent component 57 | this.changePage.emit(pageOfItems); 58 | } 59 | } -------------------------------------------------------------------------------- /projects/jw-pagination/src/lib/jw-pagination.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | import { JwPaginationComponent } from './jw-pagination.component'; 5 | 6 | @NgModule({ 7 | imports: [CommonModule], 8 | declarations: [JwPaginationComponent], 9 | exports: [JwPaginationComponent] 10 | }) 11 | export class JwPaginationModule { } 12 | -------------------------------------------------------------------------------- /projects/jw-pagination/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of jw-pagination 3 | */ 4 | 5 | export * from './lib/jw-pagination.component'; 6 | export * from './lib/jw-pagination.module'; 7 | -------------------------------------------------------------------------------- /projects/jw-pagination/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone'; 4 | import 'zone.js/dist/zone-testing'; 5 | import { getTestBed } from '@angular/core/testing'; 6 | import { 7 | BrowserDynamicTestingModule, 8 | platformBrowserDynamicTesting 9 | } from '@angular/platform-browser-dynamic/testing'; 10 | 11 | declare const require: { 12 | context(path: string, deep?: boolean, filter?: RegExp): { 13 | keys(): string[]; 14 | (id: string): T; 15 | }; 16 | }; 17 | 18 | // First, initialize the Angular testing environment. 19 | getTestBed().initTestEnvironment( 20 | BrowserDynamicTestingModule, 21 | platformBrowserDynamicTesting() 22 | ); 23 | // Then we find all the tests. 24 | const context = require.context('./', true, /\.spec\.ts$/); 25 | // And load the modules. 26 | context.keys().map(context); 27 | -------------------------------------------------------------------------------- /projects/jw-pagination/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/lib", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": [ 10 | "dom", 11 | "es2018" 12 | ] 13 | }, 14 | "angularCompilerOptions": { 15 | "skipTemplateCodegen": true, 16 | "strictMetadataEmit": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": [ 20 | "src/test.ts", 21 | "**/*.spec.ts" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /projects/jw-pagination/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.lib.json", 3 | "angularCompilerOptions": { 4 | "enableIvy": false 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /projects/jw-pagination/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts" 12 | ], 13 | "include": [ 14 | "**/*.spec.ts", 15 | "**/*.d.ts" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /projects/jw-pagination/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "allowSyntheticDefaultImports": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "importHelpers": true, 14 | "target": "es2015", 15 | "lib": [ 16 | "es2018", 17 | "dom" 18 | ], 19 | "paths": { 20 | "jw-pagination": [ 21 | "dist/jw-pagination/jw-pagination", 22 | "dist/jw-pagination" 23 | ] 24 | } 25 | }, 26 | "angularCompilerOptions": { 27 | "fullTemplateTypeCheck": true, 28 | "strictInjectionParameters": true 29 | } 30 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "align": { 8 | "options": [ 9 | "parameters", 10 | "statements" 11 | ] 12 | }, 13 | "array-type": false, 14 | "arrow-return-shorthand": true, 15 | "curly": true, 16 | "deprecation": { 17 | "severity": "warning" 18 | }, 19 | "eofline": true, 20 | "import-blacklist": [ 21 | true, 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": { 26 | "options": [ 27 | "spaces" 28 | ] 29 | }, 30 | "max-classes-per-file": false, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-empty": false, 55 | "no-inferrable-types": [ 56 | true, 57 | "ignore-params" 58 | ], 59 | "no-non-null-assertion": true, 60 | "no-redundant-jsdoc": true, 61 | "no-switch-case-fall-through": true, 62 | "no-var-requires": false, 63 | "object-literal-key-quotes": [ 64 | true, 65 | "as-needed" 66 | ], 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "semicolon": { 72 | "options": [ 73 | "always" 74 | ] 75 | }, 76 | "space-before-function-paren": { 77 | "options": { 78 | "anonymous": "never", 79 | "asyncArrow": "always", 80 | "constructor": "never", 81 | "method": "never", 82 | "named": "never" 83 | } 84 | }, 85 | "typedef-whitespace": { 86 | "options": [ 87 | { 88 | "call-signature": "nospace", 89 | "index-signature": "nospace", 90 | "parameter": "nospace", 91 | "property-declaration": "nospace", 92 | "variable-declaration": "nospace" 93 | }, 94 | { 95 | "call-signature": "onespace", 96 | "index-signature": "onespace", 97 | "parameter": "onespace", 98 | "property-declaration": "onespace", 99 | "variable-declaration": "onespace" 100 | } 101 | ] 102 | }, 103 | "variable-name": { 104 | "options": [ 105 | "ban-keywords", 106 | "check-format", 107 | "allow-pascal-case" 108 | ] 109 | }, 110 | "whitespace": { 111 | "options": [ 112 | "check-branch", 113 | "check-decl", 114 | "check-operator", 115 | "check-separator", 116 | "check-type", 117 | "check-typecast" 118 | ] 119 | }, 120 | "component-class-suffix": true, 121 | "contextual-lifecycle": true, 122 | "directive-class-suffix": true, 123 | "no-conflicting-lifecycle": true, 124 | "no-host-metadata-property": true, 125 | "no-input-rename": true, 126 | "no-inputs-metadata-property": true, 127 | "no-output-native": true, 128 | "no-output-on-prefix": true, 129 | "no-output-rename": true, 130 | "no-outputs-metadata-property": true, 131 | "template-banana-in-box": true, 132 | "template-no-negated-async": true, 133 | "use-lifecycle-interface": true, 134 | "use-pipe-transform-interface": true 135 | } 136 | } 137 | --------------------------------------------------------------------------------