-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components): extract Custom Footer to be an external component
- extract Custom Footer from the vanilla bundle and make a separate component as an external package so it could be use by Aurelia-Slickgrid/Angular-Slickgrid/... - also extract the Binding Helper & Service into a seperate package as well to that we can use it within the Custom Footer package without the need to also require vanilla-grid-bundle - this external component will still be a required dependency of the vanilla-grid-bundle, it just brings the flexibility of it being available to other framework
- Loading branch information
1 parent
7c999e0
commit 1794c27
Showing
31 changed files
with
289 additions
and
9 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,21 @@ | ||
[![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/binding.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/binding) | ||
[![npm](https://img.shields.io/npm/dy/@slickgrid-universal/binding?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/binding) | ||
|
||
[![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) | ||
|
||
## Binding Enginer & Helper | ||
#### @slickgrid-universal/binding | ||
|
||
A very Simple Vanilla Implementation of a Binding Engine & Helper to add properties/events 2 way bindings. This binding engine is a very simple implementation and is used by simple components like the Custom Footer & Pagination. Again this is a very simple implementation and should not be used with large components but is good enough for small use cases like a footer, pagination and other small ones. | ||
|
||
### External Dependencies | ||
- [DOM Purify](https://github.com/cure53/DOMPurify) to sanitize HTML text | ||
|
||
### 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,50 @@ | ||
{ | ||
"name": "@slickgrid-universal/binding", | ||
"version": "0.14.1", | ||
"description": "Simple Vanilla Implementation of a Binding Engine & Helper to add properties/events 2 way bindings", | ||
"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 sass:build sass:copy", | ||
"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", | ||
"bundle:esm": "cross-env tsc --project tsconfig.bundle.json --outDir dist/esm --module esnext --target es2018", | ||
"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=binding", | ||
"package:remove-browser-prop": "cross-env node ../change-package-browser.js --remove-browser=true --folder-name=binding" | ||
}, | ||
"author": "Ghislain B.", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=14.15.0", | ||
"npm": ">=6.14.8" | ||
}, | ||
"browserslist": [ | ||
"last 2 version", | ||
"> 1%", | ||
"not dead" | ||
], | ||
"dependencies": { | ||
"@slickgrid-universal/common": "^0.14.1", | ||
"dompurify": "^2.2.9" | ||
}, | ||
"devDependencies": { | ||
"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 | ||
**/*.* |
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,7 @@ | ||
import * as services from '../index'; | ||
|
||
describe('Testing Services entry point', () => { | ||
it('should have multiple service entries defined', () => { | ||
expect(services).toBeTruthy(); | ||
}); | ||
}); |
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,12 @@ | ||
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.BindingHelper).toBe('function'); | ||
expect(typeof entry.BindingService).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,2 @@ | ||
export * from './binding.helper'; | ||
export * from './binding.service'; |
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
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 @@ | ||
[![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/custom-footer-component.svg?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/custom-footer-component) | ||
[![npm](https://img.shields.io/npm/dy/@slickgrid-universal/custom-footer-component?color=forest)](https://www.npmjs.com/package/@slickgrid-universal/custom-footer-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) | ||
|
||
## Custom Footer Component | ||
#### @slickgrid-universal/custom-footer-component | ||
|
||
Vanilla Implementation of a Custom Footer Component that can optionally be shown at the bottom of the grid. The default behavior is to show metrics on the right side of the footer while the left side could optionally show row selection count (when that feature is enabled). The default texts for metrics & row selection (when enabled) also have a set of locales that allows you to change the text with current locale. Lastly, you could also choose to provide your own custom text/html in both left and/or right side. | ||
|
||
### Internal Dependencies | ||
- [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common) | ||
|
||
### External Dependencies | ||
- [DOM Purify](https://github.com/cure53/DOMPurify) to sanitize HTML text | ||
|
||
### 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,51 @@ | ||
{ | ||
"name": "@slickgrid-universal/custom-footer-component", | ||
"version": "0.14.1", | ||
"description": "Slick Custom Footer Component - Vanilla Implementation of a Custom Footer 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 sass:build sass:copy", | ||
"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", | ||
"bundle:esm": "cross-env tsc --project tsconfig.bundle.json --outDir dist/esm --module esnext --target es2018", | ||
"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=custom-footer-component", | ||
"package:remove-browser-prop": "cross-env node ../change-package-browser.js --remove-browser=true --folder-name=custom-footer-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", | ||
"dompurify": "^2.2.9" | ||
}, | ||
"devDependencies": { | ||
"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 | ||
**/*.* |
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.SlickFooterComponent).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-footer.component'; |
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
...components/__tests__/slick-footer.spec.ts → ...footer-component/src/slick-footer.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,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
Binary file modified
BIN
+1.93 KB
(100%)
packages/vanilla-bundle/dist-grid-bundle-zip/slickgrid-vanilla-bundle.zip
Binary file not shown.
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
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
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