@ctlyst.id/internal-ui 5.3.0 → 5.3.2

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
@@ -272,6 +272,7 @@ declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelect
272
272
  toggleAllRowsSelected: (value?: boolean | undefined) => void;
273
273
  generateColumn: () => ColumnDef<T>[];
274
274
  throttleRowClick: (val: Row<T>) => void;
275
+ selectedRow: RowSelectionState | undefined;
275
276
  };
276
277
  declare const _default: <T>(props: DataTableProps<T> & {
277
278
  ref?: React$1.Ref<DataTableRefs<T>>;
package/dist/index.d.ts CHANGED
@@ -272,6 +272,7 @@ declare const useDataTable: <T>({ columns, dataSource, withSelectedRow, onSelect
272
272
  toggleAllRowsSelected: (value?: boolean | undefined) => void;
273
273
  generateColumn: () => ColumnDef<T>[];
274
274
  throttleRowClick: (val: Row<T>) => void;
275
+ selectedRow: RowSelectionState | undefined;
275
276
  };
276
277
  declare const _default: <T>(props: DataTableProps<T> & {
277
278
  ref?: React$1.Ref<DataTableRefs<T>>;
package/dist/index.js CHANGED
@@ -1577,7 +1577,8 @@ var useDataTable = ({
1577
1577
  action,
1578
1578
  toggleAllRowsSelected,
1579
1579
  generateColumn,
1580
- throttleRowClick
1580
+ throttleRowClick,
1581
+ selectedRow
1581
1582
  };
1582
1583
  };
1583
1584
  var DataTable = React5.forwardRef((props, ref) => {
@@ -1597,7 +1598,7 @@ var DataTable = React5.forwardRef((props, ref) => {
1597
1598
  paddingRowX = 8
1598
1599
  } = props;
1599
1600
  const { clickOrDragged, getDragOrClickProps } = useDragOrClick();
1600
- const { table, action, throttleRowClick, toggleAllRowsSelected, generateColumn } = useDataTable(props);
1601
+ const { table, action, throttleRowClick, toggleAllRowsSelected, generateColumn, selectedRow } = useDataTable(props);
1601
1602
  const refTable = React5.useRef(null);
1602
1603
  React5.useImperativeHandle(ref, () => ({
1603
1604
  toggleAllRowsSelected
@@ -1741,7 +1742,7 @@ var DataTable = React5.forwardRef((props, ref) => {
1741
1742
  ),
1742
1743
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react30.Tbody, { ...styles == null ? void 0 : styles.tableBody, children: table.getRowModel().rows.map((row, index) => {
1743
1744
  const isDisabledRow = disabledRow && disabledRow(row.original);
1744
- const isHighlightedRow = highlightedRow && highlightedRow(row.original);
1745
+ const isHighlightedRow = Object.keys(selectedRow != null ? selectedRow : {}).filter((key) => selectedRow == null ? void 0 : selectedRow[key]).includes(row.id) || highlightedRow && highlightedRow(row.original);
1745
1746
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1746
1747
  import_react30.Tr,
1747
1748
  {
@@ -7632,12 +7633,12 @@ var baseStyle11 = definePartsStyle10({
7632
7633
  td: {
7633
7634
  backgroundColor: "neutral.100"
7634
7635
  }
7635
- },
7636
- '&[data-active="true"]': {
7637
- td: {
7638
- backgroundColor: "neutral.200"
7639
- }
7640
7636
  }
7637
+ // '&[data-active="true"]': {
7638
+ // td: {
7639
+ // backgroundColor: 'neutral.200',
7640
+ // },
7641
+ // },
7641
7642
  }
7642
7643
  }
7643
7644
  }