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.
package/primereact.all.js CHANGED
@@ -3881,11 +3881,7 @@ var primereact = (function (exports, React, reactTransitionGroup, ReactDOM) {
3881
3881
  return;
3882
3882
  }
3883
3883
  DomHandler.removeClass(inkRef.current, 'p-ink-active');
3884
- if (!DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
3885
- var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
3886
- inkRef.current.style.height = d + 'px';
3887
- inkRef.current.style.width = d + 'px';
3888
- }
3884
+ setDimensions();
3889
3885
  inkRef.current.style.top = offsetY + 'px';
3890
3886
  inkRef.current.style.left = offsetX + 'px';
3891
3887
  DomHandler.addClass(inkRef.current, 'p-ink-active');
@@ -3893,15 +3889,24 @@ var primereact = (function (exports, React, reactTransitionGroup, ReactDOM) {
3893
3889
  var onAnimationEnd = function onAnimationEnd(event) {
3894
3890
  DomHandler.removeClass(event.currentTarget, 'p-ink-active');
3895
3891
  };
3892
+ var setDimensions = function setDimensions() {
3893
+ if (inkRef.current && !DomHandler.getHeight(inkRef.current) && !DomHandler.getWidth(inkRef.current)) {
3894
+ var d = Math.max(DomHandler.getOuterWidth(targetRef.current), DomHandler.getOuterHeight(targetRef.current));
3895
+ inkRef.current.style.height = d + 'px';
3896
+ inkRef.current.style.width = d + 'px';
3897
+ }
3898
+ };
3896
3899
  useMountEffect(function () {
3897
3900
  if (inkRef.current) {
3898
3901
  targetRef.current = getTarget();
3902
+ setDimensions();
3899
3903
  bindEvents();
3900
3904
  }
3901
3905
  });
3902
3906
  useUpdateEffect(function () {
3903
3907
  if (inkRef.current && !targetRef.current) {
3904
3908
  targetRef.current = getTarget();
3909
+ setDimensions();
3905
3910
  bindEvents();
3906
3911
  }
3907
3912
  });
@@ -27230,14 +27235,8 @@ var primereact = (function (exports, React, reactTransitionGroup, ReactDOM) {
27230
27235
  var currentText = value.substring(triggerState.index, spaceIndex > -1 ? spaceIndex : selectionStart);
27231
27236
  var selectedText = formatValue(suggestion).replace(/\s+/g, '');
27232
27237
  if (currentText.trim() !== selectedText) {
27233
- var diff = 0;
27234
- while (diff < selectedText.length) {
27235
- var s_c = selectedText.charAt(diff);
27236
- var c_c = currentText.charAt(diff);
27237
- if (s_c === c_c || c_c === ' ') diff++;else break;
27238
- }
27239
27238
  var prevText = value.substring(0, triggerState.index);
27240
- var nextText = value.substring(triggerState.index + diff);
27239
+ var nextText = value.substring(triggerState.index + currentText.length);
27241
27240
  inputRef.current.value = "".concat(prevText).concat(selectedText, " ").concat(nextText);
27242
27241
  props.onChange && props.onChange(event);
27243
27242
  }
@@ -33857,9 +33856,9 @@ var primereact = (function (exports, React, reactTransitionGroup, ReactDOM) {
33857
33856
  var newValue = parsedValue;
33858
33857
  if (props.range) {
33859
33858
  if (handleIndex.current === 0) {
33860
- if (parsedValue < props.min) parsedValue = props.min;else if (parsedValue > value[1]) parsedValue = value[1];
33859
+ if (parsedValue < props.min) parsedValue = props.min;else if (parsedValue > props.max) parsedValue = props.max;
33861
33860
  } else {
33862
- if (parsedValue > props.max) parsedValue = props.max;else if (parsedValue < value[0]) parsedValue = value[0];
33861
+ if (parsedValue > props.max) parsedValue = props.max;else if (parsedValue < props.min) parsedValue = props.min;
33863
33862
  }
33864
33863
  newValue = _toConsumableArray(value);
33865
33864
  newValue[handleIndex.current] = parsedValue;
@@ -33917,12 +33916,14 @@ var primereact = (function (exports, React, reactTransitionGroup, ReactDOM) {
33917
33916
  var handleValueEnd = (value[1] > props.max ? props.max : value[1] - props.min) * 100 / (props.max - props.min);
33918
33917
  var rangeStartHandle = horizontal ? createHandle(handleValueStart, null, 0) : createHandle(null, handleValueStart, 0);
33919
33918
  var rangeEndHandle = horizontal ? createHandle(handleValueEnd, null, 1) : createHandle(null, handleValueEnd, 1);
33919
+ var rangeSliderWidth = handleValueEnd > handleValueStart ? handleValueEnd - handleValueStart : handleValueStart - handleValueEnd;
33920
+ var rangeSliderPosition = handleValueEnd > handleValueStart ? handleValueStart : handleValueEnd;
33920
33921
  var rangeStyle = horizontal ? {
33921
- left: handleValueStart + '%',
33922
- width: handleValueEnd - handleValueStart + '%'
33922
+ left: rangeSliderPosition + '%',
33923
+ width: rangeSliderWidth + '%'
33923
33924
  } : {
33924
- bottom: handleValueStart + '%',
33925
- height: handleValueEnd - handleValueStart + '%'
33925
+ bottom: rangeSliderPosition + '%',
33926
+ height: rangeSliderWidth + '%'
33926
33927
  };
33927
33928
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("span", {
33928
33929
  className: "p-slider-range",