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

@groupby/elements-sayt

v0.2.0

Published

## Functionality

Downloads

1

Readme

GroupBy Elements SAYT (Search As You Type) Component

Functionality

The sayt component acts as a wrapper around the gbe-autocomplete and gbe-products-sayt components and acts to show and hide all of these components in response to interactions with the gbe-search-box component.

Keyboard Navigation

When paired with a searchbox (see Customization below), this component is navigable using the arrow keys. Pressing the Up and Down arrow keys in the paired searchbox will change the autocomplete selection if hideAutocomplete is not enabled. When paired with a searchbox, pressing the Enter key on an autocomplete term will update the search term inside the paired searchbox.

Received Events

This component listens for a number of events. These events are defined in the @groupby/elements-events package.

SAYT_HIDE

Upon receiving this event, the sayt component will apply the hidden attribute to itself and hide its child elements.

SAYT_SHOW

Upon receiving this event, the sayt component will remove the hidden attribute from itself and display its child elements.

SAYT_PRODUCTS_RESPONSE

Upon receiving this event, the sayt component will remove the hidden attribute from itself and display its child elements.

AUTOCOMPLETE_RESPONSE

Upon receiving this event, the sayt component will remove the hidden attribute from itself and display its child elements.

AUTOCOMPLETE_ACTIVE_TERM

Upon receiving this event, the sayt component will dispatch a request for SAYT Products.

SEARCHBOX_INPUT

Upon receiving this event, the sayt component will dispatch requests for SAYT autocomplete terms and Products based on the included query term.

DISPATCHED EVENTS

This component dispatches a number of events. These events are defined in the @groupby/elements-events package.

AUTOCOMPLETE_REQUEST

This event is dispatched to request SAYT autocomplete terms based on the included query term.

SAYT_PRODUCTS_RESPONSE

This event is dispatched to request SAYT products based on the included query term.

Customization

The GB Elements Sayt component allows for the option to not display its children components. Users of the component can add the following attributes for particular customizations:

  • hideAutocomplete: Prevents the gbe-autocomplete component from rendering.
  • hideProducts: Prevents the gbe-products component from rendering.
  • showCloseButton: Shows a button to allow for closing SAYT manually.
  • closeText: Customizes the text in the close button.
  • visible: Determines the visibility of the sayt component.
  • minSearchLength: The minimum length of the search term required before a SAYT request will be made with it.
  • searchbox: Optional ID of the searchbox paired with this component.
  • group: Optional attribute to add the sayt component to a grouping of related search components. The component will only act on events if they contain the same group name as the component.
  • area: The area to use in product searches.
  • collection: The collection to use in autocomplete and product searches.

Testing

The test suite for this component is contained in /packages/web-components/@groupby/elements-sayt/test. To run the tests, navigate to this folder and use one of the following commands based on the desired testing flow:

  • To run the tests once:
yarn test