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

laxar-details-layer-widget

v3.0.1

Published

Provides a very simple layer to display details to some piece of information

Downloads

12

Readme

laxar-details-layer-widget Build Status

simple details layer, growing from a source element with animation as a plain LaxarJS widget

Purpose of this widget is to provide a very simple layer to display details to some piece of information. In order to clarify the link between the information and the details, the layer will be zoomed in, starting from the source element until it covers the full viewport. If no source element is given, it is directly displayed in full size.

Usage

Installation

In a LaxarJS v2 project simply run:

npm install laxar-details-layer-widget

Configuration Example

Here is an example configuration to use within your page definition:

{
   "widget": "laxar-details-layer-widget",
   "id": "myPopup",
   "features": {
      "area": {
         "name": "popupContents"
      },
      "open": {
         "onActions": [ "openSesame" ]
      },
      "close": {
         "onActions": [ "done", "closeIt" ]
      },
      "navigation": {
         "parameterName": "active-layer",
         "parameterValue": "my-popup"
      }
   }
}

This will configure a details layer instance providing a new widget area myPopup.popupContents. The popup will open itself as soon as another widget publishes a takeActionRequest event for the action topic openSesame. It will close again, when a takeActionRequest is published for either done or closeIt.

The popup will also observe and manage the place parameter active-layer to open the layer when the parameter is set to "my-popup". By using the navigation feature, the state of the UI is reflected in the URL and vice versa.

Configuration

area.name

The name of the widget area the layer will export. Depending on the theming, it will span the complete viewport, minus some margins.

open.onActions

An array of actions the widget will subscribe to and, as soon as it receives one of these actions, open itself. This action event may carry the selector for the source element under the path configured as animateFrom.actionSelectorPath.

close.onActions

An array of actions the widget will subscribe to and, as soon as it receives one of these actions, close itself. The close animation will always end at the element used to animate the layer open in the first place.

close.action

If configured, this will be used as the topic of a takeActionRequest event that is send whenever the layer is closed and the closing animation has finished.

closeIcon.enabled

If this is true, a small close icon will be rendered, that on click closes the layer. Additionally, the layer is closed as soon as the escape key is pressed.

backdropClose.enabled

If this is true, a click on the modal backdrop closes the layer.

animateFrom.activeElement

The default option is to start the opening animation from the element that triggered opening the details layer through an ui interaction. This should only be disabled, if the source of animation does not correspond to the DOM element that caused the action.

animateFrom.actionSelectorPath

A JSON path to the property within the action event object, that carries the selector for the animation source element. If this is configured, it will always have precedence over the activeElement if found on the page. In case animateFrom.activeElement is configured to be false and the element is not found, a warning will be logged.

skipAnimations.actionSelectorPath

A JSON path to the property within the action event object, that can be used to skip animations when opening the details layer widget. If this is configured and the corresponding property within the event is true, no opening animations will take place. It is still possible to provide an element to animate from. This will then be used as animation target when closing the layer again.

logTag.name

Name of a log tag to set when the popup layer is opened. As soon as the layer is closed again, the log tag is removed. Note that the log tag is only set if logTag.value is also set.

logTag.value

Value of a log tag to set when the popup layer is opened. As soon as the layer is closed again, the log tag is removed. Note that the log tag is only set if logTag.name is also set.

navigation.parameterName

Place parameter to use for indicating the currently visible details. Usually, you would use the same parameter for multiple widget instances, as only one layer should be open at any given time. If this is not set, place parameters do not interact with the details layer visibility.

navigation.parameterValue

Parameter value associated with opening this details layer instance. If set to a string, the layer is opened if the actual place parameter value matches the given string. If set to true, the layer is opened if the parameter is given flag-style, i.e. without a value.