@dreamworld/dw-ripple 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dw-ripple.js +17 -2
  2. package/package.json +1 -1
package/dw-ripple.js CHANGED
@@ -20,8 +20,9 @@ export class DwRipple extends Ripple {
20
20
  :host([secondary]) {
21
21
  --mdc-theme-on-surface: var(--mdc-theme-secondary);
22
22
  }
23
-
24
- .mdc-ripple-surface::before, .mdc-ripple-surface::after {
23
+
24
+ .mdc-ripple-surface::before,
25
+ .mdc-ripple-surface::after {
25
26
  background-color: var(--mdc-theme-on-surface, #000);
26
27
  }
27
28
  `,
@@ -78,37 +79,51 @@ export class DwRipple extends Ripple {
78
79
  }
79
80
 
80
81
  __onMouseDown(e) {
82
+ console.debug("__onMouseDown called", e);
81
83
  this._timeoutRippleOnMouseDown = setTimeout(() => {
84
+ console.debug("timeoutRippleOnMouseDown");
82
85
  window.addEventListener("mouseup", this.__onMouseUp);
83
86
  this._rippleHander.startPress(e);
84
87
  }, 50);
85
88
  }
86
89
 
87
90
  __onTouchStart(e) {
91
+ console.debug("__onTouchStart called", e);
88
92
  this._timeoutRippleOnTouchStart = setTimeout(() => {
93
+ console.debug("timeoutRippleOnTouchStart");
89
94
  window.addEventListener("touchend", this.__onTouchEnd);
90
95
  this._rippleHander.startPress(e);
91
96
  }, 50);
92
97
  }
93
98
 
94
99
  __onPointerMove() {
100
+ console.debug("__onPointerMove called");
95
101
  if (this._timeoutRippleOnMouseDown) {
96
102
  clearTimeout(this._timeoutRippleOnMouseDown);
97
103
  }
104
+ if (this._timeoutRippleOnTouchStart) {
105
+ clearTimeout(this._timeoutRippleOnTouchStart);
106
+ }
98
107
  }
99
108
 
100
109
  __onTouchMove() {
110
+ console.debug("__onTouchMove called");
101
111
  if (this._timeoutRippleOnTouchStart) {
102
112
  clearTimeout(this._timeoutRippleOnTouchStart);
103
113
  }
114
+ if (this._timeoutRippleOnMouseDown) {
115
+ clearTimeout(this._timeoutRippleOnMouseDown);
116
+ }
104
117
  }
105
118
 
106
119
  __onMouseUp() {
120
+ console.debug("__onMouseUp called");
107
121
  window.removeEventListener("mouseup", this.__onMouseUp);
108
122
  this._rippleHander.endPress();
109
123
  }
110
124
 
111
125
  __onTouchEnd() {
126
+ console.debug("__onTouchEnd called");
112
127
  window.removeEventListener("touchend", this.__onTouchEnd);
113
128
  this._rippleHander.endPress();
114
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamworld/dw-ripple",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Ripple element created as child-class of [`mwc-ripple`] (https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)",
5
5
  "main": "dw-ripple.js",
6
6
  "scripts": {