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.d.ts
CHANGED
|
@@ -1574,7 +1574,7 @@ declare function ModalDrawer({ open, height, onClose, children, widthPercent }:
|
|
|
1574
1574
|
widthPercent?: number;
|
|
1575
1575
|
}): react_jsx_runtime.JSX.Element;
|
|
1576
1576
|
|
|
1577
|
-
declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, editableDigitalCoupon, ...props }: {
|
|
1577
|
+
declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, dropdownWidth, editableDigitalCoupon, ...props }: {
|
|
1578
1578
|
[x: string]: any;
|
|
1579
1579
|
data?: any[];
|
|
1580
1580
|
value: any;
|
|
@@ -1594,6 +1594,7 @@ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarke
|
|
|
1594
1594
|
labelColor: any;
|
|
1595
1595
|
placeHolderColor: any;
|
|
1596
1596
|
margin?: string;
|
|
1597
|
+
dropdownWidth?: string;
|
|
1597
1598
|
editableDigitalCoupon?: boolean;
|
|
1598
1599
|
}): react_jsx_runtime.JSX.Element;
|
|
1599
1600
|
|
package/dist/index.esm.js
CHANGED
|
@@ -37852,6 +37852,11 @@ const FilterPop = props => {
|
|
|
37852
37852
|
const nonAllItems = getNonAllItems();
|
|
37853
37853
|
return nonAllItems.every(item => attributes[item.value]);
|
|
37854
37854
|
};
|
|
37855
|
+
const areAnyNonAllItemsSelected = function () {
|
|
37856
|
+
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : selectedAttributes;
|
|
37857
|
+
const nonAllItems = getNonAllItems();
|
|
37858
|
+
return nonAllItems.some(item => attributes[item.value]);
|
|
37859
|
+
};
|
|
37855
37860
|
const getVisibleNonAllItems = () => {
|
|
37856
37861
|
return sortedList.filter(item => item.value !== "All");
|
|
37857
37862
|
};
|
|
@@ -37872,7 +37877,7 @@ const FilterPop = props => {
|
|
|
37872
37877
|
const unselectedItems = nonAllItems.filter(item => !attributes[item.value]);
|
|
37873
37878
|
const allSelected = selectedItems.length === nonAllItems.length;
|
|
37874
37879
|
const noneSelected = selectedItems.length === 0;
|
|
37875
|
-
const
|
|
37880
|
+
const fewerSelected = selectedItems.length <= unselectedItems.length;
|
|
37876
37881
|
if (allSelected) {
|
|
37877
37882
|
return {
|
|
37878
37883
|
excluded: [],
|
|
@@ -37885,18 +37890,18 @@ const FilterPop = props => {
|
|
|
37885
37890
|
included: [],
|
|
37886
37891
|
isSelectAll: false
|
|
37887
37892
|
};
|
|
37888
|
-
} else if (
|
|
37889
|
-
return {
|
|
37890
|
-
excluded: unselectedItems.map(item => item.value),
|
|
37891
|
-
included: [],
|
|
37892
|
-
isSelectAll: true
|
|
37893
|
-
};
|
|
37894
|
-
} else {
|
|
37893
|
+
} else if (fewerSelected) {
|
|
37895
37894
|
return {
|
|
37896
37895
|
excluded: [],
|
|
37897
37896
|
included: selectedItems.map(item => item.value),
|
|
37898
37897
|
isSelectAll: false
|
|
37899
37898
|
};
|
|
37899
|
+
} else {
|
|
37900
|
+
return {
|
|
37901
|
+
excluded: unselectedItems.map(item => item.value),
|
|
37902
|
+
included: [],
|
|
37903
|
+
isSelectAll: true
|
|
37904
|
+
};
|
|
37900
37905
|
}
|
|
37901
37906
|
};
|
|
37902
37907
|
const handleCheckboxChange = attribute => {
|
|
@@ -37952,15 +37957,36 @@ const FilterPop = props => {
|
|
|
37952
37957
|
indeterminate: false
|
|
37953
37958
|
};
|
|
37954
37959
|
}
|
|
37955
|
-
|
|
37956
|
-
|
|
37957
|
-
|
|
37958
|
-
|
|
37960
|
+
if (searchTerm.trim()) {
|
|
37961
|
+
const allVisibleSelected = areAllVisibleItemsSelected();
|
|
37962
|
+
const anyVisibleSelected = areAnyVisibleItemsSelected();
|
|
37963
|
+
const noneVisibleSelected = !anyVisibleSelected;
|
|
37964
|
+
if (allVisibleSelected) {
|
|
37965
|
+
return {
|
|
37966
|
+
checked: true,
|
|
37967
|
+
indeterminate: false
|
|
37968
|
+
};
|
|
37969
|
+
} else if (noneVisibleSelected) {
|
|
37970
|
+
return {
|
|
37971
|
+
checked: false,
|
|
37972
|
+
indeterminate: false
|
|
37973
|
+
};
|
|
37974
|
+
} else {
|
|
37975
|
+
return {
|
|
37976
|
+
checked: false,
|
|
37977
|
+
indeterminate: true
|
|
37978
|
+
};
|
|
37979
|
+
}
|
|
37980
|
+
}
|
|
37981
|
+
const allSelected = areAllNonAllItemsSelected();
|
|
37982
|
+
const anySelected = areAnyNonAllItemsSelected();
|
|
37983
|
+
const noneSelected = !anySelected;
|
|
37984
|
+
if (allSelected) {
|
|
37959
37985
|
return {
|
|
37960
37986
|
checked: true,
|
|
37961
37987
|
indeterminate: false
|
|
37962
37988
|
};
|
|
37963
|
-
} else if (
|
|
37989
|
+
} else if (noneSelected) {
|
|
37964
37990
|
return {
|
|
37965
37991
|
checked: false,
|
|
37966
37992
|
indeterminate: false
|
|
@@ -37974,7 +38000,7 @@ const FilterPop = props => {
|
|
|
37974
38000
|
};
|
|
37975
38001
|
const handleSearchChange = e => {
|
|
37976
38002
|
setSearchTerm(e.target.value);
|
|
37977
|
-
setScrollTop(0);
|
|
38003
|
+
setScrollTop(0);
|
|
37978
38004
|
if (scrollContainerRef.current) {
|
|
37979
38005
|
scrollContainerRef.current.scrollTop = 0;
|
|
37980
38006
|
}
|
|
@@ -57729,6 +57755,7 @@ const OverlayDropdown = _ref => {
|
|
|
57729
57755
|
labelColor,
|
|
57730
57756
|
placeHolderColor,
|
|
57731
57757
|
margin = "8px",
|
|
57758
|
+
dropdownWidth = "100%",
|
|
57732
57759
|
editableDigitalCoupon = false,
|
|
57733
57760
|
...props
|
|
57734
57761
|
} = _ref;
|
|
@@ -57966,7 +57993,7 @@ const OverlayDropdown = _ref => {
|
|
|
57966
57993
|
ref: dropdownRef,
|
|
57967
57994
|
role: "listbox",
|
|
57968
57995
|
dropdownMaxHeight: dropdownMaxHeight,
|
|
57969
|
-
width:
|
|
57996
|
+
width: dropdownWidth,
|
|
57970
57997
|
position: dropdownPosition
|
|
57971
57998
|
}, dataToRender.map((group, groupIndex) => group.items?.length > 0 && /*#__PURE__*/React$1.createElement(SectionDiv, {
|
|
57972
57999
|
$showBorder: group.overlayName,
|