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

@muntazir86/material-extended

v7.0.0

Published

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0.

Downloads

498

Readme

Angular Popover

npm (scoped)

Links

Popover Demo | StackBlitz Template | Documentation | npm

Project status

Angular Popover is production ready.

This was originally created as an example for a @angular/material issue feature request. Issue can be found at angular/material2#2691

If you'd like to contribute please create an issue or pull request.

Version Compatibility

| Angular Version | Package Compatibility | | --------------- | ---------------------- | | 18.x | 7.x | | 17.x | 6.x | | 16.x | 5.x |

Examples

Material theme picker

Material theme picker

Standard popover

image

image

Google+ style popover

image

Installation

Install npm package using:

npm install @muntazir86/material-extended

Install required packages @angular/cdk

yarn add @angular/cdk or npm install @angular/cdk

Initial setup

The CDK overlays depend on a small set of structural styles to work correctly. If you're using Angular Material, these styles have been included together with the theme, otherwise if you're using the CDK on its own, you'll have to include the styles yourself. You can do so by importing the prebuilt styles in your global stylesheet:

@import '@angular/cdk/overlay-prebuilt.css';

Import module

app.module.ts

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


import { AppComponent } from './app.component';
import { MdePopoverModule } from '@muntazir86/material-extended';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    MdePopoverModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Usage

<mde-popover> is a floating panel containing html content.

By itself, the <mde-popover> element does not render anything. The popover is attached to and opened via application of the mdePopoverTriggerFor directive:

<mde-popover #appPopover="mdePopover">
  <button md-button> Settings </button>
  <button md-button> Help </button>
</mde-popover>

<button md-button [mdePopoverTriggerFor]="appPopover"
mdePopoverTriggerOn="click">
   <md-icon>more_vert</md-icon>
</button>

API reference

MdePopover

Selector: mde-popover
Exported as: mdePopover
Properties

| Name | Description | |----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | @Input('mdePopoverPositionX') positionX | Position of the popover in the X axis. Type: string, Values: 'start' || 'end' || 'before' || 'after' || 'center', Default: 'after'. | | @Input('mdePopoverPositionY') positionY | Position of the popover in the Y axis. Type: string, Values: 'start' || 'end' || 'above' || 'below' || 'center', Default: 'below' | | @Input('mdePopoverTriggerOn') triggerEvent | Event for triggering popover 'click', 'hover' and 'none'. Default: hover | | @Input('mdePopoverEnterDelay') enterDelay | Delay for popover before enters, Type: number, Default: 200 | | @Input('mdePopoverLeaveDelay') leaveDelay | Delay for popover before leaves, Type: number, Default: 200 | | @Input('mdePopoverOverlapTrigger') overlapTrigger | Whether the popover should overlap its trigger. Type: boolean, Default: true | | @Input('mdePopoverOffsetX') targetOffsetX | Offset position of the popover from target in the X axis. Type: number, Default: 0 | | @Input('mdePopoverOffsetY') targetOffsetY | Offset position of the popover from target in the Y axis. Type: number, Default: 0 | | @Input('mdePopoverArrowOffsetX') arrowOffsetX | Offset position of the popover arrow from the X axis. Type: number, Default: 0 | | @Input('mdePopoverArrowOffsetY') arrowOffsetY | Offset position of the popover arrow from the Y axis. Type: number, Default: 0 | | @Input('mdePopoverArrowWidth') arrowWidth | Arrow width in pixels. | | @Input('mdePopoverArrowColor') arrowColor | Arrow color, accepts CSS color values. Default: rgba(0, 0, 0, 0.12) | | @Input('mdePopoverCloseOnClick') closeOnClick | Whether the popover should close on click. Type: boolean, Default: true | | @Input('mdeFocusTrapEnabled') focusTrapEnabled | Whether the popover should focus trap. Type: boolean, Default: true | | @Input('mdeFocusTrapAutoCaptureEnabled') focusTrapAutoCaptureEnabled | Whether the popover should focus trap auto capture focus. Type: boolean, Default: true | | @Input('class') classList | This method takes classes set on the host mde-popover element and applies them on the popover template that displays in the overlay container. Otherwise, it's difficult to style the containing popover from outside the component. | | @Output() close | Event emitted when the popover is closed.

Methods

setPositionClasses

It's necessary to set position-based classes to ensure the popover panel animation folds out from the correct direction.

| Parameters | |------------| | posX? | | posY? |

MdePopoverTrigger

This directive is intended to be used in conjunction with an mde-popover tag. It is responsible for toggling the display of the provided popover instance.

Selector: [mdePopoverTriggerFor]
Exported as: mdePopoverTrigger

| Name | Description | |---------------------------------------------------------------|-----------------------------------------------------------------------------------------| | @Input('mdePopoverTriggerFor') popover | References the popover instance that the trigger is associated with. | | @Input('mdePopoverTargetAt') targetElement | References the popover target instance that the popover positioning is associated with. | | @Input('mdePopoverPositionX') positionX | Position of the popover in the X axis. | | @Input('mdePopoverPositionY') positionY | Position of the popover in the Y axis. | | @Input('mdePopoverTriggerOn') triggerEvent | Event for triggering popover 'click', 'hover' and 'none'. Default: 'hover' | | @Input('mdePopoverEnterDelay') enterDelay | Delay for popover before enters, Type: number, Default: 200 | | @Input('mdePopoverLeaveDelay') leaveDelay | Delay for popover before leaves, Type: number, Default: 200 | | @Input('mdePopoverOverlapTrigger') overlapTrigger | Whether the popover should overlap its trigger. Type: boolean, Default: true | | @Input('mdeDisablePopoverTrigger') disablePopoverTrigger | Disables popover trigger. Type: boolean, Default: false | | @Input('mdePopoverOffsetX') targetOffsetX | Offset position of the popover from target in the X axis. Type: number, Default: 0 | | @Input('mdePopoverOffsetY') targetOffsetY | Offset position of the popover from target in the Y axis. Type: number, Default: 0 | | @Input('mdePopoverArrowOffsetX') arrowOffsetX | Offset position of the popover arrow from the X axis. Type: number, Default: 0 | | @Input('mdePopoverArrowOffsetY') arrowOffsetX | Offset position of the popover arrow from the Y axis. Type: number, Default: 0 | | @Input('mdePopoverArrowWidth') arrowWidth | Arrow width in pixels. Type: number, Default: 8 | | @Input('mdePopoverArrowColor') arrowColor | Arrow color, accepts CSS color values. Default: rgba(0, 0, 0, 0.12) | | @Input('mdePopoverCloseOnClick') closeOnClick | Whether the popover should close on click. Type: boolean, Default: true. | | @Input('mdePopoverCloseOnClickTrigger') closeOnClickTrigger | Whether the popover should close on click of trigger when click event is 'click'. Type: boolean, Default: true. | | @Input('mdePopoverBackdropCloseOnClick') backdropCloseOnClick | Whether the popover should close on backdrop click. Type: boolean, Default: true. | | @Output() opened | Event emitted when the associated popover is opened. | | @Output() closed | Event emitted when the associated popover is closed. |

Methods

togglePopover Toggles the popover between the open and closed states.

openPopover Opens the popover.

closePopover Closes the popover.

destroyPopover Removes the popover from the DOM.

Issues

Please report bugs and issues here.

License

MIT © Joe Jordan Brown

Angular Popover by UIXD

FOSSA Status