Skip to content

Commit

Permalink
Resolves more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed Dec 22, 2022
1 parent b0ab240 commit 4f488b6
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/data/data-grid/column-menu/CustomColumnMenuGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ function CustomColumnMenu(props) {
};
return (
<React.Fragment>
<Stack px={1.5} py={0.5}>
<Stack px={0.5} py={0.5}>
<GridColumnMenuSortItem {...itemProps} />
{/* Only provide filtering on desk */}
{itemProps.colDef.field === 'desk' ? (
<GridColumnMenuFilterItem {...itemProps} />
) : null}
</Stack>
<Divider />
<Stack px={1.5} py={0.5}>
<Stack px={0.5} py={0.5}>
<GridColumnMenuColumnsItem {...itemProps} />
<MenuCloseComponent {...itemProps} />
</Stack>
Expand Down
4 changes: 2 additions & 2 deletions docs/data/data-grid/column-menu/CustomColumnMenuGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ function CustomColumnMenu(props: GridColumnMenuProps) {
};
return (
<React.Fragment>
<Stack px={1.5} py={0.5}>
<Stack px={0.5} py={0.5}>
<GridColumnMenuSortItem {...itemProps} />
{/* Only provide filtering on desk */}
{itemProps.colDef.field === 'desk' ? (
<GridColumnMenuFilterItem {...itemProps} />
) : null}
</Stack>
<Divider />
<Stack px={1.5} py={0.5}>
<Stack px={0.5} py={0.5}>
<GridColumnMenuColumnsItem {...itemProps} />
<MenuCloseComponent {...itemProps} />
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '../models/dataGridPremiumProps';
import { GridPremiumSlotsComponent } from '../models';
import { GRID_AGGREGATION_FUNCTIONS } from '../hooks/features/aggregation';
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants';
import { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridPremiumDefaultSlotsComponents';

/**
* The default values of `DataGridPremiumPropsWithDefaultValue` to inject in the props of DataGridPremium.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '@mui/x-data-grid-pro';
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '@mui/x-data-grid-pro';
import { GridPremiumSlotsComponent, GridPremiumIconSlotsComponent } from '../models';
import { GridWorkspacesIcon, GridGroupWorkIcon, GridFunctionsIcon } from '../components';
import { GridPremiumColumnMenu } from '../components/GridPremiumColumnMenu';
Expand All @@ -10,7 +10,7 @@ export const DEFAULT_GRID_PREMIUM_ICON_SLOTS_COMPONENTS: GridPremiumIconSlotsCom
};

export const DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS: GridPremiumSlotsComponent = {
...DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS,
...DATA_GRID_DEFAULT_SLOTS_COMPONENTS,
...DEFAULT_GRID_PREMIUM_ICON_SLOTS_COMPONENTS,
ColumnMenu: GridPremiumColumnMenu,
};
1 change: 0 additions & 1 deletion packages/grid/x-data-grid-premium/src/constants/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/grid/x-data-grid-premium/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './DataGridPremium';
export * from './hooks';
export * from './models';
export * from './components';
export * from './constants';

export type {
DataGridPremiumProps,
Expand All @@ -33,3 +32,4 @@ export {
GRID_COLUMN_MENU_COMPONENTS,
GRID_COLUMN_MENU_COMPONENTS_PROPS,
} from './components/reexports';
export { DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS as DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from './constants/dataGridPremiumDefaultSlotsComponents';
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DataGridProPropsWithDefaultValue,
} from '../models/dataGridProProps';
import { GridProSlotsComponent } from '../models';
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants';
import { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS } from '../constants/dataGridProDefaultSlotsComponents';

/**
* The default values of `DataGridProPropsWithDefaultValue` to inject in the props of DataGridPro.
Expand Down
1 change: 0 additions & 1 deletion packages/grid/x-data-grid-pro/src/constants/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/grid/x-data-grid-pro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export * from './DataGridPro';
export * from './hooks';
export * from './models';
export * from './components';
export * from './constants';
export * from './utils';

export type { DataGridProProps, GridExperimentalProFeatures } from './models/dataGridProProps';
Expand All @@ -32,3 +31,4 @@ export {
GRID_COLUMN_MENU_COMPONENTS,
GRID_COLUMN_MENU_COMPONENTS_PROPS,
} from './components/reexports';
export { DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS as DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from './constants/dataGridProDefaultSlotsComponents';
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ describe('<DataGridPro /> - Column Headers', () => {
<DataGridPro
{...baselineProps}
columns={[{ field: 'brand' }]}
components={{ ColumnMenu: GridColumnMenu }}
initialState={{ sorting: { sortModel: [{ field: 'brand', sort: 'asc' }] } }}
{...props}
/>
Expand Down
3 changes: 2 additions & 1 deletion packages/grid/x-data-grid/src/DataGrid/useDataGridProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
DataGridForcedPropsKey,
DataGridPropsWithDefaultValues,
} from '../models/props/DataGridProps';
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS, GRID_DEFAULT_LOCALE_TEXT } from '../constants';
import { GRID_DEFAULT_LOCALE_TEXT } from '../constants';
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
import { GridDensityTypes, GridEditModes, GridSlotsComponent, GridValidRowModel } from '../models';

const DATA_GRID_FORCED_PROPS: { [key in DataGridForcedPropsKey]?: DataGridProcessedProps[key] } = {
Expand Down
1 change: 0 additions & 1 deletion packages/grid/x-data-grid/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './envConstants';
export * from './localeTextConstants';
export * from './defaultGridSlotsComponents';
export * from './gridClasses';
1 change: 1 addition & 0 deletions packages/grid/x-data-grid/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export {
GRID_COLUMN_MENU_COMPONENTS,
GRID_COLUMN_MENU_COMPONENTS_PROPS,
} from './components/reexportable';
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from './constants/defaultGridSlotsComponents';

This comment has been minimized.

Copy link
@cherniavskii

cherniavskii Dec 22, 2022

Member

We can export it in /internals and avoid public export if it is not intended to be imported by users


/**
* The full grid API.
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/x-data-grid/src/locales/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const itITGrid: Partial<GridLocaleText> = {
// Column pinning text
pinToLeft: 'Blocca a sinistra',
pinToRight: 'Blocca a destra',
// unpin: 'Unpin',
unpin: 'Sblocca',

// Tree Data
treeDataGroupingHeaderName: 'Gruppo',
Expand Down
2 changes: 0 additions & 2 deletions scripts/x-data-grid-premium.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
{ "name": "CursorCoordinates", "kind": "Interface" },
{ "name": "daDK", "kind": "Variable" },
{ "name": "DATA_GRID_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "DATA_GRID_PREMIUM_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "DATA_GRID_PREMIUM_PROPS_DEFAULT_VALUES", "kind": "Variable" },
{ "name": "DataGrid", "kind": "Function" },
{ "name": "DataGridPremium", "kind": "Variable" },
{ "name": "DataGridPremiumProps", "kind": "Interface" },
{ "name": "DataGridPro", "kind": "Function" },
{ "name": "deDE", "kind": "Variable" },
{ "name": "DEFAULT_GRID_COL_TYPE_KEY", "kind": "Variable" },
{ "name": "DEFAULT_GRID_PREMIUM_ICON_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "ElementSize", "kind": "Interface" },
{ "name": "elGR", "kind": "Variable" },
{ "name": "enUS", "kind": "Variable" },
Expand Down
2 changes: 0 additions & 2 deletions scripts/x-data-grid-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
{ "name": "CursorCoordinates", "kind": "Interface" },
{ "name": "daDK", "kind": "Variable" },
{ "name": "DATA_GRID_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "DATA_GRID_PRO_DEFAULT_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "DATA_GRID_PRO_PROPS_DEFAULT_VALUES", "kind": "Variable" },
{ "name": "DataGrid", "kind": "Function" },
{ "name": "DataGridPremium", "kind": "Function" },
{ "name": "DataGridPro", "kind": "Variable" },
{ "name": "DataGridProProps", "kind": "Interface" },
{ "name": "deDE", "kind": "Variable" },
{ "name": "DEFAULT_GRID_COL_TYPE_KEY", "kind": "Variable" },
{ "name": "DEFAULT_GRID_PRO_ICON_SLOTS_COMPONENTS", "kind": "Variable" },
{ "name": "ElementSize", "kind": "Interface" },
{ "name": "elGR", "kind": "Variable" },
{ "name": "enUS", "kind": "Variable" },
Expand Down

0 comments on commit 4f488b6

Please sign in to comment.