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

electrum-events

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrum-events - npm Package Compare versions

Comparing version 0.9.0 to 1.0.0

54

lib/event-handlers.js

@@ -76,4 +76,4 @@ 'use strict';

}, {
key: 'handleSelect',
value: function handleSelect(ev) {
key: 'handleKeyPress',
value: function handleKeyPress(ev) {
var _this5 = this;

@@ -85,7 +85,16 @@

}
}, {
key: 'handleSelect',
value: function handleSelect(ev) {
var _this6 = this;
this.notify(ev, function (e) {
return _this6.processChangeEvent(e);
});
}
}, {
key: 'notify',
/* private methods */
}, {
key: 'notify',
value: function notify(ev, handler) {

@@ -124,2 +133,39 @@ if (ev.hasOwnProperty('target')) {

}
}], [{
key: 'inject',
value: function inject(obj, props, bus) {
var eh = new EventHandlers(props, bus);
/* jshint expr: true */
var existingOnFocus = obj.onFocus;
var existingOnChange = obj.onChange;
var existingOnKeyDown = obj.onKeyDown;
var existingOnKeyPress = obj.onKeyPress;
var existingOnKeyUp = obj.onKeyUp;
var existingOnSelect = obj.onSelect;
obj.onFocus = function (e) {
existingOnFocus && existingOnFocus.call(obj, e);
eh.handleFocus(e);
};
obj.onChange = function (e) {
existingOnChange && existingOnChange.call(obj, e);
eh.handleChange(e);
};
obj.onKeyDown = function (e) {
existingOnKeyDown && existingOnKeyDown.call(obj, e);
eh.handleKeyDown(e);
};
obj.onKeyUp = function (e) {
existingOnKeyUp && existingOnKeyUp.call(obj, e);
eh.handleKeyUp(e);
};
obj.onKeyPress = function (e) {
existingOnKeyPress && existingOnKeyPress.call(obj, e);
eh.handleKeyPress(e);
};
obj.onSelect = function (e) {
existingOnSelect && existingOnSelect.call(obj, e);
eh.handleSelect(e);
};
}
}]);

@@ -126,0 +172,0 @@

2

package.json
{
"name": "electrum-events",
"version": "0.9.0",
"version": "1.0.0",
"description": "Electrum Events forwards web component events to the bus.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -45,2 +45,6 @@ 'use strict';

handleKeyPress (ev) {
this.notify (ev, e => this.processChangeEvent (e));
}
handleSelect (ev) {

@@ -50,2 +54,38 @@ this.notify (ev, e => this.processChangeEvent (e));

static inject (obj, props, bus) {
const eh = new EventHandlers (props, bus);
/* jshint expr: true */
const existingOnFocus = obj.onFocus;
const existingOnChange = obj.onChange;
const existingOnKeyDown = obj.onKeyDown;
const existingOnKeyPress = obj.onKeyPress;
const existingOnKeyUp = obj.onKeyUp;
const existingOnSelect = obj.onSelect;
obj.onFocus = e => {
existingOnFocus && existingOnFocus.call (obj, e);
eh.handleFocus (e);
};
obj.onChange = e => {
existingOnChange && existingOnChange.call (obj, e);
eh.handleChange (e);
};
obj.onKeyDown = e => {
existingOnKeyDown && existingOnKeyDown.call (obj, e);
eh.handleKeyDown (e);
};
obj.onKeyUp = e => {
existingOnKeyUp && existingOnKeyUp.call (obj, e);
eh.handleKeyUp (e);
};
obj.onKeyPress = e => {
existingOnKeyPress && existingOnKeyPress.call (obj, e);
eh.handleKeyPress (e);
};
obj.onSelect = e => {
existingOnSelect && existingOnSelect.call (obj, e);
eh.handleSelect (e);
};
}
/* private methods */

@@ -52,0 +92,0 @@

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