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

@vaadin/active-state-mixin

Package Overview
Dependencies
Maintainers
16
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/active-state-mixin - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

active-state-class.d.ts
import { LitElement } from 'lit-element';
export declare abstract class ActiveStateClass extends LitElement {
protected _onKeyDown?(event: KeyboardEvent): void;
protected _onKeyUp?(event: KeyboardEvent): void;
protected _onMouseDown?(event: MouseEvent): void;

@@ -6,0 +4,0 @@ protected _onTouchStart?(event: TouchEvent): void;

6

active-state-mixin.d.ts

@@ -0,6 +1,6 @@

import { Constructor } from '@vaadin/mixin-utils';
import { DisabledStateInterface } from '@vaadin/disabled-state-mixin';
import { KeyboardClass } from '@vaadin/keyboard-mixin/keyboard-class.js';
import { ActiveStateClass } from './active-state-class';
declare type Constructor<T = object> = new (...args: any[]) => T;
export declare const ActiveStateMixin: <T extends Constructor<DisabledStateInterface & ActiveStateClass>>(base: T) => T & Constructor<ActiveStateClass>;
export {};
export declare const ActiveStateMixin: <T extends Constructor<DisabledStateInterface & ActiveStateClass & KeyboardClass>>(base: T) => T & Constructor<ActiveStateClass>;
//# sourceMappingURL=active-state-mixin.d.ts.map

@@ -0,3 +1,4 @@

import { KeyboardMixin } from '@vaadin/keyboard-mixin/keyboard-mixin.js';
export const ActiveStateMixin = (base) => {
class ActiveState extends base {
class ActiveState extends KeyboardMixin(base) {
firstUpdated(props) {

@@ -8,8 +9,2 @@ super.firstUpdated(props);

});
this.addEventListener('keydown', (event) => {
this._onKeyDown(event);
});
this.addEventListener('keyup', (event) => {
this._onKeyUp(event);
});
this.addEventListener('touchstart', (event) => {

@@ -31,2 +26,3 @@ this._onTouchStart(event);

_onKeyDown(event) {
super._onKeyDown && super._onKeyDown(event);
if (/^( |SpaceBar|Enter)$/.test(event.key) && !this.disabled && !event.defaultPrevented) {

@@ -37,3 +33,4 @@ event.preventDefault();

}
_onKeyUp(_event) {
_onKeyUp(event) {
super._onKeyUp && super._onKeyUp(event);
this._setActive(false);

@@ -40,0 +37,0 @@ }

{
"name": "@vaadin/active-state-mixin",
"version": "0.1.2",
"version": "0.1.3",
"author": "Vaadin Ltd",

@@ -18,3 +18,5 @@ "license": "Apache-2.0",

"dependencies": {
"@vaadin/disabled-state-mixin": "^0.1.0",
"@vaadin/disabled-state-mixin": "^0.1.1",
"@vaadin/keyboard-mixin": "^0.1.0",
"@vaadin/mixin-utils": "^0.1.0",
"lit-element": "^2.0.0",

@@ -30,3 +32,3 @@ "lit-html": "^1.0.0"

},
"gitHead": "f5071de4574cadf60279853ae957abdadb5cd176"
"gitHead": "ff5f69931daced1cb7176b7774547752c1c982c7"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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