@tmlmobilidade/ui 20250305.1809.16 → 20250305.1841.5
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/cjs/index.js
CHANGED
@@ -1560,15 +1560,12 @@ function DataTableContent({ classnames, columns, maxHeight, onRowClick, onRowCon
|
|
1560
1560
|
return (jsxRuntimeExports.jsxs("div", { className: cn(styles$8.root, classnames?.root), children: [jsxRuntimeExports.jsx(DataTableTitle, { search: search, title: title ?? '' }), jsxRuntimeExports.jsx("div", { className: cn(styles$8.tableWrapper, classnames?.tableWrapper), style: { maxHeight: maxHeight || '100%' }, children: jsxRuntimeExports.jsxs(core.Table, { className: cn(styles$8.table, classnames?.table, 'block'), children: [jsxRuntimeExports.jsx(DataTableHeader, { columns: columns }), jsxRuntimeExports.jsx(core.Table.Tbody, { children: jsxRuntimeExports.jsx(reactViewportList.ViewportList, { itemMargin: 0, items: data.records, children: (record, rowIndex) => (jsxRuntimeExports.jsx(DataTableRow, { columns: columns, onRowClick: onRowClick, onRowContextMenu: onRowContextMenu, onRowDoubleClick: onRowDoubleClick, record: record }, rowIdAccessor ? getValueAtPath(record, rowIdAccessor) : rowIndex)) }) })] }) })] }));
|
1561
1561
|
}
|
1562
1562
|
|
1563
|
-
function
|
1563
|
+
function useIsActiveDomain(domain) {
|
1564
1564
|
const [isActive, setIsActive] = React.useState(false);
|
1565
1565
|
React.useEffect(() => {
|
1566
1566
|
const handleRouteChange = () => {
|
1567
|
-
const
|
1568
|
-
if (
|
1569
|
-
setIsActive(true);
|
1570
|
-
}
|
1571
|
-
else if (href && pathname.includes(href) && href !== '/') {
|
1567
|
+
const currentDomain = window.location.hostname;
|
1568
|
+
if (domain.includes(currentDomain)) {
|
1572
1569
|
setIsActive(true);
|
1573
1570
|
}
|
1574
1571
|
else {
|
@@ -1584,7 +1581,7 @@ function useIsActivePage(href) {
|
|
1584
1581
|
window.removeEventListener('pushState', handleRouteChange);
|
1585
1582
|
window.removeEventListener('replaceState', handleRouteChange);
|
1586
1583
|
};
|
1587
|
-
}, [
|
1584
|
+
}, [domain]);
|
1588
1585
|
return isActive;
|
1589
1586
|
}
|
1590
1587
|
|
@@ -1608,7 +1605,7 @@ function Sidebar({ items, }) {
|
|
1608
1605
|
//
|
1609
1606
|
}
|
1610
1607
|
function SidebarItem({ classNames, disabled, href, icon, label, }) {
|
1611
|
-
const isActive =
|
1608
|
+
const isActive = useIsActiveDomain(href);
|
1612
1609
|
return (jsxRuntimeExports.jsx(core.Tooltip, { label: label, position: "right", children: jsxRuntimeExports.jsx("a", { href: href, children: jsxRuntimeExports.jsx(core.ActionIcon, { size: "xl", className: cn(styles$7.navButton, classNames?.navButton, {
|
1613
1610
|
[styles$7.disabled]: disabled,
|
1614
1611
|
[styles$7.selected]: isActive,
|