plataforma-fundacao-componentes 2.26.11 → 2.26.12
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/dist/index.modern.js
CHANGED
|
@@ -13126,6 +13126,7 @@ var VerticalSlider = forwardRef(function (_ref, ref) {
|
|
|
13126
13126
|
var index = options.findIndex(function (o) {
|
|
13127
13127
|
return o.value === value;
|
|
13128
13128
|
});
|
|
13129
|
+
movingRef.current.elementIndex = index;
|
|
13129
13130
|
if (fillRef.current) {
|
|
13130
13131
|
var height = (index + 1) * optionHeight;
|
|
13131
13132
|
var gaps = index * optionGap;
|
|
@@ -13159,7 +13160,7 @@ var VerticalSlider = forwardRef(function (_ref, ref) {
|
|
|
13159
13160
|
return optionHeight + optionGap;
|
|
13160
13161
|
});
|
|
13161
13162
|
}, [options]);
|
|
13162
|
-
var
|
|
13163
|
+
var accumulatedHeights = useMemo(function () {
|
|
13163
13164
|
return heights.reduce(function (ac, at, i) {
|
|
13164
13165
|
if (i === 0) return [at];
|
|
13165
13166
|
return [].concat(ac, [ac[i - 1] + at]);
|
|
@@ -13173,7 +13174,7 @@ var VerticalSlider = forwardRef(function (_ref, ref) {
|
|
|
13173
13174
|
var el = (_evt$currentTarget = evt.currentTarget) === null || _evt$currentTarget === void 0 ? void 0 : _evt$currentTarget.getBoundingClientRect();
|
|
13174
13175
|
var clientY = 'clientY' in evt ? evt.clientY : evt.touches[0].clientY;
|
|
13175
13176
|
var clickHeight = el.y + el.height - clientY;
|
|
13176
|
-
var i =
|
|
13177
|
+
var i = accumulatedHeights.findIndex(function (a) {
|
|
13177
13178
|
return a > clickHeight;
|
|
13178
13179
|
});
|
|
13179
13180
|
var height = (i + 1) * optionHeight;
|
|
@@ -13181,7 +13182,7 @@ var VerticalSlider = forwardRef(function (_ref, ref) {
|
|
|
13181
13182
|
var h = Math.max(height + gaps, 24);
|
|
13182
13183
|
fillRef.current.style.height = h + "px";
|
|
13183
13184
|
movingRef.current.elementIndex = i;
|
|
13184
|
-
}, [
|
|
13185
|
+
}, [accumulatedHeights, disabled, fillRef]);
|
|
13185
13186
|
var handleStart = useCallback(function (evt) {
|
|
13186
13187
|
var _fillRef$current2;
|
|
13187
13188
|
if (disabled) return;
|
|
@@ -13194,11 +13195,11 @@ var VerticalSlider = forwardRef(function (_ref, ref) {
|
|
|
13194
13195
|
if (disabled) return;
|
|
13195
13196
|
var el = evt.currentTarget.getBoundingClientRect();
|
|
13196
13197
|
var clickHeight = el.y + el.height - evt.clientY;
|
|
13197
|
-
var h =
|
|
13198
|
+
var h = accumulatedHeights.findIndex(function (a) {
|
|
13198
13199
|
return a > clickHeight;
|
|
13199
13200
|
});
|
|
13200
13201
|
onChange(options[h].value, h);
|
|
13201
|
-
}, [
|
|
13202
|
+
}, [accumulatedHeights, disabled, onChange, options]);
|
|
13202
13203
|
return React.createElement("div", Object.assign({}, props, {
|
|
13203
13204
|
className: classNames,
|
|
13204
13205
|
ref: ref,
|