Skip to content

Commit

Permalink
5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Aug 31, 2021
1 parent 236cd8b commit 55a0091
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Material Design for Bootstrap

Version: MDB React Pro 5.0.2
Version: MDB React Pro 5.1.0

Documentation:
https://mdbootstrap.com/docs/react/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/mdb.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mdbreact.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mdbreact.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions dist/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ declare class MDBCollapse extends Component<
className?: string;
children?: ReactNode;
delay?: { show: number, hide: number };
tag?: string;
isOpen?: boolean | string;
id?: string;
navbar?: boolean;
Expand Down Expand Up @@ -536,7 +537,7 @@ declare class MDBDataTable extends Component<
responsiveLg?: boolean;
responsiveXl?: boolean;
searching?: boolean;
searchingLabel?: string;
searchLabel?: string;
scrollX?: boolean;
scrollY?: boolean;
sortable?: boolean;
Expand Down Expand Up @@ -862,15 +863,15 @@ declare class MDBModal extends Component<
hiddenModal?: () => void;
hideModal?: () => void;
id?: string;
inline: boolean;
inline?: boolean;
isOpen?: boolean;
keyboard?: boolean;
modalClassName?: string;
modalStyle?: 'success' | 'info' | 'danger' | 'warning';
modalStylesWithoutBackdrop?: ReactNode;
modalTransitionTimeout?: number;
noClickableBodyWithoutBackdrop: boolean;
overflowScroll: boolean;
noClickableBodyWithoutBackdrop?: boolean;
overflowScroll?: boolean;
position?: string;
role?: string;
showModal?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion docs/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
color: #283593;
}

.nav-link:focus {
.nav-link:focus{
outline: none;
}
1 change: 0 additions & 1 deletion docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'bootstrap-css-only/css/bootstrap.min.css';
import '../dist/css/mdb.css';
import './index.css';
import App from './App';
// import AppClear from './App-clear';

import registerServiceWorker from './registerServiceWorker';

Expand Down
1 change: 1 addition & 0 deletions docs/pages/DatatablePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ const DatatablePage = () => {
data={data()}
materialSearch={true}
proSelect
onSort={(s) => console.log(s)}
/>
</MDBCardBody>
</MDBCard>
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/ModalPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class ModalPage extends Component {
</MDBModal>
</SectionContainer>

<SectionContainer header='Modal Events' flexCenter>
{/* <SectionContainer header='Modal Events' flexCenter>
<MDBBtn color='warning' onClick={this.toggle(18)}>
Modal events
</MDBBtn>
Expand All @@ -550,7 +550,7 @@ class ModalPage extends Component {
<MDBBtn color='primary'>Save changes</MDBBtn>
</MDBModalFooter>
</MDBModal>
</SectionContainer>
</SectionContainer> */}
</MDBContainer>
);
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdbreact",
"version": "5.0.2",
"version": "5.1.0",
"author": "MDBootstrap",
"repository": "https://github.com/mdbootstrap/React-Bootstrap-with-Material-Design",
"main": "dist/mdbreact.js",
Expand Down Expand Up @@ -38,11 +38,10 @@
"@fortawesome/fontawesome-free": "^5.12.0",
"@material-ui/core": "3.9.3",
"bootstrap-css-only": "4.4.1",
"chart.js": "2.9.3",
"chart.js": "2.9.4",
"classnames": "2.2.6",
"focus-trap-react": "^6.0.0",
"material-ui-pickers": "2.2.4",
"moment": "2.24.0",
"perfect-scrollbar": "1.5.0",
"popper.js": "^1.16.0",
"prop-types": "15.7.2",
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const Button = props => {
'btn-action': action,
[`btn-${social}`]: social,
[`btn-${size}`]: size,
'btn-rounded': rounded,
disabled
},
className
Expand Down Expand Up @@ -99,9 +100,12 @@ Button.propTypes = {
disabled: PropTypes.bool,
download: PropTypes.string,
flat: PropTypes.bool,
gradient: PropTypes.string,
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
onClick: PropTypes.func,
outline: PropTypes.bool,
role: PropTypes.string,
rounded: PropTypes.bool,
size: PropTypes.string,
social: PropTypes.string,
tag: PropTypes.string,
Expand Down
1 change: 1 addition & 0 deletions src/components/Collapse/Collapse.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare class MDBCollapse extends React.Component<
className?: string;
children?: React.ReactNode;
delay?: { show: number, hide: number };
tag?: string;
isOpen?: boolean | string;
id?: string;
navbar?: boolean;
Expand Down
12 changes: 7 additions & 5 deletions src/components/Collapse/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Collapse extends Component {
}

render() {
const { navbar, children, className, isOpen, delay, onOpened, onClosed, ...attributes } = this.props;
const { navbar, children, className, isOpen, delay, tag: Tag, onOpened, onClosed, ...attributes } = this.props;

const { collapse, height } = this.state;
let collapseClass;
Expand All @@ -125,7 +125,7 @@ class Collapse extends Component {
const style = height === null ? null : { height };

return (
<div
<Tag
data-test='collapse'
{...attributes}
style={{ ...attributes.style, ...style }}
Expand All @@ -135,7 +135,7 @@ class Collapse extends Component {
}}
>
{children}
</div>
</Tag>
);
}
}
Expand All @@ -148,14 +148,16 @@ Collapse.propTypes = {
isOpen: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
navbar: PropTypes.bool,
onClosed: PropTypes.func,
onOpened: PropTypes.func
onOpened: PropTypes.func,
tag: PropTypes.string
};

Collapse.defaultProps = {
isOpen: '',
delay: DEFAULT_DELAYS,
onOpened: () => {},
onClosed: () => {}
onClosed: () => {},
tag: 'div'
};
export default Collapse;
export { Collapse as MDBCollapse };
3 changes: 2 additions & 1 deletion src/components/Collapse/Collapse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe('<Collapse />', () => {
navbar: true,
delay: { show: 5, hide: 5 },
onOpened: jest.fn(),
onClosed: jest.fn()
onClosed: jest.fn(),
tag: 'div'
};

wrapper = mounted(expectedProps);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ declare class MDBDataTable extends React.Component<
responsiveLg?: boolean;
responsiveXl?: boolean;
searching?: boolean;
searchingLabel?: string;
searchLabel?: string;
scrollX?: boolean;
scrollY?: boolean;
sortable?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DataTable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class DataTable extends Component {
() => this.filterRows()
);

onSort && typeof onSort === 'function' && onSort({ column: field, direction: sort === 'desc' ? 'desc' : 'asc' });
onSort && typeof onSort === 'function' && onSort({ column: field, direction: this.state.direction === true ? 'asc' : 'desc' });
};

filterRows = (search = this.state.search) => {
Expand Down
6 changes: 5 additions & 1 deletion src/components/Dropdown/DropdownItem/DropdownItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import DropdownContext from '../DropdownContext';

class DropdownItem extends Component {
onClick = (e, callbackToggle) => {
const { disabled, header, divider, onClick } = this.props;
const { disabled, header, divider, onClick, toggle } = this.props;

if (disabled || header || divider) {
e.preventDefault();
return;
}

if (!toggle) {
e.stopPropagation();
}

if (onClick) {
onClick(e);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import Fa from '../Fa';

class Input extends React.Component {
class Input extends React.PureComponent {
state = {
innerValue: this.props.value || this.props.valueDefault,
isFocused: false,
Expand Down
6 changes: 3 additions & 3 deletions src/components/Modal/Modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ declare class MDBModal extends React.Component<
hiddenModal?: () => void;
hideModal?: () => void;
id?: string;
inline: boolean;
inline?: boolean;
isOpen?: boolean;
keyboard?: boolean;
modalClassName?: string;
modalStyle?: 'success' | 'info' | 'danger' | 'warning';
modalStylesWithoutBackdrop?: React.ReactNode;
modalTransitionTimeout?: number;
noClickableBodyWithoutBackdrop: boolean;
overflowScroll: boolean;
noClickableBodyWithoutBackdrop?: boolean;
overflowScroll?: boolean;
position?: string;
role?: string;
showModal?: () => void;
Expand Down
10 changes: 2 additions & 8 deletions src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,17 @@ class Modal extends Component {

modalContent = React.createRef();

componentDidMount = () => {
document.body.classList.add('modal-open');
};

componentWillUnmount = () => {
document.body.classList.remove('modal-open');
};

componentDidUpdate = (prevProps, prevState) => {
const { isOpen, overflowScroll } = this.props;
const overflowStatement = overflowScroll ? 'overflow-y-scroll' : 'overflow-hidden';

if (prevState.initialIsOpen !== isOpen) {
this.setState({ initialIsOpen: isOpen }, () => {
if (isOpen) {
document.body.classList.add('modal-open');
document.body.classList.add(overflowStatement);
} else {
document.body.classList.remove('modal-open');
document.body.classList.remove(overflowStatement);
}
});
Expand Down

0 comments on commit 55a0091

Please sign in to comment.