npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-search-bar-fz

v1.0.2

Published

To install this library, run:

Downloads

25

Readme

Ngx Search Bar

Installation

To install this library, run:

$ npm install ngx-search-bar-fz --save

and then from your Angular AppModule:

import { BrowserModule } from "@angular/platform-browser"
import { NgModule } from "@angular/core"

import { AppComponent } from "./app.component"

// Import your library
import { DATA_FOR_SEARCH_BAR, NgxSearchBarModule } from "ngx-search-bar-fz"

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,

    // Specify your library as an import
    NgxSearchBarModule,
  ],
  providers: [
    {
      provide: NGX_SEARCH_BAR_DATA,
      useValue: {
        BASE_URL: environment.serverBar,
        OPTIONS: {
          classContainerFilter: "main-style",
          fnScrollTop: () => {
            window.scrollTo(0, 0)
          },
          stickyTop: "55px",
        },
        OPTIONS_PAGINATE: {
          fnGetLength: (arg: any) => {
            return arg.data.total
          },
        },
      },
    },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

Usage in templates is as simple as:

<ngx-search-bar
  [isChangeUrl]="false"
  nameInputSearch="name"
  placeholder="Search products"
  title="Products"
  [autoInit]="true"
  (data)="getData($event)"
  [isBarExpand]="false"
  maxWidth="50%"
  [isSticky]="true"
  path="products-admin/products">
  <!-- Optional filters -->
  <ngx-search-bar-form-filter [filters]="formFilter" [withParamsClean]="false">
    <div [formGroup]="formFilter" class="gap-2 pt-2 grid md:grid-cols-2 w-full">
      <mat-form-field class="w-full" appearance="outline">
        <mat-label>ID</mat-label>
        <input matInput placeholder="#" formControlName="id" />
      </mat-form-field>
      <!-- More filters -->
    </div>
  </ngx-search-bar-form-filter>

  <!-- Optional buttons -->
  <ng-container buttons>
    <button class="!bg-orange-500 !text-white" mat-raised-button [routerLink]="['/admin-products/products/create']">
      <i class="fa-solid fa-plus"></i>
      Producto
    </button>
  </ng-container>

  <div class="overflow-auto p-2">
    <!-- render information -->
  </div>
  <!-- Optional paginator -->
  <ngx-search-bar-paginator></ngx-search-bar-paginator>
</ngx-search-bar>

NgxSearchBarComponent

Inputs

| Name | Type | Default | Description | | -------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------- | | placeholder |string | 'Search' | Entry placeholder | | title|string| null| Component Title | |path|string| search|Route for requests| |isChangeUrl|boolean|false|If the url should be changed when doing a search | autoInit|boolean|true|If it automatically starts searching |nameInputSearch|string| 'search'| search Name of the search input to send to the backend| isBarExpand| boolean| false| If it is an expanded bar| size| number | 1 | grow bar css| maxWidth| string | '100%' | maximum width of the bar| isSticky| boolean | true |si siempre es visible arriba(le afecta el top con el input stickyTop)| fnScrollTop| Function| null | Function to return to the top by scrolling| notScroll| boolean | false | If you scroll up with the function|

Outputs

| Names | Type | Description | | ------------- | ------- | -------------------------------------- | | data | unknown | Event fired when data is received | loading | boolean | Event fired when load state is changed |

Slots

| Name | Description | | ---------- | ---------------------------------------------------- | | ngx-search-bar-form-filter | Component for filters |ngx-search-bar-paginator | Component for paginator | buttons | Button slot next to filter button|

Example img

Example

NgxSearchBarFormFilterComponent

Inputs

|Name|Type|Default|Description| |--------|--------|--------|--------| |filters|FormGroup|is required|filter form that is sent to the backend| textBtnApply|string|'Apply Filters'| Apply button text| textBtnClose|string|'Close Filters'| Close button text| withParamsClean|boolean|false|If it should clean the params| classPanel|string|null|Class for panel of filters|

NgxSearchBarPaginatorComponent

Inputs

|Name|Type|Default|Description| |--------|--------|--------|--------| |fnGetLength|Function|null|Function that returns the length of the data| |fnGetPage|Function|null|Function that returns the current page|