mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Add support for nested-fieldset control.
This commit is contained in:
committed by
Akshay Joshi
parent
621426ac55
commit
48176ea986
35
web/pgadmin/static/js/components/FieldSet.jsx
Normal file
35
web/pgadmin/static/js/components/FieldSet.jsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import PropTypes from 'prop-types';
|
||||
import CustomPropTypes from '../custom_prop_types';
|
||||
|
||||
const useStyles = makeStyles((theme)=>({
|
||||
fieldset: {
|
||||
padding: theme.spacing(0.5),
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
backgroundColor: 'inherit',
|
||||
border: '1px solid ' + theme.otherVars.borderColor,
|
||||
},
|
||||
legend: {
|
||||
width: 'unset',
|
||||
fontSize: 'inherit',
|
||||
fontWeight: 'bold',
|
||||
}
|
||||
}));
|
||||
|
||||
export default function FieldSet({title='', className, children}) {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<fieldset className={clsx(classes.fieldset, className)}>
|
||||
<legend className={classes.legend}>{title}</legend>
|
||||
{children}
|
||||
</fieldset>
|
||||
);
|
||||
}
|
||||
|
||||
FieldSet.propTypes = {
|
||||
title: PropTypes.string,
|
||||
className: CustomPropTypes.className,
|
||||
children: CustomPropTypes.children,
|
||||
};
|
||||
Reference in New Issue
Block a user