Socket
Socket
Sign inDemoInstall

ngx-filters

Package Overview
Dependencies
5
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngx-filters

This library was generated for all type of frameworks such as Angular Material, Prime Ng, etc. Providing Filters such as Number Box, TextBox, Date, Single Select, Multi Select And True/False Filters for grids or list.


Version published
Maintainers
1
Install size
1.19 MB
Created

Readme

Source

NgxFilters

This library was generated for all type of frameworks such as Angular Material, Prime Ng, etc. Providing Filters such as Number Box, TextBox, Date, Single Select, Multi Select And True/False Filters for grids or list.

See demo in stackblitz

See angular material filter demo in stackblitz

Installation Guide

Add NgxFiltersModule into your Module

import {NgxFiltersModule} from "ngx-filters";
...
@NgModule({
  imports: [
  ...
  NgxFiltersModule.forRoot()
  ...
  ]
})

Default global configs for root:

NgxFiltersModule.forRoot({
  dateComponent: DateTimeFilterComponent,
  conditionSelectorComponent: ConditionsSelectorComponent,
  multiSelectBoxComponent: MultiSelectBoxFilterComponent,
  numberBoxComponent: NumberBoxFilterComponent,
  selectBoxComponent: SelectBoxFilterComponent,
  textBoxComponent: TextBoxFilterComponent,
  trueFalseComponent: TrueFalseFilterComponent,
  translator: new FilterTranslator()
})

Sample

How to show filters in chip list:

  import {Component, OnInit} from '@angular/core';
  import {Filter, FilterTypes, NgxApplyFilterResult} from "ngx-filters";

  @Component({
  selector: 'my-filters',
  template: '<ngx-chip-filter
            [filters]="filters"
            (apply)="onApplayFilter($event)"
            ></ngx-chip-filter>',
  })
  export class NgxChipFilterComponent  implements OnInit {
    filters: Filter[] = [
       {
        field: 'creationTime',
        type: FilterTypes.DateTime,
        value: null,
        valueTo: null,
        label: 'CreationTime',
        logicalOperator: LogicalOperator.And,
        conditionOperator: ConditionOperator.Between,
      },
      ...
    ]
    onApplayFilter(result: NgxApplyFilterResult) {
      // Do ...
    }
  }

NgxFilterConfigs for components:

PropertyDefault Componentextended From
conditionSelectorComponentConditionsSelectorComponentNgxConditionSelectorFilter
dateComponentDateComponentNgxDateFilter
numberBoxComponentNumberBoxComponent NgxNumberFilterComponent
textBoxComponentTextBoxComponentNgxTextBoxFilter
selectBoxComponentSelectBoxComponentNgxSelectBoxFilter
multiSelectBoxComponentMultiSelectBoxComponentNgxMultiSelectFilter
trueFalseComponentTrueFalseComponentNgxTrueFalseFilter

NgxFilterConfigs translator property

  • translate names of conditions and other label to local language

Keywords

FAQs

Last updated on 23 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc