Socket
Socket
Sign inDemoInstall

@material/react-ripple

Package Overview
Dependencies
Maintainers
12
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/react-ripple - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

CHANGELOG.md

33

index.js

@@ -37,6 +37,8 @@ import React, {Component} from 'react';

createAdapter_ = (instance) => {
const MATCHES = util.getMatchesProperty(HTMLElement.prototype);
return {
browserSupportsCssVars: () => util.supportsCssVariables(window),
isUnbounded: () => this.props.unbounded,
isSurfaceActive: () => this.state.isActivated,
isSurfaceActive: () => instance[MATCHES](':active'),
isSurfaceDisabled: () => this.props.disabled,

@@ -70,3 +72,2 @@ addClass: (className) =>

this.props.onMouseDown(e);
this.setState({isActivated: true});
this.activateRipple(e);

@@ -77,3 +78,3 @@ }

this.props.onMouseUp(e);
this.setState({isActivated: false});
this.deactivateRipple(e);
}

@@ -86,2 +87,7 @@

handleTouchEnd = (e) => {
this.props.onTouchEnd(e);
this.deactivateRipple(e);
}
handleKeyDown = (e) => {

@@ -92,8 +98,19 @@ this.props.onKeyDown(e);

handleKeyUp = (e) => {
this.props.onKeyUp(e);
this.deactivateRipple(e);
}
activateRipple = (e) => {
// https://reactjs.org/docs/events.html#event-pooling
e.persist();
this.foundation_.activate(e);
requestAnimationFrame(() => {
this.foundation_.activate(e);
});
}
deactivateRipple = (e) => {
this.foundation_.deactivate(e);
}
updateCssVariable = (varName, value) => {

@@ -121,3 +138,5 @@ const updatedStyle = Object.assign({}, this.state.style);

onTouchStart,
onTouchEnd,
onKeyDown,
onKeyUp,
/* eslint-enable */

@@ -132,3 +151,5 @@ /* end black list of otherprops */

onTouchStart: this.handleTouchStart,
onTouchEnd: this.handleTouchEnd,
onKeyDown: this.handleKeyDown,
onKeyUp: this.handleKeyUp,
// call initRipple on ref on root element that needs ripple

@@ -152,3 +173,5 @@ initRipple: this.initializeFoundation_,

onTouchStart: PropTypes.func,
onTouchEnd: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
}, WrappedComponent.propTypes);

@@ -164,3 +187,5 @@

onTouchStart: () => {},
onTouchEnd: () => {},
onKeyDown: () => {},
onKeyUp: () => {},
}, WrappedComponent.defaultProps);

@@ -167,0 +192,0 @@

7

package.json
{
"name": "@material/react-ripple",
"version": "0.1.0",
"version": "0.2.0",
"description": "Material Components React Ripple",

@@ -17,7 +17,10 @@ "license": "Apache-2.0",

"dependencies": {
"@material/ripple": "^0.34.1",
"@material/ripple": "^0.35.0",
"classnames": "^2.2.5",
"prop-types": "^15.6.1",
"react": "^16.3.2"
},
"publishConfig": {
"access": "public"
}
}
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