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-popper-damo

v2.0.7

Published

ngx-popper is an angular wrapper for popper.js

Downloads

27

Readme

ngx-popper

npm npm MIT licensed

ngx-popper is an angular wrapper for the Popper.js library.

Installation

node and npm are required to run this package.

  1. Use npm/yarn to install the package:
$ npm install ngx-popper --save 

Or

 $ yarn add ngx-popper --save 
  1. You simply add into your module NgxPopperModule:
import {NgxPopperModule} from 'ngx-popper';

@NgModule({
 // ...
 imports: [
   // ...
   NgxPopperModule
 ]
})

SystemJS

    System.config({
        paths: {
            // paths serve as alias
            'npm:': 'libs/'
        },
        // map tells the System loader where to look for things
        map: {
            ... ,
            'ngx-popper': 'npm:ngx-popper',
            'popper-directive.js': 'npm:ngx-popper',
            'popper.module': 'npm:ngx-popper',
        },
        // packages tells the System loader how to load when no filename and/or no extension
        packages: {
            ... ,
            'ngx-popper': {
                main: 'index.js',
                defaultExtension: 'js'
            },
            'popper.js': {
                main: 'popper-directive.js',
                defaultExtension: 'js'
            },
            'popper.module': {
                main: './popper.module.js',
                defaultExtension: 'js'
            }
        }
    });
  1. Add to view:
 <div     [popper]="popper1Content"
          [popperShowOnStart]="true"
          [popperTrigger]="'click'"
          [popperPlacement]="'bottom'">
       <p class="bold">Hey!</p>
       <p class="thin">Choose where to put your popper!</p>         
     </div>
     <popper-content #popper1Content>
       <p class="bold">Popper on bottom</p>
     </popper-content>
  1. As text:
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          (popperOnShown)="onShown($event)">
       <p class="bold">Pop</p>
       <p class="thin">on the bottom</p>
     </div>
  1. Position fixed, breaking overflow:
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          [popperPositionFixed]="true"
          (popperOnShown)="onShown($event)">
     </div>
  1. Specific target:
<div class="example">
     <div #popperTargetElement></div>
     <div [popper]="'As text'"
          [popperTrigger]="'hover'"
          [popperPlacement]="'bottom'"
          [popperTarget]="popperTargetElement"
          (popperOnShown)="onShown($event)">
     </div>
  1. hide/show programmatically:
 <div [popper]="tooltipcontent"
         [popperTrigger]="'hover'"
         [popperPlacement]="'bottom'">
      <p class="bold">Pop</p>
      <p class="thin">on the bottom</p>
    </div>
    <popper-content #tooltipcontent>
      <div>
        <p>This is a tooltip with text</p>
        <span (click)="tooltipcontent.hide()">Close</div>
      </div>
    </popper-content>
  1. Attributes map:

    | Option | Type | Default | |:------------------- |:---------------- |:-------- | | popperDisableAnimation | boolean | false | | popperDisableStyle | boolean | false | | popperDisabled | boolean | false | | popperDelay | number | 0 | | popperTimeout | number | 0 | | popperTimeoutAfterShow | number | 0 | | popperPlacement | Placement(string) | auto | | popperTarget | HtmlElement | auto | | popperBoundaries | string(selector) | undefined|
    | popperShowOnStart | number | 0 |
    | popperTrigger | Trigger(string) | hover | | popperPositionFixed | boolean | false | | popperHideOnClickOutside | boolean | true | | popperHideOnScroll | boolean | false | | popperForceDetection | boolean | false | | popperModifiers | popperModifier | undefined| | popperOnShown | EventEmitter| $event |
    | popperOnHidden | EventEmitter| $event |

  2. Override defaults:

    Ngx-popper comes with a few default properties you can override in default to effect all instances These are overridden by any child attributes.

NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    NgxPopperModule.forRoot({placement: 'bottom'})],
  declarations: [AppComponent],
  providers: [],
  bootstrap: [AppComponent]

})

| Options | Type | Default | |:------------------- |:---------------- |:-------- | | disableAnimation | boolean | false | | disableDefaultStyling | boolean | false |
| placement | Placement(string) | auto | | boundariesElement | string(selector) | undefined|
| trigger | Trigger(string) | hover |
| popperModifiers | popperModifier | undefined| | positionFixed | boolean | false | | hideOnClickOutside | boolean | true | | hideOnScroll | boolean | false |

  1. popperPlacement:

| 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'bottom-start' | 'left-start' | 'right-start' | 'top-end' | 'bottom-end' | 'left-end' | 'right-end' | 'auto' | 'auto-top' | 'auto-bottom' | 'auto-left' | 'auto-right' | Function

  1. popperTrigger:

| 'click' | 'mousedown' | 'hover' | 'none'

Demo

Demo

Contribute

Hell ya!!!

  $ yarn install
  $ yarn run build
  $ yarn run dev