Socket
Socket
Sign inDemoInstall

akutil-common

Package Overview
Dependencies
3
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

akutil-common

Utilities shared by AtlasKit components


Version published
Weekly downloads
287
decreased by-63.53%
Maintainers
1
Created
Weekly downloads
 

Readme

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc