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

@ivylab/angular-popover

v1.5.1

Published

The Popover it is a pop-up box that appears when the user clicks on an element.

Downloads

56

Readme

Popover for Angular

Angular popover library. The Popover it is a pop-up box that appears when the user clicks on an element.

Demo

http://ivylab.space/popover

Installation

Install the npm package.

npm i @ivylab/angular-popover
    

Import NgModule:

import { PopoverModule } from '@ivylab/angular-popover';
 
@NgModule({
    imports: [PopoverModule]
}) 

Usage

Use the popover tag for your content:

<popover #myPopover>
    A popover is a light roll made from an egg batter similar to that of Yorkshire pudding.
</popover>

<button [popoverTriggerFor]="myPopover">Show</button>

Or pass your component to the popover:

import {Popover} from './popover';
import {MyComponent} from './my-component';

export class AppComponent {
    constructor(public popover: Popover) { }
    
    showPopover(event){
        this.popover.load({
            event,
            component: MyComponent
        });
    }
}

Specify an $event as an argument to pass element information to the popover:

<button (click)="showPopover($event)">Show</button>

Also pass your component to entryComponents when importing into module:

import {MyComponent} from './my-component';

@NgModule({
    declarations: [MyComponent],
    entryComponents: [MyComponent]
})

Properties

| name | type | default | description | |------------------|-------------------------------------|---------|---------------------------------------------| | placement | "top", "bottom", "left", "right" | "bottom"| The position of the popover. | | showDelay | number | 300 | The delay in ms before showing the popover. | | hideDelay | number | 100 | The delay in ms before removing the popover.| | width | string | | Popover Width, for example "300px" or "30%".| | height | string | | Popover Height. | | maxWidth | string | | Minimum popover width, for example "300px" or "30%".| | theme | "dark", "light" | "light" | Theme of popover background and text. | | zIndex | number | "bottom"| Popover z-index. | | offset | number | 8 | Indent between the arrow of the popover and the element (in pixels).| | animation | "fade", "upwards" | | Animation of showing and hiding popover. | | animationDuration| number | 100 | The duration of the popover open/close animation.| | animationTimingFunction | "ease", "ease-in", "ease-out", "ease-in-out" | "ease-in-out" | Specifies the speed curve of an animation. | | popoverClass | string, string[] | | Custom classes for popover. | | padding | string | "16px" | Padding for popover content. | | noArrow | boolean | "bottom"| Hide arrow popover. | | whiteSpace | "nowrap", "normal" | "normal"| Controls how whitespace is handled within a popover. | | shadow | boolean | true | Shadow of the popover. | | fontSize | string | | The size of the text inside the popover. | | pointerEvents | "auto", "none" | "none" | Defines whether or not an element reacts to pointer events. | | display | boolean | true | Popover availability for display. |

Set default values

Pass your parameters when importing the module:

And pass your parameters when importing the module:

import {PopoverModule, PopoverProperties} from './popover';
const MyDefaultPopoverProperties: PopoverProperties = {
    theme: 'dark'
}
 
@NgModule({
    imports: [ 
        PopoverModule.forRoot(MyDefaultPopoverProperties as PopoverProperties)
    ]
})

Methods

| Method | Description | |------------------|---------------------------------------------------------------------------------------------| | load(properties: PopoverProperties) | Show popover | | close() | Hide popover |

Events

When you call events, the delays that are specified in the options in the directive are taken into account. Default delay before tooltip hiding is 300 milliseconds.

| Event | Description | |------------------|---------------------------------------------------------------------------------------------| | {type: "show"} | The event is called before the popover appears. | | {type: "shown"} | The event is called after the animation of the appearance of the popover. | | {type: "hide"} | The event is called before the popover is hidden. | | {type: "hidden"} | The event is called after the animation of the popover is hidden. |