feat: add EnterpriseDataTable component, integrate standard pagination, and update AgGridProvider for enhanced data handling
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import React, { createContext, useContext, useEffect, useRef } from 'react';
|
||||
import { useMantineColorScheme } from '@mantine/core';
|
||||
import type { Theme } from 'ag-grid-community';
|
||||
import { AllCommunityModule, type Theme } from 'ag-grid-community';
|
||||
import { initAgGrid, type AgGridInitOptions } from './ag-grid-setup';
|
||||
import { agGridMantineTheme } from './ag-grid-theme';
|
||||
import { AgGridProvider as BaseAgGridProvider } from 'ag-grid-react';
|
||||
import { AllEnterpriseModule } from 'ag-grid-enterprise';
|
||||
|
||||
/* ─── Context ──────────────────────────────────────────────────────── */
|
||||
|
||||
@@ -68,10 +70,12 @@ export function AgGridProvider({ licenseKey, bypassLicense, children }: AgGridPr
|
||||
const agThemeMode = colorScheme === 'dark' ? 'dark' : 'light';
|
||||
|
||||
return (
|
||||
<AgGridContext.Provider value={{ theme: agGridMantineTheme }}>
|
||||
<div data-ag-theme-mode={agThemeMode} style={{ display: 'contents' }}>
|
||||
{children}
|
||||
</div>
|
||||
</AgGridContext.Provider>
|
||||
<BaseAgGridProvider modules={[AllCommunityModule, AllEnterpriseModule]}>
|
||||
<AgGridContext.Provider value={{ theme: agGridMantineTheme }}>
|
||||
<div data-ag-theme-mode={agThemeMode} style={{ display: 'contents' }}>
|
||||
{children}
|
||||
</div>
|
||||
</AgGridContext.Provider>
|
||||
</BaseAgGridProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export const agGridMantineTheme = themeQuartz
|
||||
selectedRowBackgroundColor: 'var(--mantine-primary-color-light)',
|
||||
|
||||
/* ── Radius ─────────────────────────────────────────────────── */
|
||||
borderRadius: 'var(--mantine-radius-xs)',
|
||||
borderRadius: 'var(--mantine-radius-sm)',
|
||||
wrapperBorderRadius: 'var(--mantine-radius-sm)',
|
||||
|
||||
/* ── Spacing ────────────────────────────────────────────────── */
|
||||
@@ -88,8 +88,7 @@ export const agGridMantineTheme = themeQuartz
|
||||
/* ── Row Styling ──────────────────────────────────────────── */
|
||||
oddRowBackgroundColor: 'var(--mantine-color-dark-6)',
|
||||
rowHoverColor: 'color-mix(in srgb, var(--mantine-primary-color-filled) 12%, transparent)',
|
||||
selectedRowBackgroundColor:
|
||||
'color-mix(in srgb, var(--mantine-primary-color-filled) 18%, transparent)',
|
||||
selectedRowBackgroundColor: 'color-mix(in srgb, var(--mantine-primary-color-filled) 18%, transparent)',
|
||||
},
|
||||
'dark',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user