@ctlyst.id/internal-ui 4.1.8 → 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 +24 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -15
- 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");
|
@@ -5236,19 +5238,28 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
|
|
5236
5238
|
) }) }) })
|
5237
5239
|
] });
|
5238
5240
|
} }, item.id),
|
5239
|
-
!isCollapse && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
5240
|
-
|
5241
|
+
!isCollapse && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
5242
|
+
import_react77.Fade,
|
5241
5243
|
{
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
5250
|
-
|
5251
|
-
|
5244
|
+
in: true,
|
5245
|
+
transition: {
|
5246
|
+
enter: { duration: 0.5 }
|
5247
|
+
},
|
5248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_react77.AccordionPanel, { mt: "1", p: "0", children: item.children.map((submenu) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
5249
|
+
NavItem,
|
5250
|
+
{
|
5251
|
+
mt: "1",
|
5252
|
+
"data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
|
5253
|
+
isActive: active === submenu.navLink,
|
5254
|
+
isChild: true,
|
5255
|
+
...itemStyles,
|
5256
|
+
onClick: () => setActive(submenu.navLink),
|
5257
|
+
children: submenu.title
|
5258
|
+
},
|
5259
|
+
submenu.id
|
5260
|
+
)) })
|
5261
|
+
}
|
5262
|
+
)
|
5252
5263
|
] });
|
5253
5264
|
} }, item.id);
|
5254
5265
|
}) })
|