diff --git a/src/App.js b/src/App.js index dddc6ac..8e57a70 100644 --- a/src/App.js +++ b/src/App.js @@ -12,9 +12,6 @@ import GithubPushButton from './GithubPushButton'; import GroupWithDescription, { groupWithDescriptionTester } from './GroupWithDescription'; -import FlatArrayWithDescription, { - flatArrayWithDescriptionTester -} from './FlatArrayWithDescription'; import TextWithDescription, { textWithDescriptionTester } from './TextWithDescription'; @@ -87,10 +84,6 @@ const App = () => { tester: groupWithDescriptionTester, renderer: GroupWithDescription, }, - { - tester: flatArrayWithDescriptionTester, - renderer: FlatArrayWithDescription, - }, { tester: textWithDescriptionTester, renderer: TextWithDescription, diff --git a/src/FlatArrayWithDescription.js b/src/FlatArrayWithDescription.js deleted file mode 100644 index c8dae17..0000000 --- a/src/FlatArrayWithDescription.js +++ /dev/null @@ -1,46 +0,0 @@ -import React, { useCallback, useState } from 'react'; -import { ArrayLayoutProps, rankWith, isPrimitiveArrayControl } from '@jsonforms/core'; -import { withJsonFormsArrayLayoutProps } from '@jsonforms/react'; -import { Hidden } from '@mui/material'; -import { DeleteDialog, MaterialTableControl } from '@jsonforms/material-renderers'; - -export const FlatArrayWithDescription = (props) => { - const [open, setOpen] = useState(false); - const [path, setPath] = useState(undefined); - const [rowData, setRowData] = useState(undefined); - const { removeItems, visible } = props; - - const openDeleteDialog = useCallback((p, rowIndex) => { - setOpen(true); - setPath(p); - setRowData(rowIndex); - }, [setOpen, setPath, setRowData]); - const deleteCancel = useCallback(() => setOpen(false), [setOpen]); - const deleteConfirm = useCallback(() => { - const p = path.substring(0, path.lastIndexOf(('.'))); - removeItems(p, [rowData])(); - setOpen(false); - }, [setOpen, path, rowData]); - const deleteClose = useCallback(() => setOpen(false), [setOpen]); - - return ( - - - - - ); -}; - -export const flatArrayWithDescriptionTester = rankWith( - 4, - isPrimitiveArrayControl -); -export default withJsonFormsArrayLayoutProps(FlatArrayWithDescription);