# @unicef-polymer/etools-behaviors

> Common behaviors, mixins, modules

Latest version **3.1.1** (published 2022-05-10) · https://github.com/unicef-polymer/etools-behaviors/blob/master/LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @unicef-polymer/etools-behaviors
pnpm add @unicef-polymer/etools-behaviors
yarn add @unicef-polymer/etools-behaviors
bun add @unicef-polymer/etools-behaviors
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2022-05-10 |
| First published | 2019-06-03 |
| Weekly downloads | 0 |
| License | https://github.com/unicef-polymer/etools-behaviors/blob/master/LICENSE.md |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 52 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | insightfeatures, robertavram, dci_npm, drzackyll, glebp, andrei.laza, uladzimir_u, adriana.trif, adrian-hangan |

## Links

- npm: https://www.npmjs.com/package/@unicef-polymer/etools-behaviors
- Repository: https://github.com/unicef-polymer/etools-behaviors
- Issues: https://github.com/unicef-polymer/etools-behaviors/issues
- npm.io page: https://npm.io/package/@unicef-polymer/etools-behaviors

## Dependencies (4)

- [dexie](https://npm.io/package/dexie.md) ^3.0.1
- [lit-element](https://npm.io/package/lit-element.md) ^2.5.1
- [@polymer/polymer](https://npm.io/package/@polymer/polymer.md) ^3.4.1
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.10

## Recent versions

- 3.1.1 (latest) — 2022-05-10
- 3.1.0 — 2022-03-17
- 3.1.0-rc.4 — 2022-03-10
- 3.1.0-rc.3 — 2022-03-10
- 3.1.0-rc.2 — 2022-03-10
- 3.1.0-rc.1 — 2022-03-10
- 3.0.5 — 2021-10-14
- 3.0.4 — 2020-08-06
- 3.0.3 — 2020-06-05
- 3.0.2 — 2020-05-04
- 3.0.1 — 2019-08-12
- 3.0.0-rc.1 — 2019-06-03

## README

# Etools Polymer Mixins

A collection of Polymer mixins used in etools apps.

## Mixins list/ Mixin helpers
### EtoolsLogsMixin

Can be used to log errors, warnings and other info like this.
```javascript
this.logError('some error msg...', null);
this.logWarn('some warning msg...', 'some page section');
this.logInfo('some info msg...', null)
```

Each method can have 3 args:
   - the message you want to log
   - a prefix for log message
   - additional data, anything

#### Available logging levels (the levels are cumulative)
  - OFF (default)
  - ERROR - only errors will be displayed
  - WARN - errors and warning will be displayed
  - INFO - errors, warning and info logs displayed

To configure the logging level in your app config do this:
```javascript
window.EtoolsLogsLevel = window.EtoolsLogsLevel || 'INFO';
```

### PolymerMixinFactory

A helper class to combine multiple mixins.

### EtoolsPageRefreshMixin

App data cache reset mixin.

## Install
TODO: create npm package
```bash
$ npm i --save unicef-polymer/etools-behaviors#branch_name
```

## Linting the code

Install local npm packages (run `npm install`)
Then just run the linting task

```bash
$ npm run lint
```

## Running Tests

TODO: improve tests & add more tests

You need to have `web-component-tester` installed (if not run `npm install -g web-component-tester`)
```bash
$ wct
```
or
```bash
$ wct -p
```

## Circle CI

Package will be automatically published after tag push (`git tag 1.2.3` , `git push --tags`). Tag name must correspond to SemVer (Semantic Versioning) rules.  
Examples:

| Version match      | Result   |
| ------------------ | -------- |
| `1.2.3`            | match    |
| `1.2.3-pre`        | match    |
| `1.2.3+build`      | match    |
| `1.2.3-pre+build`  | match    |
| `v1.2.3-pre+build` | match    |
| `1.2`              | no match |

You can see more details [here](https://rgxdb.com/r/40OZ1HN5)

---
_Source: https://npm.io/package/@unicef-polymer/etools-behaviors · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
