pixuireactcomponents 1.3.65 → 1.3.66
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/package.json
CHANGED
|
@@ -126,7 +126,29 @@ export function ScrollBar(props) {
|
|
|
126
126
|
sWindow.style.overflow = 'hidden';
|
|
127
127
|
sWindow.style.overflow = 'scroll';
|
|
128
128
|
};
|
|
129
|
-
|
|
129
|
+
var handleMouseEnter = function () {
|
|
130
|
+
sBlock.style.backgroundImage = "url(".concat(props.sBlockImgHavor, ")");
|
|
131
|
+
sFrame.style.backgroundImage = "url(".concat(props.sFrameImgHavor, ")");
|
|
132
|
+
};
|
|
133
|
+
var handleMouseLeave = function () {
|
|
134
|
+
sFrame.style.backgroundImage = "url(".concat(props.sframeImgNormal, ")");
|
|
135
|
+
sBlock.style.backgroundImage = "url(".concat(props.sblockImgNormal, ")");
|
|
136
|
+
};
|
|
137
|
+
var dragendMouseLeave = function (event) {
|
|
138
|
+
// 获取鼠标位置
|
|
139
|
+
if (event.clientY < sFrame.getBoundingClientRect().top || // 超出上边界
|
|
140
|
+
event.clientY > sFrame.getBoundingClientRect().bottom || // 超出下边界
|
|
141
|
+
event.clientX > sFrame.getBoundingClientRect().right || // 超出右边界
|
|
142
|
+
event.clientX < sFrame.getBoundingClientRect().left) { // 超出左边界
|
|
143
|
+
handleMouseLeave();
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
handleMouseEnter();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return (
|
|
150
|
+
// <div id="sframe" style={sFrameStyle}>
|
|
151
|
+
h("div", { id: "sframe", style: sFrameStyle, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
130
152
|
h("div", { id: "sblock", style: sBlockStyle, draggable: true, onDragStart: function (event) {
|
|
131
153
|
sBlock.style.backgroundImage = "url(".concat(props.sBlockImgClick, ")");
|
|
132
154
|
sFrame.style.backgroundImage = "url(".concat(props.sFrameImgClick, ")");
|
|
@@ -137,5 +159,7 @@ export function ScrollBar(props) {
|
|
|
137
159
|
isDragingSBlock = false;
|
|
138
160
|
sBlock.style.backgroundImage = "url(".concat(props.sBlockImgNormal, ")");
|
|
139
161
|
sFrame.style.backgroundImage = "url(".concat(props.sFrameImgNormal, ")");
|
|
162
|
+
// pixui bug fix: drag end 时判断鼠标区域是否在滚动条外
|
|
163
|
+
dragendMouseLeave(event);
|
|
140
164
|
}, onDrag: sBlockScrolling })));
|
|
141
165
|
}
|