# doz-searchfield

> A search field for DOZ

Latest version **1.2.0** (published 2021-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install doz-searchfield
pnpm add doz-searchfield
yarn add doz-searchfield
bun add doz-searchfield
```

## 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 | 1.2.0 |
| Published | 2021-05-20 |
| First published | 2018-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Fabio Ricali |
| Maintainers | fabioricali |
| Keywords | doz, component, search, input |

## Links

- npm: https://www.npmjs.com/package/doz-searchfield
- Repository: https://github.com/dozjs-cmp/doz-searchfield
- Homepage: https://github.com/dozjs-cmp/doz-searchfield#readme
- Issues: https://github.com/dozjs-cmp/doz-searchfield/issues
- npm.io page: https://npm.io/package/doz-searchfield

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-05-20
- 1.1.7 — 2020-09-03
- 1.1.6 — 2018-12-28
- 1.1.5 — 2018-12-28
- 1.1.4 — 2018-10-04
- 1.1.3 — 2018-10-03
- 1.1.2 — 2018-10-03
- 1.1.1 — 2018-08-02
- 1.1.0 — 2018-07-06
- 1.0.2 — 2018-06-25
- 1.0.1 — 2018-06-25
- 1.0.0 — 2018-06-25

## README

# doz-searchfield
A search field component for DOZ

## Install
```
npm install doz-searchfield --save
```

Live <a href="https://dozjs-cmp.github.io/doz-searchfield/example/index.html">here</a>

## Usage

Globally
```javascript
import Doz from 'doz'
import 'doz-searchfield'

new Doz({
    root: '#app',
    template: `
        <doz-searchfield></doz-searchfield>
    `
})
```

Locally
```javascript
import Doz from 'doz'
import DozSearchfield from 'doz-searchfield/lib'

Doz.component('my-wrapper', {
    components: {
        'also-a-custom-name': DozSearchfield
    },
    template() {
        return `
            <also-a-custom-name></also-a-custom-name>
        `
    }
});

new Doz({
    root: '#app',
    template: `
        <my-wrapper></my-wrapper>
    `
})
```

## Props
| Name | Default | Description |
| ---- | ------- | ----------- |
| name | | Input name |
| value| | value |
| show-button | false | If true show search button |
| button-label | Search | Search button label |
| placeholder | Search here... | Input placeholder |
| button-class | | CSS button class |
| input-class | | CSS input class |
| input-id | | Input ID |
| show-clear-button | true | Show clear button |
| typeahead | 0 | Chars number to start to searching, if 0 it's disabled |
| force-search | false | Force search event if value is already searched |

## Events

| Name | Args | Description |
| ---- | ------- | ----------- |
| search | value | Triggered when search |
| clear | | Triggered when clear value |

### Example
```javascript
Doz.component('app-wrapper', {
    props: {
        log: ''
    },
    template() {
        return `
            <div>
                <doz-searchfield
                    d:on-search="$onSearch"
                    d:on-clear="$onClear"
                ></doz-searchfield>
                <p><strong>Log:</strong> ${this.props.log}</p>
            </div>
        `
    },

    $onSearch(value) {
        this.props.log = value;
    },

    $onClear() {
        this.props.log = '';
    }
});
```

## Changelog
You can view the changelog <a target="_blank" href="https://github.com/dozjs-cmp/doz-searchfield/blob/master/CHANGELOG.md">here</a>

## License
DozSearchfield is open-sourced software licensed under the <a target="_blank" href="http://opensource.org/licenses/MIT">MIT license</a>

## Author
<a target="_blank" href="http://rica.li">Fabio Ricali</a>

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