@ctlyst.id/internal-ui 4.2.0 → 4.2.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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -254,7 +254,8 @@ interface DataTableProps<T> {
|
|
254
254
|
columnPinning?: ColumnPinningState;
|
255
255
|
cellLineClamp?: number;
|
256
256
|
onRowClick?: (data: T) => void;
|
257
|
-
|
257
|
+
disabledRow?: (row: T) => boolean;
|
258
|
+
highlightedRow?: (row: T) => boolean;
|
258
259
|
}
|
259
260
|
declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
|
260
261
|
type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
|
package/dist/index.d.ts
CHANGED
@@ -254,7 +254,8 @@ interface DataTableProps<T> {
|
|
254
254
|
columnPinning?: ColumnPinningState;
|
255
255
|
cellLineClamp?: number;
|
256
256
|
onRowClick?: (data: T) => void;
|
257
|
-
|
257
|
+
disabledRow?: (row: T) => boolean;
|
258
|
+
highlightedRow?: (row: T) => boolean;
|
258
259
|
}
|
259
260
|
declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
|
260
261
|
type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
|
package/dist/index.js
CHANGED
@@ -1312,7 +1312,8 @@ var getCommonPinningStyles = (column) => {
|
|
1312
1312
|
right: "0px",
|
1313
1313
|
bottom: "-1px",
|
1314
1314
|
top: 0,
|
1315
|
-
transform: "translateX(100%)"
|
1315
|
+
transform: "translateX(100%)",
|
1316
|
+
pointerEvents: "none"
|
1316
1317
|
},
|
1317
1318
|
"[data-pin-left=true] &:after": {
|
1318
1319
|
boxShadow: "inset 14px 0px 20px -10px #00000010"
|
@@ -1329,7 +1330,8 @@ var getCommonPinningStyles = (column) => {
|
|
1329
1330
|
left: "0%",
|
1330
1331
|
top: 0,
|
1331
1332
|
bottom: "-1px",
|
1332
|
-
transform: "translateX(-100%)"
|
1333
|
+
transform: "translateX(-100%)",
|
1334
|
+
pointerEvents: "none"
|
1333
1335
|
},
|
1334
1336
|
"[data-pin-right=true] &:after": {
|
1335
1337
|
boxShadow: "inset -14px 0px 20px -10px #00000010"
|
@@ -1439,7 +1441,8 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1439
1441
|
onRowClick,
|
1440
1442
|
container,
|
1441
1443
|
columnPinning,
|
1442
|
-
|
1444
|
+
disabledRow,
|
1445
|
+
highlightedRow,
|
1443
1446
|
cellLineClamp = 2
|
1444
1447
|
} = props;
|
1445
1448
|
const { table, toggleAllRowsSelected, generateColumn } = useDataTable(props);
|
@@ -1566,14 +1569,14 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1566
1569
|
}
|
1567
1570
|
),
|
1568
1571
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Tbody, { ...styles == null ? void 0 : styles.tableBody, children: table.getRowModel().rows.map((row) => {
|
1569
|
-
const
|
1572
|
+
const isDisabledRow = disabledRow && disabledRow(row.original);
|
1573
|
+
const isHighlightedRow = highlightedRow && highlightedRow(row.original);
|
1570
1574
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
1571
1575
|
import_react28.Tr,
|
1572
1576
|
{
|
1573
1577
|
"data-test-id": "-RU0hNYGRzeVM3HQ4cXHl",
|
1574
|
-
tabindex: "0",
|
1575
1578
|
...styles == null ? void 0 : styles.tableRow,
|
1576
|
-
"aria-
|
1579
|
+
"aria-selected": isHighlightedRow,
|
1577
1580
|
css: import_react29.css`
|
1578
1581
|
&:last-child {
|
1579
1582
|
td {
|
@@ -1581,10 +1584,10 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1581
1584
|
}
|
1582
1585
|
}
|
1583
1586
|
`,
|
1584
|
-
cursor:
|
1587
|
+
cursor: isDisabledRow ? "default" : "pointer",
|
1585
1588
|
onMouseDown: (e) => {
|
1586
1589
|
var _a2;
|
1587
|
-
if (!
|
1590
|
+
if (!isDisabledRow && !isHighlightedRow) {
|
1588
1591
|
(_a2 = e.currentTarget) == null ? void 0 : _a2.setAttribute("data-active", "true");
|
1589
1592
|
}
|
1590
1593
|
},
|
@@ -1594,7 +1597,7 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1594
1597
|
},
|
1595
1598
|
onClick: () => {
|
1596
1599
|
if (onRowClick) {
|
1597
|
-
if (
|
1600
|
+
if (isDisabledRow) return;
|
1598
1601
|
onRowClick(row.original);
|
1599
1602
|
}
|
1600
1603
|
},
|
@@ -7444,6 +7447,11 @@ var baseStyle11 = definePartsStyle10({
|
|
7444
7447
|
td: {
|
7445
7448
|
backgroundColor: "neutral.200"
|
7446
7449
|
}
|
7450
|
+
},
|
7451
|
+
'&[aria-selected="true"]': {
|
7452
|
+
td: {
|
7453
|
+
backgroundColor: "danger.50"
|
7454
|
+
}
|
7447
7455
|
}
|
7448
7456
|
}
|
7449
7457
|
}
|