sag_components 2.0.0-beta241 → 2.0.0-beta243

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
@@ -35209,6 +35209,7 @@ const WeeksPicker = _ref => {
35209
35209
  borderColor,
35210
35210
  borderColorFocus,
35211
35211
  textColor,
35212
+ text = 'Week',
35212
35213
  hoverColor,
35213
35214
  required,
35214
35215
  placeholder,
@@ -35441,7 +35442,7 @@ const WeeksPicker = _ref => {
35441
35442
  console.warn('Selected weeks are outside the allowed range');
35442
35443
  return;
35443
35444
  }
35444
- const tempValue = end === start ? `Week ${start}` : `Weeks ${start} - ${end}`;
35445
+ const tempValue = end === start ? text === 'Week' ? `${text} ${start}` : `${text}${start}` : text === 'Week' ? `${text}s ${start} - ${end}` : `${text}${start} - ${end}`;
35445
35446
  onChange(tempValue);
35446
35447
  setValue(tempValue);
35447
35448
  handleApply();
@@ -42703,7 +42704,9 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42703
42704
  onCheckboxClick = () => {},
42704
42705
  onHeaderCheckboxClick = () => {},
42705
42706
  onHeroClick = () => {},
42706
- onEditableClick = () => {}
42707
+ onEditableClick = () => {},
42708
+ isEditMode = false,
42709
+ editRowIndex = -1
42707
42710
  }, ref) => {
42708
42711
  // MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
42709
42712
  if (!Array.isArray(data) || !Array.isArray(columns)) {
@@ -42805,9 +42808,12 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
42805
42808
 
42806
42809
  // Handle row click for focus state
42807
42810
  const handleRowClick = (row, rowIndex) => {
42811
+ if (isEditMode && editRowIndex !== -1) {
42812
+ return;
42813
+ }
42808
42814
  setFocusedRowIndex(rowIndex);
42809
42815
  if (onRowClick) {
42810
- onRowClick(row);
42816
+ onRowClick(row, rowIndex);
42811
42817
  }
42812
42818
  };
42813
42819
 
@@ -43428,15 +43434,16 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43428
43434
  console.warn(`Invalid row at index ${rowIndex}:`, row);
43429
43435
  return null;
43430
43436
  }
43437
+ const shouldBeFocused = isEditMode ? rowIndex === editRowIndex : focusedRowIndex === rowIndex;
43431
43438
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
43432
43439
  key: row.id || `row-${rowIndex}`
43433
43440
  }, /*#__PURE__*/React__default["default"].createElement(TableRow, {
43434
43441
  "data-row-index": rowIndex,
43435
43442
  className: shimmerRowIndex === rowIndex ? "shimmer-row" : "",
43436
- isFocused: focusedRowIndex === rowIndex,
43443
+ isFocused: shouldBeFocused,
43437
43444
  selectedColor: selectedColor,
43438
- onMouseEnter: () => setHoveredRowIndex(rowIndex),
43439
- onMouseLeave: () => setHoveredRowIndex(null),
43445
+ onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
43446
+ onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
43440
43447
  onClick: () => handleRowClick(row, rowIndex)
43441
43448
  }, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
43442
43449
  $fieldType: "expand",
@@ -43570,7 +43577,9 @@ TableBody.propTypes = {
43570
43577
  onCheckboxClick: PropTypes.func,
43571
43578
  onHeaderCheckboxClick: PropTypes.func,
43572
43579
  onHeroClick: PropTypes.func,
43573
- onEditableClick: PropTypes.func
43580
+ onEditableClick: PropTypes.func,
43581
+ isEditMode: PropTypes.bool,
43582
+ editRowIndex: PropTypes.number
43574
43583
  };
43575
43584
  TableBody.displayName = "TableBody";
43576
43585
 
@@ -47091,7 +47100,9 @@ const Table = props => {
47091
47100
  onCheckboxClick: onCheckboxClick,
47092
47101
  onHeaderCheckboxClick: onHeaderCheckboxClick,
47093
47102
  onHeroClick: onHeroClick,
47094
- onEditableClick: onEditableClick
47103
+ onEditableClick: onEditableClick,
47104
+ isEditMode: isEditMode,
47105
+ editRowIndex: editRowIndex
47095
47106
  })), data.length === 0 && /*#__PURE__*/React__default["default"].createElement(NoEventsParent, null, /*#__PURE__*/React__default["default"].createElement(NoEventsWrapper, null, showNoDataInSearch ? getNoDataSearchIcon(noDataSearchIcon) : getNoDataIcon(noDataIcon)), /*#__PURE__*/React__default["default"].createElement(NoEventsMessage, null, showNoDataInSearch ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noDataInSearchTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noDataInSearchMessage) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("strong", null, noEventsTitle), /*#__PURE__*/React__default["default"].createElement("br", null), noEventsSubtitle)), !showNoDataInSearch && showNoEventsButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
47096
47107
  height: "45px",
47097
47108
  leftIcon: noEventsButtonIcon,
@@ -57786,7 +57797,13 @@ const OverlayDropdown = _ref => {
57786
57797
  const allData = getDataWithLastDefined();
57787
57798
  for (const group of allData) {
57788
57799
  if (group.items) {
57789
- const found = group.items.find(item => item.value === value);
57800
+ const found = group.items.find(item => {
57801
+ const digitalCouponItem = item.value === value ? item.label : null;
57802
+ if (digitalCouponItem && digitalCouponItem.includes("Digital") && editableDigitalCoupon) {
57803
+ return true;
57804
+ }
57805
+ return item.value === value;
57806
+ });
57790
57807
  if (found) return found;
57791
57808
  }
57792
57809
  }