pixuireactcomponents 1.5.6 → 1.5.8
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
|
@@ -130,15 +130,15 @@ export var Slider = function (props) {
|
|
|
130
130
|
var newValue = trimValue(newPercent * (max - min));
|
|
131
131
|
if (newPercent != percent) {
|
|
132
132
|
setPercent(newValue / (max - min));
|
|
133
|
-
if (status == 'move') {
|
|
133
|
+
if (status == 'move' || status == 'all') {
|
|
134
134
|
onChange && onChange(newValue);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
// start和end一定要发
|
|
138
|
-
if (status == 'start') {
|
|
138
|
+
if (status == 'start' || status == 'all') {
|
|
139
139
|
onChangeStart && onChangeStart(newValue);
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
if (status == 'end' || status == 'all') {
|
|
142
142
|
onChangeComplete && onChangeComplete(newValue);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
@@ -169,6 +169,9 @@ export var Slider = function (props) {
|
|
|
169
169
|
draging.current = false;
|
|
170
170
|
setValueByPos(event.clientX, event.clientY, 'end');
|
|
171
171
|
};
|
|
172
|
+
var onMouseDown = function (event) {
|
|
173
|
+
setValueByPos(event.clientX, event.clientY, 'all');
|
|
174
|
+
};
|
|
172
175
|
useEffect(function () {
|
|
173
176
|
if (refRail.current) {
|
|
174
177
|
var delta = percent * (vertical ? refRail.current.clientHeight : refRail.current.clientWidth);
|
|
@@ -179,7 +182,7 @@ export var Slider = function (props) {
|
|
|
179
182
|
var elementStyleOrClass = getElementStyleOrClass();
|
|
180
183
|
var handleStyle = __assign(__assign({}, (typeof elementStyleOrClass.handle === 'object' ? elementStyleOrClass.handle : undefined)), (vertical ? { top: -handleSize / 2 } : { left: '100%', marginLeft: -handleSize / 2 }));
|
|
181
184
|
return (h("div", { id: id, className: rootClassName, style: __assign({}, rowCenterCenter) },
|
|
182
|
-
h("div", { ref: refRail, className: typeof elementStyleOrClass.rail === 'string' ? elementStyleOrClass.rail : '', style: __assign({}, (typeof elementStyleOrClass.rail === 'object' ? elementStyleOrClass.rail : undefined)), draggable: true, onDragStart: onDragStart, onDrag: onDrag, onDragEnd: onDragEnd }, refRail.current &&
|
|
185
|
+
h("div", { ref: refRail, className: typeof elementStyleOrClass.rail === 'string' ? elementStyleOrClass.rail : '', style: __assign({}, (typeof elementStyleOrClass.rail === 'object' ? elementStyleOrClass.rail : undefined)), draggable: true, onMouseDown: onMouseDown, onDragStart: onDragStart, onDrag: onDrag, onDragEnd: onDragEnd }, refRail.current &&
|
|
183
186
|
h("div", { className: typeof elementStyleOrClass.track === 'string' ? elementStyleOrClass.track : '', style: trackStyle },
|
|
184
187
|
h("div", { ref: handleRef, className: typeof elementStyleOrClass.handle === 'string' ? elementStyleOrClass.handle : '', style: __assign(__assign({}, handleStyle), { position: 'absolute' }) })))));
|
|
185
188
|
};
|
|
@@ -59,9 +59,11 @@ export var LoadChecker = function (props) {
|
|
|
59
59
|
}
|
|
60
60
|
}, [loadedElements, collectFinish]);
|
|
61
61
|
var getLoadCount = function (node) {
|
|
62
|
-
if (!node)
|
|
62
|
+
if (!node || node.nodeType !== 1)
|
|
63
63
|
return;
|
|
64
|
-
|
|
64
|
+
var style = window.getComputedStyle(node);
|
|
65
|
+
var backgroundImage = style.getPropertyValue('background-image');
|
|
66
|
+
if (node.tagName.toLowerCase() === 'img' || (backgroundImage && backgroundImage.length > 0)) {
|
|
65
67
|
// node.id = 'img_' + cnt++;
|
|
66
68
|
setCollectSrcs(function (prevRecords) {
|
|
67
69
|
var src = getEleSrc(node);
|