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.esm.js CHANGED
@@ -40717,6 +40717,7 @@ const RangePop = props => {
40717
40717
  params = [],
40718
40718
  paramType = "Week",
40719
40719
  onApply = () => {},
40720
+ onCancel = () => {},
40720
40721
  buttonColor = "#066768",
40721
40722
  hoverColor = "#066768",
40722
40723
  initialValues = null
@@ -40787,6 +40788,7 @@ const RangePop = props => {
40787
40788
  const handleCancel = () => {
40788
40789
  reset();
40789
40790
  setSelectedRadio(radioOptions[0].toLowerCase());
40791
+ onCancel();
40790
40792
  };
40791
40793
 
40792
40794
  // Validation rules
@@ -41152,6 +41154,7 @@ const TableHeader = ({
41152
41154
  activeFilters = [],
41153
41155
  activeSorts = [],
41154
41156
  expandable = false,
41157
+ expandPosition = "left",
41155
41158
  onHeaderCheckboxClick = () => {},
41156
41159
  headerCheckboxStates = {},
41157
41160
  resetFiltersKey = 0,
@@ -41330,7 +41333,7 @@ const TableHeader = ({
41330
41333
  return true;
41331
41334
  }
41332
41335
  if (filterData.selectedRadio) {
41333
- return filterData.selectedRadio === 'all weeks';
41336
+ return filterData.selectedRadio !== 'custom range';
41334
41337
  }
41335
41338
  return filterData.isSelectAll && filterData.excluded?.length === 0 && filterData.included?.length === 0;
41336
41339
  };
@@ -41613,30 +41616,22 @@ const TableHeader = ({
41613
41616
  } else if (rangeFilter) {
41614
41617
  const currentFilterState = filterState[key];
41615
41618
 
41616
- // Determine if this is a price column
41617
- const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost') || key.toLowerCase().includes('amount');
41619
+ // Determine symbol: use column prop if provided, otherwise auto-detect
41620
+ const isPriceColumn = key.toLowerCase().includes('price') || key.toLowerCase().includes('cost');
41621
+ const symbol = column.rangeFilterSymbol !== undefined ? column.rangeFilterSymbol : isPriceColumn ? '$' : '';
41622
+ const inputType = symbol !== undefined && symbol !== 'week' ? 'price' : 'week';
41618
41623
 
41619
41624
  // Configure RangePop based on column type
41620
- const rangeConfig = isPriceColumn ? {
41621
- paramType: '$',
41622
- params: [{
41623
- label: 'From $',
41624
- type: 'price'
41625
- }, {
41626
- label: 'To $',
41627
- type: 'price'
41628
- }],
41629
- radioOptions: ['All Prices', 'Custom Range']
41630
- } : {
41631
- paramType: 'Week',
41625
+ const rangeConfig = {
41626
+ paramType: symbol || '#',
41632
41627
  params: [{
41633
- label: 'From',
41634
- type: 'week'
41628
+ label: symbol ? `From ${symbol}` : 'From',
41629
+ type: inputType
41635
41630
  }, {
41636
- label: 'To',
41637
- type: 'week'
41631
+ label: symbol ? `To ${symbol}` : 'To',
41632
+ type: inputType
41638
41633
  }],
41639
- radioOptions: ['All Weeks', 'Custom Range']
41634
+ radioOptions: [`All ${title}`, 'Custom Range']
41640
41635
  };
41641
41636
  return /*#__PURE__*/React$1.createElement(RangePop, {
41642
41637
  menuName: title,
@@ -41658,7 +41653,8 @@ const TableHeader = ({
41658
41653
  [key]: data
41659
41654
  }));
41660
41655
  setVisibleFilterPopWrapper(null);
41661
- }
41656
+ },
41657
+ onCancel: () => setVisibleFilterPopWrapper(null)
41662
41658
  });
41663
41659
  } else {
41664
41660
  // Check if this column has an active filter (not in default state)
@@ -41699,7 +41695,7 @@ const TableHeader = ({
41699
41695
  onReset: () => handleSortReset(key)
41700
41696
  });
41701
41697
  };
41702
- return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, expandable && /*#__PURE__*/React$1.createElement(HeaderCell, {
41698
+ return /*#__PURE__*/React$1.createElement(StyledTableHeader, null, /*#__PURE__*/React$1.createElement("tr", null, expandable && expandPosition !== "right" && /*#__PURE__*/React$1.createElement(HeaderCell, {
41703
41699
  $fieldType: "expand",
41704
41700
  $minWidth: "16px",
41705
41701
  $maxWidth: "16px"
@@ -41750,7 +41746,11 @@ const TableHeader = ({
41750
41746
  }, /*#__PURE__*/React$1.createElement(FilterIcon, {
41751
41747
  state: getFilterIconState(column.key),
41752
41748
  isActive: shouldShowActiveIcon(column.key)
41753
- }))))))), visibleSortPopWrapper && /*#__PURE__*/createPortal(/*#__PURE__*/React$1.createElement(PopWrapper, {
41749
+ })))))), expandable && expandPosition === "right" && /*#__PURE__*/React$1.createElement(HeaderCell, {
41750
+ $fieldType: "expand",
41751
+ $minWidth: "16px",
41752
+ $maxWidth: "16px"
41753
+ }, /*#__PURE__*/React$1.createElement(ColumnContent, null, /*#__PURE__*/React$1.createElement(ColumnLabel, null)))), visibleSortPopWrapper && /*#__PURE__*/createPortal(/*#__PURE__*/React$1.createElement(PopWrapper, {
41754
41754
  ref: popupRef,
41755
41755
  className: "pop-wrapper",
41756
41756
  top: popPosition.top,
@@ -43453,6 +43453,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
43453
43453
  onCommentSave = () => {},
43454
43454
  commentTextLimit = 150,
43455
43455
  expandable = false,
43456
+ expandPosition = "left",
43456
43457
  expandedRows = {},
43457
43458
  expandedContent = {},
43458
43459
  onExpandRow = () => {},
@@ -44288,7 +44289,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
44288
44289
  onMouseEnter: () => !isEditMode && setHoveredRowIndex(rowIndex),
44289
44290
  onMouseLeave: () => !isEditMode && setHoveredRowIndex(null),
44290
44291
  onClick: () => handleRowClick(row, rowIndex)
44291
- }, expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
44292
+ }, expandPosition !== "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
44292
44293
  $fieldType: "expand",
44293
44294
  $minWidth: "16px",
44294
44295
  $maxWidth: "16px"
@@ -44307,7 +44308,7 @@ const TableBody = /*#__PURE__*/forwardRef(({
44307
44308
  $fieldType: "expand",
44308
44309
  $minWidth: "16px",
44309
44310
  $maxWidth: "16px"
44310
- }) : null, columns.map((column, columnIndex) => {
44311
+ }) : null), columns.map((column, columnIndex) => {
44311
44312
  if (!column || !column.key) {
44312
44313
  console.warn(`Invalid column at index ${columnIndex}:`, column);
44313
44314
  return /*#__PURE__*/React$1.createElement(TableCell, {
@@ -44423,7 +44424,26 @@ const TableBody = /*#__PURE__*/forwardRef(({
44423
44424
  }))))) : column.editable && column.renderEditableCell ? column.renderEditableCell(rowIndex, row, {
44424
44425
  markAllNotValidFields
44425
44426
  }) : renderCellContent(formattedValue, isTextBasedField, shouldShimmer));
44426
- })), expandable && expandedRows[rowIndex] && /*#__PURE__*/React$1.createElement(ExpandedRow, {
44427
+ }), expandPosition === "right" && (expandable && expandedContent[rowIndex] !== undefined && expandedContent[rowIndex] !== null ? /*#__PURE__*/React$1.createElement(TableCell, {
44428
+ $fieldType: "expand",
44429
+ $minWidth: "16px",
44430
+ $maxWidth: "16px"
44431
+ }, /*#__PURE__*/React$1.createElement(ExpandIcon, {
44432
+ onClick: e => handleExpandClick(row, rowIndex, e),
44433
+ $isExpanded: expandedRows[rowIndex] || false
44434
+ }, expandedRows[rowIndex] ? /*#__PURE__*/React$1.createElement(MenuItemOpenIcon, {
44435
+ width: "12",
44436
+ height: "12",
44437
+ color: "#666"
44438
+ }) : /*#__PURE__*/React$1.createElement(ChervronRightIcon, {
44439
+ width: "12",
44440
+ height: "12",
44441
+ fill: "#666"
44442
+ }))) : expandable === true ? /*#__PURE__*/React$1.createElement(TableCell, {
44443
+ $fieldType: "expand",
44444
+ $minWidth: "16px",
44445
+ $maxWidth: "16px"
44446
+ }) : null)), expandable && expandedRows[rowIndex] && /*#__PURE__*/React$1.createElement(ExpandedRow, {
44427
44447
  $expandedBackgroundColor: expandedBackgroundColor
44428
44448
  }, /*#__PURE__*/React$1.createElement(TableCell, {
44429
44449
  colSpan: columns.length + 1
@@ -48049,6 +48069,7 @@ const Table = props => {
48049
48069
  editRowIndex = -1,
48050
48070
  onCommentSave = () => {},
48051
48071
  expandable = false,
48072
+ expandPosition = "left",
48052
48073
  expandedRows = {},
48053
48074
  expandedContent = {},
48054
48075
  onExpandRow = () => {},
@@ -48199,6 +48220,7 @@ const Table = props => {
48199
48220
  onFilter: onFilter,
48200
48221
  onSelectAll: onSelectAll,
48201
48222
  expandable: expandable,
48223
+ expandPosition: expandPosition,
48202
48224
  onHeaderCheckboxClick: onHeaderCheckboxClick,
48203
48225
  headerCheckboxStates: headerCheckboxStates,
48204
48226
  resetFiltersKey: resetFiltersKey,
@@ -48226,6 +48248,7 @@ const Table = props => {
48226
48248
  changeFocusIndex: changeFocusIndex,
48227
48249
  onFocusChange: handleTableFocusChange,
48228
48250
  expandable: expandable,
48251
+ expandPosition: expandPosition,
48229
48252
  expandedRows: expandedRows,
48230
48253
  expandedContent: expandedContent,
48231
48254
  onExpandRow: onExpandRow,