@paraboly/pwc-multi-filter
Version:
A wrapper over pwc-tabview and pwc-filter. Provides means of dynamically managing multiple filters via a single component.
96 lines (66 loc) • 4.47 kB
Markdown


[](https://github.com/Paraboly/pwc-multi-filter)
[](https://www.npmjs.com/package/@paraboly/pwc-multi-filter)
[](https://www.npmjs.com/package/@paraboly/pwc-multi-filter)

[](https://opensource.org/licenses/MIT)
<p align="center">
<img alt="WebComponent PWC README Boilerplate"
src="https://raw.githubusercontent.com/paraboly/pwc-multi-filter/master/assets/Screenshots/JSLibraryBoilerplate.png" />
</p>
## [Live Codepen Example](https://codepen.io/wrathchaos/pen/dyyvRzM)
## Installation
### Script tag
- Put two script tags similar to this in the head of your index.html:
```html
<script
type="module"
src="https://unpkg.com/@paraboly/pwc-multi-filter@latest/dist/pwc-multi-filter/pwc-multi-filter.esm.js"
></script>
<script
nomodule
src="https://unpkg.com/@paraboly/pwc-multi-filter@latest/dist/pwc-multi-filter/pwc-multi-filter.js"
></script>
```
- Then you can use the element anywhere in your template, JSX, html etc
### Node Modules
- Run `npm install @paraboly/pwc-multi-filter --save`
- Put a script tag similar to this `<script src='node_modules/@paraboly/pwc-multi-filter/dist/pwc-multi-filter.js'></script>` in the head of your index.html
- Then you can use the element anywhere in your template, JSX, html etc
### In a stencil-starter app
- Run `npm install @paraboly/pwc-multi-filter --save`
- Add an import to the npm packages `import @paraboly/pwc-multi-filter;`
- Then you can use the element anywhere in your template, JSX, html etc
# Usage
## Basic Usage
This is just an example from pwc-animated-checkbox, you need to change it!
```html
<pwc-animated-checkbox></pwc-animated-checkbox>
```
## Checkbox onCheckChange Listener Usage
### JS Way
This is just an example from pwc-animated-checkbox, you need to change it!
```js
// Multiple Checkboxes
const pwcCheckboxes = document.querySelectorAll("pwc-animated-checkbox");
pwcCheckboxes.forEach(element => {
element.addEventListener("checkedEvent", event => {
console.log("Event: ", event.detail);
});
})
// Selects the first checkbox
const pwcCheckbox = document.querySelector("pwc-animated-checkbox");
pwcCheckbox.addEventListener("checkedEvent", event => {
console.log("First Element Event: ", event.detail);
```
## Future Plans
- [x] ~~Documentation~~
- [x] ~~LICENSE~~
- [ ] Color Customization
- [ ] Animation Bug Fix
## Authors
Author, author@work_email.com | author@personal_email.com
## License
WebComponent PWC README Boilerplate is available under the MIT license.
See the LICENSE file for more info.