@stella-source/stellasource-dsl 0.2.9 → 1.2.10

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
@@ -21086,7 +21086,7 @@ const IndeterminateCheckbox = ({ isIndeterminate, isChecked, onChange, }) => {
21086
21086
  return (a$j.createElement(Checkbox, { ref: ref, checked: isChecked, onChange: (e) => onChange?.(e) }));
21087
21087
  };
21088
21088
 
21089
- const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition, onFilterMenuInteraction, }) => {
21089
+ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition, onFilterMenuInteraction, onFilterApply, }) => {
21090
21090
  const column = header.column;
21091
21091
  const columnDef = column.columnDef;
21092
21092
  const meta = columnDef.meta;
@@ -21192,6 +21192,7 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
21192
21192
  setCurrentAppliedFilters([item]);
21193
21193
  column?.setFilterValue([item]);
21194
21194
  showFilterMenu(false);
21195
+ onFilterApply?.();
21195
21196
  }, "$applied": tempFilters?.includes(item) }, item));
21196
21197
  }
21197
21198
  return (a$j.createElement(MenuItem, { key: item },
@@ -21212,12 +21213,14 @@ const TableHeaderCell = ({ header, serverSide, filters, sorting, scrollPosition,
21212
21213
  setCurrentAppliedFilters(tempFilters);
21213
21214
  column?.setFilterValue(tempFilters?.length > 0 ? tempFilters : []);
21214
21215
  showFilterMenu(false);
21216
+ onFilterApply?.();
21215
21217
  } }, "Apply Selection")),
21216
21218
  filters?.[header.id]?.length > 0 && (a$j.createElement(MenuButton, { key: "clear", onClick: () => {
21217
21219
  column?.setFilterValue([]);
21218
21220
  showFilterMenu(false);
21219
21221
  setTempFilters([]);
21220
21222
  setCurrentAppliedFilters([]);
21223
+ onFilterApply?.();
21221
21224
  } }, "Clear Filter"))), document.body))),
21222
21225
  header.column.getCanSort() && (a$j.createElement(SortButton, { className: "icon", iconName: "sort", ariaLabel: "Sort Button", variant: "tertiary", "$active": sorting.some((s) => s.id === header.column.id), "$sort": column.getIsSorted(), onClick: (e) => header.column.getToggleSortingHandler()?.(e) })),
21223
21226
  textAlign === "right" && (a$j.createElement("span", { style: { fontWeight: 600 } }, flexRender(columnDef.header, header.getContext()))))));
@@ -21498,6 +21501,12 @@ function Table({ columns, data, isLoading, serverSide = false, onPageChange, onS
21498
21501
  ...prev,
21499
21502
  [id]: active,
21500
21503
  }));
21504
+ }, onFilterApply: () => {
21505
+ setPageIndex(1);
21506
+ setPagination((prev) => ({
21507
+ ...prev,
21508
+ pageIndex: 0,
21509
+ }));
21501
21510
  } }));
21502
21511
  }))))),
21503
21512
  a$j.createElement("tbody", null,
@@ -21609,25 +21618,6 @@ const Sync = ({ dataTestId, onClick, className, id, showTime = false, labelPosit
21609
21618
  a$j.createElement(CustomLabel, { htmlFor: id, id: `${id}-label`, labelValue: showTime ? `Last Updated at ${time}` : "" })));
21610
21619
  };
21611
21620
 
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
21621
  const Container = styled.div `
21632
21622
  display: flex;
21633
21623
  justify-content: space-between;
@@ -21660,17 +21650,17 @@ const SubHeaderText = styled.span `
21660
21650
  line-height: normal;
21661
21651
  `;
21662
21652
 
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;
21653
+ const TableUnitsAndTotals = ({ id, className, value, subValue, valueRightCategory, valueLeftCategory, subValueRightCategory, subValueLeftCategory }) => {
21654
+ let header = valueLeftCategory ?? "";
21655
+ header += value;
21656
+ header += valueRightCategory ? ` ${valueRightCategory}` : "";
21657
+ let subHeader = subValueLeftCategory ?? "";
21658
+ subHeader += subValue;
21659
+ subHeader += subValueRightCategory ? ` ${subValueRightCategory}` : "";
21670
21660
  return (a$j.createElement(Container, { id: id, className: className },
21671
21661
  a$j.createElement(Column, { "$align": "right" },
21672
21662
  a$j.createElement(HeaderText, null, header),
21673
- subHeader && a$j.createElement(SubHeaderText, null, subHeader))));
21663
+ subValue && a$j.createElement(SubHeaderText, null, subHeader))));
21674
21664
  };
21675
21665
 
21676
21666
  exports.HelperText = HelperText;