sag_components 2.0.0-beta335 → 2.0.0-beta337

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
@@ -40727,6 +40727,7 @@ const RangePop = props => {
40727
40727
  params = [],
40728
40728
  paramType = "Week",
40729
40729
  onApply = () => {},
40730
+ onCancel = () => {},
40730
40731
  buttonColor = "#066768",
40731
40732
  hoverColor = "#066768",
40732
40733
  initialValues = null
@@ -40797,6 +40798,7 @@ const RangePop = props => {
40797
40798
  const handleCancel = () => {
40798
40799
  reset();
40799
40800
  setSelectedRadio(radioOptions[0].toLowerCase());
40801
+ onCancel();
40800
40802
  };
40801
40803
 
40802
40804
  // Validation rules
@@ -41162,6 +41164,7 @@ const TableHeader = ({
41162
41164
  activeFilters = [],
41163
41165
  activeSorts = [],
41164
41166
  expandable = false,
41167
+ expandPosition = "left",
41165
41168
  onHeaderCheckboxClick = () => {},
41166
41169
  headerCheckboxStates = {},
41167
41170
  resetFiltersKey = 0,
@@ -41340,7 +41343,7 @@ const TableHeader = ({
41340
41343
  return true;
41341
41344
  }
41342
41345
  if (filterData.selectedRadio) {
41343
- return filterData.selectedRadio === 'all weeks';
41346
+ return filterData.selectedRadio !== 'custom range';
41344
41347
  }
41345
41348
  return filterData.isSelectAll && filterData.excluded?.length === 0 && filterData.included?.length === 0;
41346
41349
  };
@@ -41623,30 +41626,22 @@ const TableHeader = ({
41623
41626
  } else if (rangeFilter) {
41624
41627
  const currentFilterState = filterState[key];
41625
41628
 
41626
- // Determine if this is a price column
41627
- const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost') || key.toLowerCase().includes('amount');
41629
+ // Determine symbol: use column prop if provided, otherwise auto-detect
41630
+ const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost');
41631
+ const symbol = column.rangeFilterSymbol !== undefined ? column.rangeFilterSymbol : isPriceColumn ? '$' : '';
41632
+ const inputType = symbol !== undefined && symbol !== 'week' ? 'price' : 'week';
41628
41633
 
41629
41634
  // Configure RangePop based on column type
41630
- const rangeConfig = isPriceColumn ? {
41631
- paramType: '$',
41632
- params: [{
41633
- label: 'From $',
41634
- type: 'price'
41635
- }, {
41636
- label: 'To $',
41637
- type: 'price'
41638
- }],
41639
- radioOptions: ['All Prices', 'Custom Range']
41640
- } : {
41641
- paramType: 'Week',
41635
+ const rangeConfig = {
41636
+ paramType: symbol || '#',
41642
41637
  params: [{
41643
- label: 'From',
41644
- type: 'week'
41638
+ label: symbol ? `From ${symbol}` : 'From',
41639
+ type: inputType
41645
41640
  }, {
41646
- label: 'To',
41647
- type: 'week'
41641
+ label: symbol ? `To ${symbol}` : 'To',
41642
+ type: inputType
41648
41643
  }],
41649
- radioOptions: ['All Weeks', 'Custom Range']
41644
+ radioOptions: [`All ${title}`, 'Custom Range']
41650
41645
  };
41651
41646
  return /*#__PURE__*/React__default["default"].createElement(RangePop, {
41652
41647
  menuName: title,
@@ -41668,7 +41663,8 @@ const TableHeader = ({
41668
41663
  [key]: data
41669
41664
  }));
41670
41665
  setVisibleFilterPopWrapper(null);
41671
- }
41666
+ },
41667
+ onCancel: () => setVisibleFilterPopWrapper(null)
41672
41668
  });
41673
41669
  } else {
41674
41670
  // Check if this column has an active filter (not in default state)
@@ -41709,7 +41705,7 @@ const TableHeader = ({
41709
41705
  onReset: () => handleSortReset(key)
41710
41706
  });
41711
41707
  };
41712
- return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null, expandable && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
41708
+ return /*#__PURE__*/React__default["default"].createElement(StyledTableHeader, null, /*#__PURE__*/React__default["default"].createElement("tr", null, expandable && expandPosition !== "right" && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
41713
41709
  $fieldType: "expand",
41714
41710
  $minWidth: "16px",
41715
41711
  $maxWidth: "16px"
@@ -41760,7 +41756,11 @@ const TableHeader = ({
41760
41756
  }, /*#__PURE__*/React__default["default"].createElement(FilterIcon, {
41761
41757
  state: getFilterIconState(column.key),
41762
41758
  isActive: shouldShowActiveIcon(column.key)
41763
- }))))))), visibleSortPopWrapper && /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React__default["default"].createElement(PopWrapper, {
41759
+ })))))), expandable && expandPosition === "right" && /*#__PURE__*/React__default["default"].createElement(HeaderCell, {
41760
+ $fieldType: "expand",
41761
+ $minWidth: "16px",
41762
+ $maxWidth: "16px"
41763
+ }, /*#__PURE__*/React__default["default"].createElement(ColumnContent, null, /*#__PURE__*/React__default["default"].createElement(ColumnLabel, null)))), visibleSortPopWrapper && /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React__default["default"].createElement(PopWrapper, {
41764
41764
  ref: popupRef,
41765
41765
  className: "pop-wrapper",
41766
41766
  top: popPosition.top,
@@ -43463,6 +43463,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
43463
43463
  onCommentSave = () => {},
43464
43464
  commentTextLimit = 150,
43465
43465
  expandable = false,
43466
+ expandPosition = "left",
43466
43467
  expandedRows = {},
43467
43468
  expandedContent = {},
43468
43469
  onExpandRow = () => {},
@@ -44298,7 +44299,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
44298
44299
  onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
44299
44300
  onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
44300
44301
  onClick: () => handleRowClick(row, rowIndex)
44301
- }, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
44302
+ }, expandPosition !== "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
44302
44303
  $fieldType: "expand",
44303
44304
  $minWidth: "16px",
44304
44305
  $maxWidth: "16px"
@@ -44317,7 +44318,7 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
44317
44318
  $fieldType: "expand",
44318
44319
  $minWidth: "16px",
44319
44320
  $maxWidth: "16px"
44320
- }) : null, columns.map((column, columnIndex) => {
44321
+ }) : null), columns.map((column, columnIndex) => {
44321
44322
  if (!column || !column.key) {
44322
44323
  console.warn(`Invalid column at index ${columnIndex}:`, column);
44323
44324
  return /*#__PURE__*/React__default["default"].createElement(TableCell, {
@@ -44433,7 +44434,26 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
44433
44434
  }))))) : column.editable && column.renderEditableCell ? column.renderEditableCell(rowIndex, row, {
44434
44435
  markAllNotValidFields
44435
44436
  }) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer));
44436
- })), expandable && expandedRows[rowIndex] && /*#__PURE__*/React__default["default"].createElement(ExpandedRow, {
44437
+ }), expandPosition === "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
44438
+ $fieldType: "expand",
44439
+ $minWidth: "16px",
44440
+ $maxWidth: "16px"
44441
+ }, /*#__PURE__*/React__default["default"].createElement(ExpandIcon, {
44442
+ onClick: e => handleExpandClick(row, rowIndex, e),
44443
+ $isExpanded: expandedRows[rowIndex] || false
44444
+ }, expandedRows[rowIndex] ? /*#__PURE__*/React__default["default"].createElement(MenuItemOpenIcon, {
44445
+ width: "12",
44446
+ height: "12",
44447
+ color: "#666"
44448
+ }) : /*#__PURE__*/React__default["default"].createElement(ChervronRightIcon, {
44449
+ width: "12",
44450
+ height: "12",
44451
+ fill: "#666"
44452
+ }))) : expandable === true ? /*#__PURE__*/React__default["default"].createElement(TableCell, {
44453
+ $fieldType: "expand",
44454
+ $minWidth: "16px",
44455
+ $maxWidth: "16px"
44456
+ }) : null)), expandable && expandedRows[rowIndex] && /*#__PURE__*/React__default["default"].createElement(ExpandedRow, {
44437
44457
  $expandedBackgroundColor: expandedBackgroundColor
44438
44458
  }, /*#__PURE__*/React__default["default"].createElement(TableCell, {
44439
44459
  colSpan: columns.length + 1
@@ -48059,6 +48079,7 @@ const Table = props => {
48059
48079
  editRowIndex = -1,
48060
48080
  onCommentSave = () => {},
48061
48081
  expandable = false,
48082
+ expandPosition = "left",
48062
48083
  expandedRows = {},
48063
48084
  expandedContent = {},
48064
48085
  onExpandRow = () => {},
@@ -48209,6 +48230,7 @@ const Table = props => {
48209
48230
  onFilter: onFilter,
48210
48231
  onSelectAll: onSelectAll,
48211
48232
  expandable: expandable,
48233
+ expandPosition: expandPosition,
48212
48234
  onHeaderCheckboxClick: onHeaderCheckboxClick,
48213
48235
  headerCheckboxStates: headerCheckboxStates,
48214
48236
  resetFiltersKey: resetFiltersKey,
@@ -48236,6 +48258,7 @@ const Table = props => {
48236
48258
  changeFocusIndex: changeFocusIndex,
48237
48259
  onFocusChange: handleTableFocusChange,
48238
48260
  expandable: expandable,
48261
+ expandPosition: expandPosition,
48239
48262
  expandedRows: expandedRows,
48240
48263
  expandedContent: expandedContent,
48241
48264
  onExpandRow: onExpandRow,