Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

akutil-common

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

akutil-common

Utilities shared by AtlasKit components

  • 5.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
213
decreased by-11.62%
Maintainers
1
Weekly downloads
 
Created
Source

AtlasKit component registry Commitizen friendly semantic-release Report an issue Ask in our forum

AtlasKit common utilities

A set of common utilities for all AtlasKit components

Classes

KeyPressHandler

A general class to deal with key activations

Functions

computeBooleanValue()

Like el.hasAttribute(attr) but designed for use within a skate attribute change handler where you only have access to change.oldValue.

enumeration()

This property extension can be used with skate. Usage:

  props: {
      respondsTo: props.enum({values: ['toggle', 'hover'],
      missingDefault: 'toggle',
      invalidDefault: 'toggle'})({
  })

}

KeyPressHandler

A general class to deal with key activations

Kind: global class

new KeyPressHandler(key, callback, [elem])

Adds a new keypress handler

ParamTypeDescription
keyStringA named key. Case insensitive.
callbackfunctionA callback function to invoke if the given key was activated. The callback is passed the event object.
[elem]NodeThe element to listen for the key activation. Defaults to document if none given.

keyPressHandler.add(key, callback)

Adds or replaces a key that is listened for.

Kind: instance method of KeyPressHandler

ParamTypeDescription
keyStringA named key. Case insensitive. Replaces any previous listened key.
callbackfunctionThe callback function to invoke.

keyPressHandler.destroy([key])

Removes a key from the list of listened keys. Or removes the whole listener if no key given.

Kind: instance method of KeyPressHandler

ParamTypeDescription
[key]StringA named key. Case insensitive. If none given, event listener is removed.

computeBooleanValue()

Like el.hasAttribute(attr) but designed for use within a skate attribute change handler where you only have access to change.oldValue.

Kind: global function

enumeration()

This property extension can be used with skate. Usage:

props: {
    respondsTo: props.enum({values: ['toggle', 'hover'],
    missingDefault: 'toggle',
    invalidDefault: 'toggle'})({

    })
}

Kind: global function

Support and feedback

We're here to help!

Let us know what you think of our components and docs, your feedback is really important for us.

Community support

Ask a question in our forum.

Check if someone has already asked the same question before.

Create a support ticket

Are you in trouble? Let us know!

Keywords

FAQs

Package last updated on 09 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc