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

@ovh-ux/ng-ovh-responsive-popover

v6.1.1

Published

Module is used to display a popover and adapt it to the screen dimension.

Downloads

22

Readme

ng-ovh-responsive-popover

AngularJS module used to display a popover and adapt it to the screen dimension.

npm version Downloads Dependencies Dev Dependencies

Install

$ yarn add @ovh-ux/ng-ovh-responsive-popover

Usage

import angular from 'angular';
import ngOvhResponsivePopover from '@ovh-ux/ng-ovh-responsive-popover';

angular.module('myApp', [ngOvhResponsivePopover]);

The two major directives are:

  • the responsivePopover directive that will display a uibPopover to the DOM element you instanciate it;
  • the responsivePopoverClass directive that is added to the popover popup.

Note: when ui-bootstrap will be updated to version >= 2.0, it should be possible to remove responsivePopover directive and use uibPopover directive with custom class responsive-popover-class. So responsivePopoverClass directive will be the only directive of this component.

Then inject responsivePopover module in your module declaration:

Documentation

responsivePopover - directive

This is the main directive of the responsivePopover module. In fact it's an extended uibPopover with an additional class applied to it's content template.

For available options, see the doc of uibPopover.

Example

The following example will open a popover with the content of path/of/popover/content.html file inside. This popover will be closed when focus is lost inside of it.

<button type="button"
        data-responsive-popover="'path/of/popover/content.html'"
        data-popover-placement="bottom-left"
        data-popover-trigger="focus">
</button>

responsivePopoverClass - directive

This directive manage the way the popover is displayed. This uses the configuration setted into the responsivePopoverProvider to detect if the popover needs to be displayed on full screen or to be displayed normally. It is automatically setted by responsivePopover directive.

Note: when ui-bootstrap version >= 2.0 will be used, the only thing to do should be to add a custom class with the 'popover-class' option of the uibPopover directive. To be tested.

responsivePopoverProvider - provider

responsivePopoverProvider allows developer to configure which mediaQuery will be considered as a mobile.

Methods

setMobileMediaQuery

Allows you to determine what app will consider as a mobile for responsive popover display.

Parameters

| Param | Type | Details | | ---- | ---- | ---- | | query | String | The matchMedia query that will be used to detect mobile. |

Returns

| Type | Description | | ---- | ---- | | String | The new query provided. |

Example

import angular from 'angular';

angular.module('myApp').config(
  /* @ngInject */ (responsivePopoverProvider) => {
    // tell to the module that we consider a mobile device with at least 800px width
    responsivePopoverProvider.setMobileMediaQuery('(max-width: 800px)');
  },
);

responsivePopover - service

This service enable you to get configured values.

Methods

getMobileMediaQuery

Get the current configured media query. It is used to detect the popover display (simple popover or full screen popover for mobile).

Returns

| Type | Description | | ---- | ---- | | String | The configured mediaQuery. |

Test

$ yarn test

Related

Contributing

Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.

License

BSD-3-Clause © OVH SAS