@asantemedia-org/edwardsvacuum-design-system 1.6.64 → 1.6.66

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.js CHANGED
@@ -372,17 +372,6 @@ var parseDelimitedFacetValue = function (value) {
372
372
  return entry !== null;
373
373
  });
374
374
  };
375
- /**
376
- * Formats a delimited facet value into a human-readable string list
377
- * Returns null if the value is not in delimited format
378
- */
379
- var formatFacetValueAsString = function (value) {
380
- if (!isDelimitedFacetValue(value)) return null;
381
- var entries = parseDelimitedFacetValue(value);
382
- return entries.map(function (e) {
383
- return "".concat(e.value, " ").concat(e.unit);
384
- }).join(', ');
385
- };
386
375
 
387
376
  var styles$2 = {"facet-unit-selector":"FacetUnitSelector-module__facet-unit-selector___1Zdhx","facet-unit-selector__value":"FacetUnitSelector-module__facet-unit-selector__value___E-LAN","facet-unit-selector__unit":"FacetUnitSelector-module__facet-unit-selector__unit___TxIk7","facet-unit-selector__dropdown":"FacetUnitSelector-module__facet-unit-selector__dropdown___Xj3dK"};
388
377
 
@@ -401,14 +390,28 @@ var FacetUnitSelector = function (_a) {
401
390
  var _c = React.useState(0),
402
391
  selectedIndex = _c[0],
403
392
  setSelectedIndex = _c[1];
393
+ var isChanging = React.useRef(false);
404
394
  var getClassName = function (name) {
405
395
  return usePlainClasses ? name : getStyle$2(name);
406
396
  };
407
397
  if (!entries || entries.length === 0) return null;
408
398
  var selectedEntry = entries[selectedIndex];
409
- var handleUnitChange = function (e) {
410
- setSelectedIndex(Number(e.target.value));
411
- };
399
+ var handleUnitChange = React.useCallback(function (e) {
400
+ // Stop event propagation to prevent AEM handlers
401
+ e.stopPropagation();
402
+ // Prevent multiple rapid changes
403
+ if (isChanging.current) return;
404
+ isChanging.current = true;
405
+ var newIndex = Number(e.target.value);
406
+ // Use requestAnimationFrame to defer state update
407
+ requestAnimationFrame(function () {
408
+ setSelectedIndex(newIndex);
409
+ // Reset change lock
410
+ setTimeout(function () {
411
+ isChanging.current = false;
412
+ }, 100);
413
+ });
414
+ }, []);
412
415
  return /*#__PURE__*/React.createElement("div", {
413
416
  className: getClassName("facet-unit-selector")
414
417
  }, /*#__PURE__*/React.createElement("span", {
@@ -1657,12 +1660,7 @@ exports.AccordionSection = AccordionSection;
1657
1660
  exports.AlgoliaDynamicSearch = AlgoliaDynamicSearchEdwards;
1658
1661
  exports.AlgoliaDynamicSearchRaw = AlgoliaDynamicSearchRaw;
1659
1662
  exports.Card = Card;
1660
- exports.FacetUnitSelector = FacetUnitSelector;
1661
- exports.FriendlyCaptcha = FriendlyCaptcha;
1662
1663
  exports.ProductCard = ProductCard;
1663
1664
  exports.ProductDetailsCard = ProductDetailsCard;
1664
1665
  exports.QrForm = QrForm;
1665
- exports.formatFacetValueAsString = formatFacetValueAsString;
1666
- exports.isDelimitedFacetValue = isDelimitedFacetValue;
1667
- exports.parseDelimitedFacetValue = parseDelimitedFacetValue;
1668
1666
  //# sourceMappingURL=index.js.map