Socket
Socket
Sign inDemoInstall

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


Version published
Weekly downloads
295
increased by19.43%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 04 Oct 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