Browse Source

update last item

feature/axios_provider
MSI\derek 5 months ago
parent
commit
2477837f42
2 changed files with 11 additions and 9 deletions
  1. +7
    -5
      src/components/CreateMaterial/MaterialDetails.tsx
  2. +4
    -4
      src/components/useInputDataGrid/useInputDataGrid.tsx

+ 7
- 5
src/components/CreateMaterial/MaterialDetails.tsx View File

@@ -11,14 +11,12 @@ import {
} from "@mui/material";
import { useFormContext } from "react-hook-form";
import { useTranslation } from "react-i18next";
import ControlledAutoComplete from "../ControlledAutoComplete";
import InputDataGrid from "../useInputDataGrid";
import useInputDataGrid from "../useInputDataGrid";
import { useMemo, useState } from "react";
import { GridColDef, GridRowModesModel } from "@mui/x-data-grid";
import { GridColDef } from "@mui/x-data-grid";
import {
InputGridProps,
InputDataGridProps,
ResultWithId,
} from "../useInputDataGrid/useInputDataGrid";
type Props = {
isEditMode: boolean;
@@ -73,6 +71,8 @@ const MaterialDetails: React.FC<Props> = ({ isEditMode }) => {
MaterialUomInputGridProps
);

const test: InputGridProps = {}

return (
<Card sx={{ display: "block" }}>
<CardContent component={Stack} spacing={4}>
@@ -213,7 +213,9 @@ const MaterialDetails: React.FC<Props> = ({ isEditMode }) => {
/>
</Grid>
<Grid item xs={6}>
<MaterialTypeInputGrid />
<MaterialTypeInputGrid
// {...test}
/>
</Grid>
<Grid item xs={6}>
<MaterialUomInputGrid />


+ 4
- 4
src/components/useInputDataGrid/useInputDataGrid.tsx View File

@@ -29,13 +29,13 @@ import { Add } from "@mui/icons-material";
import { Box, Button, Typography } from "@mui/material";
import { useTranslation } from "react-i18next";

export interface ResultWithId {
interface ResultWithId {
id: string | number;
}
type DataGridProps = {
export type InputGridProps = {
[key: string]: any
}
export type TableRow<T, E> = Partial<
type TableRow<T, E> = Partial<
T & {
_isNew: boolean;
_error: E;
@@ -260,7 +260,7 @@ function useInputDataGrid<T, E>({
</Button>
</Box>
);
const DataGrid: React.FC<DataGridProps> = (props) => (
const DataGrid: React.FC<InputGridProps> = (props) => (
<StyledDataGrid
{...props}
getRowId={getRowId as GridRowIdGetter<GridValidRowModel>}


Loading…
Cancel
Save