1.3.1 • Published 3 years ago

nova-search v1.3.1

Weekly downloads
87
License
MIT
Repository
-
Last release
3 years ago

Nova Search

Search box for angular 2+ applications which can filter any item set with or without accents in different languages like Spanish, Portugese, French etc.

Features

  • Search dropdown list.
  • Skip/allow language accents while searching.
  • Angular reactive forms support.
  • Angular 2 and above supported.
  • Cross browser support.

  • Check it out demo

Installation

Run `npm install nova-search`

Configuration

  • Import NovaSearchModule into your app.module.

    import { NovaSearchModule } from 'nova-search';

    @NgModule({ imports: [ ..., NovaSearchModule ], ... })

  • Use nova-search component inside your HTML and pass values for inputs. Example:

    <nova-search [items]="itemList" [options]="{ key:'value', display:'value' }" [disabled]="false" [skipAccents]="false" [inputCss]="'custom-css-1'" [optionCss]="'custom-css-2'" [control]="formGroup.controls.search" [elementId]="'nova-search-element'" [skipCharactersCount]="1" [placeholder]="'search here'" (onItemSelected)="onItemSelected($event)"></nova-search>

  • Add a css class named 'bold' globally to make matched letters more readable while searching.

    .bold { font-weight: bold; }

Input

NameTypeDescription
itemsany[]Search item listrequired
options{ key : string, display : string }'key' is the property name which will be used to filter item set while 'display' will be the property which will appear in search resultsrequired
controlFormControlAngular form controlrequired
disabledbooleanDisable/Enable inputoptional
elementIdstringHTML element id (if you need mutiple nova-search instances in the same page)optional
placeholderstringInput placeholderoptional
inputCssstringCss class names for search box element Ex: [inputCss]="'class-1 class-2'"optional
optionCssstringCss class names for search results section Ex: [optionCss]="'class-1 class-2'"optional
skipAccentsbooleanA boolean property which is to toggle whether user wants to skip accents while searching or not. (default value is set to false)optional
skipCharactersCountnumberNumber of characters to skip before start the searchoptional

Output

NameTypeDescription
( onItemSelected )anyChange event when user clicks on a search result
( onClearText )voidChange event when user clears input text

Services & Methods

  • Inject NovaSearchService service and call focus(elementId :string) method.

  • Example: :

    constructor(private service: NovaSearchService){ }

    this.service.focus('element-id');

1.3.1

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

2.0.0

5 years ago

1.0.10

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago