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.d.ts CHANGED
@@ -1167,12 +1167,13 @@ declare function ModalWithOverlay(props: any): any;
1167
1167
 
1168
1168
  declare function DropdownNew(props: any): any;
1169
1169
 
1170
- declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
1170
+ declare function WeeksPicker({ label, disabled, borderColor, borderColorFocus, textColor, text, hoverColor, required, placeholder, borderRadius, year, width, height, withMarginBottom, onChange, selectedValue, isDarkerBackground, allowedWeekRange, restrictToRange, }: {
1171
1171
  label: any;
1172
1172
  disabled: any;
1173
1173
  borderColor: any;
1174
1174
  borderColorFocus: any;
1175
1175
  textColor: any;
1176
+ text?: string;
1176
1177
  hoverColor: any;
1177
1178
  required: any;
1178
1179
  placeholder: any;
package/dist/index.esm.js CHANGED
@@ -35199,6 +35199,7 @@ const WeeksPicker = _ref => {
35199
35199
  borderColor,
35200
35200
  borderColorFocus,
35201
35201
  textColor,
35202
+ text = 'Week',
35202
35203
  hoverColor,
35203
35204
  required,
35204
35205
  placeholder,
@@ -35431,7 +35432,7 @@ const WeeksPicker = _ref => {
35431
35432
  console.warn('Selected weeks are outside the allowed range');
35432
35433
  return;
35433
35434
  }
35434
- const tempValue = end === start ? `Week ${start}` : `Weeks ${start} - ${end}`;
35435
+ const tempValue = end === start ? text === 'Week' ? `${text} ${start}` : `${text}${start}` : text === 'Week' ? `${text}s ${start} - ${end}` : `${text}${start} - ${end}`;
35435
35436
  onChange(tempValue);
35436
35437
  setValue(tempValue);
35437
35438
  handleApply();
@@ -42693,7 +42694,9 @@ const TableBody = /*#__PURE__*/forwardRef(({
42693
42694
  onCheckboxClick = () => {},
42694
42695
  onHeaderCheckboxClick = () => {},
42695
42696
  onHeroClick = () => {},
42696
- onEditableClick = () => {}
42697
+ onEditableClick = () => {},
42698
+ isEditMode = false,
42699
+ editRowIndex = -1
42697
42700
  }, ref) => {
42698
42701
  // MOVE ALL VALIDATION TO THE VERY TOP BEFORE ANY HOOKS
42699
42702
  if (!Array.isArray(data) || !Array.isArray(columns)) {
@@ -42795,9 +42798,12 @@ const TableBody = /*#__PURE__*/forwardRef(({
42795
42798
 
42796
42799
  // Handle row click for focus state
42797
42800
  const handleRowClick = (row, rowIndex) => {
42801
+ if (isEditMode && editRowIndex !== -1) {
42802
+ return;
42803
+ }
42798
42804
  setFocusedRowIndex(rowIndex);
42799
42805
  if (onRowClick) {
42800
- onRowClick(row);
42806
+ onRowClick(row, rowIndex);
42801
42807
  }
42802
42808
  };
42803
42809
 
@@ -43418,15 +43424,16 @@ const TableBody = /*#__PURE__*/forwardRef(({
43418
43424
  console.warn(`Invalid row at index ${rowIndex}:`, row);
43419
43425
  return null;
43420
43426
  }
43427
+ const shouldBeFocused = isEditMode ? rowIndex === editRowIndex : focusedRowIndex === rowIndex;
43421
43428
  return /*#__PURE__*/React$1.createElement(React$1.Fragment, {
43422
43429
  key: row.id || `row-${rowIndex}`
43423
43430
  }, /*#__PURE__*/React$1.createElement(TableRow, {
43424
43431
  "data-row-index": rowIndex,
43425
43432
  className: shimmerRowIndex === rowIndex ? "shimmer-row" : "",
43426
- isFocused: focusedRowIndex === rowIndex,
43433
+ isFocused: shouldBeFocused,
43427
43434
  selectedColor: selectedColor,
43428
- onMouseEnter: () => setHoveredRowIndex(rowIndex),
43429
- onMouseLeave: () => setHoveredRowIndex(null),
43435
+ onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
43436
+ onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
43430
43437
  onClick: () => handleRowClick(row, rowIndex)
43431
43438
  }, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
43432
43439
  $fieldType: "expand",
@@ -43560,7 +43567,9 @@ TableBody.propTypes = {
43560
43567
  onCheckboxClick: PropTypes.func,
43561
43568
  onHeaderCheckboxClick: PropTypes.func,
43562
43569
  onHeroClick: PropTypes.func,
43563
- onEditableClick: PropTypes.func
43570
+ onEditableClick: PropTypes.func,
43571
+ isEditMode: PropTypes.bool,
43572
+ editRowIndex: PropTypes.number
43564
43573
  };
43565
43574
  TableBody.displayName = "TableBody";
43566
43575
 
@@ -47081,7 +47090,9 @@ const Table = props => {
47081
47090
  onCheckboxClick: onCheckboxClick,
47082
47091
  onHeaderCheckboxClick: onHeaderCheckboxClick,
47083
47092
  onHeroClick: onHeroClick,
47084
- onEditableClick: onEditableClick
47093
+ onEditableClick: onEditableClick,
47094
+ isEditMode: isEditMode,
47095
+ editRowIndex: editRowIndex
47085
47096
  })), 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
47097
  height: "45px",
47087
47098
  leftIcon: noEventsButtonIcon,
@@ -57776,7 +57787,13 @@ const OverlayDropdown = _ref => {
57776
57787
  const allData = getDataWithLastDefined();
57777
57788
  for (const group of allData) {
57778
57789
  if (group.items) {
57779
- const found = group.items.find(item => item.value === value);
57790
+ const found = group.items.find(item => {
57791
+ const digitalCouponItem = item.value === value ? item.label : null;
57792
+ if (digitalCouponItem && digitalCouponItem.includes("Digital") && editableDigitalCoupon) {
57793
+ return true;
57794
+ }
57795
+ return item.value === value;
57796
+ });
57780
57797
  if (found) return found;
57781
57798
  }
57782
57799
  }