Skip to content

Commit d09d61e

Browse files
author
Krzysztof Wilk
committed
Generate version v.5.1.0
Chagnelog: ​ Fixed: Update chart.js plugin to the 2.9.4 version Remove moment.js from free Fix invalid hook call error in pro packages. Update MDBModal API section in the documentation. Fix MDBModal generator - now it will generate fullWidth prop instead of full-width. Fix typo in installation guide. Modal - update adding modal-open class to the body. Collapse - add tag property. Dropdown - toggle property in the DropdownItem will work properly now. Buttons - add rounded property handling. Datatables - fix sorting direction in the onSort method. Datatables - update searchLabel type. Select - add onChange method to the uncontrolled select.
1 parent fd8715b commit d09d61e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+52
-45
lines changed

README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Material Design for Bootstrap
22

3-
Version: MDB React Pro 5.0.2
3+
Version: MDB React Pro 5.1.0
44

55
Documentation:
66
https://mdbootstrap.com/docs/react/

dist/css/mdb.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/img/overlays/01.png

100755100644
File mode changed.

dist/img/overlays/02.png

100755100644
File mode changed.

dist/img/overlays/03.png

100755100644
File mode changed.

dist/img/overlays/04.png

100755100644
File mode changed.

dist/img/overlays/05.png

100755100644
File mode changed.

dist/img/overlays/06.png

100755100644
File mode changed.

dist/img/overlays/07.png

100755100644
File mode changed.

dist/img/overlays/08.png

100755100644
File mode changed.

dist/img/overlays/09.png

100755100644
File mode changed.

dist/img/svg/arrow_left.svg

100755100644
+3-3

dist/img/svg/arrow_right.svg

100755100644
+3-3

dist/mdbreact.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mdbreact.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scss/core/_colors.scss

100755100644
File mode changed.

dist/scss/core/_global.scss

100755100644
File mode changed.

dist/scss/core/_masks.scss

100755100644
File mode changed.

dist/scss/core/_mixins.scss

100755100644
File mode changed.

dist/scss/core/_typography.scss

100755100644
File mode changed.

dist/scss/core/_variables.scss

100755100644
File mode changed.

dist/scss/core/_waves.scss

100755100644
File mode changed.

dist/scss/core/bootstrap/_functions.scss

100755100644
File mode changed.

dist/scss/core/bootstrap/_variables.scss

100755100644
File mode changed.

dist/scss/free/_animations-basic.scss

100755100644
File mode changed.

dist/scss/free/_badges.scss

100755100644
File mode changed.

dist/scss/free/_buttons.scss

100755100644
File mode changed.

dist/scss/free/_cards.scss

100755100644
File mode changed.

dist/scss/free/_carousels.scss

100755100644
File mode changed.

dist/scss/free/_dropdowns.scss

100755100644
File mode changed.

dist/scss/free/_footers.scss

100755100644
File mode changed.

dist/scss/free/_forms.scss

100755100644
File mode changed.

dist/scss/free/_input-group.scss

100755100644
File mode changed.

dist/scss/free/_list-group.scss

100755100644
File mode changed.

dist/scss/free/_modals.scss

100755100644
File mode changed.

dist/scss/free/_msc.scss

100755100644
File mode changed.

dist/scss/free/_navbars.scss

100755100644
File mode changed.

dist/scss/free/_pagination.scss

100755100644
File mode changed.

dist/scss/free/_tables.scss

100755100644
File mode changed.

dist/types/index.d.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ declare class MDBCollapse extends Component<
473473
className?: string;
474474
children?: ReactNode;
475475
delay?: { show: number, hide: number };
476+
tag?: string;
476477
isOpen?: boolean | string;
477478
id?: string;
478479
navbar?: boolean;
@@ -536,7 +537,7 @@ declare class MDBDataTable extends Component<
536537
responsiveLg?: boolean;
537538
responsiveXl?: boolean;
538539
searching?: boolean;
539-
searchingLabel?: string;
540+
searchLabel?: string;
540541
scrollX?: boolean;
541542
scrollY?: boolean;
542543
sortable?: boolean;
@@ -862,15 +863,15 @@ declare class MDBModal extends Component<
862863
hiddenModal?: () => void;
863864
hideModal?: () => void;
864865
id?: string;
865-
inline: boolean;
866+
inline?: boolean;
866867
isOpen?: boolean;
867868
keyboard?: boolean;
868869
modalClassName?: string;
869870
modalStyle?: 'success' | 'info' | 'danger' | 'warning';
870871
modalStylesWithoutBackdrop?: ReactNode;
871872
modalTransitionTimeout?: number;
872-
noClickableBodyWithoutBackdrop: boolean;
873-
overflowScroll: boolean;
873+
noClickableBodyWithoutBackdrop?: boolean;
874+
overflowScroll?: boolean;
874875
position?: string;
875876
role?: string;
876877
showModal?: () => void;

docs/index.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
color: #283593;
4343
}
4444

45-
.nav-link:focus {
45+
.nav-link:focus{
4646
outline: none;
4747
}

docs/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'bootstrap-css-only/css/bootstrap.min.css';
55
import '../dist/css/mdb.css';
66
import './index.css';
77
import App from './App';
8-
// import AppClear from './App-clear';
98

109
import registerServiceWorker from './registerServiceWorker';
1110

docs/pages/DatatablePage.js

+1
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ const DatatablePage = () => {
558558
data={data()}
559559
materialSearch={true}
560560
proSelect
561+
onSort={(s) => console.log(s)}
561562
/>
562563
</MDBCardBody>
563564
</MDBCard>

docs/pages/ModalPage.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ class ModalPage extends Component {
526526
</MDBModal>
527527
</SectionContainer>
528528

529-
<SectionContainer header='Modal Events' flexCenter>
529+
{/* <SectionContainer header='Modal Events' flexCenter>
530530
<MDBBtn color='warning' onClick={this.toggle(18)}>
531531
Modal events
532532
</MDBBtn>
@@ -550,7 +550,7 @@ class ModalPage extends Component {
550550
<MDBBtn color='primary'>Save changes</MDBBtn>
551551
</MDBModalFooter>
552552
</MDBModal>
553-
</SectionContainer>
553+
</SectionContainer> */}
554554
</MDBContainer>
555555
);
556556
}

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mdbreact",
3-
"version": "5.0.2",
3+
"version": "5.1.0",
44
"author": "MDBootstrap",
55
"repository": "https://github.com/mdbootstrap/React-Bootstrap-with-Material-Design",
66
"main": "dist/mdbreact.js",
@@ -38,7 +38,7 @@
3838
"@fortawesome/fontawesome-free": "^5.12.0",
3939
"@material-ui/core": "3.9.3",
4040
"bootstrap-css-only": "4.4.1",
41-
"chart.js": "2.9.3",
41+
"chart.js": "2.9.4",
4242
"classnames": "2.2.6",
4343
"focus-trap-react": "^6.0.0",
4444
"material-ui-pickers": "2.2.4",

src/components/Button/Button.js

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const Button = props => {
5454
'btn-action': action,
5555
[`btn-${social}`]: social,
5656
[`btn-${size}`]: size,
57+
'btn-rounded': rounded,
5758
disabled
5859
},
5960
className
@@ -99,9 +100,12 @@ Button.propTypes = {
99100
disabled: PropTypes.bool,
100101
download: PropTypes.string,
101102
flat: PropTypes.bool,
103+
gradient: PropTypes.string,
102104
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
103105
onClick: PropTypes.func,
106+
outline: PropTypes.bool,
104107
role: PropTypes.string,
108+
rounded: PropTypes.bool,
105109
size: PropTypes.string,
106110
social: PropTypes.string,
107111
tag: PropTypes.string,

src/components/Collapse/Collapse.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare class MDBCollapse extends React.Component<
55
className?: string;
66
children?: React.ReactNode;
77
delay?: { show: number, hide: number };
8+
tag?: string;
89
isOpen?: boolean | string;
910
id?: string;
1011
navbar?: boolean;

src/components/Collapse/Collapse.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Collapse extends Component {
9898
}
9999

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

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

127127
return (
128-
<div
128+
<Tag
129129
data-test='collapse'
130130
{...attributes}
131131
style={{ ...attributes.style, ...style }}
@@ -135,7 +135,7 @@ class Collapse extends Component {
135135
}}
136136
>
137137
{children}
138-
</div>
138+
</Tag>
139139
);
140140
}
141141
}
@@ -148,14 +148,16 @@ Collapse.propTypes = {
148148
isOpen: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
149149
navbar: PropTypes.bool,
150150
onClosed: PropTypes.func,
151-
onOpened: PropTypes.func
151+
onOpened: PropTypes.func,
152+
tag: PropTypes.string
152153
};
153154

154155
Collapse.defaultProps = {
155156
isOpen: '',
156157
delay: DEFAULT_DELAYS,
157158
onOpened: () => {},
158-
onClosed: () => {}
159+
onClosed: () => {},
160+
tag: 'div'
159161
};
160162
export default Collapse;
161163
export { Collapse as MDBCollapse };

src/components/Collapse/Collapse.test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ describe('<Collapse />', () => {
3535
navbar: true,
3636
delay: { show: 5, hide: 5 },
3737
onOpened: jest.fn(),
38-
onClosed: jest.fn()
38+
onClosed: jest.fn(),
39+
tag: 'div'
3940
};
4041

4142
wrapper = mounted(expectedProps);

src/components/DataTable/DataTable.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare class MDBDataTable extends React.Component<
4747
responsiveLg?: boolean;
4848
responsiveXl?: boolean;
4949
searching?: boolean;
50-
searchingLabel?: string;
50+
searchLabel?: string;
5151
scrollX?: boolean;
5252
scrollY?: boolean;
5353
sortable?: boolean;

src/components/DataTable/DataTable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class DataTable extends Component {
192192
() => this.filterRows()
193193
);
194194

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

198198
filterRows = (search = this.state.search) => {

src/components/Dropdown/DropdownItem/DropdownItem.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ import DropdownContext from '../DropdownContext';
66

77
class DropdownItem extends Component {
88
onClick = (e, callbackToggle) => {
9-
const { disabled, header, divider, onClick } = this.props;
9+
const { disabled, header, divider, onClick, toggle } = this.props;
1010

1111
if (disabled || header || divider) {
1212
e.preventDefault();
1313
return;
1414
}
1515

16+
if (!toggle) {
17+
e.stopPropagation();
18+
}
19+
1620
if (onClick) {
1721
onClick(e);
1822
}

src/components/Input/Input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import classNames from 'classnames';
44
import Fa from '../Fa';
55

6-
class Input extends React.Component {
6+
class Input extends React.PureComponent {
77
state = {
88
innerValue: this.props.value || this.props.valueDefault,
99
isFocused: false,

src/components/Modal/Modal.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ declare class MDBModal extends React.Component<
2121
hiddenModal?: () => void;
2222
hideModal?: () => void;
2323
id?: string;
24-
inline: boolean;
24+
inline?: boolean;
2525
isOpen?: boolean;
2626
keyboard?: boolean;
2727
modalClassName?: string;
2828
modalStyle?: 'success' | 'info' | 'danger' | 'warning';
2929
modalStylesWithoutBackdrop?: React.ReactNode;
3030
modalTransitionTimeout?: number;
31-
noClickableBodyWithoutBackdrop: boolean;
32-
overflowScroll: boolean;
31+
noClickableBodyWithoutBackdrop?: boolean;
32+
overflowScroll?: boolean;
3333
position?: string;
3434
role?: string;
3535
showModal?: () => void;

src/components/Modal/Modal.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,17 @@ class Modal extends Component {
1313

1414
modalContent = React.createRef();
1515

16-
componentDidMount = () => {
17-
document.body.classList.add('modal-open');
18-
};
19-
20-
componentWillUnmount = () => {
21-
document.body.classList.remove('modal-open');
22-
};
23-
2416
componentDidUpdate = (prevProps, prevState) => {
2517
const { isOpen, overflowScroll } = this.props;
2618
const overflowStatement = overflowScroll ? 'overflow-y-scroll' : 'overflow-hidden';
2719

2820
if (prevState.initialIsOpen !== isOpen) {
2921
this.setState({ initialIsOpen: isOpen }, () => {
3022
if (isOpen) {
23+
document.body.classList.add('modal-open');
3124
document.body.classList.add(overflowStatement);
3225
} else {
26+
document.body.classList.remove('modal-open');
3327
document.body.classList.remove(overflowStatement);
3428
}
3529
});

0 commit comments

Comments
 (0)