@longline/aqua-ui 1.0.110 → 1.0.111
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/modules/MainMenu/Item.js +30 -52
- package/package.json +1 -1
package/modules/MainMenu/Item.js
CHANGED
|
@@ -40,61 +40,39 @@ var ItemBase = function (props) {
|
|
|
40
40
|
var _b = useSpring(function () { return ({
|
|
41
41
|
from: { maxWidth: BUTTON_SIZE }
|
|
42
42
|
}); }), springs = _b[0], api = _b[1];
|
|
43
|
-
// If active is set to on, we must disable animation and collaps the button.
|
|
44
|
-
React.useEffect(function () {
|
|
45
|
-
if (props.active == true) {
|
|
46
|
-
api.start({
|
|
47
|
-
from: {
|
|
48
|
-
maxWidth: BUTTON_SIZE,
|
|
49
|
-
},
|
|
50
|
-
to: {
|
|
51
|
-
maxWidth: BUTTON_SIZE,
|
|
52
|
-
},
|
|
53
|
-
config: {
|
|
54
|
-
mass: 1,
|
|
55
|
-
tension: 170,
|
|
56
|
-
friction: 26,
|
|
57
|
-
damping: 1,
|
|
58
|
-
precision: 0.01
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}, [props.active]);
|
|
63
43
|
var handleMouseEnter = function () {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
44
|
+
api.start({
|
|
45
|
+
from: {
|
|
46
|
+
maxWidth: BUTTON_SIZE,
|
|
47
|
+
},
|
|
48
|
+
to: {
|
|
49
|
+
maxWidth: content.current.scrollWidth + 24 + 13,
|
|
50
|
+
},
|
|
51
|
+
config: {
|
|
52
|
+
mass: 1,
|
|
53
|
+
tension: 400,
|
|
54
|
+
friction: 20,
|
|
55
|
+
damping: 1,
|
|
56
|
+
precision: 0.01
|
|
57
|
+
}
|
|
58
|
+
});
|
|
80
59
|
};
|
|
81
60
|
var handleMouseLeave = function () {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
});
|
|
61
|
+
api.start({
|
|
62
|
+
from: {
|
|
63
|
+
maxWidth: content.current.scrollWidth + 24 + 13,
|
|
64
|
+
},
|
|
65
|
+
to: {
|
|
66
|
+
maxWidth: BUTTON_SIZE,
|
|
67
|
+
},
|
|
68
|
+
config: {
|
|
69
|
+
mass: 1,
|
|
70
|
+
tension: 170,
|
|
71
|
+
friction: 26,
|
|
72
|
+
damping: 1,
|
|
73
|
+
precision: 0.01
|
|
74
|
+
}
|
|
75
|
+
});
|
|
98
76
|
};
|
|
99
77
|
return (React.createElement("div", { tabIndex: -1, className: props.className, onMouseEnter: !props.noExpand ? handleMouseEnter : null, onMouseLeave: !props.noExpand ? handleMouseLeave : null, onClick: (_a = props.onClick) !== null && _a !== void 0 ? _a : null },
|
|
100
78
|
React.createElement(Animatable, { style: __assign({}, springs) },
|