primereact 9.2.1 → 9.2.3

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.
@@ -3859,11 +3859,7 @@ var Ripple = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function ()
3859
3859
  return;
3860
3860
  }
3861
3861
  DomHandler.removeClass(inkRef.current, 'p-ink-active');
3862
- if (!DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
3863
- var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
3864
- inkRef.current.style.height = d + 'px';
3865
- inkRef.current.style.width = d + 'px';
3866
- }
3862
+ setDimensions();
3867
3863
  inkRef.current.style.top = offsetY + 'px';
3868
3864
  inkRef.current.style.left = offsetX + 'px';
3869
3865
  DomHandler.addClass(inkRef.current, 'p-ink-active');
@@ -3871,15 +3867,24 @@ var Ripple = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function ()
3871
3867
  var onAnimationEnd = function onAnimationEnd(event) {
3872
3868
  DomHandler.removeClass(event.currentTarget, 'p-ink-active');
3873
3869
  };
3870
+ var setDimensions = function setDimensions() {
3871
+ if (inkRef.current && !DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
3872
+ var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
3873
+ inkRef.current.style.height = d + 'px';
3874
+ inkRef.current.style.width = d + 'px';
3875
+ }
3876
+ };
3874
3877
  useMountEffect(function () {
3875
3878
  if (inkRef.current) {
3876
3879
  targetRef.current = getTarget();
3880
+ setDimensions();
3877
3881
  bindEvents();
3878
3882
  }
3879
3883
  });
3880
3884
  useUpdateEffect(function () {
3881
3885
  if (inkRef.current && !targetRef.current) {
3882
3886
  targetRef.current = getTarget();
3887
+ setDimensions();
3883
3888
  bindEvents();
3884
3889
  }
3885
3890
  });
@@ -27208,14 +27213,8 @@ var Mention = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (i
27208
27213
  var currentText = value.substring(triggerState.index, spaceIndex > -1 ? spaceIndex : selectionStart);
27209
27214
  var selectedText = formatValue(suggestion).replace(/\s+/g, '');
27210
27215
  if (currentText.trim() !== selectedText) {
27211
- var diff = 0;
27212
- while (diff < selectedText.length) {
27213
- var s_c = selectedText.charAt(diff);
27214
- var c_c = currentText.charAt(diff);
27215
- if (s_c === c_c || c_c === ' ') diff++;else break;
27216
- }
27217
27216
  var prevText = value.substring(0, triggerState.index);
27218
- var nextText = value.substring(triggerState.index + diff);
27217
+ var nextText = value.substring(triggerState.index + currentText.length);
27219
27218
  inputRef.current.value = "".concat(prevText).concat(selectedText, " ").concat(nextText);
27220
27219
  props.onChange && props.onChange(event);
27221
27220
  }
@@ -33835,9 +33834,9 @@ var Slider = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
33835
33834
  var newValue = parsedValue;
33836
33835
  if (props.range) {
33837
33836
  if (handleIndex.current === 0) {
33838
- if (parsedValue < props.min) parsedValue = props.min;else if (parsedValue > value[1]) parsedValue = value[1];
33837
+ if (parsedValue < props.min) parsedValue = props.min;else if (parsedValue > props.max) parsedValue = props.max;
33839
33838
  } else {
33840
- if (parsedValue > props.max) parsedValue = props.max;else if (parsedValue < value[0]) parsedValue = value[0];
33839
+ if (parsedValue > props.max) parsedValue = props.max;else if (parsedValue < props.min) parsedValue = props.min;
33841
33840
  }
33842
33841
  newValue = _toConsumableArray(value);
33843
33842
  newValue[handleIndex.current] = parsedValue;
@@ -33895,12 +33894,14 @@ var Slider = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (in
33895
33894
  var handleValueEnd = (value[1] > props.max ? props.max : value[1] - props.min) * 100 / (props.max - props.min);
33896
33895
  var rangeStartHandle = horizontal ? createHandle(handleValueStart, null, 0) : createHandle(null, handleValueStart, 0);
33897
33896
  var rangeEndHandle = horizontal ? createHandle(handleValueEnd, null, 1) : createHandle(null, handleValueEnd, 1);
33897
+ var rangeSliderWidth = handleValueEnd > handleValueStart ? handleValueEnd - handleValueStart : handleValueStart - handleValueEnd;
33898
+ var rangeSliderPosition = handleValueEnd > handleValueStart ? handleValueStart : handleValueEnd;
33898
33899
  var rangeStyle = horizontal ? {
33899
- left: handleValueStart + '%',
33900
- width: handleValueEnd - handleValueStart + '%'
33900
+ left: rangeSliderPosition + '%',
33901
+ width: rangeSliderWidth + '%'
33901
33902
  } : {
33902
- bottom: handleValueStart + '%',
33903
- height: handleValueEnd - handleValueStart + '%'
33903
+ bottom: rangeSliderPosition + '%',
33904
+ height: rangeSliderWidth + '%'
33904
33905
  };
33905
33906
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
33906
33907
  className: "p-slider-range",