GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - some-angular-utils/filter: Component to make customizable filters in Angular.

BranchesTags
Open more actions menu

Latest commit

 

History

54 Commits
54 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
projects/some-angular-utils/filter
projects/some-angular-utils/filter
 
 
public
public
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.postcssrc.json
.postcssrc.json
 
 
CLAUDE.md
CLAUDE.md
 
 
README.md
README.md
 
 
angular.json
angular.json
 
 
package.json
package.json
 
 
tsconfig.app.json
tsconfig.app.json
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.spec.json
tsconfig.spec.json
 
 

Repository files navigation

@some-angular-utils/filter

github stars

NPM Version NPM Downloads

npm bundle size npm bundle size


NPM


DEMO

This repo ships with an interactive showcase app — every field type has a live, editable example (edit the code, the filter bar updates in real time). Run it locally:

npm install
npm run dev

Then open http://localhost:4200.

IMPORT

import { SAUFilterModule } from '@some-angular-utils/filter';

TYPESCRIPT

public filterConfig = {
    order: ['search', 'status'],
    mobile: ['search'],
    form: {
        search: {
            name: 'Buscar',
            key: 'q',
            type: 'inputText',
            defaultValue: ''
        },
        status: {
            name: 'Estado',
            key: 'status_id',
            type: 'selectSimple',
            dropdowns: [
                { id: 1, name: 'Activo' },
                { id: 2, name: 'Inactivo' }
            ],
            defaultValue: ''
        }
    }
};

onFilterProcessed(event: { json: any, url: string }) {
    // event.url is a ready-to-use query string: "?q=foo&status_id=1"
}

HTML

<sau-filter
    [filterConfig]="filterConfig"
    searchButtonText="Buscar"
    (onFilterProcessed)="onFilterProcessed($event)"
></sau-filter>

FIELD TYPES

inputText · inputNumber · inputCheckbox (tri-state: true / false / unset) · date · dateRange (needs keyTo) · selectSimple · selectMultiple (both accept dropdowns: [{ id, name }], optionally bindSubLabel)

SORT ORDER

Add orderParamName and orderByFields: [{ field, label }] to filterConfig to get a built-in ascending/descending sort dropdown next to the search button.

QUICK FILTER

Add quickFilter: { key, placeholder?, label?, debounceTime? } to filterConfig to show a separate search input at the top right. When the user stops typing (default debounceTime: 500ms) it runs the search automatically and emits onFilterProcessed — no need to press the search button. Its value is sent under key together with the rest of the filters, and it is pre-filled from the URL if that param is present.

quickFilter: { key: 'search', placeholder: 'Quick search...', debounceTime: 500 }

COLORS

.sau-filter{
    --sau-color-primary: rgb(147, 51, 234);
    --sau-color-background: rgb(255, 255, 255);
}

About

Component to make customizable filters in Angular.

some-angular-utils.github.io/filter/

Topics

angularangular-component

Resources

Readme
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.