@ctlyst.id/internal-ui 5.6.8 → 5.7.1

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.mts CHANGED
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
package/dist/index.d.ts CHANGED
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
package/dist/index.js CHANGED
@@ -1739,17 +1739,17 @@ var DataTable = React6.forwardRef((props, ref) => {
1739
1739
  "data-test-id": `CT_Container_TableHeader_${header.id}`,
1740
1740
  userSelect: "none",
1741
1741
  align: "center",
1742
- gap: 2,
1743
1742
  children: [
1744
1743
  (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()),
1745
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1744
+ header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1746
1745
  import_react31.Box,
1747
1746
  {
1748
1747
  as: "span",
1749
1748
  cursor: header.column.getCanSort() ? "pointer" : "default",
1750
1749
  "data-test-id": `CT_Container_SortingIcon_${header.id}`,
1751
1750
  onClick: header.column.getToggleSortingHandler(),
1752
- children: (_b2 = header.column.getCanSort() && {
1751
+ ml: 2,
1752
+ children: (_b2 = {
1753
1753
  asc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronUpIcon, { h: 4, w: 4, color: "neutral.500" }),
1754
1754
  desc: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.ChevronDownIcon, { h: 4, w: 4, color: "neutral.500" })
1755
1755
  }[header.column.getIsSorted()]) != null ? _b2 : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react31.Box, { display: "flex", justifyContent: "center", alignItems: "center", boxSize: 4, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_icons2.UpDownIcon, { color: "neutral.500" }) })
@@ -1767,12 +1767,13 @@ var DataTable = React6.forwardRef((props, ref) => {
1767
1767
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react31.Tbody, { ...styles == null ? void 0 : styles.tableBody, animation: `${fadeIn} 0.15s ease-out`, children: table.getRowModel().rows.map((row, index) => {
1768
1768
  const isDisabledRow = disabledRow && disabledRow(row.original);
1769
1769
  const isHighlightedRow = Object.keys(selectedRow != null ? selectedRow : {}).filter((key) => selectedRow == null ? void 0 : selectedRow[key]).includes(row.id) || highlightedRow && highlightedRow(row.original);
1770
+ const hgColor = typeof highlightRowColor === "function" ? highlightRowColor(row.original) : highlightRowColor;
1770
1771
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1771
1772
  import_react31.Tr,
1772
1773
  {
1773
1774
  "data-test-id": "-RU0hNYGRzeVM3HQ4cXHl",
1774
1775
  ...styles == null ? void 0 : styles.tableRow,
1775
- sx: { ...isHighlightedRow && getTableHighlightStyle(highlightRowColor) },
1776
+ sx: { ...isHighlightedRow && getTableHighlightStyle(hgColor) },
1776
1777
  "aria-disabled": isDisabledRow,
1777
1778
  "data-highlight": isHighlightedRow ? "true" : "false",
1778
1779
  css: import_react32.css`