# FILTER-MODULE
Importe o módulo FilterModule no módulo que você deseja:

```ts
import { FilterModule } from 'ngx-softfocus';
import {COMPONENT_SIZE, DROPDOWN_TYPE, DropdownOption} from 'ngx-softfocus';
import {Filter} from "../../../../ngx-softfocus/dist/ngx-softfocus/lib/components/filter/filter";

@NgModule({
    imports: [
        DropdownModule,
        FilterModule
    ]
})
```

Importe as seguintes classes no 'xxx.component.ts' onde será utilizado:

```ts
import { FilterModule } from 'ngx-softfocus';
import {COMPONENT_SIZE, DROPDOWN_TYPE, DropdownOption, Filter} from 'ngx-softfocus';
```

Parâmetros suportados pelo componente.

```ts
    filter!: Filter;
```
Output events.
```ts
    @Output() itemsSelected: EventEmitter<DropdownOption | DropdownOption[]> = new EventEmitter<DropdownOption | DropdownOption[]>();
    @Output() filterCheck: EventEmitter<boolean> = new EventEmitter<boolean>();
```

Exemplo de chamada do componente.

```html
   <soft-filter [filter]="this.filtroFilter" (filterCheck)="checkFilter($event)" (itemsSelected)="itemsSelected($event)">Default State</soft-filter>
```
Exemplo Filter. 
- `filterDisabled`: boolean (Habilita/Desabilita o filtro);
- `dropdownOption`!: DropdownOption[] (Itens para listar);
- `dropdownType`!: DROPDOWN_TYPE (Tipo Dropdown);
- `dropdownSize`!: COMPONENT_SIZE (Tamanho Dropdown);
- `dropdownPlaceholder`!: Texto que irá aparecer no Dropdown;
- `dropdownLeftIcon`!: Ícone apresentado na esquerda do Dropdown;
```ts
  filtroFilter: Filter = {
    filterDisabled: false,
    dropdownOption: this.dropdownCheckboxOptions, //(Esta no exemplo de baixo)
    dropdownType: DROPDOWN_TYPE.CHECKBOX,
    dropdownSize: COMPONENT_SIZE.SMALL,
    dropdownPlaceholder: 'Selecione abaixo ou pesquise aqui',
    dropdownLeftIcon: 'multimedia-image-3-outline',
}
```
Exemplo de DropdownOption. 
```ts
dropdownCheckboxOptions: DropdownOption[] = [
    {
        id: 1,
        value: 'Option 1',
        visible: true,
    },
    {
        id: 2,
        value: 'Option 2',
        visible: true,
    },
    {
        id: 3,
        value: 'Option 3',
        visible: true,
    },
];

```
Exemplo tratamento Output.
```ts
  itemsSelected(e: any){
    let itemnRetorn: DropdownOption[] = [];
    itemnRetorn = e;
    console.log(itemnRetorn);
  }
  
  checkFilter(e: any){
    console.log(e.toString());
  }
```
