# aax-picker

> Aax Picker is a simple library for a modal selector of colours or icons.

Latest version **2.0.1** (published 2019-07-12) · 0 weekly downloads

## Install

```sh
npm install aax-picker
pnpm add aax-picker
yarn add aax-picker
bun add aax-picker
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-07-12 |
| First published | 2019-03-04 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 969.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | l33tch |

## Links

- npm: https://www.npmjs.com/package/aax-picker
- npm.io page: https://npm.io/package/aax-picker

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 2.0.1 (latest) — 2019-07-12
- 0.0.8 — 2019-03-04
- 0.0.7 — 2019-03-04
- 0.0.6 — 2019-03-04
- 0.0.5 — 2019-03-04
- 0.0.4 — 2019-03-04
- 0.0.3 — 2019-03-04

## README

# Aax Picker

Aax Picker is a simple library for a modal selector of colours or icons.

## System Requirements

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.3.

## Installation

Install with npm:

```Shell
npm install aax-picker
```
**Note:** this project is written in [TypeScript](http://www.typescriptlang.org/) and includes type definitions in the package.json file. This means that if you want to use it from TypeScript, you don't need to install a separate @types module.

## Depends on

Default Icons (Material Icons):
```html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
```

Angular Modules:

```
@angular/animations
@angular/flex-layout
@angular/material
@angular/cdk
```

## Types

#### Colour:
A simple object with a name, a foreground colour (used in css as color) and background colour (used in css as background-color).

```typescript
export interface Colour {
  name: string;
  background: string;
  foreground: string;
}
```

#### Icon:
A selection of icon objects grouped in named groups. Icon id will be used in a material icon element and icons can be searched by their tags strings.
The icon id and description are added to the tags and so will be searched on as well. Separated to allow a material id and description to be different and tags separate to allow for search text that is not present in description or id.
```typescript
export interface Icon {
  id: string;
  description?: string; // Replaced with id if absent
  tags?: string; // Replaced with id if absent
}

export interface IconGroup {
  name: string;
  icons: Icon[];
}
```
## Example

#### Colour Picker:

Component:
```typescript
import { Colour, PickerType } from 'aax-picker';

public PickerTypes = PickerType;
public colour: Colour;

usedColours: Colour[] = [
  {name: 'Mulberry', background: '#cb498b', foreground: '#ffffff'},
  {name: 'Pearl', background: '#d9dddc', foreground: '#2f394d'},
];
```

Template:
```html
<aax-picker [usedColours]="usedColours"
            [pickerType]="PickerTypes.colour"
            [selectedColour]="colour"
            (colourSelected)="colour=$event">
</aax-picker>
```
[Stackblitz Colour Picker Example](https://examples-aax-picker-colour.stackblitz.io)

#### Icon Picker:

Component:
```typescript
import { Icon, PickerType } from 'aax-picker';

public PickerTypes = PickerType;
public icon: Icon;

usedIcons: Icon[] = [
  {id: 'backup'}, {id: 'book'}, {id: 'bookmark'},
];
```

Template:
```html
<aax-picker [usedIcons]="usedIcons"
            [pickerType]="PickerTypes.icon"
            [selectedIcon]="icon"
            (iconSelected)="icon=$event">
</aax-picker>
```
[Stackblitz Icon Picker Example](https://examples-aax-picker-icon.stackblitz.io)

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

---
_Source: https://npm.io/package/aax-picker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
