sag_components 2.0.0-beta240 → 2.0.0-beta242
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 +4 -2
- package/dist/index.esm.js +37 -36
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.d.ts +2 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.stories.d.ts +1 -0
- package/dist/types/components/WeeksPicker/WeeksPicker.d.ts +2 -1
- package/dist/types/components/WeeksPicker/WeeksPicker.stories.d.ts +16 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1284,12 +1284,13 @@ declare function ModalWithOverlay(props: any): react_jsx_runtime.JSX.Element;
|
|
|
1284
1284
|
|
|
1285
1285
|
declare function DropdownNew(props: any): react_jsx_runtime.JSX.Element;
|
|
1286
1286
|
|
|
1287
|
-
declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
|
|
1287
|
+
declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, text, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
|
|
1288
1288
|
label: any;
|
|
1289
1289
|
disabled: any;
|
|
1290
1290
|
borderColor: any;
|
|
1291
1291
|
borderColorFocus: any;
|
|
1292
1292
|
textColor: any;
|
|
1293
|
+
text?: string;
|
|
1293
1294
|
hoverColor: any;
|
|
1294
1295
|
required: any;
|
|
1295
1296
|
placeholder: any;
|
|
@@ -1574,7 +1575,7 @@ declare function ModalDrawer({ open, height, onClose, children, widthPercent }:
|
|
|
1574
1575
|
widthPercent?: number;
|
|
1575
1576
|
}): react_jsx_runtime.JSX.Element;
|
|
1576
1577
|
|
|
1577
|
-
declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, editableDigitalCoupon, ...props }: {
|
|
1578
|
+
declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarkerBackground, required, selectedColor, hoverColor, dropdownMaxHeight, width, height, label, labelEmptyValue, showLabelOnTop, placeHolder, labelColor, placeHolderColor, margin, editableDigitalCoupon, dropdownDigitalCouponTitle, ...props }: {
|
|
1578
1579
|
[x: string]: any;
|
|
1579
1580
|
data?: any[];
|
|
1580
1581
|
value: any;
|
|
@@ -1595,6 +1596,7 @@ declare function OverlayDropdown({ data, value, onSelectClick, disabled, isDarke
|
|
|
1595
1596
|
placeHolderColor: any;
|
|
1596
1597
|
margin?: string;
|
|
1597
1598
|
editableDigitalCoupon?: boolean;
|
|
1599
|
+
dropdownDigitalCouponTitle?: string;
|
|
1598
1600
|
}): react_jsx_runtime.JSX.Element;
|
|
1599
1601
|
|
|
1600
1602
|
declare function MessageBox({ isOpen, isDisabled, onClose, onConfirm, title, primaryText, secondaryText, width, height, color, hoverColor, opacity, secondaryColor, seperateSectionBorder, children, tooltipContent, }: {
|
package/dist/index.esm.js
CHANGED
|
@@ -34971,17 +34971,18 @@ css`
|
|
|
34971
34971
|
* • onApply(start,end) — callback, both numbers (inclusive)
|
|
34972
34972
|
* • onCancel() — callback
|
|
34973
34973
|
*/
|
|
34974
|
-
const WeeksCalendar =
|
|
34975
|
-
|
|
34976
|
-
|
|
34977
|
-
|
|
34978
|
-
|
|
34979
|
-
|
|
34980
|
-
|
|
34981
|
-
|
|
34982
|
-
|
|
34983
|
-
|
|
34984
|
-
|
|
34974
|
+
const WeeksCalendar = _ref => {
|
|
34975
|
+
let {
|
|
34976
|
+
year,
|
|
34977
|
+
defaultStartWeek = null,
|
|
34978
|
+
defaultEndWeek = null,
|
|
34979
|
+
backgroundColor = "#066768",
|
|
34980
|
+
hoverBackgroundColor = "#E6F0F0",
|
|
34981
|
+
allowedWeekRange = null,
|
|
34982
|
+
// New prop for range restriction
|
|
34983
|
+
onApply,
|
|
34984
|
+
onCancel
|
|
34985
|
+
} = _ref;
|
|
34985
34986
|
// state -------------------------------------------------
|
|
34986
34987
|
const [startWeek, setStartWeek] = useState(defaultStartWeek);
|
|
34987
34988
|
const [endWeek, setEndWeek] = useState(defaultEndWeek);
|
|
@@ -35199,6 +35200,7 @@ const WeeksPicker = _ref => {
|
|
|
35199
35200
|
borderColor,
|
|
35200
35201
|
borderColorFocus,
|
|
35201
35202
|
textColor,
|
|
35203
|
+
text = 'Week',
|
|
35202
35204
|
hoverColor,
|
|
35203
35205
|
required,
|
|
35204
35206
|
placeholder,
|
|
@@ -35431,7 +35433,7 @@ const WeeksPicker = _ref => {
|
|
|
35431
35433
|
console.warn('Selected weeks are outside the allowed range');
|
|
35432
35434
|
return;
|
|
35433
35435
|
}
|
|
35434
|
-
const tempValue = end === start ?
|
|
35436
|
+
const tempValue = end === start ? text === 'Week' ? `${text} ${start}` : `${text}${start}` : text === 'Week' ? `${text}s ${start} - ${end}` : `${text}${start} - ${end}`;
|
|
35435
35437
|
onChange(tempValue);
|
|
35436
35438
|
setValue(tempValue);
|
|
35437
35439
|
handleApply();
|
|
@@ -42693,7 +42695,9 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
42693
42695
|
onCheckboxClick = () => {},
|
|
42694
42696
|
onHeaderCheckboxClick = () => {},
|
|
42695
42697
|
onHeroClick = () => {},
|
|
42696
|
-
onEditableClick = () => {}
|
|
42698
|
+
onEditableClick = () => {},
|
|
42699
|
+
isEditMode = false,
|
|
42700
|
+
editRowIndex = -1
|
|
42697
42701
|
}, ref) => {
|
|
42698
42702
|
// MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
|
|
42699
42703
|
if (!Array.isArray(data) || !Array.isArray(columns)) {
|
|
@@ -42795,9 +42799,12 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
42795
42799
|
|
|
42796
42800
|
// Handle row click for focus state
|
|
42797
42801
|
const handleRowClick = (row, rowIndex) => {
|
|
42802
|
+
if (isEditMode && editRowIndex !== -1) {
|
|
42803
|
+
return;
|
|
42804
|
+
}
|
|
42798
42805
|
setFocusedRowIndex(rowIndex);
|
|
42799
42806
|
if (onRowClick) {
|
|
42800
|
-
onRowClick(row);
|
|
42807
|
+
onRowClick(row, rowIndex);
|
|
42801
42808
|
}
|
|
42802
42809
|
};
|
|
42803
42810
|
|
|
@@ -43418,15 +43425,16 @@ const TableBody = /*#__PURE__*/forwardRef(({
|
|
|
43418
43425
|
console.warn(`Invalid row at index ${rowIndex}:`, row);
|
|
43419
43426
|
return null;
|
|
43420
43427
|
}
|
|
43428
|
+
const shouldBeFocused = isEditMode ? rowIndex === editRowIndex : focusedRowIndex === rowIndex;
|
|
43421
43429
|
return /*#__PURE__*/React$1.createElement(React$1.Fragment, {
|
|
43422
43430
|
key: row.id || `row-${rowIndex}`
|
|
43423
43431
|
}, /*#__PURE__*/React$1.createElement(TableRow, {
|
|
43424
43432
|
"data-row-index": rowIndex,
|
|
43425
43433
|
className: shimmerRowIndex === rowIndex ? "shimmer-row" : "",
|
|
43426
|
-
isFocused:
|
|
43434
|
+
isFocused: shouldBeFocused,
|
|
43427
43435
|
selectedColor: selectedColor,
|
|
43428
|
-
onMouseEnter: () => setHoveredRowIndex(rowIndex),
|
|
43429
|
-
onMouseLeave: () => setHoveredRowIndex(null),
|
|
43436
|
+
onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
|
|
43437
|
+
onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
|
|
43430
43438
|
onClick: () => handleRowClick(row, rowIndex)
|
|
43431
43439
|
}, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
|
|
43432
43440
|
$fieldType: "expand",
|
|
@@ -43560,7 +43568,9 @@ TableBody.propTypes = {
|
|
|
43560
43568
|
onCheckboxClick: PropTypes.func,
|
|
43561
43569
|
onHeaderCheckboxClick: PropTypes.func,
|
|
43562
43570
|
onHeroClick: PropTypes.func,
|
|
43563
|
-
onEditableClick: PropTypes.func
|
|
43571
|
+
onEditableClick: PropTypes.func,
|
|
43572
|
+
isEditMode: PropTypes.bool,
|
|
43573
|
+
editRowIndex: PropTypes.number
|
|
43564
43574
|
};
|
|
43565
43575
|
TableBody.displayName = "TableBody";
|
|
43566
43576
|
|
|
@@ -47081,7 +47091,9 @@ const Table = props => {
|
|
|
47081
47091
|
onCheckboxClick: onCheckboxClick,
|
|
47082
47092
|
onHeaderCheckboxClick: onHeaderCheckboxClick,
|
|
47083
47093
|
onHeroClick: onHeroClick,
|
|
47084
|
-
onEditableClick: onEditableClick
|
|
47094
|
+
onEditableClick: onEditableClick,
|
|
47095
|
+
isEditMode: isEditMode,
|
|
47096
|
+
editRowIndex: editRowIndex
|
|
47085
47097
|
})), data.length === 0 && /*#__PURE__*/React$1.createElement(NoEventsParent, null, /*#__PURE__*/React$1.createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React$1.createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React$1.createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("strong", null, noEventsTitle), /*#__PURE__*/React$1.createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React$1.createElement(Button$1, {
|
|
47086
47098
|
height: "45px",
|
|
47087
47099
|
leftIcon: noEventsButtonIcon,
|
|
@@ -57725,6 +57737,7 @@ const OverlayDropdown = _ref => {
|
|
|
57725
57737
|
placeHolderColor,
|
|
57726
57738
|
margin = "8px",
|
|
57727
57739
|
editableDigitalCoupon = false,
|
|
57740
|
+
dropdownDigitalCouponTitle = "",
|
|
57728
57741
|
...props
|
|
57729
57742
|
} = _ref;
|
|
57730
57743
|
const [open, setOpen] = useState(false);
|
|
@@ -57735,8 +57748,6 @@ const OverlayDropdown = _ref => {
|
|
|
57735
57748
|
const buttonRef = useRef(null);
|
|
57736
57749
|
const dropdownRef = useRef(null);
|
|
57737
57750
|
const containerRef = useRef(null);
|
|
57738
|
-
|
|
57739
|
-
// Click outside to close dropdown
|
|
57740
57751
|
useEffect(() => {
|
|
57741
57752
|
const handleClickOutside = event => {
|
|
57742
57753
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
@@ -57752,20 +57763,13 @@ const OverlayDropdown = _ref => {
|
|
|
57752
57763
|
document.removeEventListener("touchstart", handleClickOutside);
|
|
57753
57764
|
};
|
|
57754
57765
|
}, [open]);
|
|
57755
|
-
|
|
57756
|
-
// Calculate dropdown position when opening
|
|
57757
57766
|
useEffect(() => {
|
|
57758
57767
|
if (open && buttonRef.current) {
|
|
57759
57768
|
const buttonRect = buttonRef.current.getBoundingClientRect();
|
|
57760
57769
|
const viewportHeight = window.innerHeight;
|
|
57761
57770
|
const dropdownHeight = parseInt(dropdownMaxHeight, 10);
|
|
57762
|
-
|
|
57763
|
-
// Space available below the button
|
|
57764
57771
|
const spaceBelow = viewportHeight - buttonRect.bottom;
|
|
57765
|
-
// Space available above the button
|
|
57766
57772
|
const spaceAbove = buttonRect.top;
|
|
57767
|
-
|
|
57768
|
-
// If there's not enough space below, but more space above, position above
|
|
57769
57773
|
if (spaceBelow < dropdownHeight && spaceAbove > spaceBelow) {
|
|
57770
57774
|
setDropdownPosition("above");
|
|
57771
57775
|
} else {
|
|
@@ -57773,8 +57777,6 @@ const OverlayDropdown = _ref => {
|
|
|
57773
57777
|
}
|
|
57774
57778
|
}
|
|
57775
57779
|
}, [open, dropdownMaxHeight, margin]);
|
|
57776
|
-
|
|
57777
|
-
// Combine original data with "Last defined by you" group
|
|
57778
57780
|
const getDataWithLastDefined = () => {
|
|
57779
57781
|
const combinedData = [...data];
|
|
57780
57782
|
if (lastDefinedGroup) {
|
|
@@ -57782,8 +57784,6 @@ const OverlayDropdown = _ref => {
|
|
|
57782
57784
|
}
|
|
57783
57785
|
return combinedData;
|
|
57784
57786
|
};
|
|
57785
|
-
|
|
57786
|
-
// Find selected item across all groups
|
|
57787
57787
|
const findSelectedItem = () => {
|
|
57788
57788
|
const allData = getDataWithLastDefined();
|
|
57789
57789
|
for (const group of allData) {
|
|
@@ -57949,7 +57949,7 @@ const OverlayDropdown = _ref => {
|
|
|
57949
57949
|
onMouseEnter: () => setHoveredText(selected?.label),
|
|
57950
57950
|
onMouseLeave: () => setHoveredText(null),
|
|
57951
57951
|
color: !selected && open ? placeHolderColor : "inherit"
|
|
57952
|
-
}, selected ? selected.label : open ? placeHolder :
|
|
57952
|
+
}, selected ? selected.label.includes("Digital") && editableDigitalCoupon ? dropdownDigitalCouponTitle !== "" ? dropdownDigitalCouponTitle : selected.label : selected.label : open ? placeHolder : ""), open ? /*#__PURE__*/React$1.createElement(MenuItemUpIcon, {
|
|
57953
57953
|
width: "12px",
|
|
57954
57954
|
height: "12px",
|
|
57955
57955
|
color: "#B1B1B1"
|
|
@@ -57997,9 +57997,10 @@ const OverlayDropdown = _ref => {
|
|
|
57997
57997
|
}
|
|
57998
57998
|
}
|
|
57999
57999
|
}, /*#__PURE__*/React$1.createElement(TruncatedText, {
|
|
58000
|
-
onMouseEnter: () => setHoveredText(
|
|
58001
|
-
onMouseLeave: () => setHoveredText(null)
|
|
58002
|
-
|
|
58000
|
+
onMouseEnter: () => setHoveredText(selected?.label),
|
|
58001
|
+
onMouseLeave: () => setHoveredText(null),
|
|
58002
|
+
color: !selected && open ? placeHolderColor : "inherit"
|
|
58003
|
+
}, group.templateType === 3 && editableDigitalCoupon ? dropdownDigitalCouponTitle !== "" ? dropdownDigitalCouponTitle : item.label : item.label), group.templateType === 2 ? /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
|
|
58003
58004
|
fill: item.value === value ? "#fff" : "#212121"
|
|
58004
58005
|
}) : group.templateType === 3 && editableDigitalCoupon ? /*#__PURE__*/React$1.createElement(PenIcon, {
|
|
58005
58006
|
fill: item.value === value ? "#fff" : "#212121"
|