sag_components 2.0.0-beta264 → 2.0.0-beta266
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 +1 -5
- package/dist/index.esm.js +143 -155
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +143 -155
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.d.ts +1 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8939,27 +8939,26 @@ const IconContainer$5 = styled__default["default"].div`
|
|
|
8939
8939
|
cursor: pointer;
|
|
8940
8940
|
`;
|
|
8941
8941
|
|
|
8942
|
-
const DropdownSingleNew =
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
} = _ref;
|
|
8942
|
+
const DropdownSingleNew = ({
|
|
8943
|
+
label,
|
|
8944
|
+
labelEmptyValue,
|
|
8945
|
+
options,
|
|
8946
|
+
selectedValue,
|
|
8947
|
+
onChange,
|
|
8948
|
+
required,
|
|
8949
|
+
disabled,
|
|
8950
|
+
width,
|
|
8951
|
+
height,
|
|
8952
|
+
withMarginBottom = true,
|
|
8953
|
+
error,
|
|
8954
|
+
errorMessage,
|
|
8955
|
+
xIconShow,
|
|
8956
|
+
labelColor,
|
|
8957
|
+
showLabelOnTop,
|
|
8958
|
+
orderBy,
|
|
8959
|
+
placeHolder = "",
|
|
8960
|
+
elementType
|
|
8961
|
+
}) => {
|
|
8963
8962
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
8964
8963
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
8965
8964
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -9464,27 +9463,26 @@ const IconContainer$4 = styled__default["default"].div`
|
|
|
9464
9463
|
cursor: pointer;
|
|
9465
9464
|
`;
|
|
9466
9465
|
|
|
9467
|
-
const DropdownMultiNew =
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
} = _ref;
|
|
9466
|
+
const DropdownMultiNew = ({
|
|
9467
|
+
label,
|
|
9468
|
+
labelEmptyValue,
|
|
9469
|
+
options,
|
|
9470
|
+
selectedValue,
|
|
9471
|
+
onChange,
|
|
9472
|
+
required,
|
|
9473
|
+
disabled,
|
|
9474
|
+
width,
|
|
9475
|
+
height,
|
|
9476
|
+
withMarginBottom = true,
|
|
9477
|
+
error,
|
|
9478
|
+
errorMessage,
|
|
9479
|
+
labelColor,
|
|
9480
|
+
xIconShow,
|
|
9481
|
+
checkBoxColor,
|
|
9482
|
+
showLabelOnTop,
|
|
9483
|
+
orderBy,
|
|
9484
|
+
elementType
|
|
9485
|
+
}) => {
|
|
9488
9486
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
9489
9487
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
9490
9488
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -10593,24 +10591,23 @@ const QuarterPopupPicker = ({
|
|
|
10593
10591
|
};
|
|
10594
10592
|
|
|
10595
10593
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
10596
|
-
const QuarterPicker =
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
} = _ref;
|
|
10594
|
+
const QuarterPicker = ({
|
|
10595
|
+
availableQuarters,
|
|
10596
|
+
// ["Q1-2024"]
|
|
10597
|
+
label,
|
|
10598
|
+
onChange,
|
|
10599
|
+
borderRadius,
|
|
10600
|
+
required,
|
|
10601
|
+
width,
|
|
10602
|
+
height,
|
|
10603
|
+
placeholder,
|
|
10604
|
+
disabled,
|
|
10605
|
+
borderColor,
|
|
10606
|
+
borderColorFocus,
|
|
10607
|
+
textColor,
|
|
10608
|
+
selectedValue,
|
|
10609
|
+
startYear
|
|
10610
|
+
}) => {
|
|
10614
10611
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
10615
10612
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
10616
10613
|
const [value, setValue] = React$1.useState('');
|
|
@@ -11052,23 +11049,22 @@ const MonthPopupPicker = ({
|
|
|
11052
11049
|
};
|
|
11053
11050
|
|
|
11054
11051
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
11055
|
-
const MonthPicker =
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
} = _ref;
|
|
11052
|
+
const MonthPicker = ({
|
|
11053
|
+
availableMonths,
|
|
11054
|
+
label,
|
|
11055
|
+
onChange,
|
|
11056
|
+
borderRadius,
|
|
11057
|
+
required,
|
|
11058
|
+
width,
|
|
11059
|
+
height,
|
|
11060
|
+
placeholder,
|
|
11061
|
+
disabled,
|
|
11062
|
+
borderColor,
|
|
11063
|
+
borderColorFocus,
|
|
11064
|
+
textColor,
|
|
11065
|
+
selectedValue,
|
|
11066
|
+
startYear
|
|
11067
|
+
}) => {
|
|
11072
11068
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
11073
11069
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
11074
11070
|
const [value, setValue] = React$1.useState('');
|
|
@@ -24179,22 +24175,21 @@ const DeleteIcon = styled__default["default"].div`
|
|
|
24179
24175
|
position: absolute;
|
|
24180
24176
|
`;
|
|
24181
24177
|
|
|
24182
|
-
const QuickFilterDropdownSingle =
|
|
24183
|
-
|
|
24184
|
-
|
|
24185
|
-
|
|
24186
|
-
|
|
24187
|
-
|
|
24188
|
-
|
|
24189
|
-
|
|
24190
|
-
|
|
24191
|
-
|
|
24192
|
-
|
|
24193
|
-
|
|
24194
|
-
|
|
24195
|
-
|
|
24196
|
-
|
|
24197
|
-
} = _ref;
|
|
24178
|
+
const QuickFilterDropdownSingle = ({
|
|
24179
|
+
label,
|
|
24180
|
+
hoverColor,
|
|
24181
|
+
options,
|
|
24182
|
+
selectedValue,
|
|
24183
|
+
placeHolder,
|
|
24184
|
+
onChange,
|
|
24185
|
+
disabled,
|
|
24186
|
+
width,
|
|
24187
|
+
error,
|
|
24188
|
+
errorMessage,
|
|
24189
|
+
xIconShow,
|
|
24190
|
+
labelColor,
|
|
24191
|
+
showLabelOnTop
|
|
24192
|
+
}) => {
|
|
24198
24193
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24199
24194
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24200
24195
|
const [inputValue, setInputValue] = React$1.useState("");
|
|
@@ -24651,26 +24646,25 @@ const IconContainer$2 = styled__default["default"].div`
|
|
|
24651
24646
|
cursor: pointer;
|
|
24652
24647
|
`;
|
|
24653
24648
|
|
|
24654
|
-
const QuickFilterDropdownMultiSelection =
|
|
24655
|
-
|
|
24656
|
-
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
|
|
24662
|
-
|
|
24663
|
-
|
|
24664
|
-
|
|
24665
|
-
|
|
24666
|
-
|
|
24667
|
-
|
|
24668
|
-
|
|
24669
|
-
|
|
24670
|
-
|
|
24671
|
-
|
|
24672
|
-
|
|
24673
|
-
} = _ref;
|
|
24649
|
+
const QuickFilterDropdownMultiSelection = ({
|
|
24650
|
+
label,
|
|
24651
|
+
labelEmptyValue,
|
|
24652
|
+
options,
|
|
24653
|
+
selectedValue,
|
|
24654
|
+
placeHolder,
|
|
24655
|
+
onChange,
|
|
24656
|
+
required,
|
|
24657
|
+
disabled,
|
|
24658
|
+
width,
|
|
24659
|
+
height,
|
|
24660
|
+
error,
|
|
24661
|
+
errorMessage,
|
|
24662
|
+
labelColor,
|
|
24663
|
+
xIconShow,
|
|
24664
|
+
checkBoxColor,
|
|
24665
|
+
showLabelOnTop,
|
|
24666
|
+
dropdownHeight
|
|
24667
|
+
}) => {
|
|
24674
24668
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
24675
24669
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
24676
24670
|
const [inputValue, setInputValue] = React$1.useState('');
|
|
@@ -34983,18 +34977,17 @@ styled.css`
|
|
|
34983
34977
|
* • onApply(start,end) — callback, both numbers (inclusive)
|
|
34984
34978
|
* • onCancel() — callback
|
|
34985
34979
|
*/
|
|
34986
|
-
const WeeksCalendar =
|
|
34987
|
-
|
|
34988
|
-
|
|
34989
|
-
|
|
34990
|
-
|
|
34991
|
-
|
|
34992
|
-
|
|
34993
|
-
|
|
34994
|
-
|
|
34995
|
-
|
|
34996
|
-
|
|
34997
|
-
} = _ref;
|
|
34980
|
+
const WeeksCalendar = ({
|
|
34981
|
+
year,
|
|
34982
|
+
defaultStartWeek = null,
|
|
34983
|
+
defaultEndWeek = null,
|
|
34984
|
+
backgroundColor = "#066768",
|
|
34985
|
+
hoverBackgroundColor = "#E6F0F0",
|
|
34986
|
+
allowedWeekRange = null,
|
|
34987
|
+
// New prop for range restriction
|
|
34988
|
+
onApply,
|
|
34989
|
+
onCancel
|
|
34990
|
+
}) => {
|
|
34998
34991
|
// state -------------------------------------------------
|
|
34999
34992
|
const [startWeek, setStartWeek] = React$1.useState(defaultStartWeek);
|
|
35000
34993
|
const [endWeek, setEndWeek] = React$1.useState(defaultEndWeek);
|
|
@@ -36182,9 +36175,9 @@ const ToggleSlider = styled__default["default"].span`
|
|
|
36182
36175
|
}
|
|
36183
36176
|
`;
|
|
36184
36177
|
|
|
36185
|
-
/**
|
|
36186
|
-
* ToggleSwitch component for on/off states.
|
|
36187
|
-
* Supports small/large sizes and disabled state.
|
|
36178
|
+
/**
|
|
36179
|
+
* ToggleSwitch component for on/off states.
|
|
36180
|
+
* Supports small/large sizes and disabled state.
|
|
36188
36181
|
*/
|
|
36189
36182
|
function ToggleSwitch(_ref) {
|
|
36190
36183
|
let {
|
|
@@ -57737,7 +57730,6 @@ const OverlayDropdown = _ref => {
|
|
|
57737
57730
|
selectedColor = "#066768",
|
|
57738
57731
|
hoverColor = "#E6F0F0",
|
|
57739
57732
|
dropdownMaxHeight = "600px",
|
|
57740
|
-
dropdownWidth = "100%",
|
|
57741
57733
|
width = "100%",
|
|
57742
57734
|
height = "auto",
|
|
57743
57735
|
label,
|
|
@@ -57746,23 +57738,20 @@ const OverlayDropdown = _ref => {
|
|
|
57746
57738
|
placeHolder,
|
|
57747
57739
|
labelColor,
|
|
57748
57740
|
placeHolderColor,
|
|
57749
|
-
textColorMenu = "black",
|
|
57750
57741
|
margin = "8px",
|
|
57751
57742
|
editableDigitalCoupon = false,
|
|
57752
|
-
dropdownDigitalCouponTitle = "",
|
|
57753
|
-
className = "",
|
|
57754
57743
|
...props
|
|
57755
57744
|
} = _ref;
|
|
57756
57745
|
const [open, setOpen] = React$1.useState(false);
|
|
57757
57746
|
const [hoveredText, setHoveredText] = React$1.useState(null);
|
|
57758
57747
|
const [templateDialog, setTemplateDialog] = React$1.useState(null);
|
|
57759
57748
|
const [dropdownPosition, setDropdownPosition] = React$1.useState("below");
|
|
57760
|
-
const [selected, setSelected] = React$1.useState("");
|
|
57761
|
-
const [hasValue, setHasValue] = React$1.useState(false);
|
|
57762
57749
|
const [lastDefinedGroup, setLastDefinedGroup] = React$1.useState(data.find(group => group.overlayCode === "last_defined"));
|
|
57763
57750
|
const buttonRef = React$1.useRef(null);
|
|
57764
57751
|
const dropdownRef = React$1.useRef(null);
|
|
57765
57752
|
const containerRef = React$1.useRef(null);
|
|
57753
|
+
|
|
57754
|
+
// Click outside to close dropdown
|
|
57766
57755
|
React$1.useEffect(() => {
|
|
57767
57756
|
const handleClickOutside = event => {
|
|
57768
57757
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -57778,13 +57767,20 @@ const OverlayDropdown = _ref => {
|
|
|
57778
57767
|
document.removeEventListener("touchstart", handleClickOutside);
|
|
57779
57768
|
};
|
|
57780
57769
|
}, [open]);
|
|
57770
|
+
|
|
57771
|
+
// Calculate dropdown position when opening
|
|
57781
57772
|
React$1.useEffect(() => {
|
|
57782
57773
|
if (open && buttonRef.current) {
|
|
57783
57774
|
const buttonRect = buttonRef.current.getBoundingClientRect();
|
|
57784
57775
|
const viewportHeight = window.innerHeight;
|
|
57785
57776
|
const dropdownHeight = parseInt(dropdownMaxHeight, 10);
|
|
57777
|
+
|
|
57778
|
+
// Space available below the button
|
|
57786
57779
|
const spaceBelow = viewportHeight - buttonRect.bottom;
|
|
57780
|
+
// Space available above the button
|
|
57787
57781
|
const spaceAbove = buttonRect.top;
|
|
57782
|
+
|
|
57783
|
+
// If there's not enough space below, but more space above, position above
|
|
57788
57784
|
if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {
|
|
57789
57785
|
setDropdownPosition("above");
|
|
57790
57786
|
} else {
|
|
@@ -57792,6 +57788,8 @@ const OverlayDropdown = _ref => {
|
|
|
57792
57788
|
}
|
|
57793
57789
|
}
|
|
57794
57790
|
}, [open, dropdownMaxHeight, margin]);
|
|
57791
|
+
|
|
57792
|
+
// Combine original data with "Last defined by you" group
|
|
57795
57793
|
const getDataWithLastDefined = () => {
|
|
57796
57794
|
const combinedData = [...data];
|
|
57797
57795
|
if (lastDefinedGroup) {
|
|
@@ -57799,26 +57797,20 @@ const OverlayDropdown = _ref => {
|
|
|
57799
57797
|
}
|
|
57800
57798
|
return combinedData;
|
|
57801
57799
|
};
|
|
57800
|
+
|
|
57801
|
+
// Find selected item across all groups
|
|
57802
57802
|
const findSelectedItem = () => {
|
|
57803
57803
|
const allData = getDataWithLastDefined();
|
|
57804
57804
|
for (const group of allData) {
|
|
57805
57805
|
if (group.items) {
|
|
57806
|
-
const found = group.items.find(item =>
|
|
57807
|
-
const digitalCouponItem = item.value === value ? item.label : null;
|
|
57808
|
-
if (digitalCouponItem && digitalCouponItem.includes("Digital") && editableDigitalCoupon) {
|
|
57809
|
-
return true;
|
|
57810
|
-
}
|
|
57811
|
-
return item.value === value;
|
|
57812
|
-
});
|
|
57806
|
+
const found = group.items.find(item => item.value === value);
|
|
57813
57807
|
if (found) return found;
|
|
57814
57808
|
}
|
|
57815
57809
|
}
|
|
57816
57810
|
return null;
|
|
57817
57811
|
};
|
|
57818
|
-
|
|
57819
|
-
|
|
57820
|
-
setHasValue(!!findSelectedItem());
|
|
57821
|
-
}, [value]);
|
|
57812
|
+
const selected = findSelectedItem();
|
|
57813
|
+
const hasValue = !!selected;
|
|
57822
57814
|
const getTemplateParams = label => {
|
|
57823
57815
|
if (!label) return [];
|
|
57824
57816
|
|
|
@@ -57951,7 +57943,6 @@ const OverlayDropdown = _ref => {
|
|
|
57951
57943
|
return "";
|
|
57952
57944
|
};
|
|
57953
57945
|
return /*#__PURE__*/React__default["default"].createElement(DropdownContainer, {
|
|
57954
|
-
className: className,
|
|
57955
57946
|
width: width,
|
|
57956
57947
|
ref: containerRef
|
|
57957
57948
|
}, /*#__PURE__*/React__default["default"].createElement(Label$1, {
|
|
@@ -57973,7 +57964,7 @@ const OverlayDropdown = _ref => {
|
|
|
57973
57964
|
onMouseEnter: () => setHoveredText(selected?.label),
|
|
57974
57965
|
onMouseLeave: () => setHoveredText(null),
|
|
57975
57966
|
color: !selected && open ? placeHolderColor : "inherit"
|
|
57976
|
-
}, selected ? selected.label
|
|
57967
|
+
}, selected ? selected.label : open ? placeHolder : ''), open ? /*#__PURE__*/React__default["default"].createElement(MenuItemUpIcon, {
|
|
57977
57968
|
width: "12px",
|
|
57978
57969
|
height: "12px",
|
|
57979
57970
|
color: "#B1B1B1"
|
|
@@ -57985,7 +57976,7 @@ const OverlayDropdown = _ref => {
|
|
|
57985
57976
|
ref: dropdownRef,
|
|
57986
57977
|
role: "listbox",
|
|
57987
57978
|
dropdownMaxHeight: dropdownMaxHeight,
|
|
57988
|
-
width:
|
|
57979
|
+
width: width,
|
|
57989
57980
|
position: dropdownPosition
|
|
57990
57981
|
}, dataToRender.map((group, groupIndex) => group.items?.length > 0 && /*#__PURE__*/React__default["default"].createElement(SectionDiv, {
|
|
57991
57982
|
$showBorder: group.overlayName,
|
|
@@ -58021,14 +58012,11 @@ const OverlayDropdown = _ref => {
|
|
|
58021
58012
|
}
|
|
58022
58013
|
}
|
|
58023
58014
|
}, /*#__PURE__*/React__default["default"].createElement(TruncatedText, {
|
|
58024
|
-
onMouseEnter: () => setHoveredText(
|
|
58025
|
-
onMouseLeave: () => setHoveredText(null)
|
|
58026
|
-
|
|
58027
|
-
}, group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle !== "" ? dropdownDigitalCouponTitle : item.label : item.label), group.templateType === 2 ? /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
|
|
58028
|
-
fill: item.value === value ? "#fff" : "#212121"
|
|
58029
|
-
}) : group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle === "" ? /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
|
|
58015
|
+
onMouseEnter: () => setHoveredText(item.label),
|
|
58016
|
+
onMouseLeave: () => setHoveredText(null)
|
|
58017
|
+
}, item.label), group.templateType === 2 ? /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
|
|
58030
58018
|
fill: item.value === value ? "#fff" : "#212121"
|
|
58031
|
-
}) : /*#__PURE__*/React__default["default"].createElement(PenIcon, {
|
|
58019
|
+
}) : group.templateType === 3 && editableDigitalCoupon ? /*#__PURE__*/React__default["default"].createElement(PenIcon, {
|
|
58032
58020
|
fill: item.value === value ? "#fff" : "#212121"
|
|
58033
58021
|
}) : item.value === value && /*#__PURE__*/React__default["default"].createElement(OkIcon, {
|
|
58034
58022
|
width: "22px",
|