@stella-source/stellasource-dsl 0.2.8 → 1.2.9

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/cjs/index.js CHANGED
@@ -20828,6 +20828,7 @@ const HeaderRow = styled.tr `
20828
20828
  const CellRow = styled.tr `
20829
20829
  min-height: 50px;
20830
20830
  height: 50px;
20831
+ cursor: ${({ $isClickable }) => ($isClickable ? "pointer" : "default")};
20831
20832
  &:hover {
20832
20833
  & > td {
20833
20834
  background-color: ${Styles.color.blue.pale};
@@ -21273,8 +21274,7 @@ const EmptyTableState = ({ id, className, header, subHeader, showClearFilterButt
21273
21274
  a$j.createElement(ClearFilterButtonRow, null, showClearFilterButton && (a$j.createElement(StellaButton, { label: "Clear Filters", onClick: () => onClearFilters?.(), variant: "secondary" })))))));
21274
21275
  };
21275
21276
 
21276
- // DataTable.tsx
21277
- function Table({ columns, data, isLoading, serverSide = false, onPageChange, onSortChange, onFilterChange, onRowSelect, rowStatuses, showSelection = false, showRowOptions = false, showPagination = true, variant, paginationDetails = {
21277
+ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onSortChange, onFilterChange, onRowSelect, onRowClick, rowStatuses, showSelection = false, showRowOptions = false, showPagination = true, variant, paginationDetails = {
21278
21278
  startingPage: 1,
21279
21279
  rowsPerPage: 10,
21280
21280
  totalRows: data.length,
@@ -21501,8 +21501,8 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21501
21501
  } }));
21502
21502
  }))))),
21503
21503
  a$j.createElement("tbody", null,
21504
- table.getRowModel().rows.length === 0 && (a$j.createElement(EmptyTableState, { header: emptyTableState.header, subHeader: emptyTableState.subHeader, showClearFilterButton: emptyTableState.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
21505
- table.getRowModel().rows.map((row) => (a$j.createElement(CellRow, { key: row.id }, row.getVisibleCells().map((cell) => {
21504
+ table.getRowModel().rows.length === 0 && (a$j.createElement(EmptyTableState, { header: emptyTableState?.header || "No data available.", subHeader: emptyTableState?.subHeader, showClearFilterButton: emptyTableState?.showClearFilterButton, onClearFilters: resetTable, colSpan: table.getVisibleLeafColumns().length, size: "large" })),
21505
+ table.getRowModel().rows.map((row) => (a$j.createElement(CellRow, { key: row.id, onClick: () => onRowClick?.(row.original), "$isClickable": !!onRowClick }, row.getVisibleCells().map((cell) => {
21506
21506
  const value = flexRender(cell.column.columnDef.cell, {
21507
21507
  ...cell.getContext(),
21508
21508
  localValue: rowState[row.id]?.[cell.column.id],
@@ -21609,25 +21609,6 @@ const Sync = ({ dataTestId, onClick, className, id, showTime = false, labelPosit
21609
21609
  a$j.createElement(CustomLabel, { htmlFor: id, id: `${id}-label`, labelValue: showTime ? `Last Updated at ${time}` : "" })));
21610
21610
  };
21611
21611
 
21612
- exports.QuoteVariants = void 0;
21613
- (function (QuoteVariants) {
21614
- QuoteVariants["TOTAL_PRICE"] = "total-price";
21615
- QuoteVariants["TOTAL_WEIGHT"] = "total-weight";
21616
- })(exports.QuoteVariants || (exports.QuoteVariants = {}));
21617
- exports.QuoteCategory = void 0;
21618
- (function (QuoteCategory) {
21619
- QuoteCategory["ITEM"] = "/item";
21620
- QuoteCategory["HOUR"] = "/hr";
21621
- QuoteCategory["CWT"] = "CWT";
21622
- QuoteCategory["LBS"] = "lbs";
21623
- QuoteCategory["KG"] = "kg";
21624
- QuoteCategory["TON"] = "ton";
21625
- })(exports.QuoteCategory || (exports.QuoteCategory = {}));
21626
- exports.TableUnitsAndTotalsLeftCategory = void 0;
21627
- (function (TableUnitsAndTotalsLeftCategory) {
21628
- TableUnitsAndTotalsLeftCategory["US_CURRENCY"] = "$";
21629
- })(exports.TableUnitsAndTotalsLeftCategory || (exports.TableUnitsAndTotalsLeftCategory = {}));
21630
-
21631
21612
  const Container = styled.div `
21632
21613
  display: flex;
21633
21614
  justify-content: space-between;
@@ -21660,17 +21641,17 @@ const SubHeaderText = styled.span `
21660
21641
  line-height: normal;
21661
21642
  `;
21662
21643
 
21663
- const TableUnitsAndTotals = ({ id, className, value, subValue, variant, leftCategory = exports.TableUnitsAndTotalsLeftCategory.US_CURRENCY, rightCategory, }) => {
21664
- const isWeight = variant === exports.QuoteVariants.TOTAL_WEIGHT;
21665
- const leftCategoryValue = isWeight ? "" : leftCategory;
21666
- const header = `${leftCategoryValue ?? ""}${value} ${rightCategory && isWeight ? ` ${rightCategory}` : ""}`;
21667
- const subHeader = subValue
21668
- ? `${leftCategoryValue ?? ""}${subValue} ${rightCategory ? ` ${rightCategory}` : ""}`
21669
- : undefined;
21644
+ const TableUnitsAndTotals = ({ id, className, value, subValue, valueRightCategory, valueLeftCategory, subValueRightCategory, subValueLeftCategory }) => {
21645
+ let header = valueLeftCategory ?? "";
21646
+ header += value;
21647
+ header += valueRightCategory ? ` ${valueRightCategory}` : "";
21648
+ let subHeader = subValueLeftCategory ?? "";
21649
+ subHeader += subValue;
21650
+ subHeader += subValueRightCategory ? ` ${subValueRightCategory}` : "";
21670
21651
  return (a$j.createElement(Container, { id: id, className: className },
21671
21652
  a$j.createElement(Column, { "$align": "right" },
21672
21653
  a$j.createElement(HeaderText, null, header),
21673
- subHeader && a$j.createElement(SubHeaderText, null, subHeader))));
21654
+ subValue && a$j.createElement(SubHeaderText, null, subHeader))));
21674
21655
  };
21675
21656
 
21676
21657
  exports.HelperText = HelperText;