@ctlyst.id/internal-ui 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
@@ -1092,7 +1092,8 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1092
1092
|
onRowClick,
|
1093
1093
|
container,
|
1094
1094
|
columnPinning,
|
1095
|
-
|
1095
|
+
disabledRow,
|
1096
|
+
highlightedRow,
|
1096
1097
|
cellLineClamp = 2
|
1097
1098
|
} = props;
|
1098
1099
|
const { table, toggleAllRowsSelected, generateColumn } = useDataTable(props);
|
@@ -1219,14 +1220,14 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1219
1220
|
}
|
1220
1221
|
),
|
1221
1222
|
/* @__PURE__ */ jsx24(Tbody, { ...styles == null ? void 0 : styles.tableBody, children: table.getRowModel().rows.map((row) => {
|
1222
|
-
const
|
1223
|
+
const isDisabledRow = disabledRow && disabledRow(row.original);
|
1224
|
+
const isHighlightedRow = highlightedRow && highlightedRow(row.original);
|
1223
1225
|
return /* @__PURE__ */ jsx24(
|
1224
1226
|
Tr,
|
1225
1227
|
{
|
1226
1228
|
"data-test-id": "-RU0hNYGRzeVM3HQ4cXHl",
|
1227
|
-
tabindex: "0",
|
1228
1229
|
...styles == null ? void 0 : styles.tableRow,
|
1229
|
-
"aria-
|
1230
|
+
"aria-selected": isHighlightedRow,
|
1230
1231
|
css: css`
|
1231
1232
|
&:last-child {
|
1232
1233
|
td {
|
@@ -1234,10 +1235,10 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1234
1235
|
}
|
1235
1236
|
}
|
1236
1237
|
`,
|
1237
|
-
cursor:
|
1238
|
+
cursor: isDisabledRow ? "default" : "pointer",
|
1238
1239
|
onMouseDown: (e) => {
|
1239
1240
|
var _a2;
|
1240
|
-
if (!
|
1241
|
+
if (!isDisabledRow && !isHighlightedRow) {
|
1241
1242
|
(_a2 = e.currentTarget) == null ? void 0 : _a2.setAttribute("data-active", "true");
|
1242
1243
|
}
|
1243
1244
|
},
|
@@ -1247,7 +1248,7 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1247
1248
|
},
|
1248
1249
|
onClick: () => {
|
1249
1250
|
if (onRowClick) {
|
1250
|
-
if (
|
1251
|
+
if (isDisabledRow) return;
|
1251
1252
|
onRowClick(row.original);
|
1252
1253
|
}
|
1253
1254
|
},
|
@@ -7364,6 +7365,11 @@ var baseStyle11 = definePartsStyle10({
|
|
7364
7365
|
td: {
|
7365
7366
|
backgroundColor: "neutral.200"
|
7366
7367
|
}
|
7368
|
+
},
|
7369
|
+
'&[aria-selected="true"]': {
|
7370
|
+
td: {
|
7371
|
+
backgroundColor: "danger.50"
|
7372
|
+
}
|
7367
7373
|
}
|
7368
7374
|
}
|
7369
7375
|
}
|