sag_components 2.0.0-beta266 → 2.0.0-beta268

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
@@ -37862,6 +37862,11 @@ const FilterPop = props => {
37862
37862
  const nonAllItems = getNonAllItems();
37863
37863
  return nonAllItems.every(item => attributes[item.value]);
37864
37864
  };
37865
+ const areAnyNonAllItemsSelected = function () {
37866
+ let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedAttributes;
37867
+ const nonAllItems = getNonAllItems();
37868
+ return nonAllItems.some(item => attributes[item.value]);
37869
+ };
37865
37870
  const getVisibleNonAllItems = () => {
37866
37871
  return sortedList.filter(item => item.value !== "All");
37867
37872
  };
@@ -37882,7 +37887,7 @@ const FilterPop = props => {
37882
37887
  const unselectedItems = nonAllItems.filter(item => !attributes[item.value]);
37883
37888
  const allSelected = selectedItems.length === nonAllItems.length;
37884
37889
  const noneSelected = selectedItems.length === 0;
37885
- const mostSelected = selectedItems.length > nonAllItems.length / 2;
37890
+ const fewerSelected = selectedItems.length <= unselectedItems.length;
37886
37891
  if (allSelected) {
37887
37892
  return {
37888
37893
  excluded: [],
@@ -37895,18 +37900,18 @@ const FilterPop = props => {
37895
37900
  included: [],
37896
37901
  isSelectAll: false
37897
37902
  };
37898
- } else if (mostSelected) {
37899
- return {
37900
- excluded: unselectedItems.map(item => item.value),
37901
- included: [],
37902
- isSelectAll: true
37903
- };
37904
- } else {
37903
+ } else if (fewerSelected) {
37905
37904
  return {
37906
37905
  excluded: [],
37907
37906
  included: selectedItems.map(item => item.value),
37908
37907
  isSelectAll: false
37909
37908
  };
37909
+ } else {
37910
+ return {
37911
+ excluded: unselectedItems.map(item => item.value),
37912
+ included: [],
37913
+ isSelectAll: true
37914
+ };
37910
37915
  }
37911
37916
  };
37912
37917
  const handleCheckboxChange = attribute => {
@@ -37962,15 +37967,36 @@ const FilterPop = props => {
37962
37967
  indeterminate: false
37963
37968
  };
37964
37969
  }
37965
- const allVisibleSelected = areAllVisibleItemsSelected();
37966
- const anyVisibleSelected = areAnyVisibleItemsSelected();
37967
- const noneVisibleSelected = !anyVisibleSelected;
37968
- if (allVisibleSelected) {
37970
+ if (searchTerm.trim()) {
37971
+ const allVisibleSelected = areAllVisibleItemsSelected();
37972
+ const anyVisibleSelected = areAnyVisibleItemsSelected();
37973
+ const noneVisibleSelected = !anyVisibleSelected;
37974
+ if (allVisibleSelected) {
37975
+ return {
37976
+ checked: true,
37977
+ indeterminate: false
37978
+ };
37979
+ } else if (noneVisibleSelected) {
37980
+ return {
37981
+ checked: false,
37982
+ indeterminate: false
37983
+ };
37984
+ } else {
37985
+ return {
37986
+ checked: false,
37987
+ indeterminate: true
37988
+ };
37989
+ }
37990
+ }
37991
+ const allSelected = areAllNonAllItemsSelected();
37992
+ const anySelected = areAnyNonAllItemsSelected();
37993
+ const noneSelected = !anySelected;
37994
+ if (allSelected) {
37969
37995
  return {
37970
37996
  checked: true,
37971
37997
  indeterminate: false
37972
37998
  };
37973
- } else if (noneVisibleSelected) {
37999
+ } else if (noneSelected) {
37974
38000
  return {
37975
38001
  checked: false,
37976
38002
  indeterminate: false
@@ -37984,7 +38010,7 @@ const FilterPop = props => {
37984
38010
  };
37985
38011
  const handleSearchChange = e => {
37986
38012
  setSearchTerm(e.target.value);
37987
- setScrollTop(0); // Reset scroll on search
38013
+ setScrollTop(0);
37988
38014
  if (scrollContainerRef.current) {
37989
38015
  scrollContainerRef.current.scrollTop = 0;
37990
38016
  }
@@ -57739,6 +57765,7 @@ const OverlayDropdown = _ref => {
57739
57765
  labelColor,
57740
57766
  placeHolderColor,
57741
57767
  margin = "8px",
57768
+ dropdownWidth = "100%",
57742
57769
  editableDigitalCoupon = false,
57743
57770
  ...props
57744
57771
  } = _ref;
@@ -57976,7 +58003,7 @@ const OverlayDropdown = _ref => {
57976
58003
  ref: dropdownRef,
57977
58004
  role: "listbox",
57978
58005
  dropdownMaxHeight: dropdownMaxHeight,
57979
- width: width,
58006
+ width: dropdownWidth,
57980
58007
  position: dropdownPosition
57981
58008
  }, dataToRender.map((group, groupIndex) => group.items?.length > 0 && /*#__PURE__*/React__default["default"].createElement(SectionDiv, {
57982
58009
  $showBorder: group.overlayName,