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

@spectrum-web-components/slider

Package Overview
Dependencies
Maintainers
2
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/slider - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [0.3.2](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/slider@0.3.1...@spectrum-web-components/slider@0.3.2) (2019-12-02)
### Bug Fixes
- normalize "event" and "error" argument names ([8d382cd](https://github.com/adobe/spectrum-web-components/commit/8d382cd))
## [0.3.1](https://github.com/adobe/spectrum-web-components/compare/@spectrum-web-components/slider@0.3.0...@spectrum-web-components/slider@0.3.1) (2019-11-27)

@@ -8,0 +14,0 @@

46

lib/slider.js

@@ -35,6 +35,6 @@ /*

this.supportsPointerEvent = 'setPointerCapture' in this;
this.onMouseUp = (ev) => {
this.onMouseUp = (event) => {
// Retain focus on input element after mouse up to enable keyboard interactions
this.focus();
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
document.removeEventListener('mousemove', this.onMouseMove);

@@ -48,4 +48,4 @@ document.removeEventListener('mouseup', this.onMouseUp);

};
this.onMouseMove = (ev) => {
this.currentMouseEvent = ev;
this.onMouseMove = (event) => {
this.currentMouseEvent = event;
};

@@ -242,3 +242,3 @@ }

}
onPointerDown(ev) {
onPointerDown(event) {
if (this.disabled) {

@@ -249,5 +249,5 @@ return;

this.dragging = true;
this.handle.setPointerCapture(ev.pointerId);
this.handle.setPointerCapture(event.pointerId);
}
onMouseDown(ev) {
onMouseDown(event) {
if (this.supportsPointerEvent) {

@@ -263,3 +263,3 @@ return;

this.dragging = true;
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
this._trackMouseEvent();

@@ -274,3 +274,3 @@ }

}
onPointerUp(ev) {
onPointerUp(event) {
// Retain focus on input element after mouse up to enable keyboard interactions

@@ -280,14 +280,14 @@ this.focus();

this.dragging = false;
this.handle.releasePointerCapture(ev.pointerId);
this.handle.releasePointerCapture(event.pointerId);
this.dispatchChangeEvent();
}
onPointerMove(ev) {
onPointerMove(event) {
if (!this.dragging) {
return;
}
this.value = this.calculateHandlePosition(ev);
this.value = this.calculateHandlePosition(event);
}
onPointerCancel(ev) {
onPointerCancel(event) {
this.dragging = false;
this.handle.releasePointerCapture(ev.pointerId);
this.handle.releasePointerCapture(event.pointerId);
}

@@ -298,15 +298,15 @@ /**

*/
onTrackPointerDown(ev) {
if (ev.target === this.handle || this.disabled) {
onTrackPointerDown(event) {
if (event.target === this.handle || this.disabled) {
return;
}
this.dragging = true;
this.handle.setPointerCapture(ev.pointerId);
this.value = this.calculateHandlePosition(ev);
this.handle.setPointerCapture(event.pointerId);
this.value = this.calculateHandlePosition(event);
}
onTrackMouseDown(ev) {
onTrackMouseDown(event) {
if (this.supportsPointerEvent) {
return;
}
if (ev.target === this.handle || this.disabled) {
if (event.target === this.handle || this.disabled) {
return;

@@ -317,3 +317,3 @@ }

this.dragging = true;
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
this._trackMouseEvent();

@@ -341,6 +341,6 @@ }

*/
calculateHandlePosition(ev) {
calculateHandlePosition(event) {
const rect = this.getBoundingClientRect();
const minOffset = rect.left;
const offset = ev.clientX;
const offset = event.clientX;
const size = rect.width;

@@ -347,0 +347,0 @@ const percent = (offset - minOffset) / size;

@@ -21,3 +21,3 @@ {

],
"version": "0.3.1",
"version": "0.3.2",
"description": "",

@@ -45,6 +45,6 @@ "main": "lib/index.js",

"dependencies": {
"@spectrum-web-components/shared": "^0.3.1",
"@spectrum-web-components/shared": "^0.3.2",
"tslib": "^1.10.0"
},
"gitHead": "b81218bc84e60248f14a1aee7e58ade0030e52dc"
"gitHead": "b3bff461b5e5cac7211dba5a54dae4c82d809a85"
}

@@ -286,3 +286,3 @@ /*

private onPointerDown(ev: PointerEvent): void {
private onPointerDown(event: PointerEvent): void {
if (this.disabled) {

@@ -293,6 +293,6 @@ return;

this.dragging = true;
this.handle.setPointerCapture(ev.pointerId);
this.handle.setPointerCapture(event.pointerId);
}
private onMouseDown(ev: MouseEvent): void {
private onMouseDown(event: MouseEvent): void {
if (this.supportsPointerEvent) {

@@ -308,3 +308,3 @@ return;

this.dragging = true;
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
this._trackMouseEvent();

@@ -321,3 +321,3 @@ }

private onPointerUp(ev: PointerEvent): void {
private onPointerUp(event: PointerEvent): void {
// Retain focus on input element after mouse up to enable keyboard interactions

@@ -327,10 +327,10 @@ this.focus();

this.dragging = false;
this.handle.releasePointerCapture(ev.pointerId);
this.handle.releasePointerCapture(event.pointerId);
this.dispatchChangeEvent();
}
private onMouseUp = (ev: MouseEvent): void => {
private onMouseUp = (event: MouseEvent): void => {
// Retain focus on input element after mouse up to enable keyboard interactions
this.focus();
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
document.removeEventListener('mousemove', this.onMouseMove);

@@ -345,16 +345,16 @@ document.removeEventListener('mouseup', this.onMouseUp);

private onPointerMove(ev: PointerEvent): void {
private onPointerMove(event: PointerEvent): void {
if (!this.dragging) {
return;
}
this.value = this.calculateHandlePosition(ev);
this.value = this.calculateHandlePosition(event);
}
private onMouseMove = (ev: MouseEvent): void => {
this.currentMouseEvent = ev;
private onMouseMove = (event: MouseEvent): void => {
this.currentMouseEvent = event;
};
private onPointerCancel(ev: PointerEvent): void {
private onPointerCancel(event: PointerEvent): void {
this.dragging = false;
this.handle.releasePointerCapture(ev.pointerId);
this.handle.releasePointerCapture(event.pointerId);
}

@@ -366,17 +366,17 @@

*/
private onTrackPointerDown(ev: PointerEvent): void {
if (ev.target === this.handle || this.disabled) {
private onTrackPointerDown(event: PointerEvent): void {
if (event.target === this.handle || this.disabled) {
return;
}
this.dragging = true;
this.handle.setPointerCapture(ev.pointerId);
this.handle.setPointerCapture(event.pointerId);
this.value = this.calculateHandlePosition(ev);
this.value = this.calculateHandlePosition(event);
}
private onTrackMouseDown(ev: MouseEvent): void {
private onTrackMouseDown(event: MouseEvent): void {
if (this.supportsPointerEvent) {
return;
}
if (ev.target === this.handle || this.disabled) {
if (event.target === this.handle || this.disabled) {
return;

@@ -387,3 +387,3 @@ }

this.dragging = true;
this.currentMouseEvent = ev;
this.currentMouseEvent = event;
this._trackMouseEvent();

@@ -416,6 +416,6 @@ }

*/
private calculateHandlePosition(ev: PointerEvent | MouseEvent): number {
private calculateHandlePosition(event: PointerEvent | MouseEvent): number {
const rect = this.getBoundingClientRect();
const minOffset = rect.left;
const offset = ev.clientX;
const offset = event.clientX;
const size = rect.width;

@@ -422,0 +422,0 @@

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