Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Pagination): decouple the Pagination Component to separate package
- in order to use this Pagination Component in other framework (like Aurelia-Slickgrid) without rewriting the same code, we can simply extract this into a brand new Pagination Component
- Loading branch information
1 parent
4f03d0e
commit 606795b
Showing
13 changed files
with
135 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) | ||
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) | ||
[![npm](https://img.shields.io/npm/v/@slickgrid-universal/pagination-component.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/pagination-component) | ||
[![npm](https://img.shields.io/npm/dy/@slickgrid-universal/pagination-component?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/pagination-component) | ||
|
||
[![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/CI%20Build/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions) | ||
[![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) | ||
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) | ||
[![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal) | ||
|
||
## Pagination Component | ||
#### @slickgrid-universal/pagination-component | ||
|
||
Vanilla Implementation of a Pagination Component that can optionally be shown at the bottom of the grid. This Pagination will automatically be enabled when using a Backend Service (like OData/GraphQL) but can also optionally be used with a local (in-memory) dataset as well, the data will still remain in memory but it will be shown with pagination. | ||
|
||
### Internal Dependencies | ||
- [@slickgrid-universal/binding](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/binding) | ||
- [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common) | ||
|
||
### Installation | ||
Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "@slickgrid-universal/pagination-component", | ||
"version": "0.14.1", | ||
"description": "Slick Pagination Component - Vanilla Implementation of a Pagination Component", | ||
"main": "dist/commonjs/index.js", | ||
"browser": "src/index.ts", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/commonjs/index.d.ts", | ||
"typings": "dist/commonjs/index.d.ts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"directories": { | ||
"src": "src" | ||
}, | ||
"scripts": { | ||
"build": "cross-env tsc --build", | ||
"postbuild": "npm-run-all bundle:commonjs", | ||
"build:watch": "cross-env tsc --incremental --watch", | ||
"dev": "run-s build", | ||
"dev:watch": "run-p build:watch", | ||
"bundle": "run-p bundle:commonjs bundle:esm", | ||
"bundle:commonjs": "tsc --project tsconfig.bundle.json --outDir dist/commonjs --module commonjs", | ||
"postbundle:commonjs": "run-s copy:html:cjs", | ||
"bundle:esm": "cross-env tsc --project tsconfig.bundle.json --outDir dist/esm --module esnext --target es2018", | ||
"postbundle:esm": "run-s copy:html:esm", | ||
"copy:html:cjs": "cross-env copyfiles -f src/*.html dist/commonjs", | ||
"copy:html:esm": "cross-env copyfiles -f src/*.html dist/esm", | ||
"prebundle": "npm-run-all delete:dist", | ||
"delete:dist": "cross-env rimraf --maxBusyTries=10 dist", | ||
"package:add-browser-prop": "cross-env node ../change-package-browser.js --add-browser=true --folder-name=pagination-component", | ||
"package:remove-browser-prop": "cross-env node ../change-package-browser.js --remove-browser=true --folder-name=pagination-component" | ||
}, | ||
"author": "Ghislain B.", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14.15.0", | ||
"npm": ">=6.14.8" | ||
}, | ||
"browserslist": [ | ||
"last 2 version", | ||
"> 1%", | ||
"not dead" | ||
], | ||
"dependencies": { | ||
"@slickgrid-universal/binding": "^0.14.1", | ||
"@slickgrid-universal/common": "^0.14.1" | ||
}, | ||
"devDependencies": { | ||
"copyfiles": "^2.4.1", | ||
"cross-env": "^7.0.3", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
index.ts | ||
**/*.* |
4 changes: 2 additions & 2 deletions
4
...s__/slick-pagination-without-i18n.spec.ts → ...s__/slick-pagination-without-i18n.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...onents/__tests__/slick-pagination.spec.ts → ...nt/src/__tests__/slick-pagination.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as entry from './index'; | ||
|
||
describe('Testing library entry point', () => { | ||
it('should have an index entry point defined', () => { | ||
expect(entry).toBeTruthy(); | ||
}); | ||
|
||
it('should have all exported object defined', () => { | ||
expect(typeof entry.SlickPaginationComponent).toBe('function'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './slick-pagination.component'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "../tsconfig.bundle.json", | ||
"compilerOptions": { | ||
"typeRoots": [ | ||
"../typings", | ||
"../../node_modules/@types" | ||
], | ||
"outDir": "dist/commonjs" | ||
}, | ||
"include": [ | ||
"../typings", | ||
"**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"rootDir": "src", | ||
"declarationDir": "dist/esm", | ||
"outDir": "dist/esm", | ||
"typeRoots": [ | ||
"typings" | ||
] | ||
}, | ||
"exclude": [ | ||
"dist", | ||
"node_modules", | ||
"**/*.spec.ts" | ||
], | ||
"filesGlob": [ | ||
"./src/**/*.ts" | ||
], | ||
"include": [ | ||
"src/**/*.ts", | ||
"typings/**/*.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters