@smart-react-components/ui 2.0.0-alpha-88 → 2.0.0-alpha-90
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.
package/WaveEffect/index.js
CHANGED
|
@@ -17,18 +17,18 @@ const WaveEffect = react_1.default.forwardRef(({ children, duration, palette = '
|
|
|
17
17
|
const getDuration = () => duration !== null && duration !== void 0 ? duration : theme.$.transition.waveEffectDuration;
|
|
18
18
|
react_1.default.useEffect(() => {
|
|
19
19
|
if (effectItems.length > 0) {
|
|
20
|
-
(0, dom_1.addEventListener)(window, [
|
|
21
|
-
(0, dom_1.addEventListener)(window, [
|
|
20
|
+
(0, dom_1.addEventListener)(window, [theme.$.vars.isMobile ? 'touchmove' : 'mousemove'], handleMove);
|
|
21
|
+
(0, dom_1.addEventListener)(window, [theme.$.vars.isMobile ? 'touchend' : 'mouseup'], handleEnd);
|
|
22
22
|
return () => {
|
|
23
|
-
(0, dom_1.removeEventListener)(window, [
|
|
24
|
-
(0, dom_1.removeEventListener)(window, [
|
|
23
|
+
(0, dom_1.removeEventListener)(window, [theme.$.vars.isMobile ? 'touchmove' : 'mousemove'], handleMove);
|
|
24
|
+
(0, dom_1.removeEventListener)(window, [theme.$.vars.isMobile ? 'touchend' : 'mouseup'], handleEnd);
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
}, [effectItems]);
|
|
28
28
|
const handleMouseDown = (e) => {
|
|
29
29
|
var _a, _b;
|
|
30
30
|
(_b = (_a = children.props) === null || _a === void 0 ? void 0 : _a.onMouseDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
31
|
-
if (!
|
|
31
|
+
if (!theme.$.vars.isMobile && e.button === 0) {
|
|
32
32
|
start(e);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
@@ -43,7 +43,7 @@ const WaveEffect = react_1.default.forwardRef(({ children, duration, palette = '
|
|
|
43
43
|
const scale = (ref.current.clientWidth / 100) * 2;
|
|
44
44
|
let left;
|
|
45
45
|
let top;
|
|
46
|
-
if (
|
|
46
|
+
if (theme.$.vars.isMobile) {
|
|
47
47
|
const t = e.touches[0];
|
|
48
48
|
left = (t.pageX - window.pageXOffset) - rect.left;
|
|
49
49
|
top = (t.pageY - window.pageYOffset) - rect.top;
|
|
@@ -47,7 +47,7 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
|
|
|
47
47
|
align-items: stretch;
|
|
48
48
|
background: transparent;
|
|
49
49
|
border: 0;
|
|
50
|
-
border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' :
|
|
50
|
+
border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' : '0'};
|
|
51
51
|
font-family: ${theme.$.fontFamily.button};
|
|
52
52
|
position: relative;
|
|
53
53
|
transition: box-shadow 300ms 0s ease-in-out;
|
|
@@ -244,20 +244,6 @@ exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ ha
|
|
|
244
244
|
`
|
|
245
245
|
: ''}
|
|
246
246
|
|
|
247
|
-
${hasSeparatedLeftAddon
|
|
248
|
-
? `
|
|
249
|
-
border-top-left-radius: 0;
|
|
250
|
-
border-bottom-left-radius: 0;
|
|
251
|
-
`
|
|
252
|
-
: ''}
|
|
253
|
-
|
|
254
|
-
${hasSeparatedRightAddon
|
|
255
|
-
? `
|
|
256
|
-
border-top-right-radius: 0;
|
|
257
|
-
border-bottom-right-radius: 0;
|
|
258
|
-
`
|
|
259
|
-
: ''}
|
|
260
|
-
|
|
261
247
|
.src-button-content {
|
|
262
248
|
border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' : theme.$.radius.button[shape]};
|
|
263
249
|
|
|
@@ -151,7 +151,7 @@ const useFixedBoxMethods = ({ beforeShow, boxEl, getTriggerEl, handlePosition, h
|
|
|
151
151
|
(0, dom_1.addEventListener)(window, ['click'], handleWindowClick);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
if (!
|
|
154
|
+
if (!theme.$.vars.isMobile && triggerInteraction & types_1.TriggerInteraction.HOVER) {
|
|
155
155
|
if (!getStatus()) {
|
|
156
156
|
(0, dom_1.addEventListener)(triggerEl, ['mouseenter'], handleTriggerMouseEnter);
|
|
157
157
|
}
|
|
@@ -182,7 +182,7 @@ const useFixedBoxMethods = ({ beforeShow, boxEl, getTriggerEl, handlePosition, h
|
|
|
182
182
|
(0, dom_1.removeEventListener)(window, ['click'], handleWindowClick);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
if (!
|
|
185
|
+
if (!theme.$.vars.isMobile && triggerInteraction & types_1.TriggerInteraction.HOVER) {
|
|
186
186
|
if (!getStatus()) {
|
|
187
187
|
(0, dom_1.removeEventListener)(triggerEl, ['mouseenter'], handleTriggerMouseEnter);
|
|
188
188
|
}
|