@ctlyst.id/internal-ui 4.1.9 → 4.1.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -253,6 +253,7 @@ interface DataTableProps<T> {
|
|
253
253
|
headerSticky?: boolean;
|
254
254
|
columnPinning?: ColumnPinningState;
|
255
255
|
onRowClick?: (data: T) => void;
|
256
|
+
isRowDisabled?: (row: T) => boolean;
|
256
257
|
}
|
257
258
|
declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
|
258
259
|
type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
|
package/dist/index.d.ts
CHANGED
@@ -253,6 +253,7 @@ interface DataTableProps<T> {
|
|
253
253
|
headerSticky?: boolean;
|
254
254
|
columnPinning?: ColumnPinningState;
|
255
255
|
onRowClick?: (data: T) => void;
|
256
|
+
isRowDisabled?: (row: T) => boolean;
|
256
257
|
}
|
257
258
|
declare const isCellDisabled: (row: DisabledRowData, cellId: string) => boolean;
|
258
259
|
type DataTableRefs<T> = Pick<RowSelectionInstance<T>, 'toggleAllRowsSelected'>;
|
package/dist/index.js
CHANGED
@@ -1432,7 +1432,7 @@ var useDataTable = ({
|
|
1432
1432
|
};
|
1433
1433
|
var DataTable = React5.forwardRef((props, ref) => {
|
1434
1434
|
var _a, _b, _c, _d, _e, _f, _g;
|
1435
|
-
const { isLoading, styles, headerSticky, onRowClick, container, columnPinning } = props;
|
1435
|
+
const { isLoading, styles, headerSticky, onRowClick, container, columnPinning, isRowDisabled } = props;
|
1436
1436
|
const { table, toggleAllRowsSelected, generateColumn } = useDataTable(props);
|
1437
1437
|
const refTable = React5.useRef(null);
|
1438
1438
|
React5.useImperativeHandle(ref, () => ({
|
@@ -1570,6 +1570,8 @@ var DataTable = React5.forwardRef((props, ref) => {
|
|
1570
1570
|
}
|
1571
1571
|
}
|
1572
1572
|
`,
|
1573
|
+
pointerEvents: isRowDisabled && isRowDisabled(row.original) ? "none" : "auto",
|
1574
|
+
cursor: isRowDisabled && isRowDisabled(row.original) ? "default" : "pointer",
|
1573
1575
|
onMouseDown: (e) => {
|
1574
1576
|
var _a2;
|
1575
1577
|
(_a2 = e.currentTarget) == null ? void 0 : _a2.setAttribute("data-active", "true");
|