plataforma-fundacao-componentes 2.26.11 → 2.26.13
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/components/tooltipElement/TooltipElement.stories.d.ts +1 -0
- package/dist/components/verticalSlider/verticalSlider.stories.d.ts +4 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +9 -8
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -10160,7 +10160,7 @@ function Select(props) {
|
|
|
10160
10160
|
return getUniqueKey();
|
|
10161
10161
|
};
|
|
10162
10162
|
var opcoes = JSON.stringify(props.options);
|
|
10163
|
-
|
|
10163
|
+
useLayoutEffect(function () {
|
|
10164
10164
|
if (props.preSelectUniqueOption && props.options && props.options.length === 1) {
|
|
10165
10165
|
if (props.multiple && props.value && Array.isArray(props.value) && props.value.length !== 1) {
|
|
10166
10166
|
props.onChange([props.options[0].value], {
|
|
@@ -10172,7 +10172,7 @@ function Select(props) {
|
|
|
10172
10172
|
});
|
|
10173
10173
|
}
|
|
10174
10174
|
}
|
|
10175
|
-
}, [opcoes]);
|
|
10175
|
+
}, [opcoes, props.preSelectUniqueOption]);
|
|
10176
10176
|
var RightObject = useMemo(function () {
|
|
10177
10177
|
return React.createElement("div", {
|
|
10178
10178
|
className: rootClassName$2r + "-objects"
|
|
@@ -13026,7 +13026,7 @@ function TooltipElement(_ref) {
|
|
|
13026
13026
|
return React.createElement(Fragment$1, null, React.createElement("div", Object.assign({
|
|
13027
13027
|
className: rootClassName$33 + "-reference",
|
|
13028
13028
|
ref: refs.setReference
|
|
13029
|
-
}, getReferenceProps(wrapperProps)), children), React.createElement(FloatingPortal, null, isMounted && React.createElement("div", Object.assign({
|
|
13029
|
+
}, getReferenceProps(wrapperProps)), children), React.createElement(FloatingPortal, null, Boolean(label) && isMounted && React.createElement("div", Object.assign({
|
|
13030
13030
|
className: rootClassName$33 + "-tooltip",
|
|
13031
13031
|
ref: refs.setFloating,
|
|
13032
13032
|
style: _extends({}, floatingStyles, transitionStyles)
|
|
@@ -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,
|